diff options
Diffstat (limited to 'ot_socket.h')
| -rw-r--r-- | ot_socket.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ot_socket.h b/ot_socket.h index 20fd839..21d04b1 100644 --- a/ot_socket.h +++ b/ot_socket.h | |||
| @@ -15,13 +15,14 @@ | |||
| 15 | cleared, so one descriptor serves both families and an IPv4 peer arrives | 15 | cleared, so one descriptor serves both families and an IPv4 peer arrives |
| 16 | as the v4 mapped address */ | 16 | as the v4 mapped address */ |
| 17 | 17 | ||
| 18 | /* Ask the kernel to let several processes bind the same address */ | 18 | /* How an address may be shared with other sockets. Which socket option says |
| 19 | extern int g_socket_reuseport; | 19 | so differs between kernels, which is socket_set_sharing's business */ |
| 20 | typedef enum { SOCKET_EXCLUSIVE, SOCKET_SHARED } socket_sharing; | ||
| 20 | 21 | ||
| 21 | /* Create, bind and, for TCP, listen. The returned socket is non blocking | 22 | /* Create, bind and, for TCP, listen. The returned socket is non blocking |
| 22 | Returns -1 on failure with errno set */ | 23 | Returns -1 on failure with errno set */ |
| 23 | int socket_tcp_listen(const ot_ip6 ip, uint16_t port); | 24 | int socket_tcp_listen(const ot_ip6 ip, uint16_t port, socket_sharing sharing); |
| 24 | int socket_udp_bind(const ot_ip6 ip, uint16_t port); | 25 | int socket_udp_bind(const ot_ip6 ip, uint16_t port, socket_sharing sharing); |
| 25 | 26 | ||
| 26 | int socket_tcp_connect(const ot_ip6 srcip, uint16_t srcport, const ot_ip6 dstip, uint16_t dstport); | 27 | int socket_tcp_connect(const ot_ip6 srcip, uint16_t srcport, const ot_ip6 dstip, uint16_t dstport); |
| 27 | int socket_is_connected(int s); | 28 | int socket_is_connected(int s); |
