aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-12-26 19:27:43 +0100
committerMax <msuraev@sysmocom.de>2017-12-31 11:02:07 +0000
commitef727410b28f1482a2a174cfbe943e6e98205bdb (patch)
tree8d2bf14bdc25fe7db1a22fd11320db37a7b5376b /src
parent1e57ba503ed734b36094288ad2dbedbd11f39c57 (diff)
Add control interface
* add libosmoctrl dependency * bind control interface Change-Id: I4637e88da00bac1ab0237c29ac73806d024863ba
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am4
-rw-r--r--src/hnbgw.c12
2 files changed, 13 insertions, 3 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 85bfad6..2e57a8e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -43,7 +43,7 @@ gen_ranap.stamp: $(ASN1_ROOT)/ranap/RANAP-PDU-Contents.asn $(ASN1TOSTRUCT)
ranap_decoder.c ranap_encoder.c: gen_ranap.stamp
AM_CFLAGS = -Wall -I$(top_srcdir)/include -I$(top_builddir)/include \
- $(OSMOCORE_CFLAGS) $(OSMOVTY_CFLAGS) $(OSMOGSM_CFLAGS) \
+ $(OSMOCORE_CFLAGS) $(OSMOVTY_CFLAGS) $(OSMOCTRL_CFLAGS) $(OSMOGSM_CFLAGS) \
$(OSMONETIF_CFLAGS) $(ASN1C_CFLAGS) $(OSMOSIGTRAN_CFLAGS)
# build the shared RANAP library
@@ -67,7 +67,7 @@ osmo_hnbgw_SOURCES = hnbap_encoder.c hnbap_decoder.c hnbap_common.c \
hnbgw_vty.c \
context_map.c hnbgw_cn.c
-osmo_hnbgw_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) \
+osmo_hnbgw_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOCTRL_LIBS) \
$(ASN1C_LIBS) $(OSMOSIGTRAN_LIBS) \
$(OSMONETIF_LIBS) \
hnbap/libosmo-asn1-hnbap.a rua/libosmo-asn1-rua.a \
diff --git a/src/hnbgw.c b/src/hnbgw.c
index 5f5c311..a66f14a 100644
--- a/src/hnbgw.c
+++ b/src/hnbgw.c
@@ -41,7 +41,10 @@
#include <osmocom/core/socket.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/write_queue.h>
-
+#include <osmocom/ctrl/control_if.h>
+#include <osmocom/ctrl/control_cmd.h>
+#include <osmocom/ctrl/control_vty.h>
+#include <osmocom/ctrl/ports.h>
#include <osmocom/vty/telnet_interface.h>
#include <osmocom/vty/logging.h>
#include <osmocom/vty/command.h>
@@ -477,6 +480,13 @@ int main(int argc, char **argv)
exit(1);
}
+ g_hnb_gw->ctrl = ctrl_interface_setup_dynip(NULL, ctrl_vty_get_bind_addr(), OSMO_CTRL_PORT_HNBGW, NULL);
+ if (!g_hnb_gw->ctrl) {
+ LOGP(DMAIN, LOGL_ERROR, "Failed to create CTRL interface on %s:%u\n",
+ ctrl_vty_get_bind_addr(), OSMO_CTRL_PORT_HNBGW);
+ exit(1);
+ }
+
ranap_set_log_area(DRANAP);
rc = hnbgw_cnlink_init(g_hnb_gw, "127.0.0.1", M3UA_PORT, NULL);