Branch data Line data Source code
1 : : %{
2 : : #if __GNUC__ >= 7
3 : : _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
4 : : #endif
5 : : #include <stddef.h>
6 : : #include "conf-parser.h"
7 : : #include "network-internal.h"
8 : : #include "netdev/bond.h"
9 : : #include "netdev/bridge.h"
10 : : #include "netdev/geneve.h"
11 : : #include "netdev/ipvlan.h"
12 : : #include "netdev/macsec.h"
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"
21 : : #include "netdev/vxcan.h"
22 : : #include "netdev/wireguard.h"
23 : : #include "netdev/fou-tunnel.h"
24 : : #include "netdev/l2tp-tunnel.h"
25 : : #include "netdev/xfrm.h"
26 : : #include "vlan-util.h"
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 : : %%
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 : 0 : 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)
55 : : MACVTAP.Mode, config_parse_macvlan_mode, 0, offsetof(MacVlan, mode)
56 : : IPVLAN.Mode, config_parse_ipvlan_mode, 0, offsetof(IPVlan, mode)
57 : : IPVLAN.Flags, config_parse_ipvlan_flags, 0, offsetof(IPVlan, flags)
58 : : IPVTAP.Mode, config_parse_ipvlan_mode, 0, offsetof(IPVlan, mode)
59 : : IPVTAP.Flags, config_parse_ipvlan_flags, 0, offsetof(IPVlan, flags)
60 : : Tunnel.Local, config_parse_tunnel_address, 0, offsetof(Tunnel, local)
61 : : Tunnel.Remote, config_parse_tunnel_address, 0, offsetof(Tunnel, remote)
62 : : Tunnel.TOS, config_parse_unsigned, 0, offsetof(Tunnel, tos)
63 : : Tunnel.TTL, config_parse_unsigned, 0, offsetof(Tunnel, ttl)
64 : : Tunnel.Key, config_parse_tunnel_key, 0, offsetof(Tunnel, key)
65 : : Tunnel.InputKey, config_parse_tunnel_key, 0, offsetof(Tunnel, ikey)
66 : : Tunnel.OutputKey, config_parse_tunnel_key, 0, offsetof(Tunnel, okey)
67 : : Tunnel.DiscoverPathMTU, config_parse_bool, 0, offsetof(Tunnel, pmtudisc)
68 : : Tunnel.Mode, config_parse_ip6tnl_mode, 0, offsetof(Tunnel, ip6tnl_mode)
69 : : Tunnel.IPv6FlowLabel, config_parse_ipv6_flowlabel, 0, offsetof(Tunnel, ipv6_flowlabel)
70 : : Tunnel.CopyDSCP, config_parse_bool, 0, offsetof(Tunnel, copy_dscp)
71 : : Tunnel.EncapsulationLimit, config_parse_encap_limit, 0, offsetof(Tunnel, encap_limit)
72 : : Tunnel.Independent, config_parse_bool, 0, offsetof(Tunnel, independent)
73 : : Tunnel.AssignToLoopback, config_parse_bool, 0, offsetof(Tunnel, assign_to_loopback)
74 : : Tunnel.AllowLocalRemote, config_parse_tristate, 0, offsetof(Tunnel, allow_localremote)
75 : 0 : Tunnel.FooOverUDP, config_parse_bool, 0, offsetof(Tunnel, fou_tunnel)
76 : : Tunnel.FOUDestinationPort, config_parse_ip_port, 0, offsetof(Tunnel, fou_destination_port)
77 [ # # # # : 0 : Tunnel.FOUSourcePort, config_parse_ip_port, 0, offsetof(Tunnel, encap_src_port)
# # # # #
# # ]
78 : : Tunnel.Encapsulation, config_parse_fou_encap_type, 0, offsetof(Tunnel, fou_encap_type)
79 : 0 : Tunnel.IPv6RapidDeploymentPrefix, config_parse_6rd_prefix, 0, 0
80 : 0 : Tunnel.ERSPANIndex, config_parse_uint32, 0, offsetof(Tunnel, erspan_index)
81 : : Tunnel.SerializeTunneledPackets, config_parse_tristate, 0, offsetof(Tunnel, gre_erspan_sequence)
82 : 0 : Tunnel.ISATAP, config_parse_tristate, 0, offsetof(Tunnel, isatap)
83 : 0 : FooOverUDP.Protocol, config_parse_ip_protocol, 0, offsetof(FouTunnel, fou_protocol)
84 : : FooOverUDP.Encapsulation, config_parse_fou_encap_type, 0, offsetof(FouTunnel, fou_encap_type)
85 : 0 : FooOverUDP.Port, config_parse_ip_port, 0, offsetof(FouTunnel, port)
86 : : FooOverUDP.PeerPort, config_parse_ip_port, 0, offsetof(FouTunnel, peer_port)
87 : 0 : FooOverUDP.Local, config_parse_fou_tunnel_address, 0, offsetof(FouTunnel, local)
88 : : FooOverUDP.Peer, config_parse_fou_tunnel_address, 0, offsetof(FouTunnel, peer)
89 : 0 : L2TP.TunnelId, config_parse_l2tp_tunnel_id, 0, offsetof(L2tpTunnel, tunnel_id)
90 : 0 : L2TP.PeerTunnelId, config_parse_l2tp_tunnel_id, 0, offsetof(L2tpTunnel, peer_tunnel_id)
91 : : L2TP.UDPSourcePort, config_parse_ip_port, 0, offsetof(L2tpTunnel, l2tp_udp_sport)
92 : 0 : L2TP.UDPDestinationPort, config_parse_ip_port, 0, offsetof(L2tpTunnel, l2tp_udp_dport)
93 : : L2TP.Local, config_parse_l2tp_tunnel_address, 0, offsetof(L2tpTunnel, local)
94 : 0 : L2TP.Remote, config_parse_l2tp_tunnel_address, 0, offsetof(L2tpTunnel, remote)
95 : : L2TP.EncapsulationType, config_parse_l2tp_encap_type, 0, offsetof(L2tpTunnel, l2tp_encap_type)
96 : 0 : L2TP.UDPCheckSum, config_parse_bool, 0, offsetof(L2tpTunnel, udp_csum)
97 : : L2TP.UDP6CheckSumRx, config_parse_bool, 0, offsetof(L2tpTunnel, udp6_csum_rx)
98 : : L2TP.UDP6CheckSumTx, config_parse_bool, 0, offsetof(L2tpTunnel, udp6_csum_tx)
99 : 0 : L2TPSession.SessionId, config_parse_l2tp_session_id, 0, 0
100 : : L2TPSession.PeerSessionId, config_parse_l2tp_session_id, 0, 0
101 : 0 : L2TPSession.Layer2SpecificHeader, config_parse_l2tp_session_l2spec, 0, 0
102 : : L2TPSession.Name, config_parse_l2tp_session_name, 0, 0
103 : : Peer.Name, config_parse_ifname, 0, offsetof(Veth, ifname_peer)
104 : : Peer.MACAddress, config_parse_hwaddr, 0, offsetof(Veth, mac_peer)
105 : : VXCAN.Peer, config_parse_ifname, 0, offsetof(VxCan, ifname_peer)
106 : : VXLAN.VNI, config_parse_uint32, 0, offsetof(VxLan, vni)
107 : 0 : VXLAN.Id, config_parse_uint32, 0, offsetof(VxLan, vni) /* deprecated */
108 : : VXLAN.Group, config_parse_vxlan_address, 0, offsetof(VxLan, group)
109 : 0 : VXLAN.Local, config_parse_vxlan_address, 0, offsetof(VxLan, local)
110 : 0 : VXLAN.Remote, config_parse_vxlan_address, 0, offsetof(VxLan, remote)
111 : : VXLAN.TOS, config_parse_unsigned, 0, offsetof(VxLan, tos)
112 : 0 : VXLAN.TTL, config_parse_vxlan_ttl, 0, offsetof(VxLan, ttl)
113 : : VXLAN.MacLearning, config_parse_bool, 0, offsetof(VxLan, learning)
114 : 0 : VXLAN.ARPProxy, config_parse_bool, 0, offsetof(VxLan, arp_proxy)
115 : : VXLAN.ReduceARPProxy, config_parse_bool, 0, offsetof(VxLan, arp_proxy)
116 : 0 : VXLAN.L2MissNotification, config_parse_bool, 0, offsetof(VxLan, l2miss)
117 : 0 : VXLAN.L3MissNotification, config_parse_bool, 0, offsetof(VxLan, l3miss)
118 : : VXLAN.RouteShortCircuit, config_parse_bool, 0, offsetof(VxLan, route_short_circuit)
119 : 0 : VXLAN.UDPCheckSum, config_parse_bool, 0, offsetof(VxLan, udpcsum)
120 : : VXLAN.UDPChecksum, config_parse_bool, 0, offsetof(VxLan, udpcsum)
121 : : VXLAN.UDP6ZeroCheckSumRx, config_parse_bool, 0, offsetof(VxLan, udp6zerocsumrx)
122 : 0 : VXLAN.UDP6ZeroChecksumRx, config_parse_bool, 0, offsetof(VxLan, udp6zerocsumrx)
123 : 0 : VXLAN.UDP6ZeroCheckSumTx, config_parse_bool, 0, offsetof(VxLan, udp6zerocsumtx)
124 : : VXLAN.UDP6ZeroChecksumTx, config_parse_bool, 0, offsetof(VxLan, udp6zerocsumtx)
125 : 0 : VXLAN.RemoteChecksumTx, config_parse_bool, 0, offsetof(VxLan, remote_csum_tx)
126 : : VXLAN.RemoteChecksumRx, config_parse_bool, 0, offsetof(VxLan, remote_csum_rx)
127 : : VXLAN.FDBAgeingSec, config_parse_sec, 0, offsetof(VxLan, fdb_ageing)
128 : : VXLAN.GroupPolicyExtension, config_parse_bool, 0, offsetof(VxLan, group_policy)
129 : 0 : VXLAN.GenericProtocolExtension, config_parse_bool, 0, offsetof(VxLan, generic_protocol_extension)
130 : : VXLAN.MaximumFDBEntries, config_parse_unsigned, 0, offsetof(VxLan, max_fdb)
131 : : VXLAN.PortRange, config_parse_port_range, 0, 0
132 : : VXLAN.DestinationPort, config_parse_ip_port, 0, offsetof(VxLan, dest_port)
133 : : VXLAN.FlowLabel, config_parse_flow_label, 0, 0
134 : : VXLAN.IPDoNotFragment, config_parse_df, 0, offsetof(VxLan, df)
135 : : GENEVE.Id, config_parse_geneve_vni, 0, offsetof(Geneve, id)
136 : : GENEVE.Remote, config_parse_geneve_address, 0, offsetof(Geneve, remote)
137 : : GENEVE.TOS, config_parse_uint8, 0, offsetof(Geneve, tos)
138 : : GENEVE.TTL, config_parse_geneve_ttl, 0, offsetof(Geneve, ttl)
139 : : GENEVE.UDPChecksum, config_parse_bool, 0, offsetof(Geneve, udpcsum)
140 : : GENEVE.UDP6ZeroCheckSumRx, config_parse_bool, 0, offsetof(Geneve, udp6zerocsumrx)
141 : : GENEVE.UDP6ZeroChecksumRx, config_parse_bool, 0, offsetof(Geneve, udp6zerocsumrx)
142 : : GENEVE.UDP6ZeroCheckSumTx, config_parse_bool, 0, offsetof(Geneve, udp6zerocsumtx)
143 : : GENEVE.UDP6ZeroChecksumTx, config_parse_bool, 0, offsetof(Geneve, udp6zerocsumtx)
144 : : GENEVE.DestinationPort, config_parse_ip_port, 0, offsetof(Geneve, dest_port)
145 : : GENEVE.IPDoNotFragment, config_parse_geneve_df, 0, offsetof(Geneve, geneve_df)
146 : : GENEVE.FlowLabel, config_parse_geneve_flow_label, 0, 0
147 : : MACsec.Port, config_parse_macsec_port, 0, 0
148 [ # # # # ]: 0 : MACsec.Encrypt, config_parse_tristate, 0, offsetof(MACsec, encrypt)
149 : : MACsecReceiveChannel.Port, config_parse_macsec_port, 0, 0
150 : 0 : MACsecReceiveChannel.MACAddress, config_parse_macsec_hw_address, 0, 0
151 : : MACsecTransmitAssociation.PacketNumber, config_parse_macsec_packet_number, 0, 0
152 [ # # ]: 0 : MACsecTransmitAssociation.KeyId, config_parse_macsec_key_id, 0, 0
153 : : MACsecTransmitAssociation.Key, config_parse_macsec_key, 0, 0
154 : 0 : MACsecTransmitAssociation.KeyFile, config_parse_macsec_key_file, 0, 0
155 : : MACsecTransmitAssociation.Activate, config_parse_macsec_sa_activate, 0, 0
156 [ # # # # : 0 : MACsecTransmitAssociation.UseForEncoding, config_parse_macsec_use_for_encoding, 0, 0
# # ]
157 : 0 : MACsecReceiveAssociation.Port, config_parse_macsec_port, 0, 0
158 : : MACsecReceiveAssociation.MACAddress, config_parse_macsec_hw_address, 0, 0
159 : : MACsecReceiveAssociation.PacketNumber, config_parse_macsec_packet_number, 0, 0
160 : 0 : MACsecReceiveAssociation.KeyId, config_parse_macsec_key_id, 0, 0
161 : : MACsecReceiveAssociation.Key, config_parse_macsec_key, 0, 0
162 : : MACsecReceiveAssociation.KeyFile, config_parse_macsec_key_file, 0, 0
163 : : MACsecReceiveAssociation.Activate, config_parse_macsec_sa_activate, 0, 0
164 : : Tun.OneQueue, config_parse_warn_compat, DISABLED_LEGACY, 0
165 : : Tun.MultiQueue, config_parse_bool, 0, offsetof(TunTap, multi_queue)
166 : : Tun.PacketInfo, config_parse_bool, 0, offsetof(TunTap, packet_info)
167 : : Tun.VNetHeader, config_parse_bool, 0, offsetof(TunTap, vnet_hdr)
168 : : Tun.User, config_parse_string, 0, offsetof(TunTap, user_name)
169 : : Tun.Group, config_parse_string, 0, offsetof(TunTap, group_name)
170 : : Tap.OneQueue, config_parse_warn_compat, DISABLED_LEGACY, 0
171 : : Tap.MultiQueue, config_parse_bool, 0, offsetof(TunTap, multi_queue)
172 : : Tap.PacketInfo, config_parse_bool, 0, offsetof(TunTap, packet_info)
173 : : Tap.VNetHeader, config_parse_bool, 0, offsetof(TunTap, vnet_hdr)
174 : : Tap.User, config_parse_string, 0, offsetof(TunTap, user_name)
175 : : Tap.Group, config_parse_string, 0, offsetof(TunTap, group_name)
176 : : Bond.Mode, config_parse_bond_mode, 0, offsetof(Bond, mode)
177 : : Bond.TransmitHashPolicy, config_parse_bond_xmit_hash_policy, 0, offsetof(Bond, xmit_hash_policy)
178 : : Bond.LACPTransmitRate, config_parse_bond_lacp_rate, 0, offsetof(Bond, lacp_rate)
179 : : Bond.AdSelect, config_parse_bond_ad_select, 0, offsetof(Bond, ad_select)
180 : : Bond.FailOverMACPolicy, config_parse_bond_fail_over_mac, 0, offsetof(Bond, fail_over_mac)
181 : : Bond.ARPIPTargets, config_parse_arp_ip_target_address, 0, 0
182 : : Bond.ARPValidate, config_parse_bond_arp_validate, 0, offsetof(Bond, arp_validate)
183 : : Bond.ARPAllTargets, config_parse_bond_arp_all_targets, 0, offsetof(Bond, arp_all_targets)
184 : : Bond.PrimaryReselectPolicy, config_parse_bond_primary_reselect, 0, offsetof(Bond, primary_reselect)
185 : : Bond.ResendIGMP, config_parse_unsigned, 0, offsetof(Bond, resend_igmp)
186 : : Bond.PacketsPerSlave, config_parse_unsigned, 0, offsetof(Bond, packets_per_slave)
187 : : Bond.GratuitousARP, config_parse_unsigned, 0, offsetof(Bond, num_grat_arp)
188 : : Bond.AllSlavesActive, config_parse_bool, 0, offsetof(Bond, all_slaves_active)
189 : : Bond.DynamicTransmitLoadBalancing, config_parse_tristate, 0, offsetof(Bond, tlb_dynamic_lb)
190 : : Bond.MinLinks, config_parse_unsigned, 0, offsetof(Bond, min_links)
191 : : Bond.MIIMonitorSec, config_parse_sec, 0, offsetof(Bond, miimon)
192 : : Bond.UpDelaySec, config_parse_sec, 0, offsetof(Bond, updelay)
193 : : Bond.DownDelaySec, config_parse_sec, 0, offsetof(Bond, downdelay)
194 : : Bond.ARPIntervalSec, config_parse_sec, 0, offsetof(Bond, arp_interval)
195 : : Bond.LearnPacketIntervalSec, config_parse_sec, 0, offsetof(Bond, lp_interval)
196 : : Bond.AdActorSystemPriority, config_parse_ad_actor_sys_prio, 0, offsetof(Bond, ad_actor_sys_prio)
197 : : Bond.AdUserPortKey, config_parse_ad_user_port_key, 0, offsetof(Bond, ad_user_port_key)
198 : : Bond.AdActorSystem, config_parse_ad_actor_system, 0, offsetof(Bond, ad_actor_system)
199 : : Bridge.HelloTimeSec, config_parse_sec, 0, offsetof(Bridge, hello_time)
200 : : Bridge.MaxAgeSec, config_parse_sec, 0, offsetof(Bridge, max_age)
201 : : Bridge.AgeingTimeSec, config_parse_sec, 0, offsetof(Bridge, ageing_time)
202 : : Bridge.ForwardDelaySec, config_parse_sec, 0, offsetof(Bridge, forward_delay)
203 : : Bridge.Priority, config_parse_uint16, 0, offsetof(Bridge, priority)
204 : : Bridge.GroupForwardMask, config_parse_uint16, 0, offsetof(Bridge, group_fwd_mask)
205 : : Bridge.DefaultPVID, config_parse_default_port_vlanid, 0, offsetof(Bridge, default_pvid)
206 : : Bridge.MulticastQuerier, config_parse_tristate, 0, offsetof(Bridge, mcast_querier)
207 : : Bridge.MulticastSnooping, config_parse_tristate, 0, offsetof(Bridge, mcast_snooping)
208 : : Bridge.VLANFiltering, config_parse_tristate, 0, offsetof(Bridge, vlan_filtering)
209 : : Bridge.STP, config_parse_tristate, 0, offsetof(Bridge, stp)
210 : : Bridge.MulticastIGMPVersion, config_parse_uint8, 0, offsetof(Bridge, igmp_version)
211 : : VRF.TableId, config_parse_uint32, 0, offsetof(Vrf, table) /* deprecated */
212 : : VRF.Table, config_parse_uint32, 0, offsetof(Vrf, table)
213 : : WireGuard.FirewallMark, config_parse_unsigned, 0, offsetof(Wireguard, fwmark)
214 : : WireGuard.FwMark, config_parse_unsigned, 0, offsetof(Wireguard, fwmark) /* deprecated */
215 : : WireGuard.ListenPort, config_parse_wireguard_listen_port, 0, offsetof(Wireguard, port)
216 : : WireGuard.PrivateKey, config_parse_wireguard_private_key, 0, 0
217 : : WireGuard.PrivateKeyFile, config_parse_wireguard_private_key_file, 0, 0
218 : : WireGuardPeer.AllowedIPs, config_parse_wireguard_allowed_ips, 0, 0
219 : : WireGuardPeer.Endpoint, config_parse_wireguard_endpoint, 0, 0
220 : : WireGuardPeer.PublicKey, config_parse_wireguard_public_key, 0, 0
221 : : WireGuardPeer.PresharedKey, config_parse_wireguard_preshared_key, 0, 0
222 : : WireGuardPeer.PresharedKeyFile, config_parse_wireguard_preshared_key_file, 0, 0
223 : : WireGuardPeer.PersistentKeepalive, config_parse_wireguard_keepalive, 0, 0
224 : : Xfrm.InterfaceId, config_parse_uint32, 0, offsetof(Xfrm, if_id)
225 : : Xfrm.Independent, config_parse_bool, 0, offsetof(Xfrm, independent)
|