aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc_nat
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/osmo-bsc_nat')
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_nat.c9
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_ussd.c8
2 files changed, 11 insertions, 6 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index a4dd67901..933cfeb59 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -46,7 +46,6 @@
#include <openbsc/bsc_msg_filter.h>
#include <openbsc/ipaccess.h>
#include <openbsc/abis_nm.h>
-#include <openbsc/socket.h>
#include <openbsc/vty.h>
#include <osmocom/ctrl/control_cmd.h>
@@ -59,6 +58,7 @@
#include <osmocom/core/application.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/stats.h>
+#include <osmocom/core/socket.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/gsm/gsm0808.h>
@@ -1684,8 +1684,11 @@ int main(int argc, char **argv)
bsc_msc_connect(nat->msc_con);
/* wait for the BSC */
- rc = make_sock(&bsc_listen, IPPROTO_TCP, ntohl(local_addr.s_addr),
- 5000, 0, ipaccess_listen_bsc_cb, nat);
+ bsc_listen.cb = ipaccess_listen_bsc_cb;
+ bsc_listen.data = nat;
+ rc = osmo_sock_init_ofd(&bsc_listen, AF_INET, SOCK_STREAM, IPPROTO_TCP,
+ inet_ntoa(local_addr), 5000,
+ OSMO_SOCK_F_BIND|OSMO_SOCK_F_NONBLOCK);
if (rc != 0) {
fprintf(stderr, "Failed to listen for BSC.\n");
exit(1);
diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/openbsc/src/osmo-bsc_nat/bsc_ussd.c
index 2f68381ac..b052eb86f 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_ussd.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_ussd.c
@@ -24,10 +24,10 @@
#include <openbsc/bsc_nat_sccp.h>
#include <openbsc/bsc_msg_filter.h>
#include <openbsc/ipaccess.h>
-#include <openbsc/socket.h>
#include <osmocom/gsm/protocol/gsm_08_08.h>
#include <osmocom/gsm/gsm0480.h>
+#include <osmocom/core/socket.h>
#include <osmocom/core/talloc.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/gsm/ipa.h>
@@ -287,8 +287,10 @@ int bsc_ussd_init(struct bsc_nat *nat)
inet_aton(nat->ussd_local, &addr);
nat->ussd_listen.data = nat;
- return make_sock(&nat->ussd_listen, IPPROTO_TCP,
- ntohl(addr.s_addr), 5001, 0, ussd_listen_cb, nat);
+ nat->ussd_listen.cb = ussd_listen_cb;
+ return osmo_sock_init_ofd(&nat->ussd_listen, AF_INET, SOCK_STREAM,
+ IPPROTO_TCP, inet_ntoa(addr), 5001,
+ OSMO_SOCK_F_BIND|OSMO_SOCK_F_NONBLOCK);
}
static int forward_ussd_simple(struct nat_sccp_connection *con, struct msgb *input)