aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/core
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-04-08 20:52:33 +0200
committerHarald Welte <laforge@gnumonks.org>2017-04-08 21:26:12 +0200
commitff60be3726fc766e27ad7d5890b11405b8c70041 (patch)
treeaa9160f84ffaac2d7f9a1b93c50bfcda9a5d9ac6 /include/osmocom/core
parent18a62b04887d8c6f6d338404330391a66c337b69 (diff)
Add osmo_sock_init2() function, allowing both BIND *and* CONNECTlaforge/sock2
The old osmo_sock_init() function allows only either a bind (for a server socket), or a connect (for a client socket), but not both together. So there's no way to have a client socket that is bound to a specific local IP and/or port, which is needed for some use cases. Change-Id: Idab124bcca47872f55311a82d6818aed590965e6
Diffstat (limited to 'include/osmocom/core')
-rw-r--r--include/osmocom/core/socket.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h
index 4f00e300..e19e8f28 100644
--- a/include/osmocom/core/socket.h
+++ b/include/osmocom/core/socket.h
@@ -24,6 +24,10 @@ struct osmo_fd;
int osmo_sock_init(uint16_t family, uint16_t type, uint8_t proto,
const char *host, uint16_t port, unsigned int flags);
+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_init_ofd(struct osmo_fd *ofd, int family, int type, int proto,
const char *host, uint16_t port, unsigned int flags);