1: /*
   2:  * Copyright (c) 1980 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  *
   6:  *	@(#)netdb.h	5.7 (Berkeley) 5/12/86
   7:  */
   8: 
   9: /*
  10:  * Structures returned by network
  11:  * data base library.  All addresses
  12:  * are supplied in host order, and
  13:  * returned in network order (suitable
  14:  * for use in system calls).
  15:  */
  16: struct  hostent {
  17:     char    *h_name;    /* official name of host */
  18:     char    **h_aliases;    /* alias list */
  19:     int h_addrtype; /* host address type */
  20:     int h_length;   /* length of address */
  21:     char    **h_addr_list;  /* list of addresses from name server */
  22: #define h_addr  h_addr_list[0]  /* address, for backward compatiblity */
  23: };
  24: 
  25: /*
  26:  * Assumption here is that a network number
  27:  * fits in 32 bits -- probably a poor one.
  28:  */
  29: struct  netent {
  30:     char        *n_name;    /* official name of net */
  31:     char        **n_aliases;    /* alias list */
  32:     int     n_addrtype; /* net address type */
  33:     unsigned long   n_net;      /* network # */
  34: };
  35: 
  36: struct  servent {
  37:     char    *s_name;    /* official service name */
  38:     char    **s_aliases;    /* alias list */
  39:     int s_port;     /* port # */
  40:     char    *s_proto;   /* protocol to use */
  41: };
  42: 
  43: struct  protoent {
  44:     char    *p_name;    /* official protocol name */
  45:     char    **p_aliases;    /* alias list */
  46:     int p_proto;    /* protocol # */
  47: };
  48: 
  49: struct hostent  *gethostbyname(), *gethostbyaddr(), *gethostent();
  50: struct netent   *getnetbyname(), *getnetbyaddr(), *getnetent();
  51: struct servent  *getservbyname(), *getservbyport(), *getservent();
  52: struct protoent *getprotobyname(), *getprotobynumber(), *getprotoent();
  53: 
  54: /*
  55:  * Error return codes from gethostbyname() and gethostbyaddr()
  56:  */
  57: 
  58: extern  int h_errno;
  59: 
  60: #define HOST_NOT_FOUND  1 /* Authoritive Answer Host not found */
  61: #define TRY_AGAIN   2 /* Non-Authoritive Host not found, or SERVERFAIL */
  62: #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
  63: #define NO_ADDRESS  4 /* Valid host name, no address, look for MX record */

Defined struct's

hostent defined in line 16; used 2 times
  • in line 49(2)
netent defined in line 29; used 2 times
  • in line 50(2)
protoent defined in line 43; used 2 times
  • in line 52(2)
servent defined in line 36; used 2 times
  • in line 51(2)

Defined macros

HOST_NOT_FOUND defined in line 60; never used
NO_ADDRESS defined in line 63; never used
NO_RECOVERY defined in line 62; never used
TRY_AGAIN defined in line 61; never used
h_addr defined in line 22; never used
Last modified: 1986-05-12
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1071
Valid CSS Valid XHTML 1.0 Strict