[PATCH 2/5] libctrl: remove openbsc headers, convert from make_sock to libosmocore

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/OpenBSC@lists.osmocom.org/.

Harald Welte laforge at gnumonks.org
Wed Aug 20 18:15:07 UTC 2014


---
 include/osmocom/ctrl/control_cmd.h |  3 +--
 include/osmocom/ctrl/control_if.h  |  6 ++++--
 src/ctrl/control_cmd.c             |  4 +---
 src/ctrl/control_if.c              | 24 ++++++++----------------
 4 files changed, 14 insertions(+), 23 deletions(-)

diff --git a/include/osmocom/ctrl/control_cmd.h b/include/osmocom/ctrl/control_cmd.h
index 2e6863a..10717ac 100644
--- a/include/osmocom/ctrl/control_cmd.h
+++ b/include/osmocom/ctrl/control_cmd.h
@@ -4,11 +4,10 @@
 #include <osmocom/core/msgb.h>
 #include <osmocom/core/talloc.h>
 #include <osmocom/core/write_queue.h>
+#include <osmocom/core/logging.h>
 
 #include <osmocom/vty/vector.h>
 
-#include <openbsc/vty.h>
-
 #define CTRL_CMD_ERROR		-1
 #define CTRL_CMD_HANDLED	0
 #define CTRL_CMD_REPLY		1
diff --git a/include/osmocom/ctrl/control_if.h b/include/osmocom/ctrl/control_if.h
index d103332..9ab3b2a 100644
--- a/include/osmocom/ctrl/control_if.h
+++ b/include/osmocom/ctrl/control_if.h
@@ -2,8 +2,10 @@
 #define _CONTROL_IF_H
 
 #include <osmocom/core/write_queue.h>
-#include <openbsc/control_cmd.h>
-#include <openbsc/gsm_data.h>
+#include <osmocom/ctrl/control_cmd.h>
+
+/* FIXME: this must go */
+struct gsm_network;
 
 typedef int (*ctrl_cmd_handler)(struct ctrl_cmd *, void *);
 
diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c
index 44cfa48..45e517d 100644
--- a/src/ctrl/control_cmd.c
+++ b/src/ctrl/control_cmd.c
@@ -29,9 +29,7 @@
 #include <time.h>
 #include <unistd.h>
 
-#include <openbsc/control_cmd.h>
-#include <openbsc/debug.h>
-#include <openbsc/vty.h>
+#include <osmocom/ctrl/control_cmd.h>
 
 #include <osmocom/core/msgb.h>
 #include <osmocom/core/talloc.h>
diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c
index 156a24f..7ce8bf6 100644
--- a/src/ctrl/control_if.c
+++ b/src/ctrl/control_if.c
@@ -38,31 +38,21 @@
 #include <sys/socket.h>
 #include <sys/types.h>
 
-#include <openbsc/control_cmd.h>
-#include <openbsc/control_if.h>
-#include <openbsc/debug.h>
-#include <openbsc/gsm_data.h>
-#include <openbsc/ipaccess.h>
-#include <openbsc/socket.h>
-#include <osmocom/abis/subchan_demux.h>
-
-#include <openbsc/abis_rsl.h>
-#include <openbsc/abis_nm.h>
+#include <osmocom/ctrl/control_cmd.h>
+#include <osmocom/ctrl/control_if.h>
 
 #include <osmocom/core/msgb.h>
 #include <osmocom/core/rate_ctr.h>
 #include <osmocom/core/select.h>
 #include <osmocom/core/statistics.h>
 #include <osmocom/core/talloc.h>
+#include <osmocom/core/socket.h>
 
-#include <osmocom/gsm/tlv.h>
+#include <osmocom/gsm/protocol/ipaccess.h>
 
 #include <osmocom/vty/command.h>
 #include <osmocom/vty/vector.h>
 
-#include <osmocom/abis/e1_input.h>
-#include <osmocom/abis/ipa.h>
-
 vector ctrl_node_vec;
 
 /* Send command to all  */
@@ -551,8 +541,10 @@ struct ctrl_handle *controlif_setup(struct gsm_network *gsmnet, uint16_t port,
 		goto err;
 
 	/* Listen for control connections */
-	ret = make_sock(&ctrl->listen_fd, IPPROTO_TCP, INADDR_LOOPBACK, port,
-			0, listen_fd_cb, ctrl);
+	ctrl->listen_fd.cb = listen_fd_cb;
+	ctrl->listen_fd.data = ctrl;
+	ret = osmo_sock_init_ofd(&ctrl->listen_fd, AF_INET, SOCK_STREAM, IPPROTO_TCP,
+				 "127.0.0.1", port, OSMO_SOCK_F_BIND);
 	if (ret < 0)
 		goto err_vec;
 
-- 
2.1.0.rc1





More information about the OpenBSC mailing list