home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1996 May / PCOnline_05_1996.bin / linux / source / n / bind / bind-4.001 / bind-4~ / bind-4.9.3-BETA9 / named / ns_glob.h < prev    next >
C/C++ Source or Header  |  1994-06-11  |  7KB  |  246 lines

  1. /*
  2.  *    from ns.h    4.33 (Berkeley) 8/23/90
  3.  *    $Id: ns_glob.h,v 1.7 1994/06/11 22:04:46 vixie Exp $
  4.  */
  5.  
  6. /*
  7.  * ++Copyright++ 1986
  8.  * -
  9.  * Copyright (c) 1986
  10.  *    The Regents of the University of California.  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. All advertising materials mentioning features or use of this software
  21.  *    must display the following acknowledgement:
  22.  *     This product includes software developed by the University of
  23.  *     California, Berkeley and its contributors.
  24.  * 4. Neither the name of the University nor the names of its contributors
  25.  *    may be used to endorse or promote products derived from this software
  26.  *    without specific prior written permission.
  27.  * 
  28.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  29.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  30.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  31.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  32.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  33.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  34.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  36.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  37.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  38.  * SUCH DAMAGE.
  39.  * -
  40.  * Portions Copyright (c) 1993 by Digital Equipment Corporation.
  41.  * 
  42.  * Permission to use, copy, modify, and distribute this software for any
  43.  * purpose with or without fee is hereby granted, provided that the above
  44.  * copyright notice and this permission notice appear in all copies, and that
  45.  * the name of Digital Equipment Corporation not be used in advertising or
  46.  * publicity pertaining to distribution of the document or software without
  47.  * specific, written prior permission.
  48.  * 
  49.  * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
  50.  * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
  51.  * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
  52.  * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  53.  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  54.  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  55.  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  56.  * SOFTWARE.
  57.  * -
  58.  * --Copyright--
  59.  */
  60.  
  61. /*
  62.  * Global variables for the name server.
  63.  */
  64.  
  65. #ifdef DEBUG
  66. DECL    int            debug        INIT(0);
  67. DECL    FILE            *ddt        INIT(NULL);
  68. #endif
  69.  
  70.     /* list of open streams */
  71. DECL    struct qstream        *streamq    INIT(QSTREAM_NULL);
  72.  
  73.     /* list of datagram interfaces */
  74. DECL    struct qdatagram    *datagramq    INIT(QDATAGRAM_NULL);
  75.  
  76.     /* often set to the current time */
  77. DECL    struct timeval        tt;
  78.  
  79.     /* head of allocated queries */
  80. DECL    struct qinfo        *qhead        INIT(QINFO_NULL);
  81.  
  82.     /* list of forwarding hosts */
  83. DECL    struct fwdinfo        *fwdtab        INIT(NULL);
  84.  
  85.     /* next forwarded query id */
  86. DECL    int            nsid        INIT(0);
  87.  
  88.     /* datagram socket */
  89. DECL    int            ds        INIT(-1);
  90.  
  91.     /* listening TCP socket */
  92. DECL    int            vs        INIT(-1);
  93.  
  94.     /* received SIGHUP, need to reload db */
  95. DECL    int            needreload    INIT(0);
  96.  
  97.     /* need to call ns_maint()*/
  98. DECL    int            needmaint    INIT(0);
  99.  
  100.     /* how often does ns_maint() need to be called, in seconds? */
  101.     /* (beware: this is also the upper bound on named_xfer real time) */
  102. DECL    int            maint_interval    INIT(15*60);
  103.  
  104.     /* need to reload secondary zone(s) */
  105. DECL    int            needzoneload    INIT(0);
  106.  
  107.     /* need to dump database */
  108. DECL    int            needToDoadump    INIT(0);
  109.  
  110.     /* need to checkpoint cache */
  111. DECL    int            needToChkpt    INIT(0);
  112.  
  113.     /* need to dump statistics */
  114. DECL    int            needStatsDump    INIT(0);
  115.  
  116. #ifdef ALLOW_UPDATES
  117.     /* need to exit (may need to doadump
  118.      * first, if database has changed since
  119.      * it was last dumped/booted). Gets
  120.      * set by shutdown signal handler
  121.      *  (onintr)
  122.      */
  123. DECL    int            needToExit    INIT(0);
  124. #endif /* ALLOW_UPDATES */
  125.  
  126. #ifdef QRYLOG
  127.     /* is query logging turned on? */
  128. DECL    int            qrylog        INIT(0);
  129. #endif /*QRYLOG*/
  130.  
  131.     /* is this a root server that should therefore not recurse? */
  132. DECL    int            NoRecurse    INIT(0);
  133.  
  134. /*
  135.  * We keep a list of favored networks headed by nettab.
  136.  * There are three (possibly empty) parts to this list, in this order:
  137.  *    1. directly attached (sub)nets.
  138.  *    2. logical networks for directly attached subnetted networks.
  139.  *    3. networks from the sort list.
  140.  * The value (*elocal) points at the first entry in the second part of the
  141.  * list, if any, while (*enettab) points at the first entry in the sort list.
  142.  */
  143. DECL    struct netinfo        *nettab        INIT(NULL);
  144. DECL    struct netinfo        **elocal    INIT(&nettab);
  145. DECL    struct netinfo        **enettab    INIT(&nettab);
  146.  
  147. #ifdef XFRNETS
  148.     /* list of nets we're willing to zone transfer to */
  149. DECL    struct netinfo        *xfrnets    INIT(NULL);
  150. #endif
  151.  
  152. #ifdef BOGUSNS
  153.     /* list of bogus nameservers */
  154. DECL    struct netinfo        *boglist    INIT(NULL);
  155. #endif
  156.  
  157.     /* loopback net */
  158. DECL    struct netinfo        netloop;
  159.  
  160.     /* port to which we send queries */
  161. DECL    u_int16_t        ns_port;
  162.  
  163.     /* Source addr of last packet */
  164. DECL    struct sockaddr_in    from_addr;
  165.  
  166.     /* Source addr size of last packet */
  167. DECL    int            from_len;
  168.  
  169.     /* Used by ns_stats */
  170. DECL    time_t            boottime,
  171.                 resettime;
  172.  
  173.     /* next query to retry */
  174. DECL    struct qinfo        *retryqp    INIT(NULL);
  175.  
  176.     /* default boot file */
  177. #ifdef BOOTFILE
  178. DECL    char            *bootfile    INIT(BOOTFILE);
  179. #else
  180. DECL    char            *bootfile    INIT(_PATH_BOOT);
  181. #endif
  182.  
  183.     /* default debug output file */
  184. #ifdef DEBUGFILE
  185. DECL    char            *debugfile    INIT(DEBUGFILE);
  186. #else
  187. DECL    char            *debugfile    INIT(_PATH_DEBUG);
  188. #endif
  189.  
  190. #ifdef WANT_PIDFILE
  191.     /* file to store current named PID */
  192. #ifdef PIDFILE
  193. DECL    char            *PidFile    INIT(PIDFILE);
  194. #else
  195. DECL    char            *PidFile    INIT(_PATH_PIDFILE);
  196. #endif
  197. #endif /*WANT_PIDFILE*/
  198.  
  199.     /* zone information */
  200. DECL    struct zoneinfo        *zones        INIT(NULL);
  201.  
  202.     /* number of zones in use */
  203. DECL    int            nzones        INIT(0);
  204.  
  205.     /* true on slave server */
  206. DECL    int            forward_only    INIT(0);
  207.  
  208.     /* set if we need a priming */
  209. DECL    int            needs_prime_cache INIT(0);
  210.  
  211.     /* is cache being primed */
  212. DECL    int            priming        INIT(0);
  213.  
  214.     /* ptrs to dnames in msg for dn_comp */
  215. DECL    u_char            *dnptrs[40];
  216.  
  217.     /* number of names in addinfo */
  218. DECL    int            addcount;
  219.  
  220.     /* name of cache file */
  221. DECL    char            *cache_file;
  222.  
  223. #ifdef LOCALDOM
  224.     /* our local domain (deprecated in favor of resolv.conf) */
  225. DECL    char            *localdomain;
  226. #endif
  227.  
  228. #ifdef SLAVE_FORWARD
  229.     /* retry time when a slave */
  230. DECL    int            slave_retry    INIT(4);
  231. #endif
  232.  
  233. #ifdef STATSFILE
  234. DECL    char            *statsfile    INIT(STATSFILE);
  235. #else
  236. DECL    char            *statsfile    INIT(_PATH_STATS);
  237. #endif
  238.  
  239. DECL    char            sendtoStr[]    INIT("sendto");
  240.  
  241.     /* defined in version.c, can't use DECL/INIT */
  242. extern    char            Version[];
  243.  
  244.     /* max value of xfers_running */
  245. DECL    int            max_xfers_running    INIT(MAX_XFERS_RUNNING);
  246.