sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
netdb.h
Go to the documentation of this file.
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright ps2dev - http://www.ps2dev.org
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
15#ifndef LIBCGLUE_NETDB_H
16#define LIBCGLUE_NETDB_H
17
18#include <sys/cdefs.h>
19/* Used to be a blanket #include <tcpip.h> - see libcglue's own
20 * sys/socket.h for the full story on why that header is real,
21 * pre-lwip-migration technical debt that conflicts with ps2ip's real
22 * lwip headers. struct hostent/struct addrinfo are only ever used by
23 * pointer below - real, file-scope forward declarations instead
24 * (same reasoning, and the same "declared inside parameter list"
25 * hazard, as ps2sdkapi.h's own - see that file's comment on why a
26 * shared, real tag is needed rather than none at all). */
27/* Error codes, numbered like lwip's so values from the ps2ip stack pass through unchanged. */
28#ifndef EAI_NONAME
29#define EAI_NONAME 200
30#define EAI_SERVICE 201
31#define EAI_FAIL 202
32#define EAI_MEMORY 203
33#define EAI_FAMILY 204
34#endif
35#ifndef HOST_NOT_FOUND
36#define HOST_NOT_FOUND 210
37#define NO_DATA 211
38#define NO_ADDRESS NO_DATA
39#define NO_RECOVERY 212
40#define TRY_AGAIN 213
41#endif
42
43struct hostent;
44struct addrinfo;
45
46__BEGIN_DECLS
47extern struct hostent *gethostbyaddr(const void *addr, int len, int type);
48extern struct hostent *gethostbyname(const char *name);
49extern int gethostbyname_r(const char *name, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop);
50extern void freeaddrinfo(struct addrinfo *ai);
51extern int getaddrinfo(const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res);
52__END_DECLS
53
54#endif