Change in osmo-hlr[master]: Add "show gsup-connections" VTY command

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
Sun Jun 24 13:34:03 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9724 )

Change subject: Add "show gsup-connections" VTY command
......................................................................

Add "show gsup-connections" VTY command

This can help with debugging and give operational insight.

Change-Id: I977b4b8cdb36dab42b3d736a28d8b5f17cff04cd
---
M src/hlr_vty.c
M tests/test_nodes.vty
2 files changed, 35 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved



diff --git a/src/hlr_vty.c b/src/hlr_vty.c
index c10829d..ecc2f5c 100644
--- a/src/hlr_vty.c
+++ b/src/hlr_vty.c
@@ -1,9 +1,10 @@
 /* OsmoHLR VTY implementation */
 
 /* (C) 2016 sysmocom s.f.m.c. GmbH <info at sysmocom.de>
- * All Rights Reserved
- *
  * Author: Neels Hofmeyr <nhofmeyr at sysmocom.de>
+ * (C) 2018 Harald Welte <laforge at gnumonks.org>
+ *
+ * All Rights Reserved
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -25,9 +26,11 @@
 #include <osmocom/vty/command.h>
 #include <osmocom/vty/logging.h>
 #include <osmocom/vty/misc.h>
+#include <osmocom/abis/ipa.h>
 
 #include "hlr_vty.h"
 #include "hlr_vty_subscr.h"
+#include "gsup_server.h"
 
 static struct hlr *g_hlr = NULL;
 
@@ -75,6 +78,33 @@
 	return CMD_SUCCESS;
 }
 
+static void show_one_conn(struct vty *vty, const struct osmo_gsup_conn *conn)
+{
+	const struct ipa_server_conn *isc = conn->conn;
+	char *name;
+	int rc;
+
+	rc = osmo_gsup_conn_ccm_get(conn, (uint8_t **) &name, IPAC_IDTAG_SERNR);
+	OSMO_ASSERT(rc);
+
+	vty_out(vty, " '%s' from %s:%5u, CS=%u, PS=%u, 3G_IND=%u%s",
+		name, isc->addr, isc->port, conn->supports_cs, conn->supports_ps, conn->auc_3g_ind,
+		VTY_NEWLINE);
+}
+
+DEFUN(show_gsup_conn, show_gsup_conn_cmd,
+	"show gsup-connections",
+	SHOW_STR "GSUP Connections from VLRs, SGSNs, EUSEs\n")
+{
+	struct osmo_gsup_server *gs = g_hlr->gs;
+	struct osmo_gsup_conn *conn;
+
+	llist_for_each_entry(conn, &gs->clients, list)
+		show_one_conn(vty, conn);
+
+	return CMD_SUCCESS;
+}
+
 DEFUN(cfg_hlr_gsup_bind_ip,
       cfg_hlr_gsup_bind_ip_cmd,
       "bind ip A.B.C.D",
@@ -129,6 +159,8 @@
 	logging_vty_add_cmds(cat);
 	osmo_talloc_vty_add_cmds();
 
+	install_element_ve(&show_gsup_conn_cmd);
+
 	install_element(CONFIG_NODE, &cfg_hlr_cmd);
 	install_node(&hlr_node, config_write_hlr);
 
diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty
index 5afa144..21809c8 100644
--- a/tests/test_nodes.vty
+++ b/tests/test_nodes.vty
@@ -16,6 +16,7 @@
   show talloc-context (application|all) (full|brief|DEPTH)
   show talloc-context (application|all) (full|brief|DEPTH) tree ADDRESS
   show talloc-context (application|all) (full|brief|DEPTH) filter REGEXP
+  show gsup-connections
   subscriber (imsi|msisdn|id) IDENT show
 
 OsmoHLR> enable

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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I977b4b8cdb36dab42b3d736a28d8b5f17cff04cd
Gerrit-Change-Number: 9724
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180624/c0223926/attachment.htm>


More information about the gerrit-log mailing list