Annotation of 43BSD/etc/named/tools/ns.lookup/src/res.h, revision 1.1

1.1     ! root        1: /*
        !             2:  *******************************************************************************
        !             3:  *
        !             4:  *  res.h --
        !             5:  *
        !             6:  *     Definitions used by modules of the name server 
        !             7:  *     lookup program.
        !             8:  *
        !             9:  *     Copyright (c) 1985 
        !            10:  *     Andrew Cherenson
        !            11:  *     CS298-26  Fall 1985
        !            12:  *  
        !            13:  *     Copyright (c) 1985 Regents of the University of California.
        !            14:  *     All rights reserved.  The Berkeley software License Agreement
        !            15:  *     specifies the terms and conditions for redistribution.
        !            16:  *
        !            17:  *     @(#)res.h       5.1 (Berkeley) 11/29/85
        !            18:  *
        !            19:  *******************************************************************************
        !            20:  */
        !            21: 
        !            22: 
        !            23: #define TRUE   1
        !            24: #define FALSE  0
        !            25: 
        !            26: /*
        !            27:  *  Define return statuses in addtion to the ones defined in namserv.h
        !            28:  *   let SUCCESS be a synonym for NOERROR
        !            29:  *
        !            30:  *     TIME_OUT        - a socket connection timed out.
        !            31:  *     NO_INFO         - the server didn't find any info about the host.
        !            32:  *     ERROR           - one of the following types of errors:
        !            33:  *                        dn_expand, res_mkquery failed
        !            34:  *                        bad command line, socket operation failed, etc.
        !            35:  *     NONAUTH         - the server didn't have the desired info but
        !            36:  *                       returned the name(s) of some servers who should.
        !            37:  *
        !            38:  */
        !            39: 
        !            40: #define  SUCCESS               0
        !            41: #define  TIME_OUT              -1
        !            42: #define  NO_INFO               -2
        !            43: #define  ERROR                         -3
        !            44: #define  NONAUTH               -4
        !            45: 
        !            46: /*
        !            47:  *  Define additional options for the resolver state structure.
        !            48:  *
        !            49:  *   RES_DEBUG2                more verbose debug level 
        !            50:  */
        !            51: 
        !            52: #define RES_DEBUG2     0x80000000
        !            53: 
        !            54: /*
        !            55:  *  Maximum length of server, host and file names.
        !            56:  */
        !            57: 
        !            58: #define NAME_LEN 80
        !            59: 
        !            60: 
        !            61: /*
        !            62:  * Modified struct hostent from <netdb.h>
        !            63:  *
        !            64:  * "Structures returned by network data base library.  All addresses
        !            65:  * are supplied in host order, and returned in network order (suitable
        !            66:  * for use in system calls)."
        !            67:  */
        !            68: 
        !            69: typedef struct {
        !            70:        char    *name;          /* official name of host */
        !            71:        char    **domains;      /* domains it serves */
        !            72:        char    **addrList;     /* list of addresses from name server */
        !            73: } ServerInfo;
        !            74: 
        !            75: typedef struct {
        !            76:        char    *name;          /* official name of host */
        !            77:        char    **aliases;      /* alias list */
        !            78:        char    **addrList;     /* list of addresses from name server */
        !            79:        int     addrType;       /* host address type */
        !            80:        int     addrLen;        /* length of address */
        !            81:        ServerInfo **servers;
        !            82: } HostInfo;
        !            83: 
        !            84: 
        !            85: /*
        !            86:  *  SockFD is the file descriptor for sockets used to connect with
        !            87:  *  the name servers. It is global so the Control-C handler can close
        !            88:  *  it. Likewise for filePtr, which is used for directing listings
        !            89:  *  to a file.
        !            90:  */
        !            91: 
        !            92: extern int sockFD;
        !            93: extern FILE *filePtr;
        !            94: 
        !            95: 
        !            96: /*
        !            97:  *  External routines:
        !            98:  */
        !            99: 
        !           100: extern int   Print_query();
        !           101: extern char *Print_cdname();
        !           102: extern char *Print_cdname2();  /* fixed width */
        !           103: extern char *Print_rr();
        !           104: extern char *DecodeType();     /* descriptive version of p_type */
        !           105: extern char *DecodeError();
        !           106: extern char *Calloc();
        !           107: extern void PrintServer();
        !           108: extern void PrintHostInfo();
        !           109: extern void ShowOptions();
        !           110: extern void FreeHostInfoPtr();
        !           111: extern FILE *OpenFile();
        !           112: extern char *inet_ntoa();
        !           113: extern char *res_skip();

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.