]> git.ipfire.org Git - people/ms/strongswan.git/blob - src/starter/keywords.c
4cc5c03e87e5e40276b045d2932c623d3d59d7b3
[people/ms/strongswan.git] / src / starter / keywords.c
1 /* C code produced by gperf version 3.0.1 */
2 /* Command-line: gperf -C -G -t */
3 /* Computed positions: -k'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
33 /* strongSwan keywords
34 * Copyright (C) 2005 Andreas Steffen
35 * Hochschule fuer Technik Rapperswil, Switzerland
36 *
37 * This program is free software; you can redistribute it and/or modify it
38 * under the terms of the GNU General Public License as published by the
39 * Free Software Foundation; either version 2 of the License, or (at your
40 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
41 *
42 * This program is distributed in the hope that it will be useful, but
43 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
44 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
45 * for more details.
46 *
47 * RCSID $Id: keywords.c,v 1.7 2006/04/17 10:32:48 as Exp $
48 */
49
50 #include <string.h>
51
52 #include "keywords.h"
53
54 struct kw_entry {
55 char *name;
56 kw_token_t token;
57 };
58
59 #define TOTAL_KEYWORDS 77
60 #define MIN_WORD_LENGTH 3
61 #define MAX_WORD_LENGTH 17
62 #define MIN_HASH_VALUE 9
63 #define MAX_HASH_VALUE 146
64 /* maximum key range = 138, duplicates = 0 */
65
66 #ifdef __GNUC__
67 __inline
68 #else
69 #ifdef __cplusplus
70 inline
71 #endif
72 #endif
73 static unsigned int
74 hash (str, len)
75 register const char *str;
76 register unsigned int len;
77 {
78 static const unsigned char asso_values[] =
79 {
80 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
81 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
82 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
83 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
84 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
85 15, 147, 147, 147, 147, 147, 147, 147, 147, 147,
86 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
87 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
88 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
89 147, 147, 147, 147, 147, 147, 147, 85, 147, 40,
90 25, 25, 0, 10, 5, 80, 147, 35, 60, 35,
91 60, 55, 10, 147, 15, 20, 5, 65, 147, 147,
92 147, 35, 0, 147, 147, 147, 147, 147, 147, 147,
93 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
94 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
95 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
96 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
97 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
98 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
99 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
100 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
101 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
102 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
103 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
104 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
105 147, 147, 147, 147, 147, 147
106 };
107 return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[len - 1]];
108 }
109
110 static const struct kw_entry wordlist[] =
111 {
112 {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
113 {"left", KW_LEFT},
114 {""}, {""}, {""},
115 {"leftcert", KW_LEFTCERT,},
116 {"auth", KW_AUTH},
117 {"leftsubnet", KW_LEFTSUBNET},
118 {""},
119 {"leftsendcert", KW_LEFTSENDCERT},
120 {"leftprotoport", KW_LEFTPROTOPORT},
121 {""},
122 {"right", KW_RIGHT},
123 {"leftnexthop", KW_LEFTNEXTHOP},
124 {"leftsourceip", KW_LEFTSOURCEIP},
125 {"esp", KW_ESP},
126 {"rightcert", KW_RIGHTCERT},
127 {""},
128 {"rightsubnet", KW_RIGHTSUBNET},
129 {""},
130 {"rightsendcert", KW_RIGHTSENDCERT},
131 {"rightprotoport", KW_RIGHTPROTOPORT},
132 {"leftgroups", KW_LEFTGROUPS},
133 {"leftid", KW_LEFTID},
134 {"rightnexthop", KW_RIGHTNEXTHOP},
135 {"rightsourceip", KW_RIGHTSOURCEIP},
136 {"lefthostaccess", KW_LEFTHOSTACCESS},
137 {"interfaces", KW_INTERFACES},
138 {""}, {""},
139 {"pfsgroup", KW_PFSGROUP},
140 {"type", KW_TYPE},
141 {"dpdtimeout", KW_DPDTIMEOUT},
142 {"rightgroups", KW_RIGHTGROUPS},
143 {"rightid", KW_RIGHTID},
144 {"pfs", KW_PFS},
145 {"rekeyfuzz", KW_REKEYFUZZ},
146 {"righthostaccess", KW_RIGHTHOSTACCESS},
147 {"authby", KW_AUTHBY},
148 {""},
149 {"leftrsasigkey", KW_LEFTRSASIGKEY},
150 {""}, {""},
151 {"cacert", KW_CACERT},
152 {"hidetos", KW_HIDETOS},
153 {"ike", KW_IKE},
154 {""},
155 {"virtual_private", KW_VIRTUAL_PRIVATE},
156 {""},
157 {"dumpdir", KW_DUMPDIR},
158 {"packetdefault", KW_PACKETDEFAULT},
159 {"rightrsasigkey", KW_RIGHTRSASIGKEY},
160 {"keep_alive", KW_KEEP_ALIVE},
161 {"ikelifetime", KW_IKELIFETIME},
162 {""},
163 {"compress", KW_COMPRESS},
164 {"auto", KW_AUTO},
165 {"strictcrlpolicy", KW_STRICTCRLPOLICY},
166 {"keyingtries", KW_KEYINGTRIES},
167 {"keylife", KW_KEYLIFE},
168 {"dpddelay", KW_DPDDELAY},
169 {"cachecrls", KW_CACHECRLS},
170 {"leftupdown", KW_LEFTUPDOWN},
171 {"keyexchange", KW_KEYEXCHANGE},
172 {"leftfirewall", KW_LEFTFIREWALL},
173 {"nocrsend", KW_NOCRSEND},
174 {""},
175 {"rekey", KW_REKEY},
176 {"leftsubnetwithin", KW_LEFTSUBNETWITHIN},
177 {"pkcs11module", KW_PKCS11MODULE},
178 {"nat_traversal", KW_NAT_TRAVERSAL},
179 {"also", KW_ALSO},
180 {"pkcs11keepstate", KW_PKCS11KEEPSTATE},
181 {"rightupdown", KW_RIGHTUPDOWN},
182 {"crluri2", KW_CRLURI2},
183 {"rightfirewall", KW_RIGHTFIREWALL},
184 {"postpluto", KW_POSTPLUTO},
185 {"plutodebug", KW_PLUTODEBUG},
186 {"pkcs11proxy", KW_PKCS11PROXY},
187 {"rightsubnetwithin", KW_RIGHTSUBNETWITHIN},
188 {"prepluto", KW_PREPLUTO},
189 {""}, {""},
190 {"leftca", KW_LEFTCA},
191 {""}, {""},
192 {"dpdaction", KW_DPDACTION},
193 {""}, {""}, {""},
194 {"ldaphost", KW_LDAPHOST},
195 {""},
196 {"klipsdebug", KW_KLIPSDEBUG},
197 {"overridemtu", KW_OVERRIDEMTU},
198 {"rightca", KW_RIGHTCA},
199 {"fragicmp", KW_FRAGICMP},
200 {""}, {""},
201 {"rekeymargin", KW_REKEYMARGIN},
202 {"ocspuri", KW_OCSPURI},
203 {""},
204 {"uniqueids", KW_UNIQUEIDS},
205 {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
206 {"ldapbase", KW_LDAPBASE},
207 {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
208 {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
209 {"crlcheckinterval", KW_CRLCHECKINTERVAL},
210 {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
211 {"crluri", KW_CRLURI}
212 };
213
214 #ifdef __GNUC__
215 __inline
216 #endif
217 const struct kw_entry *
218 in_word_set (str, len)
219 register const char *str;
220 register unsigned int len;
221 {
222 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
223 {
224 register int key = hash (str, len);
225
226 if (key <= MAX_HASH_VALUE && key >= 0)
227 {
228 register const char *s = wordlist[key].name;
229
230 if (*str == *s && !strcmp (str + 1, s + 1))
231 return &wordlist[key];
232 }
233 }
234 return 0;
235 }