bglibs
socket.h
1 #ifndef NET__SOCKET__H__
2 #define NET__SOCKET__H__
3 
4 #include "ipv4.h"
5 #include "ipv6.h"
6 
22 int socket_tcp4(void);
23 int socket_tcp6(void);
24 int socket_tcp(void);
25 int socket_udp4(void);
26 int socket_udp6(void);
27 int socket_udp(void);
28 int socket_connect4(int sock, const ipv4addr* ip, ipv4port port);
29 int socket_connect4_timeout(int sock, const ipv4addr* ip, ipv4port port,
30  int timeout);
31 int socket_connect6(int sock, const ipv6addr* ip, ipv6port port);
32 int socket_connect6_timeout(int sock, const ipv6addr* ip, ipv6port port,
33  int timeout);
34 int socket_bind4(int sock, const ipv4addr* ip, ipv4port port);
35 int socket_bind6(int sock, const ipv6addr* ip, ipv6port port);
36 int socket_accept4(int sock, ipv4addr* ip, ipv4port* port);
37 int socket_accept6(int sock, ipv6addr* ip, ipv6port* port);
38 int socket_recv4(int sock, char* buffer, unsigned buflen,
39  ipv4addr* ip, ipv4port* port);
40 int socket_recv6(int sock, char* buffer, unsigned buflen,
41  ipv6addr* ip, ipv6port* port);
42 int socket_send4(int sock, const char* buffer, unsigned buflen,
43  const ipv4addr* ip, ipv4port port);
44 int socket_send6(int sock, const char* buffer, unsigned buflen,
45  const ipv6addr* ip, ipv6port port);
46 int socket_getaddr4(int sock, ipv4addr* ip, ipv4port* port);
47 int socket_getaddr6(int sock, ipv6addr* ip, ipv6port* port);
48 int socket_cork(int sock);
49 int socket_uncork(int sock);
50 int socket_notcpdelay(int sock, int enable);
55 int socket_unixdgm(void);
56 int socket_unixstr(void);
57 int socket_connectu(int sock, const char* path);
58 int socket_connectu_timeout(int sock, const char* path, int timeout);
59 int socket_bindu(int sock, const char* path);
60 int socket_acceptu(int sock);
61 int socket_recvu(int sock, char* buffer, unsigned buflen);
62 int socket_sendu(int sock, const char* buffer, unsigned buflen);
63 
64 int socket_pairstr(int fd[2]);
65 int socket_pairdgm(int fd[2]);
70 int socket_broadcast(int sock);
71 int socket_connected(int sock);
72 int socket_linger(int fd, int onoff, int seconds);
73 int socket_listen(int sock, int backlog);
74 int socket_reuse(int sock);
75 int socket_shutdown(int sock, int shut_rd, int shut_wr);
76 
77 int socket_sendfd(int sock, int fd);
78 int socket_recvfd(int sock);
83 #endif
int socket_tcp(void)
Definition: tcp4.c:32
int socket_bind6(int sock, const ipv6addr *ip, ipv6port port)
Definition: bind6.c:27
int socket_listen(int sock, int backlog)
Definition: listen.c:25
int socket_send6(int sock, const char *buffer, unsigned buflen, const ipv6addr *ip, ipv6port port)
Definition: send6.c:27
int socket_udp6(void)
Definition: udp6.c:27
int socket_pairdgm(int fd[2])
Definition: pairdgm.c:26
int socket_recvu(int sock, char *buffer, unsigned buflen)
Definition: recvu.c:24
int socket_sendu(int sock, const char *buffer, unsigned buflen)
Definition: sendu.c:24
int socket_shutdown(int sock, int shut_rd, int shut_wr)
Definition: shutdown.c:36
int socket_notcpdelay(int sock, int enable)
Definition: notcpdelay.c:35
int socket_connectu(int sock, const char *path)
Definition: connectu.c:27
int socket_connect6(int sock, const ipv6addr *ip, ipv6port port)
Definition: connect6.c:28
int socket_unixstr(void)
Definition: unixstr.c:26
int socket_accept6(int sock, ipv6addr *ip, ipv6port *port)
Definition: accept6.c:27
Definition: ipv6.h:11
int socket_connect6_timeout(int sock, const ipv6addr *ip, ipv6port port, int timeout)
Definition: connect6_timeout.c:27
int socket_uncork(int sock)
Definition: uncork.c:26
int socket_linger(int fd, int onoff, int seconds)
Definition: linger.c:24
int socket_acceptu(int sock)
Definition: acceptu.c:25
int socket_getaddr4(int sock, ipv4addr *ip, ipv4port *port)
Definition: getaddr4.c:26
int socket_connect4(int sock, const ipv4addr *ip, ipv4port port)
Definition: connect4.c:28
int socket_accept4(int sock, ipv4addr *ip, ipv4port *port)
Definition: accept4.c:26
int socket_tcp4(void)
Definition: tcp4.c:26
int socket_bind4(int sock, const ipv4addr *ip, ipv4port port)
Definition: bind4.c:26
int socket_unixdgm(void)
Definition: unixdgm.c:26
int socket_send4(int sock, const char *buffer, unsigned buflen, const ipv4addr *ip, ipv4port port)
Definition: send4.c:26
int socket_udp(void)
Definition: udp4.c:32
int socket_connectu_timeout(int sock, const char *path, int timeout)
Definition: connectu_timeout.c:27
int socket_broadcast(int sock)
Definition: broadcast.c:24
int socket_bindu(int sock, const char *path)
Definition: bindu.c:27
uint16 ipv6port
Definition: ipv6.h:16
Definition: ipv4.h:11
int socket_reuse(int sock)
Definition: reuse.c:24
int socket_tcp6(void)
Definition: tcp6.c:27
int socket_sendfd(int sock, int fd)
Definition: sendfd.c:25
int socket_connected(int sock)
Definition: connected.c:24
int socket_recvfd(int sock)
Definition: recvfd.c:25
int socket_connect4_timeout(int sock, const ipv4addr *ip, ipv4port port, int timeout)
Definition: connect4_timeout.c:27
int socket_udp4(void)
Definition: udp4.c:26
int socket_pairstr(int fd[2])
Definition: pairstr.c:26
int socket_recv4(int sock, char *buffer, unsigned buflen, ipv4addr *ip, ipv4port *port)
Definition: recv4.c:26
uint16 ipv4port
Definition: ipv4.h:16
int socket_recv6(int sock, char *buffer, unsigned buflen, ipv6addr *ip, ipv6port *port)
Definition: recv6.c:27
int socket_cork(int sock)
Definition: cork.c:35
int socket_getaddr6(int sock, ipv6addr *ip, ipv6port *port)
Definition: getaddr6.c:27