doc "type" param of getnetbyaddr; n_net is uinsigned long, not int.
[unix-history] / usr / src / include / netdb.h
CommitLineData
5efaa119
KM
1/*
2 * Copyright (c) 1980 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 *
d492c426 6 * @(#)netdb.h 5.5 (Berkeley) %G%
5efaa119
KM
7 */
8
f3ac96de
SL
9/*
10 * Structures returned by network
11 * data base library. All addresses
12 * are supplied in host order, and
13 * returned in network order (suitable
14 * for use in system calls).
15 */
16struct hostent {
17 char *h_name; /* official name of host */
18 char **h_aliases; /* alias list */
19 int h_addrtype; /* host address type */
20 int h_length; /* length of address */
be3764b5 21 char **h_addr_list; /* list of addresses from name server */
84156e4e 22#define h_addr h_addr_list[0] /* address, for backward compatiblity */
f3ac96de
SL
23};
24
25/*
26 * Assumption here is that a network number
27 * fits in 32 bits -- probably a poor one.
28 */
29struct netent {
30 char *n_name; /* official name of net */
31 char **n_aliases; /* alias list */
32 int n_addrtype; /* net address type */
33 int n_net; /* network # */
34};
35
36struct servent {
37 char *s_name; /* official service name */
38 char **s_aliases; /* alias list */
39 int s_port; /* port # */
40 char *s_proto; /* protocol to use */
41};
42
43struct protoent {
44 char *p_name; /* official protocol name */
45 char **p_aliases; /* alias list */
46 int p_proto; /* protocol # */
47};
48
49struct hostent *gethostbyname(), *gethostbyaddr(), *gethostent();
50struct netent *getnetbyname(), *getnetbyaddr(), *getnetent();
51struct servent *getservbyname(), *getservbyport(), *getservent();
52struct protoent *getprotobyname(), *getprotobynumber(), *getprotoent();
c0bcfdb1
KD
53
54/*
55 * Error return codes from gethostbyname() and gethostbyaddr()
56 */
57
58extern int h_errno;
59
60#define HOST_NOT_FOUND 1 /* Authoritive Answer Host not found */
61#define TRY_AGAIN 2 /* Non-Authoritive Host not found, or SERVERFAIL */
62#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
d492c426 63#define NO_ADDRESS 4 /* Valid host name, no address, look for MF record */