wut v1.8.0
Wii U Toolchain
Loading...
Searching...
No Matches
netdb.h
Go to the documentation of this file.
1#pragma once
2#include <stdint.h>
3#include <sys/socket.h>
4
5extern int h_errno;
6
7struct hostent
8{
9 char *h_name;
10 char **h_aliases;
14#define h_addr h_addr_list[0]
15};
16
17struct servent
18{
19 char *s_name;
20 char **s_aliases;
21 int s_port;
22 char *s_proto;
23};
24
36
37#define NETDB_INTERNAL -1
38#define NETDB_SUCCESS 0
39#define HOST_NOT_FOUND 1
40#define TRY_AGAIN 2
41#define NO_RECOVERY 3
42#define NO_DATA 4
43#define NO_ADDRESS NO_DATA
44
45#define EAI_ADDRFAMILY 1
46#define EAI_AGAIN 2
47#define EAI_BADFLAGS 3
48#define EAI_FAIL 4
49#define EAI_FAMILY 5
50#define EAI_MEMORY 6
51#define EAI_NODATA 7
52#define EAI_NONAME 8
53#define EAI_SERVICE 9
54#define EAI_SOCKTYPE 10
55#define EAI_SYSTEM 11
56#define EAI_BADHINTS 12
57#define EAI_PROTOCOL 13
58#define EAI_OVERFLOW 14
59#define EAI_MAX 15
60
61#define NI_MAXHOST 1025
62#define NI_MAXSERV 32
63
64// nsysnet only implements NI_NOFQDN, NI_NUMERICHOST and NI_NUMERICSERV
65#define NI_NOFQDN 0x0001
66#define NI_NUMERICHOST 0x0002
67#define NI_NAMEREQD 0x0004
68#define NI_NUMERICSERV 0x0008
69#define NI_DGRAM 0x0010
70#define NI_NUMERICSCOPE 0x0020
71
72// nsysnet only implements AI_PASSIVE, AI_CANONNAME and AI_NUMERICHOST
73#define AI_PASSIVE 0x0001
74#define AI_CANONNAME 0x0002
75#define AI_NUMERICHOST 0x0004
76#define AI_V4MAPPED 0x0008
77#define AI_ALL 0x0010
78#define AI_ADDRCONFIG 0x0020
79
80#ifdef __cplusplus
81extern "C" {
82#endif
83
84struct hostent *
85gethostbyname(const char *name);
86
87struct hostent *
88gethostbyaddr(const void *addr,
89 socklen_t len,
90 int type);
91
92struct hostent *
94
95struct servent *
96getservbyname(const char *name,
97 const char *proto);
98
99struct servent *
101 const char *proto);
102
103struct servent *
105
106int
107getaddrinfo(const char *node,
108 const char *service,
109 const struct addrinfo *hints,
110 struct addrinfo **res);
111
112void
114
115int
116getnameinfo(const struct sockaddr *addr,
117 socklen_t addrlen,
118 char *host,
119 socklen_t hostlen,
120 char *serv,
121 socklen_t servlen,
122 int flags);
123
124const char *
125gai_strerror(int ecode);
126
127#ifdef __cplusplus
128}
129#endif
char ** h_addr_list
Definition netdb.h:13
struct servent * getservbyport(int port, const char *proto)
struct sockaddr * ai_addr
Definition netdb.h:33
socklen_t ai_addrlen
Definition netdb.h:31
int getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res)
int ai_socktype
Definition netdb.h:29
int h_errno
char * h_name
Definition netdb.h:9
void freeaddrinfo(struct addrinfo *res)
struct hostent * gethostent(void)
int ai_family
Definition netdb.h:28
char * s_proto
Definition netdb.h:22
int getnameinfo(const struct sockaddr *addr, socklen_t addrlen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, int flags)
int s_port
Definition netdb.h:21
int ai_protocol
Definition netdb.h:30
char * s_name
Definition netdb.h:19
const char * gai_strerror(int ecode)
char ** s_aliases
Definition netdb.h:20
int h_addrtype
Definition netdb.h:11
int ai_flags
Definition netdb.h:27
struct servent * getservbyname(const char *name, const char *proto)
char * ai_canonname
Definition netdb.h:32
struct servent * getservent(void)
int h_length
Definition netdb.h:12
struct addrinfo * ai_next
Definition netdb.h:34
struct hostent * gethostbyaddr(const void *addr, socklen_t len, int type)
struct hostent * gethostbyname(const char *name)
char ** h_aliases
Definition netdb.h:10
Definition netdb.h:8
uint32_t socklen_t
Definition socket.h:56