Commit | Line | Data |
---|---|---|
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 | * | |
be3764b5 | 6 | * @(#)netdb.h 5.2 (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 | */ | |
16 | struct 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 KD |
21 | char **h_addr_list; /* list of addresses from name server */ |
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 | */ | |
29 | struct 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 | ||
36 | struct 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 | ||
43 | struct protoent { | |
44 | char *p_name; /* official protocol name */ | |
45 | char **p_aliases; /* alias list */ | |
46 | int p_proto; /* protocol # */ | |
47 | }; | |
48 | ||
49 | struct hostent *gethostbyname(), *gethostbyaddr(), *gethostent(); | |
50 | struct netent *getnetbyname(), *getnetbyaddr(), *getnetent(); | |
51 | struct servent *getservbyname(), *getservbyport(), *getservent(); | |
52 | struct protoent *getprotobyname(), *getprotobynumber(), *getprotoent(); |