[MERGED] libosmo-sccp[master]: move osmo_ss7_vty.c [back] into libosmo-sigtran

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Apr 14 12:59:50 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: move osmo_ss7_vty.c [back] into libosmo-sigtran
......................................................................


move osmo_ss7_vty.c [back] into libosmo-sigtran

Now that the VTY has no static dependencies like a global ss7_instance
anymore, we can move it back to libosmo-sigtran and make use of it in
other programs outside osmo-stp.

This requires Change-Id I184a7e3187b48c15c71bf773f86e188fe1daad15 in
libosmocore

Change-Id: I2e549f1eadbfb28dde79f620b130cbf022312c42
---
M include/osmocom/sigtran/osmo_ss7.h
M src/Makefile.am
R src/osmo_ss7_vty.c
M stp/Makefile.am
D stp/internal.h
M stp/stp_main.c
6 files changed, 11 insertions(+), 25 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h
index 1d82669..24f83e9 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -437,3 +437,11 @@
 
 enum osmo_ss7_as_traffic_mode osmo_ss7_tmode_from_xua(uint32_t in);
 int osmo_ss7_tmode_to_xua(enum osmo_ss7_as_traffic_mode tmod);
+
+/* VTY related */
+struct vty;
+void osmo_ss7_set_vty_alloc_ctx(void *ctx);
+void osmo_ss7_vty_init_asp(void);
+void osmo_ss7_vty_init_sg(void);
+int osmo_ss7_vty_go_parent(struct vty *vty);
+int osmo_ss7_is_config_node(struct vty *vty, int node);
diff --git a/src/Makefile.am b/src/Makefile.am
index f9b87b0..8e52792 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -29,6 +29,7 @@
 libosmo_sigtran_la_SOURCES = sccp_sap.c sua.c m3ua.c xua_msg.c sccp_helpers.c \
 			     sccp2sua.c sccp_scrc.c sccp_sclc.c sccp_scoc.c \
 			     sccp_user.c xua_rkm.c xua_default_lm_fsm.c \
-			     osmo_ss7.c osmo_ss7_hmrt.c xua_asp_fsm.c xua_as_fsm.c
+			     osmo_ss7.c osmo_ss7_hmrt.c xua_asp_fsm.c xua_as_fsm.c \
+			     osmo_ss7_vty.c
 libosmo_sigtran_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined -export-symbols-regex '^osmo_'
 libosmo_sigtran_la_LIBADD = $(LIBOSMOCORE_LIBS) $(LIBOSMONETIF_LIBS) $(LIBSCTP_LIBS)
diff --git a/stp/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
similarity index 99%
rename from stp/osmo_ss7_vty.c
rename to src/osmo_ss7_vty.c
index fe7bc41..59c4008 100644
--- a/stp/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -35,8 +35,6 @@
 #include <osmocom/sigtran/osmo_ss7.h>
 #include <osmocom/sigtran/protocol/mtp.h>
 
-#include "internal.h"
-
 #define CS7_STR	"ITU-T Signaling System 7\n"
 #define PC_STR	"Point Code\n"
 
diff --git a/stp/Makefile.am b/stp/Makefile.am
index 81aa11c..ae37487 100644
--- a/stp/Makefile.am
+++ b/stp/Makefile.am
@@ -2,10 +2,8 @@
 AM_CFLAGS=-Wall -g $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMONETIF_CFLAGS) $(COVERAGE_FLAGS)
 AM_LDFLAGS=$(COVERAGE_LDFLAGS)
 
-EXTRA_DIST = internal.h
-
 bin_PROGRAMS = osmo-stp
 
-osmo_stp_SOURCES = stp_main.c osmo_ss7_vty.c
+osmo_stp_SOURCES = stp_main.c
 osmo_stp_LDADD = $(top_builddir)/src/libosmo-sigtran.la \
 		   $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS)
diff --git a/stp/internal.h b/stp/internal.h
deleted file mode 100644
index cbd6bac..0000000
--- a/stp/internal.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#pragma once
-
-#include <osmocom/vty/command.h>
-
-enum stp_vty_node {
-	L_CS7_NODE = _LAST_OSMOVTY_NODE + 1,
-	L_CS7_AS_NODE,
-	L_CS7_ASP_NODE,
-	L_CS7_XUA_NODE,
-	L_CS7_RTABLE_NODE,
-};
-
-void osmo_ss7_set_vty_alloc_ctx(void *ctx);
-void osmo_ss7_vty_init_asp(void);
-void osmo_ss7_vty_init_sg(void);
-int osmo_ss7_vty_go_parent(struct vty *vty);
-int osmo_ss7_is_config_node(struct vty *vty, int node);
diff --git a/stp/stp_main.c b/stp/stp_main.c
index 24e2230..267806b 100644
--- a/stp/stp_main.c
+++ b/stp/stp_main.c
@@ -38,8 +38,6 @@
 #include <osmocom/sigtran/protocol/sua.h>
 #include <osmocom/sigtran/protocol/m3ua.h>
 
-#include "internal.h"
-
 static const struct log_info_cat log_info_cat[] = {
 };
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2e549f1eadbfb28dde79f620b130cbf022312c42
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list