diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-07-27 19:42:35 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-07-27 20:03:11 +0200 |
commit | b97089432f43505329b57630c5520d555ec998d1 (patch) | |
tree | 876f60fe826d4e413e7f0eb8fc7a63f8e4432e3a /openbsc | |
parent | a7328a5642566bf7b07c6d0e58dfe5da018873a5 (diff) |
expiration: Print the "expire_lu" time in show subscriber
This can help with debugging subscriber expiration issues.
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/src/libmsc/vty_interface_layer3.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index 393844ea1..79c345771 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -21,6 +21,7 @@ #include <stdlib.h> #include <limits.h> #include <unistd.h> +#include <time.h> #include <osmocom/vty/command.h> #include <osmocom/vty/buffer.h> @@ -55,6 +56,7 @@ static void subscr_dump_full_vty(struct vty *vty, struct gsm_subscriber *subscr, int rc; struct gsm_auth_info ainfo; struct gsm_auth_tuple atuple; + char expire_time[200]; vty_out(vty, " ID: %llu, Authorized: %d%s", subscr->id, subscr->authorized, VTY_NEWLINE); @@ -95,6 +97,13 @@ static void subscr_dump_full_vty(struct vty *vty, struct gsm_subscriber *subscr, osmo_hexdump(atuple.kc, sizeof(atuple.kc)), VTY_NEWLINE); } + + /* print the expiration time of a subscriber */ + strftime(expire_time, sizeof(expire_time), + "%a, %d %b %Y %T %z", localtime(&subscr->expire_lu)); + expire_time[sizeof(expire_time) - 1] = '\0'; + vty_out(vty, " Expiration Time: %s%s", expire_time, VTY_NEWLINE); + if (pending) vty_out(vty, " Pending: %d%s", subscr_pending_requests(subscr), VTY_NEWLINE); |