wut  1.0.0-beta9
Wii U Toolchain
Data Structures | Macros | Typedefs | Functions
Socket

Data Structures

struct  sockaddr
 
struct  sockaddr_storage
 
struct  linger
 
struct  in_addr
 
struct  sockaddr_in
 

Macros

#define SOL_SOCKET   -1
 
#define INADDR_ANY   0
 
#define INADDR_BROADCAST   0xFFFFFFFF
 
#define PF_UNSPEC   0
 
#define PF_INET   2
 
#define PF_INET6   23
 
#define AF_UNSPEC   PF_UNSPEC
 
#define AF_INET   PF_INET
 
#define AF_INET6   PF_INET6
 
#define SOCK_STREAM   1
 
#define SOCK_DGRAM   2
 
#define MSG_OOB   0x0001
 
#define MSG_PEEK   0x0002
 
#define MSG_DONTROUTE   0x0004
 
#define MSG_DONTWAIT   0x0020
 
#define SHUT_RD   0
 
#define SHUT_WR   1
 
#define SHUT_RDWR   2
 
#define IPPROTO_IP   0
 
#define IPPROTO_TCP   6
 
#define IPPROTO_UDP   17
 
#define SO_REUSEADDR   0x0004
 
#define SO_BROADCAST   0x0020
 
#define SO_LINGER   0x0080
 
#define SO_OOBINLINE   0x0100
 
#define SO_TCPSACK   0x0200
 
#define SO_WINSCALE   0x0400
 
#define SO_SNDBUF   0x1001
 
#define SO_RCVBUF   0x1002
 
#define SO_SNDLOWAT   0x1003
 
#define SO_RCVLOWAT   0x1004
 
#define SO_TYPE   0x1008
 
#define SO_ERROR   0x1009
 
#define SO_NBIO   0x1014
 
#define SO_BIO   0x1015
 
#define SO_NONBLOCK   0x1016
 
#define NSN_EAGAIN   6
 
#define NSN_EWOULDBLOCK   6
 

Typedefs

typedef uint32_t socklen_t
 
typedef uint16_t sa_family_t
 

Functions

void socket_lib_init ()
 
void socket_lib_finish ()
 
int accept (int sockfd, struct sockaddr *addr, socklen_t *addrlen)
 
int bind (int sockfd, const struct sockaddr *addr, socklen_t addrlen)
 
int socketclose (int sockfd)
 
int connect (int sockfd, const struct sockaddr *addr, socklen_t addrlen)
 
int getpeername (int sockfd, struct sockaddr *addr, socklen_t *addrlen)
 
int getsockname (int sockfd, struct sockaddr *addr, socklen_t *addrlen)
 
int getsockopt (int sockfd, int level, int optname, void *optval, socklen_t *optlen)
 
int listen (int sockfd, int backlog)
 
int recv (int sockfd, void *buf, size_t len, int flags)
 
int recvfrom (int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen)
 
int send (int sockfd, const void *buf, size_t len, int flags)
 
int sendto (int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen)
 
int setsockopt (int sockfd, int level, int optname, const void *optval, socklen_t optlen)
 
int shutdown (int sockfd, int how)
 
int socket (int domain, int type, int protocol)
 
int select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
 
const char * inet_ntoa (struct in_addr in)
 
int inet_aton (const char *cp, struct in_addr *inp)
 
int socketlasterr ()
 
uint32_t htonl (uint32_t val)
 
uint16_t htons (uint16_t val)
 
uint32_t ntohl (uint32_t val)
 
uint16_t ntohs (uint16_t val)
 

Detailed Description


Data Structure Documentation

◆ sockaddr

struct sockaddr

Definition at line 77 of file socket.h.

Data Fields
sa_family_t sa_family
char sa_data[]

◆ sockaddr_storage

struct sockaddr_storage

Definition at line 83 of file socket.h.

Data Fields
sa_family_t ss_family
char ss_padding[14]

◆ linger

struct linger

Definition at line 89 of file socket.h.

Data Fields
int l_onoff
int l_linger

◆ in_addr

struct in_addr

Definition at line 95 of file socket.h.

Data Fields
unsigned int s_addr

◆ sockaddr_in

struct sockaddr_in

Definition at line 100 of file socket.h.

Data Fields
unsigned short sin_family
unsigned short sin_port
struct in_addr sin_addr
char sin_zero[8]

Macro Definition Documentation

◆ SOL_SOCKET

#define SOL_SOCKET   -1

Definition at line 19 of file socket.h.

◆ INADDR_ANY

#define INADDR_ANY   0

Definition at line 21 of file socket.h.

◆ INADDR_BROADCAST

#define INADDR_BROADCAST   0xFFFFFFFF

Definition at line 22 of file socket.h.

◆ PF_UNSPEC

#define PF_UNSPEC   0

Definition at line 24 of file socket.h.

◆ PF_INET

#define PF_INET   2

Definition at line 25 of file socket.h.

◆ PF_INET6

#define PF_INET6   23

Definition at line 26 of file socket.h.

◆ AF_UNSPEC

#define AF_UNSPEC   PF_UNSPEC

Definition at line 28 of file socket.h.

◆ AF_INET

#define AF_INET   PF_INET

Definition at line 29 of file socket.h.

◆ AF_INET6

#define AF_INET6   PF_INET6

Definition at line 30 of file socket.h.

◆ SOCK_STREAM

#define SOCK_STREAM   1

Definition at line 32 of file socket.h.

◆ SOCK_DGRAM

#define SOCK_DGRAM   2

Definition at line 33 of file socket.h.

◆ MSG_OOB

#define MSG_OOB   0x0001

Definition at line 35 of file socket.h.

◆ MSG_PEEK

#define MSG_PEEK   0x0002

Definition at line 36 of file socket.h.

◆ MSG_DONTROUTE

#define MSG_DONTROUTE   0x0004

Definition at line 37 of file socket.h.

◆ MSG_DONTWAIT

#define MSG_DONTWAIT   0x0020

Definition at line 38 of file socket.h.

◆ SHUT_RD

#define SHUT_RD   0

Definition at line 40 of file socket.h.

◆ SHUT_WR

#define SHUT_WR   1

Definition at line 41 of file socket.h.

◆ SHUT_RDWR

#define SHUT_RDWR   2

Definition at line 42 of file socket.h.

◆ IPPROTO_IP

#define IPPROTO_IP   0

Definition at line 44 of file socket.h.

◆ IPPROTO_TCP

#define IPPROTO_TCP   6

Definition at line 45 of file socket.h.

◆ IPPROTO_UDP

#define IPPROTO_UDP   17

Definition at line 46 of file socket.h.

◆ SO_REUSEADDR

#define SO_REUSEADDR   0x0004

Definition at line 51 of file socket.h.

◆ SO_BROADCAST

#define SO_BROADCAST   0x0020

Definition at line 52 of file socket.h.

◆ SO_LINGER

#define SO_LINGER   0x0080

Definition at line 53 of file socket.h.

◆ SO_OOBINLINE

#define SO_OOBINLINE   0x0100

Definition at line 54 of file socket.h.

◆ SO_TCPSACK

#define SO_TCPSACK   0x0200

Definition at line 55 of file socket.h.

◆ SO_WINSCALE

#define SO_WINSCALE   0x0400

Definition at line 56 of file socket.h.

◆ SO_SNDBUF

#define SO_SNDBUF   0x1001

Definition at line 57 of file socket.h.

◆ SO_RCVBUF

#define SO_RCVBUF   0x1002

Definition at line 58 of file socket.h.

◆ SO_SNDLOWAT

#define SO_SNDLOWAT   0x1003

Definition at line 59 of file socket.h.

◆ SO_RCVLOWAT

#define SO_RCVLOWAT   0x1004

Definition at line 60 of file socket.h.

◆ SO_TYPE

#define SO_TYPE   0x1008

Definition at line 61 of file socket.h.

◆ SO_ERROR

#define SO_ERROR   0x1009

Definition at line 62 of file socket.h.

◆ SO_NBIO

#define SO_NBIO   0x1014

Definition at line 63 of file socket.h.

◆ SO_BIO

#define SO_BIO   0x1015

Definition at line 64 of file socket.h.

◆ SO_NONBLOCK

#define SO_NONBLOCK   0x1016

Definition at line 65 of file socket.h.

◆ NSN_EAGAIN

#define NSN_EAGAIN   6

Definition at line 71 of file socket.h.

◆ NSN_EWOULDBLOCK

#define NSN_EWOULDBLOCK   6

Definition at line 72 of file socket.h.

Typedef Documentation

◆ socklen_t

typedef uint32_t socklen_t

Definition at line 74 of file socket.h.

◆ sa_family_t

typedef uint16_t sa_family_t

Definition at line 75 of file socket.h.

Function Documentation

◆ socket_lib_init()

void socket_lib_init ( )

◆ socket_lib_finish()

void socket_lib_finish ( )

◆ accept()

int accept ( int  sockfd,
struct sockaddr addr,
socklen_t addrlen 
)

◆ bind()

int bind ( int  sockfd,
const struct sockaddr addr,
socklen_t  addrlen 
)

◆ socketclose()

int socketclose ( int  sockfd)

◆ connect()

int connect ( int  sockfd,
const struct sockaddr addr,
socklen_t  addrlen 
)

◆ getpeername()

int getpeername ( int  sockfd,
struct sockaddr addr,
socklen_t addrlen 
)

◆ getsockname()

int getsockname ( int  sockfd,
struct sockaddr addr,
socklen_t addrlen 
)

◆ getsockopt()

int getsockopt ( int  sockfd,
int  level,
int  optname,
void *  optval,
socklen_t optlen 
)

◆ listen()

int listen ( int  sockfd,
int  backlog 
)

◆ recv()

int recv ( int  sockfd,
void *  buf,
size_t  len,
int  flags 
)

◆ recvfrom()

int recvfrom ( int  sockfd,
void *  buf,
size_t  len,
int  flags,
struct sockaddr src_addr,
socklen_t addrlen 
)

◆ send()

int send ( int  sockfd,
const void *  buf,
size_t  len,
int  flags 
)

◆ sendto()

int sendto ( int  sockfd,
const void *  buf,
size_t  len,
int  flags,
const struct sockaddr dest_addr,
socklen_t  addrlen 
)

◆ setsockopt()

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

◆ shutdown()

int shutdown ( int  sockfd,
int  how 
)

◆ socket()

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

◆ select()

int select ( int  nfds,
fd_set *  readfds,
fd_set *  writefds,
fd_set *  exceptfds,
struct timeval *  timeout 
)

◆ inet_ntoa()

const char* inet_ntoa ( struct in_addr  in)

◆ inet_aton()

int inet_aton ( const char *  cp,
struct in_addr inp 
)

◆ socketlasterr()

int socketlasterr ( )

◆ htonl()

uint32_t htonl ( uint32_t  val)

◆ htons()

uint16_t htons ( uint16_t  val)

◆ ntohl()

uint32_t ntohl ( uint32_t  val)

◆ ntohs()

uint16_t ntohs ( uint16_t  val)