[PATCH] osmo-iuh[master]: Add control interface

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Tue Dec 26 18:42:00 UTC 2017


Review at  https://gerrit.osmocom.org/5591

Add control interface

* add libosmoctrl dependency
* bind control interface

Change-Id: I4637e88da00bac1ab0237c29ac73806d024863ba
---
M configure.ac
M include/osmocom/iuh/hnbgw.h
M src/Makefile.am
M src/hnbgw.c
4 files changed, 15 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/91/5591/1

diff --git a/configure.ac b/configure.ac
index 4c5f47f..2b8974f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,6 +36,7 @@
 PKG_CHECK_MODULES(OSMOCORE, libosmocore >= 0.10.0)
 PKG_CHECK_MODULES(OSMOGSM, libosmogsm >= 0.10.0)
 PKG_CHECK_MODULES(OSMOVTY, libosmovty >= 0.10.0)
+PKG_CHECK_MODULES(OSMOCTRL, libosmoctrl)
 PKG_CHECK_MODULES(OSMONETIF, libosmo-netif >= 0.1.0)
 PKG_CHECK_MODULES(OSMOSIGTRAN, libosmo-sigtran >= 0.8.0)
 PKG_CHECK_MODULES(ASN1C, libasn1c >= 0.9.28)
diff --git a/include/osmocom/iuh/hnbgw.h b/include/osmocom/iuh/hnbgw.h
index 58bdab4..f3970b0 100644
--- a/include/osmocom/iuh/hnbgw.h
+++ b/include/osmocom/iuh/hnbgw.h
@@ -120,6 +120,7 @@
 		const char *iups_remote_addr_name;
 		uint16_t rnc_id;
 		bool hnbap_allow_tmsi;
+		struct ctrl_handle *ctrl;
 	} config;
 	/*! SCTP listen socket for incoming connections */
 	struct osmo_stream_srv_link *iuh;
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 @@
 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 @@
 		     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 752fc0f..7e501fa 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 @@
 		exit(1);
 	}
 
+	g_hnb_gw->config.ctrl = ctrl_interface_setup_dynip(NULL, ctrl_vty_get_bind_addr(), OSMO_CTRL_PORT_HNBGW, NULL);
+	if (!g_hnb_gw->config.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);

-- 
To view, visit https://gerrit.osmocom.org/5591
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4637e88da00bac1ab0237c29ac73806d024863ba
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list