Line data Source code
1 : /* ANSI-C code produced by gperf version 3.0.4 */
2 : /* Command-line: gperf -L ANSI-C -t --ignore-case -N lookup_arphrd -H hash_arphrd_name -p -C */
3 : /* Computed positions: -k'2-3,$' */
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 : struct arphrd_name { const char* name; int id; };
33 :
34 : #define TOTAL_KEYWORDS 58
35 : #define MIN_WORD_LENGTH 3
36 : #define MAX_WORD_LENGTH 18
37 : #define MIN_HASH_VALUE 5
38 : #define MAX_HASH_VALUE 135
39 : /* maximum key range = 131, duplicates = 0 */
40 :
41 : #ifndef GPERF_DOWNCASE
42 : #define GPERF_DOWNCASE 1
43 : static unsigned char gperf_downcase[256] =
44 : {
45 : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
46 : 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
47 : 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
48 : 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
49 : 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
50 : 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
51 : 122, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
52 : 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
53 : 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
54 : 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
55 : 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
56 : 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
57 : 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
58 : 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
59 : 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224,
60 : 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
61 : 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254,
62 : 255
63 : };
64 : #endif
65 :
66 : #ifndef GPERF_CASE_STRCMP
67 : #define GPERF_CASE_STRCMP 1
68 : static int
69 0 : gperf_case_strcmp (register const char *s1, register const char *s2)
70 : {
71 : for (;;)
72 : {
73 0 : unsigned char c1 = gperf_downcase[(unsigned char)*s1++];
74 0 : unsigned char c2 = gperf_downcase[(unsigned char)*s2++];
75 0 : if (c1 != 0 && c1 == c2)
76 0 : continue;
77 0 : return (int)c1 - (int)c2;
78 0 : }
79 : }
80 : #endif
81 :
82 : #ifdef __GNUC__
83 : __inline
84 : #else
85 : #ifdef __cplusplus
86 : inline
87 : #endif
88 : #endif
89 : static unsigned int
90 0 : hash_arphrd_name (register const char *str, register unsigned int len)
91 : {
92 : static const unsigned char asso_values[] =
93 : {
94 : 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
95 : 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
96 : 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
97 : 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
98 : 136, 136, 136, 136, 136, 136, 136, 136, 136, 55,
99 : 0, 0, 60, 0, 15, 136, 136, 136, 136, 136,
100 : 136, 136, 136, 136, 136, 20, 55, 15, 5, 5,
101 : 10, 0, 60, 0, 45, 25, 10, 25, 45, 15,
102 : 0, 25, 0, 15, 0, 5, 136, 25, 5, 5,
103 : 136, 136, 136, 136, 136, 136, 136, 20, 55, 15,
104 : 5, 5, 10, 0, 60, 0, 45, 25, 10, 25,
105 : 45, 15, 0, 25, 0, 15, 0, 5, 136, 25,
106 : 5, 5, 136, 136, 136, 136, 136, 136, 136, 136,
107 : 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
108 : 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
109 : 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
110 : 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
111 : 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
112 : 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
113 : 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
114 : 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
115 : 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
116 : 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
117 : 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
118 : 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
119 : 136, 136, 136, 136, 136, 136, 136
120 : };
121 0 : return len + asso_values[(unsigned char)str[2]+1] + asso_values[(unsigned char)str[1]] + asso_values[(unsigned char)str[len - 1]];
122 : }
123 :
124 : #ifdef __GNUC__
125 : __inline
126 : #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
127 : __attribute__ ((__gnu_inline__))
128 : #endif
129 : #endif
130 : const struct arphrd_name *
131 0 : lookup_arphrd (register const char *str, register unsigned int len)
132 : {
133 : static const struct arphrd_name wordlist[] =
134 : {
135 : {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
136 : {(char*)0},
137 : {"ETHER", ARPHRD_ETHER},
138 : {"PRONET", ARPHRD_PRONET},
139 : {(char*)0},
140 : {"SIT", ARPHRD_SIT},
141 : {"AX25", ARPHRD_AX25},
142 : {"IPDDP", ARPHRD_IPDDP},
143 : {"ARCNET", ARPHRD_ARCNET},
144 : {(char*)0},
145 : {"BIF", ARPHRD_BIF},
146 : {"FDDI", ARPHRD_FDDI},
147 : {"DDCMP", ARPHRD_DDCMP},
148 : {"EETHER", ARPHRD_EETHER},
149 : {(char*)0},
150 : {"X25", ARPHRD_X25},
151 : {"DLCI", ARPHRD_DLCI},
152 : {"CISCO", ARPHRD_CISCO},
153 : {"ECONET", ARPHRD_ECONET},
154 : {"IEEE802", ARPHRD_IEEE802},
155 : {(char*)0},
156 : {"ROSE", ARPHRD_ROSE},
157 : {"IEEE802_TR", ARPHRD_IEEE802_TR},
158 : {(char*)0}, {(char*)0},
159 : {"PPP", ARPHRD_PPP},
160 : {"IRDA", ARPHRD_IRDA},
161 : {"HIPPI", ARPHRD_HIPPI},
162 : {(char*)0}, {(char*)0},
163 : {"IEEE80211_RADIOTAP", ARPHRD_IEEE80211_RADIOTAP},
164 : {"IEEE802154_PHY", ARPHRD_IEEE802154_PHY},
165 : {"HWX25", ARPHRD_HWX25},
166 : {"TUNNEL", ARPHRD_TUNNEL},
167 : {(char*)0},
168 : {"FCFABRIC", ARPHRD_FCFABRIC},
169 : {"NONE", ARPHRD_NONE},
170 : {"RSRVD", ARPHRD_RSRVD},
171 : {"NETROM", ARPHRD_NETROM},
172 : {"TUNNEL6", ARPHRD_TUNNEL6},
173 : {"METRICOM", ARPHRD_METRICOM},
174 : {"FCPP", ARPHRD_FCPP},
175 : {"CSLIP", ARPHRD_CSLIP},
176 : {(char*)0},
177 : {"RAWHDLC", ARPHRD_RAWHDLC},
178 : {"LOOPBACK", ARPHRD_LOOPBACK},
179 : {"HDLC", ARPHRD_HDLC},
180 : {(char*)0},
181 : {"PIMREG", ARPHRD_PIMREG},
182 : {(char*)0},
183 : {"LOCALTLK", ARPHRD_LOCALTLK},
184 : {"FCPL", ARPHRD_FCPL},
185 : {"IEEE80211_PRISM", ARPHRD_IEEE80211_PRISM},
186 : {(char*)0}, {(char*)0},
187 : {"APPLETLK", ARPHRD_APPLETLK},
188 : {"SLIP", ARPHRD_SLIP},
189 : {"INFINIBAND", ARPHRD_INFINIBAND},
190 : {"CSLIP6", ARPHRD_CSLIP6},
191 : {(char*)0}, {(char*)0},
192 : {"FRAD", ARPHRD_FRAD},
193 : {"ADAPT", ARPHRD_ADAPT},
194 : {(char*)0}, {(char*)0}, {(char*)0},
195 : {"VOID", ARPHRD_VOID},
196 : {"IPGRE", ARPHRD_IPGRE},
197 : {(char*)0}, {(char*)0},
198 : {"ATM", ARPHRD_ATM},
199 : {"SKIP", ARPHRD_SKIP},
200 : {"SLIP6", ARPHRD_SLIP6},
201 : {(char*)0}, {(char*)0},
202 : {"ASH", ARPHRD_ASH},
203 : {"IEEE80211", ARPHRD_IEEE80211},
204 : {(char*)0}, {(char*)0}, {(char*)0},
205 : {"IEEE1394", ARPHRD_IEEE1394},
206 : {"FCAL", ARPHRD_FCAL},
207 : {"IEEE802154", ARPHRD_IEEE802154},
208 : {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
209 : {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
210 : {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
211 : {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
212 : {(char*)0}, {(char*)0},
213 : {"LAPB", ARPHRD_LAPB},
214 : {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
215 : {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
216 : {(char*)0}, {(char*)0},
217 : {"EUI64", ARPHRD_EUI64},
218 : {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
219 : {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
220 : {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
221 : {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
222 : {(char*)0}, {(char*)0}, {(char*)0},
223 : {"CHAOS", ARPHRD_CHAOS}
224 : };
225 :
226 0 : if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
227 : {
228 0 : register int key = hash_arphrd_name (str, len);
229 :
230 0 : if (key <= MAX_HASH_VALUE && key >= 0)
231 : {
232 0 : register const char *s = wordlist[key].name;
233 :
234 0 : if (s && (((unsigned char)*str ^ (unsigned char)*s) & ~32) == 0 && !gperf_case_strcmp (str, s))
235 0 : return &wordlist[key];
236 : }
237 : }
238 0 : return 0;
239 : }
|