diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-10-10 17:38:35 +0200 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2019-10-18 09:21:48 +0000 |
commit | 3f464fc007ace5a829e8d43e72a88055f14b52e3 (patch) | |
tree | d2785c51e0b50b3cc95dec011061a40479f4895c /include/osmocom/core | |
parent | c85f773640965066ce5488f0be291fc69065a50b (diff) |
socket: Introduce API osmo_sock_init2_multiaddr()
This API will be used by libosmo-netif's osmo_stream for SCTP sockets,
which in turn will be used by libosmo-sccp to support multi-homed
connections.
Related: OS#3608
Change-Id: Ic8681d9e093216c99c6bca4be81c31ef83688ed1
Diffstat (limited to 'include/osmocom/core')
-rw-r--r-- | include/osmocom/core/socket.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index 37b1eaef..e26ca0d3 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -36,6 +36,9 @@ struct osmo_fd; /*! use SO_REUSEADDR on UDP ports (required for multicast) */ #define OSMO_SOCK_F_UDP_REUSEADDR (1 << 5) +/*! maximum number of local or remote addresses supported by an osmo_sock instance */ +#define OSMO_SOCK_MAX_ADDRS 32 + int osmo_sock_init(uint16_t family, uint16_t type, uint8_t proto, const char *host, uint16_t port, unsigned int flags); @@ -43,6 +46,10 @@ int osmo_sock_init2(uint16_t family, uint16_t type, uint8_t proto, const char *local_host, uint16_t local_port, const char *remote_host, uint16_t remote_port, unsigned int flags); +int osmo_sock_init2_multiaddr(uint16_t family, uint16_t type, uint8_t proto, + const char **local_hosts, size_t local_hosts_cnt, uint16_t local_port, + const char **remote_hosts, size_t remote_hosts_cnt, uint16_t remote_port, unsigned int flags); + int osmo_sock_init_ofd(struct osmo_fd *ofd, int family, int type, int proto, const char *host, uint16_t port, unsigned int flags); |