]>
Commit | Line | Data |
---|---|---|
c0dda186 | 1 | %{ |
4831981d SL |
2 | #if __GNUC__ >= 7 |
3 | _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") | |
4 | #endif | |
c0dda186 | 5 | #include <stddef.h> |
737f1405 YW |
6 | #include "bond.h" |
7 | #include "bridge.h" | |
c0dda186 | 8 | #include "conf-parser.h" |
737f1405 YW |
9 | #include "geneve.h" |
10 | #include "ipvlan.h" | |
11 | #include "macsec.h" | |
12 | #include "macvlan.h" | |
13 | #include "tunnel.h" | |
14 | #include "tuntap.h" | |
15 | #include "veth.h" | |
267fabd2 | 16 | #include "vlan-util.h" |
737f1405 YW |
17 | #include "vlan.h" |
18 | #include "vxlan.h" | |
19 | #include "vrf.h" | |
20 | #include "netdev.h" | |
21 | #include "network-internal.h" | |
22 | #include "vxcan.h" | |
23 | #include "wireguard.h" | |
24 | #include "fou-tunnel.h" | |
25 | #include "l2tp-tunnel.h" | |
26 | #include "xfrm.h" | |
c0dda186 TG |
27 | %} |
28 | struct ConfigPerfItem; | |
29 | %null_strings | |
30 | %language=ANSI-C | |
31 | %define slot-name section_and_lvalue | |
32 | %define hash-function-name network_netdev_gperf_hash | |
33 | %define lookup-function-name network_netdev_gperf_lookup | |
34 | %readonly-tables | |
35 | %omit-struct-type | |
36 | %struct-type | |
37 | %includes | |
38 | %% | |
e57319dd YW |
39 | Match.Host, config_parse_net_condition, CONDITION_HOST, offsetof(NetDev, conditions) |
40 | Match.Virtualization, config_parse_net_condition, CONDITION_VIRTUALIZATION, offsetof(NetDev, conditions) | |
41 | Match.KernelCommandLine, config_parse_net_condition, CONDITION_KERNEL_COMMAND_LINE, offsetof(NetDev, conditions) | |
42 | Match.KernelVersion, config_parse_net_condition, CONDITION_KERNEL_VERSION, offsetof(NetDev, conditions) | |
43 | Match.Architecture, config_parse_net_condition, CONDITION_ARCHITECTURE, offsetof(NetDev, conditions) | |
44 | NetDev.Description, config_parse_string, 0, offsetof(NetDev, description) | |
45 | NetDev.Name, config_parse_ifname, 0, offsetof(NetDev, ifname) | |
46 | NetDev.Kind, config_parse_netdev_kind, 0, offsetof(NetDev, kind) | |
47 | NetDev.MTUBytes, config_parse_mtu, AF_UNSPEC, offsetof(NetDev, mtu) | |
48 | NetDev.MACAddress, config_parse_hwaddr, 0, offsetof(NetDev, mac) | |
49 | VLAN.Id, config_parse_vlanid, 0, offsetof(VLan, id) | |
50 | VLAN.GVRP, config_parse_tristate, 0, offsetof(VLan, gvrp) | |
51 | VLAN.MVRP, config_parse_tristate, 0, offsetof(VLan, mvrp) | |
52 | VLAN.LooseBinding, config_parse_tristate, 0, offsetof(VLan, loose_binding) | |
53 | VLAN.ReorderHeader, config_parse_tristate, 0, offsetof(VLan, reorder_hdr) | |
54 | MACVLAN.Mode, config_parse_macvlan_mode, 0, offsetof(MacVlan, mode) | |
0d0de133 | 55 | MACVLAN.SourceMACAddress, config_parse_hwaddrs, 0, offsetof(MacVlan, match_source_mac) |
e57319dd | 56 | MACVTAP.Mode, config_parse_macvlan_mode, 0, offsetof(MacVlan, mode) |
0d0de133 | 57 | MACVTAP.SourceMACAddress, config_parse_hwaddrs, 0, offsetof(MacVlan, match_source_mac) |
e57319dd YW |
58 | IPVLAN.Mode, config_parse_ipvlan_mode, 0, offsetof(IPVlan, mode) |
59 | IPVLAN.Flags, config_parse_ipvlan_flags, 0, offsetof(IPVlan, flags) | |
69c317a0 SS |
60 | IPVTAP.Mode, config_parse_ipvlan_mode, 0, offsetof(IPVlan, mode) |
61 | IPVTAP.Flags, config_parse_ipvlan_flags, 0, offsetof(IPVlan, flags) | |
e57319dd YW |
62 | Tunnel.Local, config_parse_tunnel_address, 0, offsetof(Tunnel, local) |
63 | Tunnel.Remote, config_parse_tunnel_address, 0, offsetof(Tunnel, remote) | |
64 | Tunnel.TOS, config_parse_unsigned, 0, offsetof(Tunnel, tos) | |
65 | Tunnel.TTL, config_parse_unsigned, 0, offsetof(Tunnel, ttl) | |
66 | Tunnel.Key, config_parse_tunnel_key, 0, offsetof(Tunnel, key) | |
67 | Tunnel.InputKey, config_parse_tunnel_key, 0, offsetof(Tunnel, ikey) | |
68 | Tunnel.OutputKey, config_parse_tunnel_key, 0, offsetof(Tunnel, okey) | |
69 | Tunnel.DiscoverPathMTU, config_parse_bool, 0, offsetof(Tunnel, pmtudisc) | |
70 | Tunnel.Mode, config_parse_ip6tnl_mode, 0, offsetof(Tunnel, ip6tnl_mode) | |
71 | Tunnel.IPv6FlowLabel, config_parse_ipv6_flowlabel, 0, offsetof(Tunnel, ipv6_flowlabel) | |
72 | Tunnel.CopyDSCP, config_parse_bool, 0, offsetof(Tunnel, copy_dscp) | |
73 | Tunnel.EncapsulationLimit, config_parse_encap_limit, 0, offsetof(Tunnel, encap_limit) | |
74 | Tunnel.Independent, config_parse_bool, 0, offsetof(Tunnel, independent) | |
8c9c703c | 75 | Tunnel.AssignToLoopback, config_parse_bool, 0, offsetof(Tunnel, assign_to_loopback) |
e57319dd YW |
76 | Tunnel.AllowLocalRemote, config_parse_tristate, 0, offsetof(Tunnel, allow_localremote) |
77 | Tunnel.FooOverUDP, config_parse_bool, 0, offsetof(Tunnel, fou_tunnel) | |
78 | Tunnel.FOUDestinationPort, config_parse_ip_port, 0, offsetof(Tunnel, fou_destination_port) | |
79 | Tunnel.FOUSourcePort, config_parse_ip_port, 0, offsetof(Tunnel, encap_src_port) | |
80 | Tunnel.Encapsulation, config_parse_fou_encap_type, 0, offsetof(Tunnel, fou_encap_type) | |
81 | Tunnel.IPv6RapidDeploymentPrefix, config_parse_6rd_prefix, 0, 0 | |
82 | Tunnel.ERSPANIndex, config_parse_uint32, 0, offsetof(Tunnel, erspan_index) | |
83 | Tunnel.SerializeTunneledPackets, config_parse_tristate, 0, offsetof(Tunnel, gre_erspan_sequence) | |
84 | Tunnel.ISATAP, config_parse_tristate, 0, offsetof(Tunnel, isatap) | |
85 | FooOverUDP.Protocol, config_parse_ip_protocol, 0, offsetof(FouTunnel, fou_protocol) | |
86 | FooOverUDP.Encapsulation, config_parse_fou_encap_type, 0, offsetof(FouTunnel, fou_encap_type) | |
87 | FooOverUDP.Port, config_parse_ip_port, 0, offsetof(FouTunnel, port) | |
8f02c9b0 | 88 | FooOverUDP.PeerPort, config_parse_ip_port, 0, offsetof(FouTunnel, peer_port) |
4502a61c SS |
89 | FooOverUDP.Local, config_parse_fou_tunnel_address, 0, offsetof(FouTunnel, local) |
90 | FooOverUDP.Peer, config_parse_fou_tunnel_address, 0, offsetof(FouTunnel, peer) | |
e57319dd YW |
91 | L2TP.TunnelId, config_parse_l2tp_tunnel_id, 0, offsetof(L2tpTunnel, tunnel_id) |
92 | L2TP.PeerTunnelId, config_parse_l2tp_tunnel_id, 0, offsetof(L2tpTunnel, peer_tunnel_id) | |
93 | L2TP.UDPSourcePort, config_parse_ip_port, 0, offsetof(L2tpTunnel, l2tp_udp_sport) | |
94 | L2TP.UDPDestinationPort, config_parse_ip_port, 0, offsetof(L2tpTunnel, l2tp_udp_dport) | |
95 | L2TP.Local, config_parse_l2tp_tunnel_address, 0, offsetof(L2tpTunnel, local) | |
96 | L2TP.Remote, config_parse_l2tp_tunnel_address, 0, offsetof(L2tpTunnel, remote) | |
97 | L2TP.EncapsulationType, config_parse_l2tp_encap_type, 0, offsetof(L2tpTunnel, l2tp_encap_type) | |
98 | L2TP.UDPCheckSum, config_parse_bool, 0, offsetof(L2tpTunnel, udp_csum) | |
99 | L2TP.UDP6CheckSumRx, config_parse_bool, 0, offsetof(L2tpTunnel, udp6_csum_rx) | |
100 | L2TP.UDP6CheckSumTx, config_parse_bool, 0, offsetof(L2tpTunnel, udp6_csum_tx) | |
101 | L2TPSession.SessionId, config_parse_l2tp_session_id, 0, 0 | |
102 | L2TPSession.PeerSessionId, config_parse_l2tp_session_id, 0, 0 | |
103 | L2TPSession.Layer2SpecificHeader, config_parse_l2tp_session_l2spec, 0, 0 | |
104 | L2TPSession.Name, config_parse_l2tp_session_name, 0, 0 | |
105 | Peer.Name, config_parse_ifname, 0, offsetof(Veth, ifname_peer) | |
106 | Peer.MACAddress, config_parse_hwaddr, 0, offsetof(Veth, mac_peer) | |
107 | VXCAN.Peer, config_parse_ifname, 0, offsetof(VxCan, ifname_peer) | |
8c32c588 SS |
108 | VXLAN.VNI, config_parse_uint32, 0, offsetof(VxLan, vni) |
109 | VXLAN.Id, config_parse_uint32, 0, offsetof(VxLan, vni) /* deprecated */ | |
83cb24ac | 110 | VXLAN.Group, config_parse_vxlan_address, 0, offsetof(VxLan, group) |
e57319dd YW |
111 | VXLAN.Local, config_parse_vxlan_address, 0, offsetof(VxLan, local) |
112 | VXLAN.Remote, config_parse_vxlan_address, 0, offsetof(VxLan, remote) | |
113 | VXLAN.TOS, config_parse_unsigned, 0, offsetof(VxLan, tos) | |
f4a8ca32 | 114 | VXLAN.TTL, config_parse_vxlan_ttl, 0, offsetof(VxLan, ttl) |
e57319dd YW |
115 | VXLAN.MacLearning, config_parse_bool, 0, offsetof(VxLan, learning) |
116 | VXLAN.ARPProxy, config_parse_bool, 0, offsetof(VxLan, arp_proxy) | |
117 | VXLAN.ReduceARPProxy, config_parse_bool, 0, offsetof(VxLan, arp_proxy) | |
118 | VXLAN.L2MissNotification, config_parse_bool, 0, offsetof(VxLan, l2miss) | |
119 | VXLAN.L3MissNotification, config_parse_bool, 0, offsetof(VxLan, l3miss) | |
120 | VXLAN.RouteShortCircuit, config_parse_bool, 0, offsetof(VxLan, route_short_circuit) | |
121 | VXLAN.UDPCheckSum, config_parse_bool, 0, offsetof(VxLan, udpcsum) | |
122 | VXLAN.UDPChecksum, config_parse_bool, 0, offsetof(VxLan, udpcsum) | |
123 | VXLAN.UDP6ZeroCheckSumRx, config_parse_bool, 0, offsetof(VxLan, udp6zerocsumrx) | |
124 | VXLAN.UDP6ZeroChecksumRx, config_parse_bool, 0, offsetof(VxLan, udp6zerocsumrx) | |
125 | VXLAN.UDP6ZeroCheckSumTx, config_parse_bool, 0, offsetof(VxLan, udp6zerocsumtx) | |
126 | VXLAN.UDP6ZeroChecksumTx, config_parse_bool, 0, offsetof(VxLan, udp6zerocsumtx) | |
127 | VXLAN.RemoteChecksumTx, config_parse_bool, 0, offsetof(VxLan, remote_csum_tx) | |
128 | VXLAN.RemoteChecksumRx, config_parse_bool, 0, offsetof(VxLan, remote_csum_rx) | |
129 | VXLAN.FDBAgeingSec, config_parse_sec, 0, offsetof(VxLan, fdb_ageing) | |
130 | VXLAN.GroupPolicyExtension, config_parse_bool, 0, offsetof(VxLan, group_policy) | |
4cc0fd75 | 131 | VXLAN.GenericProtocolExtension, config_parse_bool, 0, offsetof(VxLan, generic_protocol_extension) |
e57319dd YW |
132 | VXLAN.MaximumFDBEntries, config_parse_unsigned, 0, offsetof(VxLan, max_fdb) |
133 | VXLAN.PortRange, config_parse_port_range, 0, 0 | |
134 | VXLAN.DestinationPort, config_parse_ip_port, 0, offsetof(VxLan, dest_port) | |
135 | VXLAN.FlowLabel, config_parse_flow_label, 0, 0 | |
1189c00a | 136 | VXLAN.IPDoNotFragment, config_parse_df, 0, offsetof(VxLan, df) |
e57319dd YW |
137 | GENEVE.Id, config_parse_geneve_vni, 0, offsetof(Geneve, id) |
138 | GENEVE.Remote, config_parse_geneve_address, 0, offsetof(Geneve, remote) | |
139 | GENEVE.TOS, config_parse_uint8, 0, offsetof(Geneve, tos) | |
d70c9bbd | 140 | GENEVE.TTL, config_parse_geneve_ttl, 0, offsetof(Geneve, ttl) |
e57319dd YW |
141 | GENEVE.UDPChecksum, config_parse_bool, 0, offsetof(Geneve, udpcsum) |
142 | GENEVE.UDP6ZeroCheckSumRx, config_parse_bool, 0, offsetof(Geneve, udp6zerocsumrx) | |
143 | GENEVE.UDP6ZeroChecksumRx, config_parse_bool, 0, offsetof(Geneve, udp6zerocsumrx) | |
144 | GENEVE.UDP6ZeroCheckSumTx, config_parse_bool, 0, offsetof(Geneve, udp6zerocsumtx) | |
145 | GENEVE.UDP6ZeroChecksumTx, config_parse_bool, 0, offsetof(Geneve, udp6zerocsumtx) | |
146 | GENEVE.DestinationPort, config_parse_ip_port, 0, offsetof(Geneve, dest_port) | |
aac35019 | 147 | GENEVE.IPDoNotFragment, config_parse_geneve_df, 0, offsetof(Geneve, geneve_df) |
e57319dd YW |
148 | GENEVE.FlowLabel, config_parse_geneve_flow_label, 0, 0 |
149 | MACsec.Port, config_parse_macsec_port, 0, 0 | |
150 | MACsec.Encrypt, config_parse_tristate, 0, offsetof(MACsec, encrypt) | |
151 | MACsecReceiveChannel.Port, config_parse_macsec_port, 0, 0 | |
152 | MACsecReceiveChannel.MACAddress, config_parse_macsec_hw_address, 0, 0 | |
153 | MACsecTransmitAssociation.PacketNumber, config_parse_macsec_packet_number, 0, 0 | |
154 | MACsecTransmitAssociation.KeyId, config_parse_macsec_key_id, 0, 0 | |
155 | MACsecTransmitAssociation.Key, config_parse_macsec_key, 0, 0 | |
156 | MACsecTransmitAssociation.KeyFile, config_parse_macsec_key_file, 0, 0 | |
157 | MACsecTransmitAssociation.Activate, config_parse_macsec_sa_activate, 0, 0 | |
158 | MACsecTransmitAssociation.UseForEncoding, config_parse_macsec_use_for_encoding, 0, 0 | |
159 | MACsecReceiveAssociation.Port, config_parse_macsec_port, 0, 0 | |
160 | MACsecReceiveAssociation.MACAddress, config_parse_macsec_hw_address, 0, 0 | |
161 | MACsecReceiveAssociation.PacketNumber, config_parse_macsec_packet_number, 0, 0 | |
162 | MACsecReceiveAssociation.KeyId, config_parse_macsec_key_id, 0, 0 | |
163 | MACsecReceiveAssociation.Key, config_parse_macsec_key, 0, 0 | |
164 | MACsecReceiveAssociation.KeyFile, config_parse_macsec_key_file, 0, 0 | |
165 | MACsecReceiveAssociation.Activate, config_parse_macsec_sa_activate, 0, 0 | |
35433040 | 166 | Tun.OneQueue, config_parse_warn_compat, DISABLED_LEGACY, 0 |
e57319dd YW |
167 | Tun.MultiQueue, config_parse_bool, 0, offsetof(TunTap, multi_queue) |
168 | Tun.PacketInfo, config_parse_bool, 0, offsetof(TunTap, packet_info) | |
75eed300 | 169 | Tun.VNetHeader, config_parse_bool, 0, offsetof(TunTap, vnet_hdr) |
e57319dd YW |
170 | Tun.User, config_parse_string, 0, offsetof(TunTap, user_name) |
171 | Tun.Group, config_parse_string, 0, offsetof(TunTap, group_name) | |
35433040 | 172 | Tap.OneQueue, config_parse_warn_compat, DISABLED_LEGACY, 0 |
e57319dd YW |
173 | Tap.MultiQueue, config_parse_bool, 0, offsetof(TunTap, multi_queue) |
174 | Tap.PacketInfo, config_parse_bool, 0, offsetof(TunTap, packet_info) | |
175 | Tap.VNetHeader, config_parse_bool, 0, offsetof(TunTap, vnet_hdr) | |
176 | Tap.User, config_parse_string, 0, offsetof(TunTap, user_name) | |
177 | Tap.Group, config_parse_string, 0, offsetof(TunTap, group_name) | |
178 | Bond.Mode, config_parse_bond_mode, 0, offsetof(Bond, mode) | |
179 | Bond.TransmitHashPolicy, config_parse_bond_xmit_hash_policy, 0, offsetof(Bond, xmit_hash_policy) | |
180 | Bond.LACPTransmitRate, config_parse_bond_lacp_rate, 0, offsetof(Bond, lacp_rate) | |
181 | Bond.AdSelect, config_parse_bond_ad_select, 0, offsetof(Bond, ad_select) | |
182 | Bond.FailOverMACPolicy, config_parse_bond_fail_over_mac, 0, offsetof(Bond, fail_over_mac) | |
183 | Bond.ARPIPTargets, config_parse_arp_ip_target_address, 0, 0 | |
184 | Bond.ARPValidate, config_parse_bond_arp_validate, 0, offsetof(Bond, arp_validate) | |
185 | Bond.ARPAllTargets, config_parse_bond_arp_all_targets, 0, offsetof(Bond, arp_all_targets) | |
186 | Bond.PrimaryReselectPolicy, config_parse_bond_primary_reselect, 0, offsetof(Bond, primary_reselect) | |
187 | Bond.ResendIGMP, config_parse_unsigned, 0, offsetof(Bond, resend_igmp) | |
188 | Bond.PacketsPerSlave, config_parse_unsigned, 0, offsetof(Bond, packets_per_slave) | |
189 | Bond.GratuitousARP, config_parse_unsigned, 0, offsetof(Bond, num_grat_arp) | |
190 | Bond.AllSlavesActive, config_parse_bool, 0, offsetof(Bond, all_slaves_active) | |
191 | Bond.DynamicTransmitLoadBalancing, config_parse_tristate, 0, offsetof(Bond, tlb_dynamic_lb) | |
192 | Bond.MinLinks, config_parse_unsigned, 0, offsetof(Bond, min_links) | |
193 | Bond.MIIMonitorSec, config_parse_sec, 0, offsetof(Bond, miimon) | |
194 | Bond.UpDelaySec, config_parse_sec, 0, offsetof(Bond, updelay) | |
195 | Bond.DownDelaySec, config_parse_sec, 0, offsetof(Bond, downdelay) | |
196 | Bond.ARPIntervalSec, config_parse_sec, 0, offsetof(Bond, arp_interval) | |
197 | Bond.LearnPacketIntervalSec, config_parse_sec, 0, offsetof(Bond, lp_interval) | |
198 | Bond.AdActorSystemPriority, config_parse_ad_actor_sys_prio, 0, offsetof(Bond, ad_actor_sys_prio) | |
199 | Bond.AdUserPortKey, config_parse_ad_user_port_key, 0, offsetof(Bond, ad_user_port_key) | |
200 | Bond.AdActorSystem, config_parse_ad_actor_system, 0, offsetof(Bond, ad_actor_system) | |
201 | Bridge.HelloTimeSec, config_parse_sec, 0, offsetof(Bridge, hello_time) | |
202 | Bridge.MaxAgeSec, config_parse_sec, 0, offsetof(Bridge, max_age) | |
203 | Bridge.AgeingTimeSec, config_parse_sec, 0, offsetof(Bridge, ageing_time) | |
204 | Bridge.ForwardDelaySec, config_parse_sec, 0, offsetof(Bridge, forward_delay) | |
205 | Bridge.Priority, config_parse_uint16, 0, offsetof(Bridge, priority) | |
206 | Bridge.GroupForwardMask, config_parse_uint16, 0, offsetof(Bridge, group_fwd_mask) | |
207 | Bridge.DefaultPVID, config_parse_default_port_vlanid, 0, offsetof(Bridge, default_pvid) | |
208 | Bridge.MulticastQuerier, config_parse_tristate, 0, offsetof(Bridge, mcast_querier) | |
209 | Bridge.MulticastSnooping, config_parse_tristate, 0, offsetof(Bridge, mcast_snooping) | |
210 | Bridge.VLANFiltering, config_parse_tristate, 0, offsetof(Bridge, vlan_filtering) | |
4df4df5b | 211 | Bridge.VLANProtocol, config_parse_vlanprotocol, 0, offsetof(Bridge, vlan_protocol) |
e57319dd | 212 | Bridge.STP, config_parse_tristate, 0, offsetof(Bridge, stp) |
e8489008 | 213 | Bridge.MulticastIGMPVersion, config_parse_uint8, 0, offsetof(Bridge, igmp_version) |
e57319dd YW |
214 | VRF.TableId, config_parse_uint32, 0, offsetof(Vrf, table) /* deprecated */ |
215 | VRF.Table, config_parse_uint32, 0, offsetof(Vrf, table) | |
1c30b174 YW |
216 | WireGuard.FirewallMark, config_parse_unsigned, 0, offsetof(Wireguard, fwmark) |
217 | WireGuard.FwMark, config_parse_unsigned, 0, offsetof(Wireguard, fwmark) /* deprecated */ | |
e57319dd YW |
218 | WireGuard.ListenPort, config_parse_wireguard_listen_port, 0, offsetof(Wireguard, port) |
219 | WireGuard.PrivateKey, config_parse_wireguard_private_key, 0, 0 | |
220 | WireGuard.PrivateKeyFile, config_parse_wireguard_private_key_file, 0, 0 | |
221 | WireGuardPeer.AllowedIPs, config_parse_wireguard_allowed_ips, 0, 0 | |
222 | WireGuardPeer.Endpoint, config_parse_wireguard_endpoint, 0, 0 | |
223 | WireGuardPeer.PublicKey, config_parse_wireguard_public_key, 0, 0 | |
224 | WireGuardPeer.PresharedKey, config_parse_wireguard_preshared_key, 0, 0 | |
225 | WireGuardPeer.PresharedKeyFile, config_parse_wireguard_preshared_key_file, 0, 0 | |
226 | WireGuardPeer.PersistentKeepalive, config_parse_wireguard_keepalive, 0, 0 | |
98d20a17 | 227 | Xfrm.InterfaceId, config_parse_uint32, 0, offsetof(Xfrm, if_id) |
228 | Xfrm.Independent, config_parse_bool, 0, offsetof(Xfrm, independent) |