sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
inet.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_ARPA_INET_H
16#define LIBCGLUE_ARPA_INET_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. ip4_addr_t (used only by pointer below, a forward
23 * reference is enough) already comes from <sys/socket.h>. Found for
24 * real building ps2_drivers's tcp_burst_client_ee sample, the first
25 * real external consumer to include this header far enough to hit
26 * the conflict. */
27#include <sys/socket.h>
28
29#ifndef LIBCGLUE_ARPA_INET_NO_ALIASES
30#define inet_addr(cp) libcglue_inet_addr(cp)
31#define inet_ntoa(addr) libcglue_inet_ntoa((const ip4_addr_t*)&(addr))
32#define inet_ntoa_r(addr, buf, buflen) libcglue_inet_ntoa_r((const ip4_addr_t*)&(addr), buf, buflen)
33#define inet_aton(cp, addr) libcglue_inet_aton(cp, (ip4_addr_t*)addr)
34#endif
35
36__BEGIN_DECLS
37extern u32 libcglue_inet_addr(const char *cp);
38extern char *libcglue_inet_ntoa(const ip4_addr_t *addr);
39extern char *libcglue_inet_ntoa_r(const ip4_addr_t *addr, char *buf, int buflen);
40extern int libcglue_inet_aton(const char *cp, ip4_addr_t *addr);
41__END_DECLS
42
43#endif
struct ip4_addr ip4_addr_t
Definition ps2ip_rpc.h:41