socket.h
#ifndef NET__SOCKET__H__
#define NET__SOCKET__H__
#include "ipv4.h"
#include "ipv6.h"
int socket_tcp4(void);
int socket_tcp6(void);
int socket_tcp(void);
int socket_udp4(void);
int socket_udp6(void);
int socket_udp(void);
int socket_connect4(int sock, const ipv4addr* ip, ipv4port port);
int socket_connect4_timeout(int sock, const ipv4addr* ip, ipv4port port,
int timeout);
int socket_connect6(int sock, const ipv6addr* ip, ipv6port port);
int socket_connect6_timeout(int sock, const ipv6addr* ip, ipv6port port,
int timeout);
int socket_bind4(int sock, const ipv4addr* ip, ipv4port port);
int socket_bind6(int sock, const ipv6addr* ip, ipv6port port);
int socket_accept4(int sock, ipv4addr* ip, ipv4port* port);
int socket_accept6(int sock, ipv6addr* ip, ipv6port* port);
int socket_recv4(int sock, char* buffer, unsigned buflen,
ipv4addr* ip, ipv4port* port);
int socket_recv6(int sock, char* buffer, unsigned buflen,
ipv6addr* ip, ipv6port* port);
int socket_send4(int sock, const char* buffer, unsigned buflen,
const ipv4addr* ip, ipv4port port);
int socket_send6(int sock, const char* buffer, unsigned buflen,
const ipv6addr* ip, ipv6port port);
int socket_getaddr4(int sock, ipv4addr* ip, ipv4port* port);
int socket_getaddr6(int sock, ipv6addr* ip, ipv6port* port);
int socket_cork(int sock);
int socket_uncork(int sock);
int socket_notcpdelay(int sock, int enable);
int socket_unixdgm(void);
int socket_unixstr(void);
int socket_connectu(int sock, const char* path);
int socket_connectu_timeout(int sock, const char* path, int timeout);
int socket_bindu(int sock, const char* path);
int socket_acceptu(int sock);
int socket_recvu(int sock, char* buffer, unsigned buflen);
int socket_sendu(int sock, const char* buffer, unsigned buflen);
int socket_pairstr(int fd[2]);
int socket_pairdgm(int fd[2]);
int socket_broadcast(int sock);
int socket_connected(int sock);
int socket_linger(int fd, int onoff, int seconds);
int socket_listen(int sock, int backlog);
int socket_reuse(int sock);
int socket_shutdown(int sock, int shut_rd, int shut_wr);
int socket_sendfd(int sock, int fd);
int socket_recvfd(int sock);
#endif
ipv4port
uint16 ipv4port
Definition ipv4.h:16
ipv6port
uint16 ipv6port
Definition ipv6.h:16
socket_getaddr4
int socket_getaddr4(int sock, ipv4addr *ip, ipv4port *port)
Definition getaddr4.c:26
socket_sendfd
int socket_sendfd(int sock, int fd)
Definition sendfd.c:25
socket_accept6
int socket_accept6(int sock, ipv6addr *ip, ipv6port *port)
Definition accept6.c:27
socket_recv4
int socket_recv4(int sock, char *buffer, unsigned buflen, ipv4addr *ip, ipv4port *port)
Definition recv4.c:26
socket_broadcast
int socket_broadcast(int sock)
Definition broadcast.c:24
socket_sendu
int socket_sendu(int sock, const char *buffer, unsigned buflen)
Definition sendu.c:24
socket_pairstr
int socket_pairstr(int fd[2])
Definition pairstr.c:26
socket_linger
int socket_linger(int fd, int onoff, int seconds)
Definition linger.c:24
socket_pairdgm
int socket_pairdgm(int fd[2])
Definition pairdgm.c:26
socket_getaddr6
int socket_getaddr6(int sock, ipv6addr *ip, ipv6port *port)
Definition getaddr6.c:27
socket_reuse
int socket_reuse(int sock)
Definition reuse.c:24
socket_unixdgm
int socket_unixdgm(void)
Definition unixdgm.c:26
socket_notcpdelay
int socket_notcpdelay(int sock, int enable)
Definition notcpdelay.c:35
socket_bind4
int socket_bind4(int sock, const ipv4addr *ip, ipv4port port)
Definition bind4.c:26
socket_recvfd
int socket_recvfd(int sock)
Definition recvfd.c:25
socket_acceptu
int socket_acceptu(int sock)
Definition acceptu.c:25
socket_recvu
int socket_recvu(int sock, char *buffer, unsigned buflen)
Definition recvu.c:24
socket_send6
int socket_send6(int sock, const char *buffer, unsigned buflen, const ipv6addr *ip, ipv6port port)
Definition send6.c:27
socket_connectu_timeout
int socket_connectu_timeout(int sock, const char *path, int timeout)
Definition connectu_timeout.c:27
socket_send4
int socket_send4(int sock, const char *buffer, unsigned buflen, const ipv4addr *ip, ipv4port port)
Definition send4.c:26
socket_udp4
int socket_udp4(void)
Definition udp4.c:26
socket_connect6
int socket_connect6(int sock, const ipv6addr *ip, ipv6port port)
Definition connect6.c:28
socket_connect4_timeout
int socket_connect4_timeout(int sock, const ipv4addr *ip, ipv4port port, int timeout)
Definition connect4_timeout.c:27
socket_bind6
int socket_bind6(int sock, const ipv6addr *ip, ipv6port port)
Definition bind6.c:27
socket_tcp
int socket_tcp(void)
Definition tcp4.c:32
socket_unixstr
int socket_unixstr(void)
Definition unixstr.c:26
socket_udp6
int socket_udp6(void)
Definition udp6.c:27
socket_cork
int socket_cork(int sock)
Definition cork.c:35
socket_tcp6
int socket_tcp6(void)
Definition tcp6.c:27
socket_udp
int socket_udp(void)
Definition udp4.c:32
socket_bindu
int socket_bindu(int sock, const char *path)
Definition bindu.c:27
socket_connectu
int socket_connectu(int sock, const char *path)
Definition connectu.c:27
socket_recv6
int socket_recv6(int sock, char *buffer, unsigned buflen, ipv6addr *ip, ipv6port *port)
Definition recv6.c:27
socket_connected
int socket_connected(int sock)
Definition connected.c:24
socket_tcp4
int socket_tcp4(void)
Definition tcp4.c:26
socket_accept4
int socket_accept4(int sock, ipv4addr *ip, ipv4port *port)
Definition accept4.c:26
socket_shutdown
int socket_shutdown(int sock, int shut_rd, int shut_wr)
Definition shutdown.c:36
socket_connect6_timeout
int socket_connect6_timeout(int sock, const ipv6addr *ip, ipv6port port, int timeout)
Definition connect6_timeout.c:27
socket_connect4
int socket_connect4(int sock, const ipv4addr *ip, ipv4port port)
Definition connect4.c:28
socket_listen
int socket_listen(int sock, int backlog)
Definition listen.c:25
socket_uncork
int socket_uncork(int sock)
Definition uncork.c:26
ipv4addr
Definition ipv4.h:11
ipv6addr
Definition ipv6.h:11