~ubuntu-branches/ubuntu/raring/clamav/raring

« back to all changes in this revision

Viewing changes to libclamav/iana_cctld.h

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Gran
  • Date: 2008-09-05 17:25:34 UTC
  • mfrom: (0.35.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080905172534-yi3f8fkye1o7u1r3
* New upstream version (closes: #497662, #497773)
  - lots of new options for clamd.conf
  - fixes CVEs CVE-2008-3912, CVE-2008-3913, CVE-2008-3914, and
    CVE-2008-1389
* No longer supports --unzip option, so typo is gone (closes: #496276)
* Translations:
  - sv (thanks Martin Bagge <brother@bsnet.se>) (closes: #491760)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ANSI-C code produced by gperf version 3.0.3 */
 
2
/* Command-line: gperf -C -l -L ANSI-C -E -C -H cctld_hash -N in_cctld_set  */
 
3
/* Computed positions: -k'1-2' */
 
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
/* maximum key range = 472, duplicates = 0 */
 
33
 
 
34
#ifdef __GNUC__
 
35
__inline
 
36
#else
 
37
#ifdef __cplusplus
 
38
inline
 
39
#endif
 
40
#endif
 
41
static unsigned int
 
42
cctld_hash (const char *str, unsigned int len)
 
43
{
 
44
  static const unsigned short asso_values[] =
 
45
    {
 
46
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
47
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
48
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
49
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
50
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
51
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
52
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
53
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
54
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
55
      476, 476, 476, 476, 476, 476, 476, 119,  97,  33,
 
56
      103,   4,  59, 115, 210, 149, 169, 143, 175,  55,
 
57
      145,  89, 178,  37,  85,  18,  34, 239,   2,  73,
 
58
      112,   3,  25,  10,  15, 117, 209, 229, 150, 223,
 
59
      200,  78, 225,  54,   5, 215, 215, 190,  25,  23,
 
60
        0,  20, 233, 234,  14, 476,  33, 204, 476, 476,
 
61
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
62
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
63
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
64
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
65
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
66
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
67
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
68
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
69
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
70
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
71
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
72
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
73
      476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
 
74
      476
 
75
    };
 
76
  return len + asso_values[(unsigned char)str[1]] + asso_values[(unsigned char)str[0]+25];
 
77
}
 
78
 
 
79
#ifdef __GNUC__
 
80
__inline
 
81
#ifdef __GNUC_STDC_INLINE__
 
82
__attribute__ ((__gnu_inline__))
 
83
#endif
 
84
#endif
 
85
static const char *
 
86
in_cctld_set (const char *str, unsigned int len)
 
87
{
 
88
  enum
 
89
    {
 
90
      TOTAL_KEYWORDS = 252,
 
91
      MIN_WORD_LENGTH = 2,
 
92
      MAX_WORD_LENGTH = 2,
 
93
      MIN_HASH_VALUE = 4,
 
94
      MAX_HASH_VALUE = 475
 
95
    };
 
96
 
 
97
  static const unsigned char lengthtable[] =
 
98
    {
 
99
       0,  0,  0,  0,  2,  2,  2,  0,  0,  2,  2,  2,  0,  0,
 
100
       2,  2,  2,  0,  0,  2,  2,  0,  0,  0,  2,  2,  0,  2,
 
101
       0,  2,  2,  2,  2,  0,  2,  2,  2,  2,  0,  2,  2,  2,
 
102
       2,  2,  2,  2,  2,  2,  0,  0,  2,  0,  2,  0,  0,  2,
 
103
       2,  2,  2,  2,  2,  2,  2,  0,  2,  0,  2,  2,  0,  2,
 
104
       0,  2,  2,  0,  2,  2,  2,  2,  0,  0,  2,  2,  2,  0,
 
105
       2,  2,  2,  2,  0,  2,  2,  2,  2,  0,  0,  2,  2,  2,
 
106
       2,  2,  2,  2,  2,  0,  0,  2,  2,  2,  0,  2,  2,  2,
 
107
       2,  0,  2,  2,  2,  2,  0,  2,  2,  2,  2,  2,  0,  2,
 
108
       2,  2,  0,  2,  2,  2,  2,  0,  0,  2,  2,  2,  0,  2,
 
109
       0,  2,  2,  0,  2,  2,  2,  2,  0,  0,  2,  2,  2,  2,
 
110
       0,  2,  2,  2,  0,  0,  2,  2,  2,  0,  0,  2,  2,  2,
 
111
       0,  2,  2,  2,  2,  0,  2,  2,  2,  2,  0,  0,  0,  2,
 
112
       2,  0,  0,  2,  2,  2,  0,  2,  0,  2,  2,  0,  0,  2,
 
113
       2,  2,  0,  2,  2,  0,  2,  0,  0,  2,  2,  2,  2,  0,
 
114
       2,  2,  2,  0,  0,  2,  0,  2,  0,  0,  2,  2,  2,  0,
 
115
       0,  2,  2,  2,  0,  2,  2,  2,  2,  0,  0,  0,  2,  2,
 
116
       2,  2,  2,  2,  2,  0,  2,  2,  2,  2,  0,  2,  2,  2,
 
117
       2,  2,  0,  2,  2,  2,  2,  2,  2,  2,  2,  0,  2,  2,
 
118
       2,  2,  0,  2,  0,  2,  2,  0,  2,  0,  2,  2,  0,  2,
 
119
       2,  0,  2,  0,  0,  0,  2,  2,  2,  0,  2,  2,  0,  0,
 
120
       0,  2,  2,  2,  0,  0,  2,  2,  2,  0,  0,  2,  2,  2,
 
121
       0,  0,  2,  2,  2,  0,  0,  0,  2,  0,  0,  0,  2,  0,
 
122
       0,  0,  0,  2,  2,  2,  0,  0,  2,  0,  2,  0,  0,  2,
 
123
       2,  2,  0,  0,  0,  0,  2,  0,  0,  0,  0,  2,  0,  0,
 
124
       2,  2,  0,  0,  2,  2,  0,  0,  0,  0,  0,  0,  2,  0,
 
125
       0,  0,  2,  2,  2,  0,  2,  0,  2,  0,  2,  0,  2,  2,
 
126
       2,  0,  2,  2,  0,  0,  0,  2,  0,  0,  0,  0,  0,  2,
 
127
       2,  0,  0,  2,  0,  0,  0,  0,  2,  0,  2,  0,  0,  2,
 
128
       0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 
129
       0,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 
130
       0,  0,  0,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 
131
       0,  0,  2,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,
 
132
       0,  0,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2
 
133
    };
 
134
  static const char * const wordlist[] =
 
135
    {
 
136
      "", "", "", "",
 
137
      "sv",
 
138
      "sy",
 
139
      "se",
 
140
      "", "",
 
141
      "mv",
 
142
      "my",
 
143
      "me",
 
144
      "", "",
 
145
      "bv",
 
146
      "by",
 
147
      "be",
 
148
      "", "",
 
149
      "cv",
 
150
      "cy",
 
151
      "", "", "",
 
152
      "tv",
 
153
      "ms",
 
154
      "",
 
155
      "sz",
 
156
      "",
 
157
      "re",
 
158
      "bs",
 
159
      "ae",
 
160
      "mz",
 
161
      "",
 
162
      "ws",
 
163
      "sc",
 
164
      "st",
 
165
      "bz",
 
166
      "",
 
167
      "ye",
 
168
      "mc",
 
169
      "mt",
 
170
      "cz",
 
171
      "rs",
 
172
      "mq",
 
173
      "as",
 
174
      "bt",
 
175
      "tz",
 
176
      "", "",
 
177
      "cc",
 
178
      "",
 
179
      "az",
 
180
      "", "",
 
181
      "tc",
 
182
      "tt",
 
183
      "sm",
 
184
      "lv",
 
185
      "ly",
 
186
      "ac",
 
187
      "at",
 
188
      "mm",
 
189
      "",
 
190
      "aq",
 
191
      "",
 
192
      "mf",
 
193
      "bm",
 
194
      "",
 
195
      "yt",
 
196
      "",
 
197
      "bf",
 
198
      "cm",
 
199
      "",
 
200
      "ls",
 
201
      "wf",
 
202
      "cf",
 
203
      "tm",
 
204
      "", "",
 
205
      "mw",
 
206
      "tf",
 
207
      "am",
 
208
      "",
 
209
      "je",
 
210
      "bw",
 
211
      "af",
 
212
      "sr",
 
213
      "",
 
214
      "lc",
 
215
      "lt",
 
216
      "so",
 
217
      "mr",
 
218
      "", "",
 
219
      "tw",
 
220
      "mo",
 
221
      "br",
 
222
      "rw",
 
223
      "sb",
 
224
      "aw",
 
225
      "bo",
 
226
      "cr",
 
227
      "", "",
 
228
      "sd",
 
229
      "co",
 
230
      "tr",
 
231
      "",
 
232
      "bb",
 
233
      "md",
 
234
      "to",
 
235
      "ar",
 
236
      "",
 
237
      "ro",
 
238
      "bd",
 
239
      "ao",
 
240
      "sg",
 
241
      "",
 
242
      "mx",
 
243
      "cd",
 
244
      "sa",
 
245
      "mg",
 
246
      "de",
 
247
      "",
 
248
      "td",
 
249
      "ma",
 
250
      "bg",
 
251
      "",
 
252
      "cx",
 
253
      "ad",
 
254
      "ba",
 
255
      "cg",
 
256
      "", "",
 
257
      "jm",
 
258
      "ca",
 
259
      "tg",
 
260
      "",
 
261
      "ax",
 
262
      "",
 
263
      "lr",
 
264
      "ag",
 
265
      "",
 
266
      "dz",
 
267
      "sk",
 
268
      "qa",
 
269
      "sn",
 
270
      "", "",
 
271
      "mk",
 
272
      "si",
 
273
      "mn",
 
274
      "lb",
 
275
      "",
 
276
      "gy",
 
277
      "ge",
 
278
      "bn",
 
279
      "", "",
 
280
      "ck",
 
281
      "bi",
 
282
      "cn",
 
283
      "", "",
 
284
      "tk",
 
285
      "ci",
 
286
      "tn",
 
287
      "",
 
288
      "jo",
 
289
      "gs",
 
290
      "sj",
 
291
      "an",
 
292
      "",
 
293
      "dm",
 
294
      "la",
 
295
      "ai",
 
296
      "sl",
 
297
      "", "", "",
 
298
      "bj",
 
299
      "ml",
 
300
      "", "",
 
301
      "mp",
 
302
      "gt",
 
303
      "bl",
 
304
      "",
 
305
      "gq",
 
306
      "",
 
307
      "tj",
 
308
      "cl",
 
309
      "", "",
 
310
      "py",
 
311
      "pe",
 
312
      "tl",
 
313
      "",
 
314
      "lk",
 
315
      "tp",
 
316
      "",
 
317
      "al",
 
318
      "", "",
 
319
      "li",
 
320
      "ie",
 
321
      "gm",
 
322
      "do",
 
323
      "",
 
324
      "ps",
 
325
      "gf",
 
326
      "sh",
 
327
      "", "",
 
328
      "ee",
 
329
      "",
 
330
      "mh",
 
331
      "", "",
 
332
      "is",
 
333
      "ne",
 
334
      "bh",
 
335
      "", "",
 
336
      "gw",
 
337
      "pt",
 
338
      "ch",
 
339
      "",
 
340
      "es",
 
341
      "ky",
 
342
      "ke",
 
343
      "th",
 
344
      "", "", "",
 
345
      "it",
 
346
      "gr",
 
347
      "uy",
 
348
      "iq",
 
349
      "ve",
 
350
      "su",
 
351
      "nz",
 
352
      "",
 
353
      "ec",
 
354
      "et",
 
355
      "mu",
 
356
      "pm",
 
357
      "",
 
358
      "gb",
 
359
      "nc",
 
360
      "pf",
 
361
      "kz",
 
362
      "us",
 
363
      "",
 
364
      "gd",
 
365
      "cu",
 
366
      "im",
 
367
      "jp",
 
368
      "ht",
 
369
      "uz",
 
370
      "zm",
 
371
      "dk",
 
372
      "",
 
373
      "ru",
 
374
      "pw",
 
375
      "au",
 
376
      "gg",
 
377
      "",
 
378
      "vc",
 
379
      "",
 
380
      "ga",
 
381
      "om",
 
382
      "",
 
383
      "yu",
 
384
      "",
 
385
      "nf",
 
386
      "pr",
 
387
      "",
 
388
      "zw",
 
389
      "hm",
 
390
      "",
 
391
      "km",
 
392
      "", "", "",
 
393
      "fm",
 
394
      "ir",
 
395
      "dj",
 
396
      "",
 
397
      "um",
 
398
      "io",
 
399
      "", "", "",
 
400
      "lu",
 
401
      "er",
 
402
      "gn",
 
403
      "", "",
 
404
      "kw",
 
405
      "gi",
 
406
      "nr",
 
407
      "", "",
 
408
      "id",
 
409
      "no",
 
410
      "pg",
 
411
      "", "",
 
412
      "hr",
 
413
      "pa",
 
414
      "kr",
 
415
      "", "", "",
 
416
      "fr",
 
417
      "", "", "",
 
418
      "fo",
 
419
      "", "", "", "",
 
420
      "za",
 
421
      "eg",
 
422
      "gl",
 
423
      "", "",
 
424
      "gp",
 
425
      "",
 
426
      "ng",
 
427
      "", "",
 
428
      "pk",
 
429
      "na",
 
430
      "pn",
 
431
      "", "", "", "",
 
432
      "kg",
 
433
      "", "", "", "",
 
434
      "in",
 
435
      "", "",
 
436
      "ug",
 
437
      "vg",
 
438
      "", "",
 
439
      "ua",
 
440
      "va",
 
441
      "", "", "", "", "", "",
 
442
      "gh",
 
443
      "", "", "",
 
444
      "ni",
 
445
      "pl",
 
446
      "hk",
 
447
      "",
 
448
      "hn",
 
449
      "",
 
450
      "kn",
 
451
      "",
 
452
      "fk",
 
453
      "",
 
454
      "ki",
 
455
      "il",
 
456
      "uk",
 
457
      "",
 
458
      "fi",
 
459
      "vn",
 
460
      "", "", "",
 
461
      "vi",
 
462
      "", "", "", "", "",
 
463
      "gu",
 
464
      "nl",
 
465
      "", "",
 
466
      "np",
 
467
      "", "", "", "",
 
468
      "fj",
 
469
      "",
 
470
      "ph",
 
471
      "", "",
 
472
      "kp",
 
473
      "", "", "", "", "", "", "", "", "",
 
474
      "", "", "", "", "", "",
 
475
      "eh",
 
476
      "", "", "", "", "", "", "", "", "",
 
477
      "", "", "", "", "", "",
 
478
      "kh",
 
479
      "", "", "", "", "", "", "", "", "",
 
480
      "", "", "",
 
481
      "eu",
 
482
      "", "", "", "", "",
 
483
      "nu",
 
484
      "", "", "", "", "", "", "",
 
485
      "hu",
 
486
      "", "", "", "", "", "", "", "", "",
 
487
      "",
 
488
      "vu"
 
489
    };
 
490
 
 
491
  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
 
492
    {
 
493
      int key = cctld_hash (str, len);
 
494
 
 
495
      if (key <= MAX_HASH_VALUE && key >= 0)
 
496
        if (len == lengthtable[key])
 
497
          {
 
498
            const char *s = wordlist[key];
 
499
 
 
500
            if (*str == *s && !memcmp (str + 1, s + 1, len - 1))
 
501
              return s;
 
502
          }
 
503
    }
 
504
  return 0;
 
505
}