Change in ...osmo-sgsn[master]: vty: Introduce cs7-instance-iu

pespin gerrit-no-reply at lists.osmocom.org
Mon Aug 19 17:07:06 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/15239


Change subject: vty: Introduce cs7-instance-iu
......................................................................

vty: Introduce cs7-instance-iu

Similar to what we already have in osmo-msc.

Change-Id: Iaa9e1d06dd0430848ef4f7498a3c15d13f899904
---
M doc/manuals/vty/sgsn_vty_reference.xml
M include/osmocom/sgsn/sgsn.h
M src/gprs/sgsn_main.c
M src/gprs/sgsn_vty.c
4 files changed, 28 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/39/15239/1

diff --git a/doc/manuals/vty/sgsn_vty_reference.xml b/doc/manuals/vty/sgsn_vty_reference.xml
index c3f91cf..38e21c2 100644
--- a/doc/manuals/vty/sgsn_vty_reference.xml
+++ b/doc/manuals/vty/sgsn_vty_reference.xml
@@ -2502,6 +2502,12 @@
         <param name='passive' doc='Compression is available on request' />
       </params>
     </command>
+    <command id='cs7-instance-iu <0-15>'>
+      <params>
+        <param name='cs7-instance-iu' doc='Set SS7 to be used by the Iu-Interface.' />
+        <param name='<0-15>' doc='SS7 instance reference number (default: 0)' />
+      </params>
+    </command>
     <command id='iu rab-assign-addr-enc (x213|v4raw)'>
       <params>
         <param name='iu' doc='Iu interface protocol options' />
diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h
index 0a6ea29..f940a1c 100644
--- a/include/osmocom/sgsn/sgsn.h
+++ b/include/osmocom/sgsn/sgsn.h
@@ -124,6 +124,7 @@
 #if BUILD_IU
 	struct {
 		enum ranap_nsap_addr_enc rab_assign_addr_enc;
+		uint32_t cs7_instance;
 	} iu;
 #endif
 
diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c
index 5979886..4232e23 100644
--- a/src/gprs/sgsn_main.c
+++ b/src/gprs/sgsn_main.c
@@ -500,7 +500,9 @@
 
 #if BUILD_IU
 	/* Note that these are mostly defaults and can be overriden from the VTY */
-	sccp = osmo_sccp_simple_client_on_ss7_id(tall_sgsn_ctx, 0, "OsmoSGSN",
+	sccp = osmo_sccp_simple_client_on_ss7_id(tall_sgsn_ctx,
+						 sgsn->cfg.iu.cs7_instance,
+						 "OsmoSGSN",
 						 (23 << 3) + 4,
 						 OSMO_SS7_ASP_PROT_M3UA,
 						 0, NULL,
diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c
index d1d53e6..13bc432 100644
--- a/src/gprs/sgsn_vty.c
+++ b/src/gprs/sgsn_vty.c
@@ -295,6 +295,8 @@
 		vty_out(vty, " no compression v42bis%s", VTY_NEWLINE);
 
 #ifdef BUILD_IU
+	vty_out(vty, " cs7-instance-iu %u%s", g_cfg->iu.cs7_instance,
+		VTY_NEWLINE);
 	ranap_iu_vty_config_write(vty, " ");
 #endif
 
@@ -1384,6 +1386,21 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(cfg_sgsn_cs7_instance_iu,
+      cfg_sgsn_cs7_instance_iu_cmd,
+      "cs7-instance-iu <0-15>",
+      "Set SS7 to be used by the Iu-Interface.\n" "SS7 instance reference number (default: 0)\n")
+{
+#if BUILD_IU
+	g_cfg->iu.cs7_instance = atoi(argv[0]);
+	return CMD_SUCCESS;
+#else
+	vty_out(vty, "WARNING: 'cs7-instance-iu' without effect: built without Iu support%s",
+		VTY_NEWLINE);
+	return CMD_WARNING;
+#endif
+}
+
 int sgsn_vty_init(struct sgsn_config *cfg)
 {
 	g_cfg = cfg;
@@ -1454,6 +1471,7 @@
 	install_element(SGSN_NODE, &cfg_comp_v42bisp_cmd);
 
 #ifdef BUILD_IU
+	install_element(SGSN_NODE, &cfg_sgsn_cs7_instance_iu_cmd);
 	ranap_iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc);
 #endif
 	return 0;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/15239
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Iaa9e1d06dd0430848ef4f7498a3c15d13f899904
Gerrit-Change-Number: 15239
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190819/7832ad4e/attachment.html>


More information about the gerrit-log mailing list