home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / NETWORK / ISP / bind.4.8.3.lzh / BIND483 / INCLUDE / netdb.h.4.2 < prev    next >
Text File  |  1993-08-24  |  3KB  |  80 lines

  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 the above copyright notice and this paragraph are
  7.  * duplicated in all such forms and that any documentation,
  8.  * advertising materials, and other materials related to such
  9.  * distribution and use acknowledge that the software was developed
  10.  * by the University of California, Berkeley.  The name of the
  11.  * University may not be used to endorse or promote products derived
  12.  * from this software without specific prior written permission.
  13.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  14.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  15.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  16.  *
  17.  *    @(#)netdb.h    5.10.1.1 (Berkeley) 2/14/89
  18.  */
  19.  
  20. #define    _PATH_HEQUIV    "/etc/hosts.equiv"
  21. #define    _PATH_HOSTS    "/etc/hosts"
  22. #define    _PATH_NETWORKS    "/etc/networks"
  23. #define    _PATH_PROTOCOLS    "/etc/protocols"
  24. #define    _PATH_SERVICES    "/etc/services"
  25.  
  26. /*
  27.  * Structures returned by network
  28.  * data base library.  All addresses
  29.  * are supplied in host order, and
  30.  * returned in network order (suitable
  31.  * for use in system calls).
  32.  */
  33. struct    hostent {
  34.     char    *h_name;    /* official name of host */
  35.     char    **h_aliases;    /* alias list */
  36.     int    h_addrtype;    /* host address type */
  37.     int    h_length;    /* length of address */
  38.     char    *h_addr;    /* address */
  39. };
  40.  
  41. /*
  42.  * Assumption here is that a network number
  43.  * fits in 32 bits -- probably a poor one.
  44.  */
  45. struct    netent {
  46.     char        *n_name;    /* official name of net */
  47.     char        **n_aliases;    /* alias list */
  48.     int        n_addrtype;    /* net address type */
  49.     unsigned long    n_net;        /* network # */
  50. };
  51.  
  52. struct    servent {
  53.     char    *s_name;    /* official service name */
  54.     char    **s_aliases;    /* alias list */
  55.     int    s_port;        /* port # */
  56.     char    *s_proto;    /* protocol to use */
  57. };
  58.  
  59. struct    protoent {
  60.     char    *p_name;    /* official protocol name */
  61.     char    **p_aliases;    /* alias list */
  62.     int    p_proto;    /* protocol # */
  63. };
  64.  
  65. struct hostent    *gethostbyname(), *gethostbyaddr(), *gethostent();
  66. struct netent    *getnetbyname(), *getnetbyaddr(), *getnetent();
  67. struct servent    *getservbyname(), *getservbyport(), *getservent();
  68. struct protoent    *getprotobyname(), *getprotobynumber(), *getprotoent();
  69.  
  70. /*
  71.  * Error return codes from gethostbyname() and gethostbyaddr()
  72.  * (left in extern int h_errno).
  73.  */
  74.  
  75. #define    HOST_NOT_FOUND    1 /* Authoritative Answer Host not found */
  76. #define    TRY_AGAIN    2 /* Non-Authoritive Host not found, or SERVERFAIL */
  77. #define    NO_RECOVERY    3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
  78. #define    NO_DATA        4 /* Valid name, no data record of requested type */
  79. #define    NO_ADDRESS    NO_DATA        /* no address, look for MX record */
  80.