10 date 90.04.05.15.06.01; author sources; state Exp;
15 date 89.11.17.15.56.56; author sources; state Exp;
21 @named's netdb.h for BIND option
32 * Copyright (c) 1980,1983,1988 Regents of the University of California.
33 * All rights reserved.
35 * Redistribution and use in source and binary forms are permitted
36 * provided that this notice is preserved and that due credit is given
37 * to the University of California at Berkeley. The name of the University
38 * may not be used to endorse or promote products derived from this
39 * software without specific prior written permission. This software
40 * is provided ``as is'' without express or implied warranty.
42 * @@(#)netdb.h 5.9 (Berkeley) 4/5/88
46 * Structures returned by network
47 * data base library. All addresses
48 * are supplied in host order, and
49 * returned in network order (suitable
50 * for use in system calls).
53 char *h_name; /* official name of host */
54 char **h_aliases; /* alias list */
55 int h_addrtype; /* host address type */
56 int h_length; /* length of address */
57 char **h_addr_list; /* list of addresses from name server */
58 #define h_addr h_addr_list[0] /* address, for backward compatiblity */
62 * Assumption here is that a network number
63 * fits in 32 bits -- probably a poor one.
66 char *n_name; /* official name of net */
67 char **n_aliases; /* alias list */
68 int n_addrtype; /* net address type */
69 unsigned long n_net; /* network # */
73 char *s_name; /* official service name */
74 char **s_aliases; /* alias list */
75 int s_port; /* port # */
76 char *s_proto; /* protocol to use */
80 char *p_name; /* official protocol name */
81 char **p_aliases; /* alias list */
82 int p_proto; /* protocol # */
85 struct hostent *gethostbyname(), *gethostbyaddr(), *gethostent();
86 struct netent *getnetbyname(), *getnetbyaddr(), *getnetent();
87 struct servent *getservbyname(), *getservbyport(), *getservent();
88 struct protoent *getprotobyname(), *getprotobynumber(), *getprotoent();
91 * Error return codes from gethostbyname() and gethostbyaddr()
92 * (left in extern int h_errno).
95 #define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */
96 #define TRY_AGAIN 2 /* Non-Authoritive Host not found, or SERVERFAIL */
97 #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
98 #define NO_DATA 4 /* Valid name, no data record of requested type */
99 #define NO_ADDRESS NO_DATA /* no address, look for MX record */
105 @changes for SUN40 shared libraries and NNTP under bbc