6 #define SOL_SOCKET 0xFFFF
12 #define AF_UNSPEC PF_UNSPEC
13 #define AF_INET PF_INET
14 #define AF_INET6 PF_INET6
20 #define MSG_OOB 0x0001
21 #define MSG_PEEK 0x0002
22 #define MSG_DONTWAIT 0x0004
23 #define MSG_DONTROUTE 0x0000
24 #define MSG_WAITALL 0x0000
25 #define MSG_MORE 0x0000
26 #define MSG_NOSIGNAL 0x0000
35 #define SO_REUSEADDR 0x0004
36 #define SO_LINGER 0x0080
37 #define SO_OOBINLINE 0x0100
38 #define SO_SNDBUF 0x1001
39 #define SO_RCVBUF 0x1002
40 #define SO_SNDLOWAT 0x1003
41 #define SO_RCVLOWAT 0x1004
42 #define SO_TYPE 0x1008
43 #define SO_ERROR 0x1009
45 #define SO_BROADCAST 0x0000
47 #define _SOCKLEN_T_DECLARED
49 typedef uint32_t socklen_t;
50 typedef uint16_t sa_family_t;
53 sa_family_t sa_family;
59 sa_family_t ss_family;
60 char __ss_padding[26];
72 int accept(
int sockfd,
struct sockaddr *addr, socklen_t *addrlen);
73 int bind(
int sockfd,
const struct sockaddr *addr, socklen_t addrlen);
74 int closesocket(
int sockfd);
75 int connect(
int sockfd,
const struct sockaddr *addr, socklen_t addrlen);
76 int getpeername(
int sockfd,
struct sockaddr *addr, socklen_t *addrlen);
77 int getsockname(
int sockfd,
struct sockaddr *addr, socklen_t *addrlen);
78 int getsockopt(
int sockfd,
int level,
int optname,
void *optval, socklen_t *optlen);
79 int listen(
int sockfd,
int backlog);
80 ssize_t recv(
int sockfd,
void *buf,
size_t len,
int flags);
81 ssize_t recvfrom(
int sockfd,
void *buf,
size_t len,
int flags,
struct sockaddr *src_addr, socklen_t *addrlen);
82 ssize_t send(
int sockfd,
const void *buf,
size_t len,
int flags);
83 ssize_t sendto(
int sockfd,
const void *buf,
size_t len,
int flags,
const struct sockaddr *dest_addr, socklen_t addrlen);
84 int setsockopt(
int sockfd,
int level,
int optname,
const void *optval, socklen_t optlen);
85 int shutdown(
int sockfd,
int how);
86 int socket(
int domain,
int type,
int protocol);
87 int sockatmark(
int sockfd);