My Project
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
socket.h File Reference
#include <stdint.h>
#include <sys/time.h>

Go to the source code of this file.

Data Structures

struct  sockaddr
 
struct  sockaddr_storage
 
struct  linger
 

Macros

#define SOL_SOCKET   0xFFFF
 
#define PF_UNSPEC   0
 
#define PF_INET   2
 
#define PF_INET6   10
 
#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_CTRUNC   0x01000000
 
#define MSG_DONTROUTE   0x02000000
 
#define MSG_EOR   0x04000000
 
#define MSG_OOB   0x08000000
 
#define MSG_PEEK   0x10000000
 
#define MSG_TRUNC   0x20000000
 
#define MSG_WAITALL   0x40000000
 
#define SHUT_RD   0
 
#define SHUT_WR   1
 
#define SHUT_RDWR   2
 
#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_SNDTIMEO   0x1005
 
#define SO_RCVTIMEO   0x1006
 
#define SO_ERROR   0x1007
 
#define SO_TYPE   0x1008
 

Typedefs

typedef uint32_t socklen_t
 
typedef uint16_t sa_family_t
 

Functions

int accept (int sockfd, struct sockaddr *addr, socklen_t *addrlen)
 
int bind (int sockfd, const struct sockaddr *addr, socklen_t addrlen)
 
int closesocket (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)
 
ssize_t recv (int sockfd, void *buf, size_t len, int flags)
 
ssize_t recvfrom (int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen)
 
ssize_t send (int sockfd, const void *buf, size_t len, int flags)
 
ssize_t 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 sockatmark (int sockfd)
 

Macro Definition Documentation

#define AF_INET   PF_INET

Definition at line 13 of file socket.h.

#define AF_INET6   PF_INET6

Definition at line 14 of file socket.h.

#define AF_UNSPEC   PF_UNSPEC

Definition at line 12 of file socket.h.

#define MSG_CTRUNC   0x01000000

Definition at line 19 of file socket.h.

#define MSG_DONTROUTE   0x02000000

Definition at line 20 of file socket.h.

#define MSG_EOR   0x04000000

Definition at line 21 of file socket.h.

#define MSG_OOB   0x08000000

Definition at line 22 of file socket.h.

#define MSG_PEEK   0x10000000

Definition at line 23 of file socket.h.

#define MSG_TRUNC   0x20000000

Definition at line 24 of file socket.h.

#define MSG_WAITALL   0x40000000

Definition at line 25 of file socket.h.

#define PF_INET   2

Definition at line 9 of file socket.h.

#define PF_INET6   10

Definition at line 10 of file socket.h.

#define PF_UNSPEC   0

Definition at line 8 of file socket.h.

#define SHUT_RD   0

Definition at line 27 of file socket.h.

#define SHUT_RDWR   2

Definition at line 29 of file socket.h.

#define SHUT_WR   1

Definition at line 28 of file socket.h.

#define SO_ACCEPTCONN   0x0002

Definition at line 32 of file socket.h.

#define SO_BROADCAST   0x0020

Definition at line 36 of file socket.h.

#define SO_DEBUG   0x0001

Definition at line 31 of file socket.h.

#define SO_DONTROUTE   0x0010

Definition at line 35 of file socket.h.

#define SO_ERROR   0x1007

Definition at line 47 of file socket.h.

#define SO_KEEPALIVE   0x0008

Definition at line 34 of file socket.h.

#define SO_LINGER   0x0080

Definition at line 38 of file socket.h.

#define SO_OOBINLINE   0x0100

Definition at line 39 of file socket.h.

#define SO_RCVBUF   0x1002

Definition at line 42 of file socket.h.

#define SO_RCVLOWAT   0x1004

Definition at line 44 of file socket.h.

#define SO_RCVTIMEO   0x1006

Definition at line 46 of file socket.h.

#define SO_REUSEADDR   0x0004

Definition at line 33 of file socket.h.

#define SO_REUSEPORT   0x0200

Definition at line 40 of file socket.h.

#define SO_SNDBUF   0x1001

Definition at line 41 of file socket.h.

#define SO_SNDLOWAT   0x1003

Definition at line 43 of file socket.h.

#define SO_SNDTIMEO   0x1005

Definition at line 45 of file socket.h.

#define SO_TYPE   0x1008

Definition at line 48 of file socket.h.

#define SO_USELOOPBACK   0x0040

Definition at line 37 of file socket.h.

#define SOCK_DGRAM   2

Definition at line 17 of file socket.h.

#define SOCK_STREAM   1

Definition at line 16 of file socket.h.

#define SOL_SOCKET   0xFFFF

Definition at line 6 of file socket.h.

Typedef Documentation

typedef uint16_t sa_family_t

Definition at line 51 of file socket.h.

typedef uint32_t socklen_t

Definition at line 50 of file socket.h.

Function Documentation

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

Definition at line 4 of file soc_accept.c.

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

Definition at line 5 of file soc_bind.c.

int closesocket ( int  sockfd)

Definition at line 4 of file soc_closesocket.c.

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

Definition at line 5 of file soc_connect.c.

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

Definition at line 4 of file soc_getpeername.c.

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

Definition at line 4 of file soc_getsockname.c.

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

Definition at line 4 of file soc_getsockopt.c.

int listen ( int  sockfd,
int  backlog 
)

Definition at line 4 of file soc_listen.c.

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

Definition at line 4 of file soc_recv.c.

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

Definition at line 103 of file soc_recvfrom.c.

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

Definition at line 4 of file soc_send.c.

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

Definition at line 109 of file soc_sendto.c.

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

Definition at line 4 of file soc_setsockopt.c.

int shutdown ( int  sockfd,
int  how 
)

Definition at line 4 of file soc_shutdown.c.

int sockatmark ( int  sockfd)

Definition at line 4 of file soc_sockatmark.c.

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

Definition at line 4 of file soc_socket.c.