sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
socket.h File Reference
#include <stdint.h>
#include <stddef.h>
#include <sys/types.h>
#include <sys/cdefs.h>
#include <unistd.h>
#include <sys/uio.h>
#include <tamtypes.h>

Go to the source code of this file.

Classes

struct  in_addr
struct  t_ip_info
struct  sockaddr
struct  linger
struct  msghdr

Macros

#define SOCKLEN_T_DEFINED
#define T_IP_INFO_DEFINED
#define IOCPARM_MASK   0x7fUL
#define IOC_VOID   0x20000000UL
#define IOC_OUT   0x40000000UL
#define IOC_IN   0x80000000UL
#define IOC_INOUT   (IOC_IN | IOC_OUT)
#define _IO(x, y)
#define _IOR(x, y, t)
#define _IOW(x, y, t)
#define FIONREAD   _IOR('f', 127, unsigned long)
#define FIONBIO   _IOW('f', 126, unsigned long)
#define F_GETFL   3
#define F_SETFL   4
#define O_NONBLOCK   1
#define O_NDELAY   O_NONBLOCK
#define SA_FAMILY_T_DEFINED
#define _SOCKADDR_STRUCT_DEFINED
#define SOCK_STREAM   1
#define SOCK_DGRAM   2
#define SOCK_RAW   3
#define SOCK_RDM   4
#define SOCK_SEQPACKET   5
#define AF_UNSPEC   0
#define AF_LOCAL   1
#define AF_UNIX   AF_LOCAL
#define AF_INET   2
#define AF_INET6   24
#define AF_ROUTE   34
#define AF_MAX   37
#define PF_UNSPEC   AF_UNSPEC
#define PF_LOCAL   AF_LOCAL
#define PF_UNIX   PF_LOCAL
#define PF_INET   AF_INET
#define PF_INET6   AF_INET6
#define PF_ROUTE   AF_ROUTE
#define PF_MAX   AF_MAX
#define SOL_SOCKET   0xffff
#define SO_DEBUG   0x0001
#define SO_ACCEPTCONN   0x0002
#define SO_REUSEADDR   0x0004
#define SO_KEEPALIVE   0x0008
#define SO_DONTROUTE   0x0010
#define SO_BROADCAST   0x0020
#define SO_USELOOPBACK   0x0040
#define SO_LINGER   0x0080
#define SO_OOBINLINE   0x0100
#define SO_REUSEPORT   0x0200
#define SO_SNDBUF   0x1001
#define SO_RCVBUF   0x1002
#define SO_SNDLOWAT   0x1003
#define SO_RCVLOWAT   0x1004
#define SO_ERROR   0x1007
#define SO_TYPE   0x1008
#define SO_SNDTIMEO   0x100b
#define SO_RCVTIMEO   0x100c
#define _LINGER_STRUCT_DEFINED
#define SOMAXCONN   128
#define MSG_TRUNC   0x0000
#define LIBCGLUE_SYS_SOCKET_ALIASES   0

Typedefs

typedef u32 socklen_t

Functions

__BEGIN_DECLS int accept (int, struct sockaddr *__restrict, socklen_t *__restrict)
int bind (int, const struct sockaddr *, socklen_t)
int connect (int, const struct sockaddr *, socklen_t)
int getpeername (int, struct sockaddr *__restrict, socklen_t *__restrict)
int getsockname (int, struct sockaddr *__restrict, socklen_t *__restrict)
int getsockopt (int, int, int, void *__restrict, socklen_t *__restrict)
int listen (int, int)
ssize_t recv (int, void *, size_t, int)
ssize_t recvfrom (int, void *__restrict, size_t, int, struct sockaddr *__restrict, socklen_t *__restrict)
ssize_t recvmsg (int, struct msghdr *, int)
ssize_t send (int, const void *, size_t, int)
ssize_t sendto (int, const void *, size_t, int, const struct sockaddr *, socklen_t)
ssize_t sendmsg (int, const struct msghdr *, int)
int setsockopt (int, int, int, const void *, socklen_t)
int shutdown (int, int)
int socket (int, int, int)
int libcglue_ps2ip_setconfig (const t_ip_info *ip_info)
int libcglue_ps2ip_getconfig (char *netif_name, t_ip_info *ip_info)
void libcglue_dns_setserver (u8 numdns, const ip_addr_t *dnsserver)
const ip_addr_t * libcglue_dns_getserver (u8 numdns)

Macro Definition Documentation

◆ _IO

#define _IO ( x,
y )
Value:
((long)(IOC_VOID | ((x) << 8) | (y)))

Definition at line 178 of file socket.h.

◆ _IOR

#define _IOR ( x,
y,
t )
Value:
((long)(IOC_OUT | ((sizeof(t) & IOCPARM_MASK) << 16) | ((x) << 8) | (y)))

Definition at line 179 of file socket.h.

◆ _IOW

#define _IOW ( x,
y,
t )
Value:
((long)(IOC_IN | ((sizeof(t) & IOCPARM_MASK) << 16) | ((x) << 8) | (y)))

Definition at line 180 of file socket.h.

◆ _LINGER_STRUCT_DEFINED

#define _LINGER_STRUCT_DEFINED

Definition at line 293 of file socket.h.

◆ _SOCKADDR_STRUCT_DEFINED

#define _SOCKADDR_STRUCT_DEFINED

Definition at line 221 of file socket.h.

◆ AF_INET

#define AF_INET   2

Definition at line 251 of file socket.h.

◆ AF_INET6

#define AF_INET6   24

Definition at line 252 of file socket.h.

◆ AF_LOCAL

#define AF_LOCAL   1

Definition at line 249 of file socket.h.

◆ AF_MAX

#define AF_MAX   37

Definition at line 254 of file socket.h.

◆ AF_ROUTE

#define AF_ROUTE   34

Definition at line 253 of file socket.h.

◆ AF_UNIX

#define AF_UNIX   AF_LOCAL

Definition at line 250 of file socket.h.

◆ AF_UNSPEC

#define AF_UNSPEC   0

Definition at line 248 of file socket.h.

◆ F_GETFL

#define F_GETFL   3

Definition at line 191 of file socket.h.

◆ F_SETFL

#define F_SETFL   4

Definition at line 194 of file socket.h.

◆ FIONBIO

#define FIONBIO   _IOW('f', 126, unsigned long)

Definition at line 187 of file socket.h.

◆ FIONREAD

#define FIONREAD   _IOR('f', 127, unsigned long)

Definition at line 184 of file socket.h.

◆ IOC_IN

#define IOC_IN   0x80000000UL

Definition at line 176 of file socket.h.

◆ IOC_INOUT

#define IOC_INOUT   (IOC_IN | IOC_OUT)

Definition at line 177 of file socket.h.

◆ IOC_OUT

#define IOC_OUT   0x40000000UL

Definition at line 175 of file socket.h.

◆ IOC_VOID

#define IOC_VOID   0x20000000UL

Definition at line 174 of file socket.h.

◆ IOCPARM_MASK

#define IOCPARM_MASK   0x7fUL

Definition at line 173 of file socket.h.

◆ LIBCGLUE_SYS_SOCKET_ALIASES

#define LIBCGLUE_SYS_SOCKET_ALIASES   0

Definition at line 948 of file socket.h.

◆ MSG_TRUNC

#define MSG_TRUNC   0x0000

Definition at line 323 of file socket.h.

◆ O_NDELAY

#define O_NDELAY   O_NONBLOCK

Definition at line 201 of file socket.h.

◆ O_NONBLOCK

#define O_NONBLOCK   1

Definition at line 198 of file socket.h.

◆ PF_INET

#define PF_INET   AF_INET

Definition at line 260 of file socket.h.

◆ PF_INET6

#define PF_INET6   AF_INET6

Definition at line 261 of file socket.h.

◆ PF_LOCAL

#define PF_LOCAL   AF_LOCAL

Definition at line 258 of file socket.h.

◆ PF_MAX

#define PF_MAX   AF_MAX

Definition at line 263 of file socket.h.

◆ PF_ROUTE

#define PF_ROUTE   AF_ROUTE

Definition at line 262 of file socket.h.

◆ PF_UNIX

#define PF_UNIX   PF_LOCAL

Definition at line 259 of file socket.h.

◆ PF_UNSPEC

#define PF_UNSPEC   AF_UNSPEC

Definition at line 257 of file socket.h.

◆ SA_FAMILY_T_DEFINED

#define SA_FAMILY_T_DEFINED

Definition at line 216 of file socket.h.

◆ SO_ACCEPTCONN

#define SO_ACCEPTCONN   0x0002

Definition at line 271 of file socket.h.

◆ SO_BROADCAST

#define SO_BROADCAST   0x0020

Definition at line 275 of file socket.h.

◆ SO_DEBUG

#define SO_DEBUG   0x0001

Definition at line 270 of file socket.h.

◆ SO_DONTROUTE

#define SO_DONTROUTE   0x0010

Definition at line 274 of file socket.h.

◆ SO_ERROR

#define SO_ERROR   0x1007

Definition at line 286 of file socket.h.

◆ SO_KEEPALIVE

#define SO_KEEPALIVE   0x0008

Definition at line 273 of file socket.h.

◆ SO_LINGER

#define SO_LINGER   0x0080

Definition at line 277 of file socket.h.

◆ SO_OOBINLINE

#define SO_OOBINLINE   0x0100

Definition at line 278 of file socket.h.

◆ SO_RCVBUF

#define SO_RCVBUF   0x1002

Definition at line 283 of file socket.h.

◆ SO_RCVLOWAT

#define SO_RCVLOWAT   0x1004

Definition at line 285 of file socket.h.

◆ SO_RCVTIMEO

#define SO_RCVTIMEO   0x100c

Definition at line 289 of file socket.h.

◆ SO_REUSEADDR

#define SO_REUSEADDR   0x0004

Definition at line 272 of file socket.h.

◆ SO_REUSEPORT

#define SO_REUSEPORT   0x0200

Definition at line 279 of file socket.h.

◆ SO_SNDBUF

#define SO_SNDBUF   0x1001

Definition at line 282 of file socket.h.

◆ SO_SNDLOWAT

#define SO_SNDLOWAT   0x1003

Definition at line 284 of file socket.h.

◆ SO_SNDTIMEO

#define SO_SNDTIMEO   0x100b

Definition at line 288 of file socket.h.

◆ SO_TYPE

#define SO_TYPE   0x1008

Definition at line 287 of file socket.h.

◆ SO_USELOOPBACK

#define SO_USELOOPBACK   0x0040

Definition at line 276 of file socket.h.

◆ SOCK_DGRAM

#define SOCK_DGRAM   2

Definition at line 241 of file socket.h.

◆ SOCK_RAW

#define SOCK_RAW   3

Definition at line 242 of file socket.h.

◆ SOCK_RDM

#define SOCK_RDM   4

Definition at line 243 of file socket.h.

◆ SOCK_SEQPACKET

#define SOCK_SEQPACKET   5

Definition at line 244 of file socket.h.

◆ SOCK_STREAM

#define SOCK_STREAM   1

Definition at line 240 of file socket.h.

◆ SOCKLEN_T_DEFINED

#define SOCKLEN_T_DEFINED

Definition at line 108 of file socket.h.

◆ SOL_SOCKET

#define SOL_SOCKET   0xffff

Definition at line 267 of file socket.h.

◆ SOMAXCONN

#define SOMAXCONN   128

Definition at line 305 of file socket.h.

◆ T_IP_INFO_DEFINED

#define T_IP_INFO_DEFINED

Definition at line 150 of file socket.h.

Typedef Documentation

◆ socklen_t

typedef u32 socklen_t

Definition at line 109 of file socket.h.

Function Documentation

◆ accept()

__BEGIN_DECLS int accept ( int fd,
struct sockaddr * __restrict,
socklen_t * __restrict )
extern

Definition at line 56 of file socket.c.

◆ bind()

int bind ( int fd,
const struct sockaddr * my_addr,
socklen_t addrlen )
extern

Definition at line 93 of file socket.c.

◆ connect()

int connect ( int fd,
const struct sockaddr * serv_addr,
socklen_t addrlen )
extern

Definition at line 111 of file socket.c.

◆ getpeername()

int getpeername ( int fd,
struct sockaddr * __restrict,
socklen_t * __restrict )
extern

Definition at line 309 of file socket.c.

◆ getsockname()

int getsockname ( int fd,
struct sockaddr * __restrict,
socklen_t * __restrict )
extern

Definition at line 327 of file socket.c.

◆ getsockopt()

int getsockopt ( int fd,
int level,
int optname,
void * __restrict,
socklen_t * __restrict )
extern

Definition at line 255 of file socket.c.

◆ libcglue_dns_getserver()

const ip_addr_t * libcglue_dns_getserver ( u8 numdns)
extern

Definition at line 504 of file ps2sdkapi.c.

◆ libcglue_dns_setserver()

void libcglue_dns_setserver ( u8 numdns,
const ip_addr_t * dnsserver )
extern

Definition at line 495 of file ps2sdkapi.c.

◆ libcglue_ps2ip_getconfig()

int libcglue_ps2ip_getconfig ( char * netif_name,
t_ip_info * ip_info )
extern

Definition at line 485 of file ps2sdkapi.c.

◆ libcglue_ps2ip_setconfig()

int libcglue_ps2ip_setconfig ( const t_ip_info * ip_info)
extern

Definition at line 475 of file ps2sdkapi.c.

◆ listen()

int listen ( int fd,
int backlog )
extern

Definition at line 129 of file socket.c.

◆ recv()

ssize_t recv ( int fd,
void * buf,
size_t len,
int flags )
extern

Definition at line 147 of file socket.c.

◆ recvfrom()

ssize_t recvfrom ( int fd,
void * __restrict,
size_t len,
int flags,
struct sockaddr * __restrict,
socklen_t * __restrict )
extern

Definition at line 165 of file socket.c.

◆ recvmsg()

ssize_t recvmsg ( int fd,
struct msghdr * msg,
int flags )
extern

Definition at line 183 of file socket.c.

◆ send()

ssize_t send ( int fd,
const void * buf,
size_t len,
int flags )
extern

Definition at line 201 of file socket.c.

◆ sendmsg()

ssize_t sendmsg ( int fd,
const struct msghdr * msg,
int flags )
extern

Definition at line 237 of file socket.c.

◆ sendto()

ssize_t sendto ( int fd,
const void * buf,
size_t len,
int flags,
const struct sockaddr * to,
socklen_t tolen )
extern

Definition at line 219 of file socket.c.

◆ setsockopt()

int setsockopt ( int fd,
int level,
int optname,
const void * optval,
socklen_t optlen )
extern

Definition at line 273 of file socket.c.

◆ shutdown()

int shutdown ( int fd,
int how )
extern

Definition at line 291 of file socket.c.

◆ socket()

int socket ( int domain,
int type,
int protocol )
extern

Definition at line 26 of file socket.c.