aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2019-02-13 14:11:29 +0100
committerMax <msuraev@sysmocom.de>2019-02-13 14:11:29 +0100
commit34604c26b4178f7a75388ca1de84eb1dc033feb1 (patch)
tree03b1bc239c52fd1bec92d599b632d146f5557747
parent319a52b577843f6eebb00d8039c2e2479adc8da5 (diff)
Improve 'show subscriber cache' vty command
* don't use spaces when printing hex data like RAND, SRES etc to increase the chance that it'll fit onto single line which will improve readability * don't print non-existent QoS value Change-Id: I0a09063f30c1116803994117f49df9d02bcc9181
-rw-r--r--src/gprs/sgsn_vty.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c
index 3757c07..0147b85 100644
--- a/src/gprs/sgsn_vty.c
+++ b/src/gprs/sgsn_vty.c
@@ -749,13 +749,13 @@ static void subscr_dump_full_vty(struct vty *vty, struct gprs_subscr *gsub, int
at->key_seq);
if (at->vec.auth_types & OSMO_AUTH_TYPE_GSM) {
vty_out(vty, "RAND: %s, ",
- osmo_hexdump(at->vec.rand,
+ osmo_hexdump_nospc(at->vec.rand,
sizeof(at->vec.rand)));
vty_out(vty, "SRES: %s, ",
- osmo_hexdump(at->vec.sres,
+ osmo_hexdump_nospc(at->vec.sres,
sizeof(at->vec.sres)));
vty_out(vty, "Kc: %s%s",
- osmo_hexdump(at->vec.kc,
+ osmo_hexdump_nospc(at->vec.kc,
sizeof(at->vec.kc)), VTY_NEWLINE);
}
if (at->vec.auth_types & OSMO_AUTH_TYPE_UMTS) {
@@ -763,19 +763,22 @@ static void subscr_dump_full_vty(struct vty *vty, struct gprs_subscr *gsub, int
osmo_hexdump(at->vec.autn,
sizeof(at->vec.autn)));
vty_out(vty, "RES: %s, ",
- osmo_hexdump(at->vec.res, at->vec.res_len));
+ osmo_hexdump_nospc(at->vec.res, at->vec.res_len));
vty_out(vty, "IK: %s, ",
- osmo_hexdump(at->vec.ik, sizeof(at->vec.ik)));
+ osmo_hexdump_nospc(at->vec.ik, sizeof(at->vec.ik)));
vty_out(vty, "CK: %s, ",
- osmo_hexdump(at->vec.ck, sizeof(at->vec.ck)));
+ osmo_hexdump_nospc(at->vec.ck, sizeof(at->vec.ck)));
}
}
llist_for_each_entry(pdp, &gsub->sgsn_data->pdp_list, list) {
- vty_out(vty, " PDP info: Id: %d, Type: 0x%04x, APN: '%s' QoS: %s%s",
- pdp->context_id, pdp->pdp_type, pdp->apn_str,
- osmo_hexdump(pdp->qos_subscribed, pdp->qos_subscribed_len),
- VTY_NEWLINE);
+ vty_out(vty, " PDP info: Id: %d, Type: 0x%04x, APN: '%s'",
+ pdp->context_id, pdp->pdp_type, pdp->apn_str);
+
+ if (pdp->qos_subscribed_len)
+ vty_out(vty, " QoS: %s", osmo_hexdump(pdp->qos_subscribed, pdp->qos_subscribed_len));
+
+ vty_out(vty, "%s", VTY_NEWLINE);
}
#if 0