1: /*
   2:  * Copyright (c) 1985,1989 Regents of the University of California.
   3:  * All rights reserved.
   4:  *
   5:  * Redistribution and use in source and binary forms are permitted provided
   6:  * that: (1) source distributions retain this entire copyright notice and
   7:  * comment, and (2) distributions including binaries display the following
   8:  * acknowledgement:  ``This product includes software developed by the
   9:  * University of California, Berkeley and its contributors'' in the
  10:  * documentation or other materials provided with the distribution and in
  11:  * all advertising materials mentioning features or use of this software.
  12:  * Neither the name of the University nor the names of its contributors may
  13:  * be used to endorse or promote products derived from this software without
  14:  * specific prior written permission.
  15:  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  16:  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  17:  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  18:  *
  19:  *	@(#)res.h	5.10.1 (2.11BSD GTE) 1/26/94
  20:  */
  21: 
  22: /*
  23:  *******************************************************************************
  24:  *
  25:  *  res.h --
  26:  *
  27:  *	Definitions used by modules of the name server lookup program.
  28:  *
  29:  *	Copyright (c) 1985
  30:  *	Andrew Cherenson
  31:  *	U.C. Berkeley
  32:  *	CS298-26  Fall 1985
  33:  *
  34:  *******************************************************************************
  35:  */
  36: 
  37: /*
  38:  * This really doesn't belong here and can go away when newer resolver routines
  39:  * and include files are ported over.
  40: */
  41: #define MAXDFLSRCH  3
  42: 
  43: #define TRUE    1
  44: #define FALSE   0
  45: typedef int Boolean;
  46: 
  47: /*
  48:  *  Define return statuses in addtion to the ones defined in namserv.h
  49:  *   let SUCCESS be a synonym for NOERROR
  50:  *
  51:  *	TIME_OUT	- a socket connection timed out.
  52:  *	NO_INFO		- the server didn't find any info about the host.
  53:  *	ERROR		- one of the following types of errors:
  54:  *			   dn_expand, res_mkquery failed
  55:  *			   bad command line, socket operation failed, etc.
  56:  *	NONAUTH		- the server didn't have the desired info but
  57:  *			  returned the name(s) of some servers who should.
  58:  *	NO_RESPONSE	- the server didn't respond.
  59:  *
  60:  */
  61: 
  62: #define  SUCCESS        0
  63: #define  TIME_OUT       -1
  64: #define  NO_INFO        -2
  65: #define  ERROR          -3
  66: #define  NONAUTH        -4
  67: #define  NO_RESPONSE        -5
  68: 
  69: /*
  70:  *  Define additional options for the resolver state structure.
  71:  *
  72:  *   RES_DEBUG2		more verbose debug level
  73:  */
  74: 
  75: #define RES_DEBUG2  0x80000000
  76: 
  77: /*
  78:  *  Maximum length of server, host and file names.
  79:  */
  80: 
  81: #define NAME_LEN 256
  82: 
  83: 
  84: /*
  85:  * Modified struct hostent from <netdb.h>
  86:  *
  87:  * "Structures returned by network data base library.  All addresses
  88:  * are supplied in host order, and returned in network order (suitable
  89:  * for use in system calls)."
  90:  */
  91: 
  92: typedef struct  {
  93:     char    *name;      /* official name of host */
  94:     char    **domains;  /* domains it serves */
  95:     char    **addrList; /* list of addresses from name server */
  96: } ServerInfo;
  97: 
  98: typedef struct  {
  99:     char    *name;      /* official name of host */
 100:     char    **aliases;  /* alias list */
 101:     char    **addrList; /* list of addresses from name server */
 102:     int addrType;   /* host address type */
 103:     int addrLen;    /* length of address */
 104:     ServerInfo **servers;
 105: } HostInfo;
 106: 
 107: 
 108: /*
 109:  *  FilePtr is used for directing listings to a file.
 110:  *  It is global so the Control-C handler can close it.
 111:  */
 112: 
 113: extern FILE *filePtr;
 114: 
 115: /*
 116:  * TCP/UDP port of server.
 117:  */
 118: extern unsigned short nsport;
 119: 
 120: /*
 121:  *  External routines:
 122:  */
 123: 
 124: extern Boolean IsAddr();
 125: extern int  Print_query();
 126: extern char *Print_cdname();
 127: extern char *Print_cdname2();   /* fixed width */
 128: extern char *Print_rr();
 129: extern char *DecodeType();  /* descriptive version of p_type */
 130: extern char *DecodeError();
 131: extern char *Calloc();
 132: extern char *Malloc();
 133: extern void NsError();
 134: extern void PrintServer();
 135: extern void PrintHostInfo();
 136: extern void ShowOptions();
 137: extern void FreeHostInfoPtr();
 138: extern FILE *OpenFile();
 139: extern char *res_skip();
 140: extern char *getenv();

Defined typedef's

Defined macros

MAXDFLSRCH defined in line 41; used 1 times
TIME_OUT defined in line 63; used 1 times

Usage of this include

Last modified: 1994-01-27
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2458
Valid CSS Valid XHTML 1.0 Strict