denyhosts/clamav/libclamav/iana_tld.h

718 lines
20 KiB
C
Raw Normal View History

2022-10-22 18:41:00 +08:00
/* ANSI-C code produced by gperf version 3.0.3 */
/* Command-line: gperf -C -l -L ANSI-C -E -C -H tld_hash -N in_tld_set */
/* Computed positions: -k'1-2,6' */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
/* The character set is not based on ISO-646. */
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#endif
/* maximum key range = 983, duplicates = 0 */
#ifdef __GNUC__
__inline
#else
#ifdef __cplusplus
inline
#endif
#endif
static unsigned int
tld_hash(const char *str, unsigned int len)
{
static const unsigned short asso_values[] =
{
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 0, 15,
988, 988, 988, 988, 0, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 170, 328, 88,
3, 50, 293, 205, 123, 430, 500, 238, 115, 320,
375, 30, 413, 348, 70, 43, 475, 18, 6, 283,
95, 58, 10, 220, 5, 485, 480, 8, 190, 390,
225, 113, 420, 95, 0, 15, 50, 295, 20, 128,
130, 80, 405, 470, 340, 0, 305, 415, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
988};
int hval = len;
switch (hval) {
default:
hval += asso_values[(unsigned char)str[5]];
/*FALLTHROUGH*/
case 5:
case 4:
case 3:
case 2:
hval += asso_values[(unsigned char)str[1]];
/*FALLTHROUGH*/
case 1:
hval += asso_values[(unsigned char)str[0] + 25];
break;
}
return hval;
}
#ifdef __GNUC__
__inline
#ifdef __GNUC_STDC_INLINE__
__attribute__((__gnu_inline__))
#endif
#endif
static const char *
in_tld_set(const char *str, unsigned int len)
{
enum {
TOTAL_KEYWORDS = 280,
MIN_WORD_LENGTH = 2,
MAX_WORD_LENGTH = 18,
MIN_HASH_VALUE = 5,
MAX_HASH_VALUE = 987
};
static const unsigned char lengthtable[] =
{
0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 2, 0, 2, 2,
0, 2, 0, 2, 0, 0, 2, 0, 2, 0, 0, 2, 0, 2,
0, 0, 2, 0, 2, 0, 4, 2, 0, 2, 3, 4, 2, 0,
2, 0, 0, 2, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2,
0, 4, 0, 0, 2, 0, 2, 0, 4, 2, 0, 2, 3, 0,
0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 2, 0,
4, 2, 0, 2, 2, 0, 2, 0, 2, 0, 0, 2, 0, 2,
0, 0, 2, 0, 2, 2, 0, 2, 0, 2, 0, 0, 0, 0,
2, 0, 0, 2, 0, 2, 0, 0, 0, 0, 2, 3, 0, 2,
0, 2, 0, 0, 2, 0, 2, 3, 0, 2, 0, 0, 2, 0,
2, 0, 2, 0, 0, 2, 0, 4, 2, 0, 2, 0, 2, 0,
0, 2, 0, 0, 0, 0, 2, 0, 2, 0, 0, 2, 0, 2,
0, 0, 2, 0, 2, 2, 0, 0, 0, 2, 3, 0, 2, 0,
2, 0, 0, 2, 0, 2, 0, 4, 2, 0, 2, 0, 0, 2,
0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 2, 0, 0,
2, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 2, 3,
0, 2, 0, 0, 2, 0, 2, 0, 2, 0, 0, 2, 0, 0,
0, 0, 2, 0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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 2};
static const char *const wordlist[] =
{
"", "", "", "", "",
"md",
"", "",
"mv",
"",
"cd",
"",
"mz",
"cv",
"",
"ad",
"",
"cz",
"", "",
"mu",
"",
"az",
"", "",
"cu",
"",
"nz",
"", "",
"au",
"",
"mo",
"",
"mobi",
"nu",
"",
"co",
"com",
"coop",
"fo",
"",
"ao",
"", "",
"ms",
"",
"no",
"", "", "", "",
"me",
"", "",
"as",
"",
"asia",
"", "",
"my",
"",
"ae",
"",
"aero",
"cy",
"",
"ne",
"net",
"", "", "",
"mr",
"", "", "", "",
"cr",
"", "",
"fr",
"",
"ar",
"",
"arpa",
"td",
"",
"nr",
"tv",
"",
"mc",
"",
"tz",
"", "",
"cc",
"",
"mx",
"", "",
"ac",
"",
"cx",
"lv",
"",
"nc",
"",
"ax",
"", "", "", "",
"to",
"", "",
"lu",
"",
"ml",
"", "", "", "",
"cl",
"org",
"",
"mh",
"",
"al",
"", "",
"ch",
"",
"nl",
"tel",
"",
"sd",
"", "",
"sv",
"",
"ls",
"",
"sz",
"", "",
"jo",
"",
"jobs",
"ru",
"",
"su",
"",
"tr",
"", "",
"ly",
"", "", "", "",
"ro",
"",
"so",
"", "",
"je",
"",
"lr",
"", "",
"tc",
"",
"ma",
"rs",
"", "", "",
"ca",
"cat",
"",
"re",
"",
"se",
"", "",
"lc",
"",
"na",
"",
"name",
"sy",
"",
"qa",
"", "",
"gd",
"",
"tl",
"", "", "", "",
"sr",
"", "",
"th",
"",
"mg",
"", "",
"gu",
"",
"cg",
"", "", "", "",
"ag",
"", "",
"sc",
"",
"ng",
"gov",
"",
"bd",
"", "",
"bv",
"",
"id",
"",
"bz",
"", "",
"gs",
"", "", "", "",
"mk",
"",
"ge",
"", "",
"ck",
"",
"sl",
"fk",
"",
"gy",
"",
"bo",
"", "",
"sh",
"",
"io",
"", "", "", "",
"gr",
"", "",
"bs",
"",
"la",
"", "",
"is",
"travel",
"be",
"", "", "", "",
"ie",
"", "",
"by",
"", "", "", "",
"mw",
"",
"tg",
"", "", "", "",
"br",
"", "",
"aw",
"",
"ir",
"", "",
"cf",
"",
"sa",
"", "",
"af",
"",
"gl",
"", "",
"nf",
"", "", "", "",
"gh",
"", "", "", "",
"tk",
"",
"mm",
"", "",
"yu",
"",
"cm",
"", "",
"fm",
"",
"am",
"", "",
"lk",
"",
"sg",
"", "",
"ps",
"",
"il",
"",
"museum",
"bh",
"",
"pe",
"", "",
"mq",
"", "", "", "",
"py",
"",
"ye",
"", "",
"aq",
"",
"ga",
"", "",
"tw",
"",
"pr",
"pro",
"",
"sk",
"",
"om",
"", "",
"tf",
"",
"mn",
"", "", "", "",
"cn",
"", "",
"ws",
"xn--g6w251d",
"an",
"", "", "",
"xn--80akhbyknj4f",
"ba",
"", "", "",
"xn--0zwm56d",
"gg",
"", "", "", "",
"tm",
"", "", "", "",
"xn--11b5bs3a9aj6g",
"", "",
"hu",
"",
"pl",
"rw",
"",
"mp",
"",
"uz",
"", "",
"ph",
"", "", "", "",
"lb",
"",
"bg",
"", "",
"np",
"",
"kz",
"mil",
"",
"jm",
"xn--deba0ad",
"ci",
"", "",
"fi",
"",
"ai",
"", "", "", "",
"ni",
"", "",
"us",
"",
"sm",
"", "", "", "",
"tn",
"", "",
"sb",
"",
"hr",
"", "",
"uy",
"",
"pa",
"", "", "", "",
"ke",
"xn--zckzah",
"",
"gw",
"",
"mt",
"", "",
"ky",
"",
"xn--jxalpdlp",
"", "",
"gf",
"edu",
"at",
"", "",
"vu",
"",
"kr",
"", "",
"tp",
"",
"dz",
"", "",
"eu",
"",
"pg",
"", "",
"bw",
"",
"sn",
"xn--hlcj6aya9esc7a",
"",
"fj",
"",
"gm",
"", "",
"bf",
"",
"do",
"", "",
"gb",
"",
"ve",
"", "",
"es",
"",
"li",
"jp",
"", "", "",
"ee",
"", "",
"pk",
"",
"de",
"", "",
"gq",
"",
"bm",
"", "",
"kh",
"",
"im",
"", "",
"bb",
"",
"er",
"", "", "", "",
"tt",
"", "",
"vc",
"",
"si",
"", "", "", "",
"gn",
"", "",
"ec",
"",
"lt",
"", "",
"iq",
"",
"ua",
"", "",
"pw",
"",
"tj",
"", "", "", "",
"za",
"", "",
"pf",
"",
"xn--kgbechtv",
"", "", "", "",
"bn",
"xn--hgbk6aj7f53bba",
"", "", "",
"in",
"int",
"info",
"gp",
"",
"st",
"", "", "", "",
"ug",
"", "", "", "",
"pm",
"", "", "", "",
"gi",
"", "", "", "",
"kg",
"", "",
"hk",
"",
"sj",
"", "",
"wf",
"", "", "", "", "", "",
"va",
"", "",
"uk",
"", "", "", "", "", "",
"bi",
"biz",
"", "", "", "", "", "", "", "", "",
"", "", "", "",
"gt",
"", "", "", "",
"pn",
"", "", "", "",
"vg",
"", "", "", "", "", "", "", "", "",
"eg",
"", "", "", "", "", "", "", "", "",
"bt",
"", "",
"zw",
"",
"it",
"", "",
"kw",
"", "", "", "", "", "",
"hm",
"", "", "", "", "", "", "", "", "",
"bj",
"", "",
"dk",
"", "", "", "", "", "", "", "", "",
"", "",
"zm",
"", "", "", "",
"km",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "",
"hn",
"", "", "", "",
"pt",
"", "", "", "", "", "", "", "", "",
"yt",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "",
"kn",
"", "", "", "", "", "", "", "", "",
"dm",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"kp",
"", "", "", "", "", "", "", "", "",
"", "",
"vn",
"", "", "", "",
"ki",
"", "", "", "", "", "", "", "", "",
"", "",
"xn--9t4b11yi5a",
"", "",
"ht",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "",
"vi",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"et",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "",
"dj"};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) {
int key = tld_hash(str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
if (len == lengthtable[key]) {
const char *s = wordlist[key];
if (*str == *s && !memcmp(str + 1, s + 1, len - 1))
return s;
}
}
return 0;
}