Return to keywords.c CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / strongswan / src / starter |
1.1 ! misho 1: /* ANSI-C code produced by gperf version 3.1 */ ! 2: /* Command-line: /usr/bin/gperf -m 10 -C -G -D -t */ ! 3: /* Computed positions: -k'2-3,6,$' */ ! 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-gperf@gnu.org>." ! 30: #endif ! 31: ! 32: ! 33: /* ! 34: * Copyright (C) 2005 Andreas Steffen ! 35: * HSR Hochschule fuer Technik Rapperswil ! 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: ! 48: #include <string.h> ! 49: ! 50: #define IN_GPERF_GENERATED_FILE ! 51: #include "keywords.h" ! 52: ! 53: struct kw_entry { ! 54: char *name; ! 55: kw_token_t token; ! 56: }; ! 57: ! 58: #define TOTAL_KEYWORDS 140 ! 59: #define MIN_WORD_LENGTH 2 ! 60: #define MAX_WORD_LENGTH 17 ! 61: #define MIN_HASH_VALUE 9 ! 62: #define MAX_HASH_VALUE 257 ! 63: /* maximum key range = 249, duplicates = 0 */ ! 64: ! 65: #ifdef __GNUC__ ! 66: __inline ! 67: #else ! 68: #ifdef __cplusplus ! 69: inline ! 70: #endif ! 71: #endif ! 72: static unsigned int ! 73: hash (register const char *str, register size_t len) ! 74: { ! 75: static const unsigned short asso_values[] = ! 76: { ! 77: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 78: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 79: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 80: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 81: 258, 258, 258, 258, 258, 258, 258, 258, 258, 14, ! 82: 129, 258, 258, 258, 4, 258, 258, 258, 258, 258, ! 83: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 84: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 85: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 86: 258, 258, 258, 258, 258, 3, 258, 31, 4, 83, ! 87: 50, 5, 4, 1, 79, 1, 258, 121, 62, 5, ! 88: 33, 51, 41, 2, 22, 1, 25, 103, 6, 1, ! 89: 258, 8, 2, 258, 258, 258, 258, 258, 258, 258, ! 90: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 91: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 92: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 93: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 94: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 95: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 96: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 97: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 98: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 99: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 100: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 101: 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, ! 102: 258, 258, 258, 258, 258, 258 ! 103: }; ! 104: register unsigned int hval = len; ! 105: ! 106: switch (hval) ! 107: { ! 108: default: ! 109: hval += asso_values[(unsigned char)str[5]]; ! 110: /*FALLTHROUGH*/ ! 111: case 5: ! 112: case 4: ! 113: case 3: ! 114: hval += asso_values[(unsigned char)str[2]]; ! 115: /*FALLTHROUGH*/ ! 116: case 2: ! 117: hval += asso_values[(unsigned char)str[1]]; ! 118: break; ! 119: } ! 120: return hval + asso_values[(unsigned char)str[len - 1]]; ! 121: } ! 122: ! 123: static const struct kw_entry wordlist[] = ! 124: { ! 125: {"pfs", KW_PFS_DEPRECATED}, ! 126: {"rightgroups", KW_RIGHTGROUPS}, ! 127: {"aggressive", KW_AGGRESSIVE}, ! 128: {"lifetime", KW_KEYLIFE}, ! 129: {"rightsigkey", KW_RIGHTSIGKEY}, ! 130: {"lifebytes", KW_LIFEBYTES}, ! 131: {"keyingtries", KW_KEYINGTRIES}, ! 132: {"leftsigkey", KW_LEFTSIGKEY}, ! 133: {"keylife", KW_KEYLIFE}, ! 134: {"leftrsasigkey", KW_LEFTSIGKEY}, ! 135: {"right", KW_RIGHT}, ! 136: {"leftcertpolicy", KW_LEFTCERTPOLICY}, ! 137: {"left", KW_LEFT}, ! 138: {"rightsubnet", KW_RIGHTSUBNET}, ! 139: {"rightikeport", KW_RIGHTIKEPORT}, ! 140: {"rightsendcert", KW_RIGHTSENDCERT}, ! 141: {"leftgroups", KW_LEFTGROUPS}, ! 142: {"rightrsasigkey", KW_RIGHTSIGKEY}, ! 143: {"leftcert", KW_LEFTCERT}, ! 144: {"lifepackets", KW_LIFEPACKETS}, ! 145: {"uniqueids", KW_UNIQUEIDS}, ! 146: {"leftdns", KW_LEFTDNS}, ! 147: {"leftsendcert", KW_LEFTSENDCERT}, ! 148: {"rightsubnetwithin", KW_RIGHTSUBNET}, ! 149: {"rightallowany", KW_RIGHTALLOWANY}, ! 150: {"keep_alive", KW_SETUP_DEPRECATED}, ! 151: {"rightsourceip", KW_RIGHTSOURCEIP}, ! 152: {"type", KW_TYPE}, ! 153: {"rightid", KW_RIGHTID}, ! 154: {"rightdns", KW_RIGHTDNS}, ! 155: {"reqid", KW_REQID}, ! 156: {"certuribase", KW_CERTURIBASE}, ! 157: {"leftnexthop", KW_LEFT_DEPRECATED}, ! 158: {"replay_window", KW_REPLAY_WINDOW}, ! 159: {"leftprotoport", KW_LEFTPROTOPORT}, ! 160: {"compress", KW_COMPRESS}, ! 161: {"mobike", KW_MOBIKE}, ! 162: {"me_peerid", KW_ME_PEERID}, ! 163: {"interfaces", KW_SETUP_DEPRECATED}, ! 164: {"virtual_private", KW_SETUP_DEPRECATED}, ! 165: {"lefthostaccess", KW_LEFTHOSTACCESS}, ! 166: {"leftca", KW_LEFTCA}, ! 167: {"rightfirewall", KW_RIGHTFIREWALL}, ! 168: {"rightprotoport", KW_RIGHTPROTOPORT}, ! 169: {"inactivity", KW_INACTIVITY}, ! 170: {"leftfirewall", KW_LEFTFIREWALL}, ! 171: {"esp", KW_ESP}, ! 172: {"rightnexthop", KW_RIGHT_DEPRECATED}, ! 173: {"forceencaps", KW_FORCEENCAPS}, ! 174: {"leftallowany", KW_LEFTALLOWANY}, ! 175: {"crluri", KW_CRLURI}, ! 176: {"leftupdown", KW_LEFTUPDOWN}, ! 177: {"mark_in", KW_MARK_IN}, ! 178: {"strictcrlpolicy", KW_STRICTCRLPOLICY}, ! 179: {"force_keepalive", KW_SETUP_DEPRECATED}, ! 180: {"righthostaccess", KW_RIGHTHOSTACCESS}, ! 181: {"marginbytes", KW_MARGINBYTES}, ! 182: {"mediated_by", KW_MEDIATED_BY}, ! 183: {"marginpackets", KW_MARGINPACKETS}, ! 184: {"margintime", KW_REKEYMARGIN}, ! 185: {"fragmentation", KW_FRAGMENTATION}, ! 186: {"pfsgroup", KW_PFS_DEPRECATED}, ! 187: {"crluri1", KW_CRLURI}, ! 188: {"rightcertpolicy", KW_RIGHTCERTPOLICY}, ! 189: {"hidetos", KW_SETUP_DEPRECATED}, ! 190: {"keyexchange", KW_KEYEXCHANGE}, ! 191: {"leftsourceip", KW_LEFTSOURCEIP}, ! 192: {"ocspuri", KW_OCSPURI}, ! 193: {"leftid", KW_LEFTID}, ! 194: {"eap", KW_CONN_DEPRECATED}, ! 195: {"installpolicy", KW_INSTALLPOLICY}, ! 196: {"also", KW_ALSO}, ! 197: {"rightcert", KW_RIGHTCERT}, ! 198: {"rightauth", KW_RIGHTAUTH}, ! 199: {"mediation", KW_MEDIATION}, ! 200: {"rightca", KW_RIGHTCA}, ! 201: {"klipsdebug", KW_SETUP_DEPRECATED}, ! 202: {"ldapbase", KW_CA_DEPRECATED}, ! 203: {"overridemtu", KW_SETUP_DEPRECATED}, ! 204: {"sha256_96", KW_SHA256_96}, ! 205: {"ocspuri1", KW_OCSPURI}, ! 206: {"dpdtimeout", KW_DPDTIMEOUT}, ! 207: {"aaa_identity", KW_AAA_IDENTITY}, ! 208: {"ike", KW_IKE}, ! 209: {"mark_out", KW_MARK_OUT}, ! 210: {"dumpdir", KW_SETUP_DEPRECATED}, ! 211: {"rekey", KW_REKEY}, ! 212: {"rightid2", KW_RIGHTID2}, ! 213: {"rekeyfuzz", KW_REKEYFUZZ}, ! 214: {"eap_identity", KW_EAP_IDENTITY}, ! 215: {"rightgroups2", KW_RIGHTGROUPS2}, ! 216: {"ikelifetime", KW_IKELIFETIME}, ! 217: {"leftsubnet", KW_LEFTSUBNET}, ! 218: {"rightupdown", KW_RIGHTUPDOWN}, ! 219: {"authby", KW_AUTHBY}, ! 220: {"leftcert2", KW_LEFTCERT2}, ! 221: {"nat_traversal", KW_SETUP_DEPRECATED}, ! 222: {"charondebug", KW_CHARONDEBUG}, ! 223: {"dpdaction", KW_DPDACTION}, ! 224: {"xauth_identity", KW_XAUTH_IDENTITY}, ! 225: {"ah", KW_AH}, ! 226: {"leftsubnetwithin", KW_LEFTSUBNET}, ! 227: {"modeconfig", KW_MODECONFIG}, ! 228: {"ldaphost", KW_CA_DEPRECATED}, ! 229: {"leftikeport", KW_LEFTIKEPORT}, ! 230: {"crlcheckinterval", KW_SETUP_DEPRECATED}, ! 231: {"dpddelay", KW_DPDDELAY}, ! 232: {"cacert", KW_CACERT}, ! 233: {"leftgroups2", KW_LEFTGROUPS2}, ! 234: {"rightauth2", KW_RIGHTAUTH2}, ! 235: {"tfc", KW_TFC}, ! 236: {"postpluto", KW_SETUP_DEPRECATED}, ! 237: {"rekeymargin", KW_REKEYMARGIN}, ! 238: {"leftca2", KW_LEFTCA2}, ! 239: {"packetdefault", KW_SETUP_DEPRECATED}, ! 240: {"mark", KW_MARK}, ! 241: {"charonstart", KW_SETUP_DEPRECATED}, ! 242: {"plutostderrlog", KW_SETUP_DEPRECATED}, ! 243: {"auto", KW_AUTO}, ! 244: {"fragicmp", KW_SETUP_DEPRECATED}, ! 245: {"closeaction", KW_CLOSEACTION}, ! 246: {"prepluto", KW_SETUP_DEPRECATED}, ! 247: {"leftid2", KW_LEFTID2}, ! 248: {"nocrsend", KW_SETUP_DEPRECATED}, ! 249: {"leftauth", KW_LEFTAUTH}, ! 250: {"reauth", KW_REAUTH}, ! 251: {"plutostart", KW_SETUP_DEPRECATED}, ! 252: {"cachecrls", KW_CACHECRLS}, ! 253: {"xauth", KW_XAUTH}, ! 254: {"crluri2", KW_CRLURI2}, ! 255: {"rightca2", KW_RIGHTCA2}, ! 256: {"rightcert2", KW_RIGHTCERT2}, ! 257: {"plutodebug", KW_SETUP_DEPRECATED}, ! 258: {"pkcs11initargs", KW_PKCS11_DEPRECATED}, ! 259: {"pkcs11module", KW_PKCS11_DEPRECATED}, ! 260: {"pkcs11proxy", KW_PKCS11_DEPRECATED}, ! 261: {"pkcs11keepstate", KW_PKCS11_DEPRECATED}, ! 262: {"ocspuri2", KW_OCSPURI2}, ! 263: {"leftauth2", KW_LEFTAUTH2}, ! 264: {"ikedscp", KW_IKEDSCP,} ! 265: }; ! 266: ! 267: static const short lookup[] = ! 268: { ! 269: -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, ! 270: -1, -1, -1, -1, -1, 1, -1, -1, 2, 3, ! 271: -1, -1, 4, 5, -1, -1, 6, -1, 7, 8, ! 272: -1, 9, 10, -1, -1, -1, 11, -1, 12, 13, ! 273: 14, 15, 16, -1, -1, -1, 17, 18, 19, 20, ! 274: 21, 22, -1, 23, 24, -1, 25, 26, 27, -1, ! 275: 28, 29, 30, -1, -1, 31, 32, -1, 33, 34, ! 276: 35, 36, 37, 38, 39, 40, -1, 41, -1, -1, ! 277: -1, 42, 43, 44, 45, -1, 46, -1, 47, -1, ! 278: 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, ! 279: 58, 59, -1, -1, 60, 61, 62, -1, 63, -1, ! 280: 64, -1, 65, 66, 67, 68, 69, 70, 71, 72, ! 281: -1, 73, 74, 75, 76, 77, 78, 79, 80, -1, ! 282: -1, 81, 82, -1, 83, -1, -1, 84, 85, 86, ! 283: 87, 88, 89, -1, 90, -1, 91, 92, -1, 93, ! 284: 94, -1, 95, 96, -1, 97, -1, -1, 98, 99, ! 285: 100, 101, -1, 102, -1, 103, 104, 105, -1, 106, ! 286: 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, ! 287: -1, 117, -1, 118, -1, 119, -1, -1, 120, 121, ! 288: -1, -1, -1, -1, -1, 122, -1, 123, -1, 124, ! 289: 125, 126, -1, -1, -1, -1, -1, 127, -1, -1, ! 290: -1, -1, -1, -1, -1, -1, -1, -1, 128, -1, ! 291: -1, 129, 130, -1, 131, -1, 132, -1, -1, -1, ! 292: -1, -1, -1, 133, -1, 134, -1, 135, 136, -1, ! 293: -1, -1, -1, 137, -1, -1, -1, -1, -1, -1, ! 294: 138, -1, -1, -1, -1, -1, -1, 139 ! 295: }; ! 296: ! 297: const struct kw_entry * ! 298: in_word_set (register const char *str, register size_t len) ! 299: { ! 300: if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) ! 301: { ! 302: register unsigned int key = hash (str, len); ! 303: ! 304: if (key <= MAX_HASH_VALUE) ! 305: { ! 306: register int index = lookup[key]; ! 307: ! 308: if (index >= 0) ! 309: { ! 310: register const char *s = wordlist[index].name; ! 311: ! 312: if (*str == *s && !strcmp (str + 1, s + 1)) ! 313: return &wordlist[index]; ! 314: } ! 315: } ! 316: } ! 317: return 0; ! 318: }