Line data Source code
1 : /* ANSI-C code produced by gperf version 3.0.4 */
2 : /* Command-line: gperf */
3 : /* Computed positions: -k'2,5,8-9,23' */
4 :
5 : #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
6 : && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
7 : && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
8 : && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
9 : && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
10 : && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
11 : && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
12 : && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
13 : && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
14 : && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
15 : && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
16 : && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
17 : && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
18 : && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
19 : && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
20 : && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
21 : && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
22 : && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
23 : && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
24 : && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
25 : && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
26 : && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
27 : && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
28 : /* The character set is not based on ISO-646. */
29 : #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
30 : #endif
31 :
32 :
33 : #include <stddef.h>
34 : #include "conf-parser.h"
35 : #include "networkd-netdev.h"
36 : #include "networkd-netdev-tunnel.h"
37 : #include "networkd-netdev-bond.h"
38 : #include "networkd-netdev-macvlan.h"
39 : #include "network-internal.h"
40 : #include <string.h>
41 :
42 : #define TOTAL_KEYWORDS 66
43 : #define MIN_WORD_LENGTH 7
44 : #define MAX_WORD_LENGTH 27
45 : #define MIN_HASH_VALUE 9
46 : #define MAX_HASH_VALUE 94
47 : /* maximum key range = 86, duplicates = 0 */
48 :
49 : #ifdef __GNUC__
50 : __inline
51 : #else
52 : #ifdef __cplusplus
53 : inline
54 : #endif
55 : #endif
56 : static unsigned int
57 0 : network_netdev_gperf_hash (register const char *str, register unsigned int len)
58 : {
59 : static const unsigned char asso_values[] =
60 : {
61 : 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
62 : 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
63 : 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
64 : 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
65 : 95, 95, 95, 95, 95, 95, 0, 95, 95, 95,
66 : 60, 50, 95, 95, 95, 95, 95, 95, 95, 95,
67 : 95, 95, 95, 95, 95, 5, 40, 25, 20, 95,
68 : 95, 30, 5, 0, 95, 10, 25, 0, 5, 60,
69 : 0, 0, 35, 0, 10, 35, 10, 95, 5, 95,
70 : 95, 95, 95, 95, 95, 95, 95, 5, 95, 35,
71 : 40, 0, 95, 95, 5, 10, 95, 10, 30, 0,
72 : 35, 0, 30, 95, 20, 55, 10, 0, 95, 30,
73 : 95, 15, 95, 95, 95, 95, 95, 95, 95, 95,
74 : 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
75 : 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
76 : 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
77 : 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
78 : 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
79 : 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
80 : 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
81 : 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
82 : 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
83 : 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
84 : 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
85 : 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
86 : 95, 95, 95, 95, 95, 95
87 : };
88 0 : register int hval = len;
89 :
90 0 : switch (hval)
91 : {
92 : default:
93 0 : hval += asso_values[(unsigned char)str[22]];
94 : /*FALLTHROUGH*/
95 : case 22:
96 : case 21:
97 : case 20:
98 : case 19:
99 : case 18:
100 : case 17:
101 : case 16:
102 : case 15:
103 : case 14:
104 : case 13:
105 : case 12:
106 : case 11:
107 : case 10:
108 : case 9:
109 0 : hval += asso_values[(unsigned char)str[8]];
110 : /*FALLTHROUGH*/
111 : case 8:
112 0 : hval += asso_values[(unsigned char)str[7]];
113 : /*FALLTHROUGH*/
114 : case 7:
115 : case 6:
116 : case 5:
117 0 : hval += asso_values[(unsigned char)str[4]];
118 : /*FALLTHROUGH*/
119 : case 4:
120 : case 3:
121 : case 2:
122 0 : hval += asso_values[(unsigned char)str[1]];
123 0 : break;
124 : }
125 0 : return hval;
126 : }
127 :
128 : #ifdef __GNUC__
129 : __inline
130 : #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
131 : __attribute__ ((__gnu_inline__))
132 : #endif
133 : #endif
134 : const struct ConfigPerfItem *
135 0 : network_netdev_gperf_lookup (register const char *str, register unsigned int len)
136 : {
137 : static const struct ConfigPerfItem wordlist[] =
138 : {
139 : {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
140 : {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
141 : {(char*)0},
142 : {"Peer.Name", config_parse_ifname, 0, offsetof(Veth, ifname_peer)},
143 : {(char*)0},
144 : {"Tunnel.Mode", config_parse_ip6tnl_mode, 0, offsetof(Tunnel, ip6tnl_mode)},
145 : {(char*)0},
146 : {"Bond.AdSelect", config_parse_bond_ad_select, 0, offsetof(Bond, ad_select)},
147 : {(char*)0}, {(char*)0},
148 : {"IPVLAN.Mode", config_parse_ipvlan_mode, 0, offsetof(IPVlan, mode)},
149 : {"Bond.ARPIPTargets", config_parse_arp_ip_target_address, 0, 0},
150 : {"Bond.MIIMonitorSec", config_parse_sec, 0, offsetof(Bond, miimon)},
151 : {"Bond.ARPIntervalSec", config_parse_sec, 0, offsetof(Bond, arp_interval)},
152 : {"Tunnel.IPv6FlowLabel", config_parse_ipv6_flowlabel, 0, offsetof(Tunnel, ipv6_flowlabel)},
153 : {"NetDev.Name", config_parse_ifname, 0, offsetof(NetDev, ifname)},
154 : {"NetDev.MACAddress", config_parse_hwaddr, 0, offsetof(NetDev, mac)},
155 : {"Bond.ARPAllTargets", config_parse_bond_arp_all_targets, 0, offsetof(Bond, arp_all_targets)},
156 : {"Tun.PacketInfo", config_parse_bool, 0, offsetof(TunTap, packet_info)},
157 : {"NetDev.MTUBytes", config_parse_iec_size, 0, offsetof(NetDev, mtu)},
158 : {"Bond.ARPValidate", config_parse_bond_arp_validate, 0, offsetof(Bond, arp_validate)},
159 : {"MACVTAP.Mode", config_parse_macvlan_mode, 0, offsetof(MacVlan, mode)},
160 : {(char*)0},
161 : {"Tap.PacketInfo", config_parse_bool, 0, offsetof(TunTap, packet_info)},
162 : {"Tunnel.TTL", config_parse_unsigned, 0, offsetof(Tunnel, ttl)},
163 : {"NetDev.Kind", config_parse_netdev_kind, 0, offsetof(NetDev, kind)},
164 : {"VLAN.Id", config_parse_uint64, 0, offsetof(VLan, id)},
165 : {"Bond.GratuitousARP", config_parse_unsigned, 0, offsetof(Bond, num_grat_arp)},
166 : {"Tun.MultiQueue", config_parse_bool, 0, offsetof(TunTap, multi_queue)},
167 : {"Bond.UpDelaySec", config_parse_sec, 0, offsetof(Bond, updelay)},
168 : {(char*)0},
169 : {"Tunnel.Local", config_parse_tunnel_address, 0, offsetof(Tunnel, local)},
170 : {"NetDev.Description", config_parse_string, 0, offsetof(NetDev, description)},
171 : {"Tap.MultiQueue", config_parse_bool, 0, offsetof(TunTap, multi_queue)},
172 : {"Tunnel.CopyDSCP", config_parse_bool, 0, offsetof(Tunnel, copy_dscp)},
173 : {"VXLAN.Group", config_parse_vxlan_group_address, 0, offsetof(VxLan, group)},
174 : {"MACVLAN.Mode", config_parse_macvlan_mode, 0, offsetof(MacVlan, mode)},
175 : {"VXLAN.RouteShortCircuit", config_parse_bool, 0, offsetof(VxLan, route_short_circuit)},
176 : {"Tap.VNetHeader", config_parse_bool, 0, offsetof(TunTap, vnet_hdr)},
177 : {"Peer.MACAddress", config_parse_hwaddr, 0, offsetof(Veth, mac_peer)},
178 : {"Bond.LACPTransmitRate", config_parse_bond_lacp_rate, 0, offsetof(Bond, lacp_rate)},
179 : {"VXLAN.UDPCheckSum", config_parse_bool, 0, offsetof(VxLan, udpcsum)},
180 : {"Tunnel.Remote", config_parse_tunnel_address, 0, offsetof(Tunnel, remote)},
181 : {"Bond.Mode", config_parse_bond_mode, 0, offsetof(Bond, mode)},
182 : {"Bond.AllSlavesActive", config_parse_unsigned, 0, offsetof(Bond, all_slaves_active)},
183 : {(char*)0},
184 : {"Tunnel.DiscoverPathMTU", config_parse_bool, 0, offsetof(Tunnel, pmtudisc)},
185 : {"Match.KernelCommandLine", config_parse_net_condition, CONDITION_KERNEL_COMMAND_LINE, offsetof(NetDev, match_kernel)},
186 : {"VXLAN.TTL", config_parse_unsigned, 0, offsetof(VxLan, ttl)},
187 : {(char*)0}, {(char*)0},
188 : {"Bond.LearnPacketIntervalSec", config_parse_sec, 0, offsetof(Bond, lp_interval)},
189 : {"VXLAN.Id", config_parse_uint64, 0, offsetof(VxLan, id)},
190 : {"VXLAN.ARPProxy", config_parse_bool, 0, offsetof(VxLan, arp_proxy)},
191 : {"Match.Virtualization", config_parse_net_condition, CONDITION_VIRTUALIZATION, offsetof(NetDev, match_virt)},
192 : {(char*)0},
193 : {"Bond.FailOverMACPolicy", config_parse_bond_fail_over_mac, 0, offsetof(Bond, fail_over_mac)},
194 : {"Tun.User", config_parse_string, 0, offsetof(TunTap, user_name)},
195 : {"VXLAN.UDP6ZeroCheckSumTx", config_parse_bool, 0, offsetof(VxLan, udp6zerocsumtx)},
196 : {"Bond.PacketsPerSlave", config_parse_unsigned, 0, offsetof(Bond, packets_per_slave)},
197 : {"Bond.PrimaryReselectPolicy", config_parse_bond_primary_reselect, 0, offsetof(Bond, primary_reselect)},
198 : {"VXLAN.MacLearning", config_parse_bool, 0, offsetof(VxLan, learning)},
199 : {"Tap.User", config_parse_string, 0, offsetof(TunTap, user_name)},
200 : {"Tun.Group", config_parse_string, 0, offsetof(TunTap, group_name)},
201 : {"Bond.ResendIGMP", config_parse_unsigned, 0, offsetof(Bond, resend_igmp)},
202 : {(char*)0},
203 : {"Tun.OneQueue", config_parse_bool, 0, offsetof(TunTap, one_queue)},
204 : {"Bond.MinLinks", config_parse_unsigned, 0, offsetof(Bond, min_links)},
205 : {"Tap.Group", config_parse_string, 0, offsetof(TunTap, group_name)},
206 : {"Match.Host", config_parse_net_condition, CONDITION_HOST, offsetof(NetDev, match_host)},
207 : {(char*)0},
208 : {"Tap.OneQueue", config_parse_bool, 0, offsetof(TunTap, one_queue)},
209 : {"Bond.TransmitHashPolicy", config_parse_bond_xmit_hash_policy, 0, offsetof(Bond, xmit_hash_policy)},
210 : {"VXLAN.TOS", config_parse_unsigned, 0, offsetof(VxLan, tos)},
211 : {"Tunnel.TOS", config_parse_unsigned, 0, offsetof(Tunnel, tos)},
212 : {(char*)0},
213 : {"Bond.DownDelaySec", config_parse_sec, 0, offsetof(Bond, downdelay)},
214 : {"Match.Architecture", config_parse_net_condition, CONDITION_ARCHITECTURE, offsetof(NetDev, match_arch)},
215 : {"VXLAN.L3MissNotification", config_parse_bool, 0, offsetof(VxLan, l3miss)},
216 : {(char*)0}, {(char*)0}, {(char*)0},
217 : {"VXLAN.FDBAgeingSec", config_parse_sec, 0, offsetof(VxLan, fdb_ageing)},
218 : {"VXLAN.UDP6ZeroCheckSumRx", config_parse_bool, 0, offsetof(VxLan, udp6zerocsumrx)},
219 : {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
220 : {"VXLAN.L2MissNotification", config_parse_bool, 0, offsetof(VxLan, l2miss)}
221 : };
222 :
223 0 : if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
224 : {
225 0 : register int key = network_netdev_gperf_hash (str, len);
226 :
227 0 : if (key <= MAX_HASH_VALUE && key >= 0)
228 : {
229 0 : register const char *s = wordlist[key].section_and_lvalue;
230 :
231 0 : if (s && *str == *s && !strcmp (str + 1, s + 1))
232 0 : return &wordlist[key];
233 : }
234 : }
235 0 : return 0;
236 : }
|