[PATCH] osmo-sgsn[master]: SGSN: print additional GTP-related info

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

Max gerrit-no-reply at lists.osmocom.org
Thu Oct 19 13:35:24 UTC 2017


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/4352

to look at the new patch set (#2).

SGSN: print additional GTP-related info

* print libgtp version on startup
* print GSN mode and addresses in 'sh sgsn'

Change-Id: I699a9eb56c4b362984ea8292a3d2b22b71f53c15
Related: SYS#3610
---
M src/gprs/sgsn_main.c
M src/gprs/sgsn_vty.c
M tests/vty_test_runner.py
3 files changed, 21 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/52/4352/2

diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c
index d79beb3..7036bf6 100644
--- a/src/gprs/sgsn_main.c
+++ b/src/gprs/sgsn_main.c
@@ -447,7 +447,8 @@
 	if (rc) {
 		LOGP(DGPRS, LOGL_FATAL, "Cannot bind/listen on GTP socket\n");
 		exit(2);
-	}
+	} else
+		LOGP(DGPRS, LOGL_NOTICE, "libGTP v%s initialized\n", gtp_version());
 
 	rc = gprs_subscr_init(&sgsn_inst);
 	if (rc < 0) {
diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c
index 1882852..d7b1316 100644
--- a/src/gprs/sgsn_vty.c
+++ b/src/gprs/sgsn_vty.c
@@ -44,6 +44,7 @@
 #include <osmocom/abis/ipa.h>
 
 #include <pdp.h>
+#include <gtp.h>
 
 #include "../../bscconfig.h"
 
@@ -511,6 +512,23 @@
 			link->addr, link->port,
 			VTY_NEWLINE);
 	}
+	if (sgsn->gsn) {
+		const char *mode;
+
+		switch (sgsn->gsn->mode) {
+		case GTP_MODE_SGSN:
+			mode = "SGSN";
+			break;
+		case GTP_MODE_GGSN:
+			mode = "GGSN";
+			break;
+		default:
+			mode = "unknown";
+		}
+
+		vty_out(vty, "  GSN mode %s: signalling %s, user traffic %s%s",
+			mode, inet_ntoa(sgsn->gsn->gsnc), inet_ntoa(sgsn->gsn->gsnu), VTY_NEWLINE);
+	}
 	/* FIXME: statistics */
 	return CMD_SUCCESS;
 }
diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py
index 9be8d03..8353f2d 100644
--- a/tests/vty_test_runner.py
+++ b/tests/vty_test_runner.py
@@ -154,7 +154,7 @@
         # self.assertTrue(self.vty.verify('show bssgp nsei 123', ['']))
         # self.assertTrue(self.vty.verify('show bssgp nsei 123 stats', ['']))
 
-        self.assertTrue(self.vty.verify('show sgsn', ['']))
+        self.assertTrue(self.vty.verify('show sgsn', ['  GSN mode SGSN: signalling 127.0.0.1, user traffic 127.0.0.1']))
         self.assertTrue(self.vty.verify('show mm-context all', ['']))
         self.assertTrue(self.vty.verify('show mm-context imsi 000001234567', ['No MM context for IMSI 000001234567']))
         self.assertTrue(self.vty.verify('show pdp-context all', ['']))

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I699a9eb56c4b362984ea8292a3d2b22b71f53c15
Gerrit-PatchSet: 2
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list