Change in osmo-sgsn[master]: make gsup ipa name configurable in osmo-sgsn.cfg

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

Stefan Sperling gerrit-no-reply at lists.osmocom.org
Tue Dec 11 15:22:24 UTC 2018


Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/12243


Change subject: make gsup ipa name configurable in osmo-sgsn.cfg
......................................................................

make gsup ipa name configurable in osmo-sgsn.cfg

Add a 'ipa-name' VTY command which overrides the default IPA
name used by the SGSN on the GSUP link towards the HLR.
This is required for GSUP routing in multi-SGSN networks.

Related: OS#3356

Change-Id: Ib2f65fed9f56b9718e8a9647e3f01dce69870c1f
---
M include/osmocom/sgsn/sgsn.h
M src/gprs/gprs_subscriber.c
M src/gprs/sgsn_vty.c
3 files changed, 30 insertions(+), 2 deletions(-)



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

diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h
index 3a34ff9..c80355d 100644
--- a/include/osmocom/sgsn/sgsn.h
+++ b/include/osmocom/sgsn/sgsn.h
@@ -124,6 +124,12 @@
 		enum ranap_nsap_addr_enc rab_assign_addr_enc;
 	} iu;
 #endif
+
+	/* This is transmitted as IPA Serial Number tag, which is used for GSUP routing (e.g. in OsmoHLR).
+	 * This name must be set in a multi-SGSN network, and it must be unique to each SGSN.
+	 * If no name is set, the IPA Serial Number will be the same as the Unit Name,
+	 * and will be of the form 'SGSN-00-00-00-00-00-00' */
+	char *sgsn_ipa_name;
 };
 
 struct sgsn_instance {
diff --git a/src/gprs/gprs_subscriber.c b/src/gprs/gprs_subscriber.c
index 4ab45c2..484c7ef 100644
--- a/src/gprs/gprs_subscriber.c
+++ b/src/gprs/gprs_subscriber.c
@@ -23,6 +23,7 @@
 #include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
 #include <osmocom/gsm/gsup.h>
 #include <osmocom/gsm/apn.h>
+#include <osmocom/gsm/ipa.h>
 #include <osmocom/core/utils.h>
 #include <osmocom/core/logging.h>
 #include <osmocom/sgsn/gprs_subscriber.h>
@@ -63,15 +64,20 @@
 int gprs_subscr_init(struct sgsn_instance *sgi)
 {
 	const char *addr_str;
+	struct ipaccess_unit *ipa_dev;
 
 	if (!sgi->cfg.gsup_server_addr.sin_addr.s_addr)
 		return 0;
 
 	addr_str = inet_ntoa(sgi->cfg.gsup_server_addr.sin_addr);
 
-	sgi->gsup_client = osmo_gsup_client_create(
+	ipa_dev = talloc_zero(sgi, struct ipaccess_unit);
+	ipa_dev->unit_name = "SGSN";
+	ipa_dev->serno = sgi->cfg.sgsn_ipa_name; /* NULL unless configured via VTY */
+
+	sgi->gsup_client = osmo_gsup_client_create2(
 		sgi,
-		"SGSN",
+		ipa_dev,
 		addr_str, sgi->cfg.gsup_server_port,
 		&gsup_read_cb,
 		&sgi->cfg.oap);
diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c
index 601b3c5..ebf77ba 100644
--- a/src/gprs/sgsn_vty.c
+++ b/src/gprs/sgsn_vty.c
@@ -177,6 +177,9 @@
 	vty_out(vty, " gtp local-ip %s%s",
 		inet_ntoa(g_cfg->gtp_listenaddr.sin_addr), VTY_NEWLINE);
 
+	if (g_cfg->sgsn_ipa_name)
+		vty_out(vty, " ipa-name %s%s", g_cfg->sgsn_ipa_name, VTY_NEWLINE);
+
 	llist_for_each_entry(gctx, &sgsn_ggsn_ctxts, list) {
 		if (gctx->id == UINT32_MAX)
 			continue;
@@ -338,6 +341,18 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(cfg_sgsn_ipa_name,
+      cfg_sgsn_ipa_name_cmd,
+      "ipa-name NAME",
+      "Set the IPA name of this SGSN\n"
+      "A unique name for this SGSN. For example: PLMN + redundancy server number: SGSN-901-70-0. "
+      "This name is used for GSUP routing and must be set if more than one SGSN is connected to the network. "
+      "The default is 'SGSN-00-00-00-00-00-00'.\n")
+{
+	g_cfg->sgsn_ipa_name = talloc_strdup(tall_vty_ctx, argv[0]);
+	return CMD_SUCCESS;
+}
+
 #if 0
 DEFUN(cfg_ggsn_remote_port, cfg_ggsn_remote_port_cmd,
 	"ggsn <0-255> remote-port <0-65535>",
@@ -1358,6 +1373,7 @@
 	install_node(&sgsn_node, config_write_sgsn);
 	install_element(SGSN_NODE, &cfg_sgsn_bind_addr_cmd);
 	install_element(SGSN_NODE, &cfg_ggsn_remote_ip_cmd);
+	install_element(SGSN_NODE, &cfg_sgsn_ipa_name_cmd);
 	//install_element(SGSN_NODE, &cfg_ggsn_remote_port_cmd);
 	install_element(SGSN_NODE, &cfg_ggsn_gtp_version_cmd);
 	install_element(SGSN_NODE, &cfg_ggsn_echo_interval_cmd);

-- 
To view, visit https://gerrit.osmocom.org/12243
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2f65fed9f56b9718e8a9647e3f01dce69870c1f
Gerrit-Change-Number: 12243
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Sperling <stsp at stsp.name>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181211/f3069e95/attachment.htm>


More information about the gerrit-log mailing list