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