2 * Copyright (c) 1980,1983,1988 Regents of the University of California.
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.
14 * Structures returned by network data base library.
15 * All addresses are supplied in host order, and
16 * returned in network order (suitable for use in system calls).
22 /* from UCB 5.9 4/5/88 */
24 #pragma ident "%Z%%M% %I% %E% SMI"
26 #define _PATH_HEQUIV "/etc/hosts.equiv"
27 #define _PATH_HOSTS "/etc/hosts"
28 #define _PATH_NETWORKS "/etc/networks"
29 #define _PATH_PROTOCOLS "/etc/protocols"
30 #define _PATH_SERVICES "/etc/services"
33 char *h_name
; /* official name of host */
34 char **h_aliases
; /* alias list */
35 int h_addrtype
; /* host address type */
36 int h_length
; /* length of address */
37 char **h_addr_list
; /* list of addresses from name server */
38 #define h_addr h_addr_list[0] /* address, for backward compatiblity */
42 * Assumption here is that a network number
43 * fits in 32 bits -- probably a poor one.
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 # */
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 */
60 char *p_name
; /* official protocol name */
61 char **p_aliases
; /* alias list */
62 int p_proto
; /* protocol # */
66 char *r_name
; /* name of server for this rpc program */
67 char **r_aliases
; /* alias list */
68 int r_number
; /* rpc program number */
71 struct hostent
*gethostbyname(), *gethostbyaddr(), *gethostent();
72 struct netent
*getnetbyname(), *getnetbyaddr(), *getnetent();
73 struct servent
*getservbyname(), *getservbyport(), *getservent();
74 struct protoent
*getprotobyname(), *getprotobynumber(), *getprotoent();
75 struct rpcent
*getrpcbyname(), *getrpcbynumber(), *getrpcent();
78 * Error return codes from gethostbyname() and gethostbyaddr()
79 * (when using the resolver)
84 #define HOST_NOT_FOUND 1 /* Authoritive Answer Host not found */
85 #define TRY_AGAIN 2 /* Non-Authoritive Host not found, or SERVERFAIL */
86 #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
87 #define NO_DATA 4 /* Valid name, no data record of requested type */
88 #define NO_ADDRESS NO_DATA /* no address, look for MX record */