Commit | Line | Data |
---|---|---|
e775ec98 | 1 | /*- |
f4f66d2c | 2 | * Copyright (c) 1980, 1983, 1988 Regents of the University of California. |
8ff78169 | 3 | * All rights reserved. |
5efaa119 | 4 | * |
e775ec98 | 5 | * %sccs.include.redist.c% |
8ff78169 | 6 | * |
e775ec98 | 7 | * @(#)netdb.h 5.11 (Berkeley) %G% |
5efaa119 KM |
8 | */ |
9 | ||
e775ec98 KB |
10 | #define _PATH_HEQUIV "/etc/hosts.equiv" |
11 | #define _PATH_HOSTS "/etc/hosts" | |
12 | #define _PATH_NETWORKS "/etc/networks" | |
13 | #define _PATH_PROTOCOLS "/etc/protocols" | |
14 | #define _PATH_SERVICES "/etc/services" | |
15 | ||
f3ac96de | 16 | /* |
e775ec98 KB |
17 | * Structures returned by network data base library. All addresses are |
18 | * supplied in host order, and returned in network order (suitable for | |
19 | * use in system calls). | |
f3ac96de SL |
20 | */ |
21 | struct hostent { | |
22 | char *h_name; /* official name of host */ | |
23 | char **h_aliases; /* alias list */ | |
24 | int h_addrtype; /* host address type */ | |
25 | int h_length; /* length of address */ | |
56630706 | 26 | char *h_addr; /* address */ |
f3ac96de SL |
27 | }; |
28 | ||
29 | /* | |
30 | * Assumption here is that a network number | |
31 | * fits in 32 bits -- probably a poor one. | |
32 | */ | |
33 | struct netent { | |
37164239 JL |
34 | char *n_name; /* official name of net */ |
35 | char **n_aliases; /* alias list */ | |
36 | int n_addrtype; /* net address type */ | |
37 | unsigned long n_net; /* network # */ | |
f3ac96de SL |
38 | }; |
39 | ||
40 | struct servent { | |
41 | char *s_name; /* official service name */ | |
42 | char **s_aliases; /* alias list */ | |
43 | int s_port; /* port # */ | |
44 | char *s_proto; /* protocol to use */ | |
45 | }; | |
46 | ||
47 | struct protoent { | |
48 | char *p_name; /* official protocol name */ | |
49 | char **p_aliases; /* alias list */ | |
50 | int p_proto; /* protocol # */ | |
51 | }; | |
52 | ||
53 | struct hostent *gethostbyname(), *gethostbyaddr(), *gethostent(); | |
54 | struct netent *getnetbyname(), *getnetbyaddr(), *getnetent(); | |
55 | struct servent *getservbyname(), *getservbyport(), *getservent(); | |
56 | struct protoent *getprotobyname(), *getprotobynumber(), *getprotoent(); | |
c0bcfdb1 KD |
57 | |
58 | /* | |
59 | * Error return codes from gethostbyname() and gethostbyaddr() | |
8ff78169 | 60 | * (left in extern int h_errno). |
c0bcfdb1 KD |
61 | */ |
62 | ||
8ff78169 | 63 | #define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */ |
c0bcfdb1 KD |
64 | #define TRY_AGAIN 2 /* Non-Authoritive Host not found, or SERVERFAIL */ |
65 | #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ | |
8ff78169 MK |
66 | #define NO_DATA 4 /* Valid name, no data record of requested type */ |
67 | #define NO_ADDRESS NO_DATA /* no address, look for MX record */ |