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.compat < prev    next >
Text File  |  1993-08-24  |  3KB  |  82 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. #define    h_addr    h_addr_0    /* Force 4.3 mode in resolver */
  39.     char    *h_addr;    /* This field for binary compatibility */
  40.     char    **h_addr_list;    /* list of addresses from name server */
  41. };
  42.  
  43. /*
  44.  * Assumption here is that a network number
  45.  * fits in 32 bits -- probably a poor one.
  46.  */
  47. struct    netent {
  48.     char        *n_name;    /* official name of net */
  49.     char        **n_aliases;    /* alias list */
  50.     int        n_addrtype;    /* net address type */
  51.     unsigned long    n_net;        /* network # */
  52. };
  53.  
  54. struct    servent {
  55.     char    *s_name;    /* official service name */
  56.     char    **s_aliases;    /* alias list */
  57.     int    s_port;        /* port # */
  58.     char    *s_proto;    /* protocol to use */
  59. };
  60.  
  61. struct    protoent {
  62.     char    *p_name;    /* official protocol name */
  63.     char    **p_aliases;    /* alias list */
  64.     int    p_proto;    /* protocol # */
  65. };
  66.  
  67. struct hostent    *gethostbyname(), *gethostbyaddr(), *gethostent();
  68. struct netent    *getnetbyname(), *getnetbyaddr(), *getnetent();
  69. struct servent    *getservbyname(), *getservbyport(), *getservent();
  70. struct protoent    *getprotobyname(), *getprotobynumber(), *getprotoent();
  71.  
  72. /*
  73.  * Error return codes from gethostbyname() and gethostbyaddr()
  74.  * (left in extern int h_errno).
  75.  */
  76.  
  77. #define    HOST_NOT_FOUND    1 /* Authoritative Answer Host not found */
  78. #define    TRY_AGAIN    2 /* Non-Authoritive Host not found, or SERVERFAIL */
  79. #define    NO_RECOVERY    3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
  80. #define    NO_DATA        4 /* Valid name, no data record of requested type */
  81. #define    NO_ADDRESS    NO_DATA        /* no address, look for MX record */
  82.