"Fossies" - the Fresh Open Source Software Archive

Member "tin-2.4.1/include/policy.h" (12 Oct 2016, 15516 Bytes) of package /linux/misc/tin-2.4.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "policy.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.4.0_vs_2.4.1.

    1 /*
    2  *  Project   : tin - a Usenet reader
    3  *  Module    : policy.h
    4  *  Author    : Ralf Doeblitz <doeblitz@gmx.de>
    5  *  Created   : 1999-01-12
    6  *  Updated   : 2015-09-14
    7  *  Notes     : #defines and static data for policy configuration
    8  *
    9  * Copyright (c) 1999-2017 Ralf Doeblitz <doeblitz@gmx.de>
   10  * All rights reserved.
   11  *
   12  * Redistribution and use in source and binary forms, with or without
   13  * modification, are permitted provided that the following conditions
   14  * are met:
   15  * 1. Redistributions of source code must retain the above copyright
   16  *    notice, this list of conditions and the following disclaimer.
   17  * 2. Redistributions in binary form must reproduce the above copyright
   18  *    notice, this list of conditions and the following disclaimer in the
   19  *    documentation and/or other materials provided with the distribution.
   20  * 3. The name of the author may not be used to endorse or promote
   21  *    products derived from this software without specific prior written
   22  *    permission.
   23  *
   24  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
   25  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   26  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   27  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
   28  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   29  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
   30  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   31  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
   32  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   33  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   34  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   35  */
   36 
   37 /*
   38  * CAUTION: THIS FILE IS OUTDATED AND NO LONGER ACTIVELY MAINTAINED
   39  * "disable_gnksa_domain_check=OFF" MIGHT RESULT IN FALSE POSITIVES
   40  */
   41 
   42 /*
   43  * tables for TLD search in misc.c, gnksa domain checking
   44  */
   45 
   46 #ifndef TIN_POLICY_H
   47 #   define TIN_POLICY_H 1
   48 /*
   49  * known two letter country codes
   50  *
   51  * .ac  Ascension Island               .ad  Andorra
   52  * .ae  United Arab Emirates           .af  Afghanistan
   53  * .ag  Antigua and Barbuda            .ai  Anguilla
   54  * .al  Albania                        .am  Armenia
   55  * .an  Netherlands Antilles           .ao  Angola
   56  * .aq  Antarctica                     .ar  Argentina
   57  * .as  American Samoa                 .at  Austria
   58  * .au  Australia                      .aw  Aruba
   59  * .ax  Aland                          .az  Azerbaijan
   60  *
   61  * .ba  Bosnia and Herzegowina         .bb  Barbados
   62  * .bd  Bangladesh                     .be  Belgium
   63  * .bf  Burkina Faso                   .bg  Bulgaria
   64  * .bh  Bahrain                        .bi  Burundi
   65  * .bj  Benin                          .bm  Bermuda
   66  * .bn  Brunei Darussalam              .bo  Bolivia
   67  * .br  Brazil                         .bs  Bahamas
   68  * .bt  Bhutan                         .bw  Botswana
   69  * .by  Belarus                        .bz  Belize
   70  *
   71  * .ca  Canada                         .cc  Cocos (Keeling) Islands
   72  * .cd  Congo, Democratic People's Republic
   73  * .cf  Central African Republic       .cg  Congo, Republic of
   74  * .ch  Switzerland                    .ci  Côte d'Ivoire
   75  * .ck  Cook Islands                   .cl  Chile
   76  * .cm  Cameroon                       .cn  China
   77  * .co  Colombia                       .cr  Costa Rica
   78  * .cu  Cuba                           .cv  Cape Verde
   79  * .cw  Curacao                        .cx  Christmas Island
   80  * .cy  Cyprus                         .cz  Czech Republic
   81  *
   82  * .de  Germany                        .dj  Djibouti
   83  * .dk  Denmark                        .dm  Dominica
   84  * .do  Dominican Republic             .dz  Algeria
   85  *
   86  * .ec  Ecuador                        .ee  Estonia
   87  * .eg  Egypt                          .er  Eritrea
   88  * .es  Spain                          .et  Ethiopia
   89  * .eu  European Union
   90  *
   91  * .fi  Finland                        .fj  Fiji
   92  * .fk  Falkland Islands (Malvina)     .fm  Micronesia, Federal State of
   93  * .fo  Faroe Islands                  .fr  France
   94  *
   95  * .ga  Gabon                          .gb  United Kingdom
   96  * .gd  Grenada                        .ge  Georgia
   97  * .gf  French Guiana                  .gg  Guernsey
   98  * .gh  Ghana                          .gi  Gibraltar
   99  * .gl  Greenland                      .gm  Gambia
  100  * .gn  Guinea                         .gp  Guadelope
  101  * .gq  Equatorial Guinea              .gr  Greece
  102  * .gs  South Georgia and the South Sandwich Islands
  103  * .gt  Guatemala                      .gu  Guam
  104  * .gw  Guinea-Bissau                  .gy  Guyana
  105  *
  106  * .hk  Hong Kong                      .hm  Heard and McDonald Islands
  107  * .hn  Honduras                       .hr  Croatia/Hrvatska
  108  * .ht  Haiti                          .hu  Hungary
  109  *
  110  * .id  Indonesia                      .ie  Ireland
  111  * .il  Israel                         .im  Isle of Man
  112  * .in  India                          .io  British Indian Ocean Territory
  113  * .iq  Iraq                           .ir  Iran
  114  * .is  Iceland                        .it  Italy
  115  *
  116  * .je  Jersey                         .jm  Jamaica
  117  * .jo  Jordan                         .jp  Japan
  118  *
  119  * .ke  Kenya                          .kg  Kyrgystan
  120  * .kh  Cambodia                       .ki  Kiribati
  121  * .km  Comoros                        .kn  Saint Kitts and Nevis
  122  * .kp  Korea, Democratic People's Republic
  123  * .kr  Korea, Republic of             .kw  Kuwait
  124  * .ky  Cayman Islands                 .kz  Kazakhstan
  125  *
  126  * .la  Laos (People's Democratic Republic)
  127  * .lb  Lebanon                        .lc  Saint Lucia
  128  * .li  Liechtenstein                  .lk  Sri Lanka
  129  * .lr  Liberia                        .ls  Lesotho
  130  * .lt  Lithuania                      .lu  Luxembourg
  131  * .lv  Latvia                         .ly  Libyan Arab Jamahiriya
  132  *
  133  * .ma  Morocco                        .mc  Monaco
  134  * .md  Moldova, Republic of           .me  Montenegro
  135  * .mg  Madagascar                     .mh  Marshall Islands
  136  * .mk  Macedonia                      .ml  Mali
  137  * .mm  Myanmar                        .mn  Mongolia
  138  * .mo  Macau                          .mp  Northern Mariana Islands
  139  * .mq  Martinique                     .mr  Mauritania
  140  * .ms  Montserrat                     .mt  Malta
  141  * .mu  Mauritius                      .mv  Maldives
  142  * .mw  Malawi                         .mx  Mexico
  143  * .my  Malaysia                       .mz  Mozambique
  144  *
  145  * .na  Namibia                        .nc  New Caledonia
  146  * .ne  Niger                          .nf  Norfolk Island
  147  * .ng  Nigeria                        .ni  Nicaragua
  148  * .nl  The Netherlands                .no  Norway
  149  * .np  Nepal                          .nr  Nauru
  150  * .nu  Niue                           .nz  New Zealand
  151  *
  152  * .om  Oman
  153  *
  154  * .pa  Panama                         .pe  Peru
  155  * .pf  French Polynesia               .pg  Papua New Guinea
  156  * .ph  Philippines                    .pk  Pakistan
  157  * .pl  Poland                         .pm  St. Pierre and Miquelon
  158  * .pn  Pitcairn Island                .pr  Puerto Rico
  159  * .ps  Palestinian Territories        .pt  Portugal
  160  * .pw  Palau                          .py  Paraguay
  161  *
  162  * .qa  Qatar
  163  *
  164  * .re  Reunion                        .ro  Romania
  165  * .rs  Republic of Serbia             .ru  Russian Federation
  166  * .rw  Rwanda
  167  *
  168  * .sa  Saudi Arabia                   .sb  Solomon Islands
  169  * .sc  Seychelles                     .sd  Sudan
  170  * .se  Sweden                         .sg  Singapore
  171  * .sh  St. Helena                     .si  Slovenia
  172  * .sk  Slovakia                       .sl  Sierra Leone
  173  * .sm  San Marino                     .sn  Senegal
  174  * .so  Somalia                        .sr  Surinam
  175  * .st  Sao Tome and Principe          .su  Soviet Union (former)
  176  * .sv  El Salvador                    .sx  Sint Maarten (Dutch side)
  177  * .sy  Syrian Arab Republic           .sz  Swaziland
  178  *
  179  * .tc  The Turks & Caicos Islands     .td  Chad
  180  * .tf  French Southern Territories    .tg  Togo
  181  * .th  Thailand                       .tj  Tajikistan
  182  * .tk  Tokelau                        .tl  Timor-Leste
  183  * .tm  Turkmenistan                   .tn  Tunisia
  184  * .to  Tonga                          .tp  East Timor
  185  * .tr  Turkey                         .tt  Trinidad and Tobago
  186  * .tv  Tuvalu                         .tw  Taiwan
  187  * .tz  Tanzania
  188  *
  189  * .ua  Ukraine                        .ug  Uganda
  190  * .uk  United Kingdom
  191  * .us  United States                  .uy  Uruguay
  192  * .uz  Uzbekistan
  193  *
  194  * .va  Holy See (Vatican City State)  .vc  Saint Vincent and the Grenadines
  195  * .ve  Venezuela                      .vg  Virgin Islands (British)
  196  * .vi  Virgin Islands (U.S)           .vn  Vietnam
  197  * .vu  Vanuatu
  198  *
  199  * .wf  Wallis and Futuna Islands      .ws  Western Samoa
  200  *
  201  * .ye  Yemen                          .yt  Mayotte
  202  *
  203  * .za  South Africa                   .zm  Zambia
  204  * .zw  Zimbabwe
  205  *
  206  *
  207  * invalid/obsolete TLDs:
  208  * .bu  Burma, now .mm
  209  * .cs  former Czechoslovakia, now .cz and .sk
  210  * .dd  former German Democratic Republic, now .de
  211  * .fx  France, Metropolitan
  212  * .oz  Australian MHSnet
  213  * .um  United States Minor Outlying Islands
  214  * .yd  Democratic Yemen, now .ye
  215  * .yu  Yugoslavia, now .rs and .me
  216  * .wg  West Bank and Gaza, now .ps
  217  * .zr  former Zaire, now .cd
  218  *
  219  * user-assigned code elements:
  220  * .aa, .qm, .qz, .xa, .xz, .zz
  221  *
  222  * unused TLDs:
  223  * .bl  Saint Barthélemy
  224  * .bq  Bonaire, Sint Eustatius and Saba
  225  * .bv  Bouvet Island (Norway)
  226  * .eh  Western Sahara
  227  * .gb  United Kingdom, use .uk
  228  * .mf  Sint Maarten (French side)
  229  * .sj  Svalbard and Jan Mayen Islands (Norway)
  230  * .ss  South Sudan
  231  *
  232  * requested new TLDs:
  233  *
  234  * xccTLDs:
  235  * .an  Netherlands Antilles, becomes .bq, .cw, and .sx
  236  * .su  former USSR, now .ru
  237  * .tp  former East Timor, now .tl
  238  */
  239 
  240 static char gnksa_country_codes[26*26] = {
  241 /*      A B C D E  F G H I J  K L M N O  P Q R S T  U V W X Y Z */
  242 /* A */ 0,0,1,1,1, 1,1,0,1,0, 0,1,1,1,1, 0,1,1,1,1, 1,0,1,1,0,1,
  243 /* B */ 1,1,0,1,1, 1,1,1,1,1, 0,0,1,1,1, 0,0,1,1,1, 0,0,1,0,1,1,
  244 /* C */ 1,0,1,1,0, 1,1,1,1,0, 1,1,1,1,1, 0,0,1,0,0, 1,1,1,1,1,1,
  245 /* D */ 0,0,0,0,1, 0,0,0,0,1, 1,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0,1,
  246 /* E */ 0,0,1,0,1, 0,1,0,0,0, 0,0,0,0,0, 0,0,1,1,1, 1,0,0,0,0,0,
  247 /* F */ 0,0,0,0,0, 0,0,0,1,1, 1,0,1,0,1, 0,0,1,0,0, 0,0,0,0,0,0,
  248 /* G */ 1,0,0,1,1, 1,1,1,1,0, 0,1,1,1,0, 1,1,1,1,1, 1,0,1,0,1,0,
  249 /* H */ 0,0,0,0,0, 0,0,0,0,0, 1,0,1,1,0, 0,0,1,0,1, 1,0,0,0,0,0,
  250 /* I */ 0,0,0,1,1, 0,0,0,0,0, 0,1,1,1,1, 0,1,1,1,1, 0,0,0,0,0,0,
  251 /* J */ 0,0,0,0,1, 0,0,0,0,0, 0,0,1,0,1, 1,0,0,0,0, 0,0,0,0,0,0,
  252 /* K */ 0,0,0,0,1, 0,1,1,1,0, 0,0,1,1,0, 1,0,1,0,0, 0,0,1,0,1,1,
  253 /* L */ 1,1,1,0,0, 0,0,0,1,0, 1,0,0,0,0, 0,0,1,1,1, 1,1,0,0,1,0,
  254 /* M */ 1,0,1,1,1, 0,1,1,0,0, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1,1,
  255 /* N */ 1,0,1,0,1, 1,1,0,1,0, 0,1,0,0,1, 1,0,1,0,0, 1,0,0,0,0,1,
  256 /* O */ 0,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0,0,
  257 /* P */ 1,0,0,0,1, 1,1,1,0,0, 1,1,1,1,0, 0,0,1,1,1, 0,0,1,0,1,0,
  258 /* Q */ 1,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,
  259 /* R */ 0,0,0,0,1, 0,0,0,0,0, 0,0,0,0,1, 0,0,0,1,0, 1,0,1,0,0,0,
  260 /* S */ 1,1,1,1,1, 0,1,1,1,0, 1,1,1,1,1, 0,0,1,0,1, 1,1,0,1,1,1,
  261 /* T */ 0,0,1,1,0, 1,1,1,0,1, 1,1,1,1,1, 1,0,1,0,1, 0,1,1,0,0,1,
  262 /* U */ 1,0,0,0,0, 0,1,0,0,0, 1,0,0,0,0, 0,0,0,1,0, 0,0,0,0,1,1,
  263 /* V */ 1,0,1,0,1, 0,1,0,1,0, 0,0,0,1,0, 0,0,0,0,0, 1,0,0,0,0,0,
  264 /* W */ 0,0,0,0,0, 1,0,0,0,0, 0,0,0,0,0, 0,0,0,1,0, 0,0,0,0,0,0,
  265 /* X */ 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,
  266 /* Y */ 0,0,0,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1, 0,0,0,0,0,0,
  267 /* Z */ 1,0,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,1,0,0,0
  268 /*      A B C D E  F G H I J  K L M N O  P Q R S T  U V W X Y Z */
  269 };
  270 
  271 
  272 /*
  273  * valid domains with 3 or more characters
  274  */
  275 static const char *gnksa_domain_list[] = {
  276     "biz",  /* Businesses */
  277     "cat",  /* Catalan linguistic and cultural community */
  278     "com",  /* Commercial */
  279     "edu",  /* Educational */
  280     "gov",  /* US Government */
  281     "int",  /* International Organizations */
  282     "mil",  /* US Dept of Defense */
  283     "net",  /* Networks */
  284     "org",  /* Organizations */
  285     "pro",  /* Accountants, lawyers, and physicians */
  286     "tel",  /* Internet communication */
  287     "xxx",  /* For adult entertainment */
  288     "aero", /* Air-transport industry */
  289     "arpa", /* Address and Routing Parameter Area */
  290     "asia", /* Asia and the Pacific */
  291     "bike",
  292     "coop", /* Non-profit cooperatives */
  293     "guru",
  294     "info", /* Unrestricted use */
  295     "jobs", /* Human resource managers */
  296     "land",
  297     "mobi", /* Mobile products and services */
  298     "name", /* For registration by individuals */
  299     "post", /* Postal sector */
  300     "sexy",
  301     "camera",
  302     "estate",
  303     "museum",   /* Museums */
  304     "tattoo",
  305     "travel",   /* Travel industry */
  306     "voyage",
  307     "gallery",
  308     "singles",
  309     "clothing",
  310     "graphics",
  311     "holdings",
  312     "lighting",
  313     "plumbing",
  314     "ventures",
  315     "equipment",
  316     "technology",
  317     "contractors",
  318     "construction",
  319     /*
  320      * more gTLDs to come, proposed are:
  321      *  .kids     .mail     .catholic
  322      *  (.berlin) (.sco)    (.bzh)    (.cym)    (.gal)
  323      */
  324 #   if 0        /* $DEAD */
  325     "nato",
  326     "uucp",
  327     "csnet",
  328     "bitnet",
  329 #   endif /* 0 */
  330     /* the next five are defined in RFC 2606, RFC 6761 */
  331     "invalid",
  332 #   if 0
  333     /* but four of them shoudn't be used on usenet */
  334     "test",
  335     "onion",
  336     "example",
  337     "localhost",
  338 #   endif /* 0 */
  339 #   ifdef TINC_DNS
  340     "bofh", /* There Is No Cabal */
  341 #   endif /* TINC_DNS */
  342     /* active IDN ccTLDs */
  343     "xn--lgbbat1ad8j",  /* Algeria */
  344     "xn--fiqs8s",       /* China, Simplified Chinese */
  345     "xn--fiqz9s",       /* China, Traditional Chinese */
  346     "xn--wgbh1c",       /* Egypt */
  347     "xn--j6w193g",      /* Hong Kong, Han */
  348     "xn--45brj9c",      /* India, Bengali */
  349     "xn--gecrj9c",      /* India, Gujarati */
  350     "xn--h2brj9c",      /* India, Hindi */
  351     "xn--s9brj9c",      /* India, Punjabi */
  352     "xn--xkc2dl3a5ee0h",    /* India, Tamil */
  353     "xn--fpcrj9c3d",    /* India, Telugu */
  354     "xn--mgbbh1a71e",   /* India, Urdu */
  355     "xn--mgba3a4f16a",  /* Iran */
  356     "xn--mgbayh7gpa",   /* Jordan */
  357     "xn--80ao21a",      /* Kazakhstan */
  358     "xn--3e0b707e",     /* Korea, Republic of */
  359     "xn--mgbx4cd0ab",   /* Malaysia */
  360     "xn--l1acc",        /* Mongolia */
  361     "xn--mgbc0a9azcg",  /* Morocco */
  362     "xn--mgb9awbf",     /* Oman */
  363     "xn--ygbi2ammx",    /* Palestinian Territory */
  364     "xn--wgbl6a",       /* Qatar */
  365     "xn--p1ai",         /* Russian Federation */
  366     "xn--mgberp4a5d4ar",    /* Saudi Arabia */
  367     "xn--90a3ac",       /* Serbia */
  368     "xn--yfro4i67o",    /* Singapore, Chinese */
  369     "xn--clchc0ea0b2g2a9gcd",   /* Singapore, Tamil */
  370     "xn--fzc2c9e2c",    /* Sri Lanka, Sinhala */
  371     "xn--xkc2al3hye2a", /* Sri Lanka, Tamil */
  372     "xn--ogbpf8fl",     /* Syrian Arab Republic */
  373     "xn--kpry57d",      /* Taiwan, Simplified Chinese */
  374     "xn--kprw13d",      /* Taiwan, Traditional Chinese */
  375     "xn--o3cw4h",       /* Thailand */
  376     "xn--pgbs0dh",      /* Tunisia */
  377     "xn--j1amh",        /* Ukraine */
  378     "xn--mgbaam7a8h",   /* United Arab Emirates */
  379 #   if 0
  380     /* purposed IDN ccTLDs */
  381     "xn--54b7fta0cc",   /* Bangladesh */
  382     "xn--node",         /* Georgia */
  383     "xn--mgbai9azgqp6j",    /* Pakistan */
  384     "xn--mgbpl2fh",     /* Sudan */
  385     "xn--mgb2ddes",     /* Yemen */
  386 #   endif /* 0 */
  387 #   if 0
  388     /* Desired Variant String(s) IDN ccTLDs */
  389     "xn--mgba3a4fra",   /* Iran */
  390     "xn--mgbai9a5eva00b",   /* Pakistan */
  391     "xn--mgberp4a5d4a87g",  /* Saudi Arabia */
  392     "xn--mgbqly7c0a67fbc",  /* Saudi Arabia */
  393     "xn--mgbqly7cvafr", /* Saudi Arabia */
  394     "xn--mgbtf8fl",     /* Syria */
  395     "xn--nnx388a",      /* Taiwan */
  396 #   endif /* 0 */
  397     /* active IDN gTLDs */
  398     "xn--ngbc5azd",     /* Arabic for "web/network" */
  399     "xn--80asehdb",     /* Cyrillic for "online" */
  400     "xn--80aswg",       /* Cyrillic for "site" */
  401     "xn--unup4y",       /* Chinese for "game(s)" */
  402     /* puposed IDN gTLDs */
  403     /* sentinel */
  404     ""
  405 };
  406 #endif /* !TIN_POLICY_H */