Change in ...osmo-msc[master]: libmsc/msc_vty.c: print subscriber expiration time

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

fixeria gerrit-no-reply at lists.osmocom.org
Mon Jul 8 17:35:11 UTC 2019


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/14701


Change subject: libmsc/msc_vty.c: print subscriber expiration time
......................................................................

libmsc/msc_vty.c: print subscriber expiration time

Change-Id: I092691a8c443f4c5ed4d33de2e551fef592c1baf
---
M src/libmsc/msc_vty.c
1 file changed, 17 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/01/14701/1

diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index 8a976cb..c75cd0e 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -791,6 +791,8 @@
 static void vty_dump_one_subscr(struct vty *vty, struct vlr_subscr *vsub,
 				int offset, uint8_t dump_flags)
 {
+	struct gsm_network *net;
+	struct timespec now;
 	char buf[128];
 
 	if (vsub->name[0] != '\0') {
@@ -863,6 +865,21 @@
 			     VTY_NEWLINE);
 	}
 
+	/* XXX move t3212 into struct vlr_instance? */
+	net = vsub->vlr->user_ctx;
+	if (!net->t3212) {
+		MSC_VTY_DUMP(vty, offset, "Expires: never (T3212 is disabled)%s",
+			     VTY_NEWLINE);
+	} else if (vsub->expire_lu == VLR_SUBSCRIBER_NO_EXPIRATION) {
+		MSC_VTY_DUMP(vty, offset, "Expires: never%s",
+			     VTY_NEWLINE);
+	} else if (osmo_clock_gettime(CLOCK_MONOTONIC, &now) == 0) {
+		MSC_VTY_DUMP(vty, offset, "Expires: in %ld min %ld sec%s",
+			     (vsub->expire_lu - now.tv_sec) / 60,
+			     (vsub->expire_lu - now.tv_sec) % 60,
+			     VTY_NEWLINE);
+	}
+
 	MSC_VTY_DUMP(vty, offset, "Paging: %s paging for %d requests%s",
 		     vsub->cs.is_paging ? "is" : "not",
 		     llist_count(&vsub->cs.requests),

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I092691a8c443f4c5ed4d33de2e551fef592c1baf
Gerrit-Change-Number: 14701
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190708/eabbe0d4/attachment.htm>


More information about the gerrit-log mailing list