diff options
Diffstat (limited to 'ot_socket.h')
| -rw-r--r-- | ot_socket.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ot_socket.h b/ot_socket.h index aa4e2d2..f73a5c9 100644 --- a/ot_socket.h +++ b/ot_socket.h | |||
| @@ -16,8 +16,18 @@ | |||
| 16 | as the v4 mapped address */ | 16 | as the v4 mapped address */ |
| 17 | 17 | ||
| 18 | /* How an address may be shared with other sockets. Which socket option says | 18 | /* How an address may be shared with other sockets. Which socket option says |
| 19 | so differs between kernels, which is socket_set_sharing's business */ | 19 | so differs between kernels, which is socket_set_sharing's business. |
| 20 | typedef enum { SOCKET_EXCLUSIVE, SOCKET_SHARED } socket_sharing; | 20 | |
| 21 | SHARED lets another socket bind the same address. BALANCED asks the kernel | ||
| 22 | to spread arriving datagrams over the sockets that did, which is a | ||
| 23 | different thing and not everywhere available: ask socket_can_balance | ||
| 24 | before binding a group that depends on it. */ | ||
| 25 | typedef enum { SOCKET_EXCLUSIVE, SOCKET_SHARED, SOCKET_BALANCED } socket_sharing; | ||
| 26 | |||
| 27 | /* Whether this kernel spreads datagrams over a group of sockets bound to one | ||
| 28 | address. Where it does not, binding a group is worse than one socket with | ||
| 29 | several readers, so the caller wants to know first. */ | ||
| 30 | int socket_can_balance(void); | ||
| 21 | 31 | ||
| 22 | /* Create, bind and, for TCP, listen. The returned socket is non blocking | 32 | /* Create, bind and, for TCP, listen. The returned socket is non blocking |
| 23 | Returns -1 on failure with errno set */ | 33 | Returns -1 on failure with errno set */ |
