1: /*
   2:  * Copyright (c) 1980,1983,1988 Regents of the University of California.
   3:  * All rights reserved.
   4:  *
   5:  * Redistribution and use in source and binary forms are permitted
   6:  * provided that this notice is preserved and that due credit is given
   7:  * to the University of California at Berkeley. The name of the University
   8:  * may not be used to endorse or promote products derived from this
   9:  * software without specific prior written permission. This software
  10:  * is provided ``as is'' without express or implied warranty.
  11:  *
  12:  *	@(#)netdb.h	5.9.1 (2.11BSD GTE) 12/31/93
  13:  */
  14: 
  15: /*
  16:  * Structures returned by network
  17:  * data base library.  All addresses
  18:  * are supplied in host order, and
  19:  * returned in network order (suitable
  20:  * for use in system calls).
  21:  */
  22: struct  hostent {
  23:     char    *h_name;    /* official name of host */
  24:     char    **h_aliases;    /* alias list */
  25:     int h_addrtype; /* host address type */
  26:     int h_length;   /* length of address */
  27:     char    **h_addr_list;  /* list of addresses from name server */
  28: #define h_addr  h_addr_list[0]  /* address, for backward compatiblity */
  29: };
  30: 
  31: /*
  32:  * Assumption here is that a network number
  33:  * fits in 32 bits -- probably a poor one.
  34:  */
  35: struct  netent {
  36:     char        *n_name;    /* official name of net */
  37:     char        **n_aliases;    /* alias list */
  38:     int     n_addrtype; /* net address type */
  39:     unsigned long   n_net;      /* network # */
  40: };
  41: 
  42: struct  servent {
  43:     char    *s_name;    /* official service name */
  44:     char    **s_aliases;    /* alias list */
  45:     int s_port;     /* port # */
  46:     char    *s_proto;   /* protocol to use */
  47: };
  48: 
  49: struct  protoent {
  50:     char    *p_name;    /* official protocol name */
  51:     char    **p_aliases;    /* alias list */
  52:     int p_proto;    /* protocol # */
  53: };
  54: 
  55: struct hostent  *gethostbyname(), *gethostbyaddr(), *gethostent();
  56: struct netent   *getnetbyname(), *getnetbyaddr(), *getnetent();
  57: struct servent  *getservbyname(), *getservbyport(), *getservent();
  58: struct protoent *getprotobyname(), *getprotobynumber(), *getprotoent();
  59: 
  60: /*
  61:  * Error return codes from gethostbyname() and gethostbyaddr()
  62:  * (left in extern int h_errno).
  63:  */
  64: 
  65: #define HOST_NOT_FOUND  1 /* Authoritative Answer Host not found */
  66: #define TRY_AGAIN   2 /* Non-Authoritive Host not found, or SERVERFAIL */
  67: #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
  68: #define NO_DATA     4 /* Valid name, no data record of requested type */
  69: #define NO_ADDRESS  NO_DATA     /* no address, look for MX record */
  70: 
  71: unsigned long   gethostid();

Defined struct's

hostent defined in line 22; used 2 times
  • in line 55(2)
netent defined in line 35; used 2 times
  • in line 56(2)
protoent defined in line 49; used 2 times
  • in line 58(2)
servent defined in line 42; used 2 times
  • in line 57(2)

Defined macros

HOST_NOT_FOUND defined in line 65; never used
NO_ADDRESS defined in line 69; never used
NO_DATA defined in line 68; used 1 times
  • in line 69
NO_RECOVERY defined in line 67; never used
TRY_AGAIN defined in line 66; never used
h_addr defined in line 28; never used
Last modified: 1994-01-11
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2919
Valid CSS Valid XHTML 1.0 Strict