[PATCH] libosmo-sccp[master]: vty: hide SG commands when running as ASP

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

dexter gerrit-no-reply at lists.osmocom.org
Wed Aug 9 17:01:33 UTC 2017


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

vty: hide SG commands when running as ASP

The SG (signal gateway) requires an extra set of VTY commands in
order to be fully configurable. These VTY commands do not make
sense in a situation where libosmo-sccp is used to implement an
ASP (application server process).

Detect in which role libosmo-sccp is used by which of the VTY
initalization functions are called:

osmo_ss7_vty_init_asp() ==> ASP
osmo_ss7_vty_init_sg() ==> SG

Prevent writing back of SG specific configuration when in
running as ASP. Only write back the full parameter set when
running as SG.

Change-Id: I707bcd790f4c6d0f618e41163b51d2179ea3aeaf
---
M src/osmo_ss7_vty.c
1 file changed, 13 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/53/3453/1

diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 21efcae..9343edd 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -50,6 +50,8 @@
  * Core CS7 Configuration
  ***********************************************************************/
 
+enum cs7_role_t {CS7_ROLE_SG, CS7_ROLE_ASP};
+static enum cs7_role_t cs7_role;
 static void *g_ctx;
 
 static struct cmd_node cs7_node = {
@@ -1559,12 +1561,16 @@
 	llist_for_each_entry(as, &inst->as_list, list)
 		write_one_as(vty, as);
 
-	/* now dump routes, as their target ASs exist */
-	llist_for_each_entry(rtable, &inst->rtable_list, list)
-		write_one_rtable(vty, rtable);
+	/* now dump everything that is relevent for the SG role */
+	if (cs7_role == CS7_ROLE_SG) {
 
-	llist_for_each_entry(oxs, &inst->xua_servers, list)
-		write_one_xua(vty, oxs);
+		/* dump routes, as their target ASs exist */
+		llist_for_each_entry(rtable, &inst->rtable_list, list)
+			write_one_rtable(vty, rtable);
+
+		llist_for_each_entry(oxs, &inst->xua_servers, list)
+			write_one_xua(vty, oxs);
+	}
 
 	/* Append SCCP Addressbook */
 	write_sccp_addressbook(vty, inst);
@@ -1717,11 +1723,13 @@
 
 void osmo_ss7_vty_init_asp(void *ctx)
 {
+	cs7_role = CS7_ROLE_ASP;
 	vty_init_shared(ctx);
 }
 
 void osmo_ss7_vty_init_sg(void *ctx)
 {
+	cs7_role = CS7_ROLE_SG;
 	vty_init_shared(ctx);
 
 	install_node(&rtable_node, NULL);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I707bcd790f4c6d0f618e41163b51d2179ea3aeaf
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>



More information about the gerrit-log mailing list