-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathnetdb.h
58 lines (53 loc) · 2.65 KB
/
netdb.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <stdint.h>
struct hostent {
char *h_name; // Official name of the host.
char **h_aliases; // A pointer to an array of pointers to alternative host names, terminated by a null pointer.
int32_t h_addrtype; // Address type.
int32_t h_length; // The length, in bytes, of the address.
char **h_addr_list; // A pointer to an array of pointers to network addresses (in network byte order) for the host, terminated by a null pointer.
};
struct netent {
char *n_name; // Official, fully-qualified (including the domain) name of the host.
char **n_aliases; // A pointer to an array of pointers to alternative network names, terminated by a null pointer.
int n_addrtype; // The address type of the network.
uint32_t n_net; // The network number, in host byte order.
};
struct protoent {
char *p_name; // Official name of the protocol.
char **p_aliases; // A pointer to an array of pointers to alternative protocol names, terminated by a null pointer.
int p_proto; // The protocol number.
};
struct servent {
char *s_name; // Official name of the service.
char **s_aliases; // A pointer to an array of pointers to alternative service names, terminated by a null pointer.
int s_port; // The port number at which the service resides, in network byte order.
char *s_proto; // The name of the protocol to use when contacting the service.
};
void endhostent(void);
void endnetent(void);
void endprotoent(void);
void endservent(void);
void freeaddrinfo(struct addrinfo *);
const char *gai_strerror(int);
int getaddrinfo(const char *restrict, const char *restrict,
const struct addrinfo *restrict,
struct addrinfo **restrict);
struct hostent *gethostbyaddr(const void *, socklen_t, int);
struct hostent *gethostbyname(const char *);
struct hostent *gethostent(void);
int getnameinfo(const struct sockaddr *restrict, socklen_t,
char *restrict, socklen_t, char *restrict,
socklen_t, int);
struct netent *getnetbyaddr(uint32_t, int);
struct netent *getnetbyname(const char *);
struct netent *getnetent(void);
struct protoent *getprotobyname(const char *);
struct protoent *getprotobynumber(int);
struct protoent *getprotoent(void);
struct servent *getservbyname(const char *, const char *);
struct servent *getservbyport(int, const char *);
struct servent *getservent(void);
void sethostent(int);
void setnetent(int);
void setprotoent(int);
void setservent(int);