aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gtphub_vty.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2015-12-06 16:39:23 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2015-12-07 13:37:03 +0100
commitba0525e3d8b7ca5e9d1cd3aeb342f09ba142bccb (patch)
tree6a0259eb07be8b824a8c25b9024cc98e30d6eaa3 /openbsc/src/gprs/gtphub_vty.c
parent28a70f20cdb5507feacac48cc4e0833f6b1e9afd (diff)
gtphub: tweak logging.
Less spaces in tunnel strings, adjust tests accordingly. Use side_idx to remove code dup in rate counter output. Sponsored-by: On-Waves ehi
Diffstat (limited to 'openbsc/src/gprs/gtphub_vty.c')
-rw-r--r--openbsc/src/gprs/gtphub_vty.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/openbsc/src/gprs/gtphub_vty.c b/openbsc/src/gprs/gtphub_vty.c
index 324d155b9..0eb9261d3 100644
--- a/openbsc/src/gprs/gtphub_vty.c
+++ b/openbsc/src/gprs/gtphub_vty.c
@@ -290,17 +290,15 @@ static void show_bind_stats_all(struct vty *vty)
vty_out(vty, "- %s Plane:%s",
gtphub_plane_idx_names[plane_idx], VTY_NEWLINE);
- struct gtphub_bind *b = &g_hub->to_gsns[GTPH_SIDE_GGSN][plane_idx];
- vty_out(vty, " - to/from GGSNs: %s port %d%s",
- gsn_addr_to_str(&b->local_addr), (int)b->local_port,
- VTY_NEWLINE);
- vty_out_rate_ctr_group(vty, " ", b->counters_io);
-
- b = &g_hub->to_gsns[GTPH_SIDE_SGSN][plane_idx];
- vty_out(vty, " - to/from SGSNs: %s port %d%s",
- gsn_addr_to_str(&b->local_addr), (int)b->local_port,
- VTY_NEWLINE);
- vty_out_rate_ctr_group(vty, " ", b->counters_io);
+ int side_idx;
+ for_each_side(side_idx) {
+ struct gtphub_bind *b = &g_hub->to_gsns[side_idx][plane_idx];
+ vty_out(vty, " - to/from %ss: %s port %d%s",
+ gtphub_side_idx_names[side_idx],
+ gsn_addr_to_str(&b->local_addr), (int)b->local_port,
+ VTY_NEWLINE);
+ vty_out_rate_ctr_group(vty, " ", b->counters_io);
+ }
}
}
@@ -387,7 +385,7 @@ static void show_tunnels_all(struct vty *vty)
time_t now = gtphub_now();
vty_out(vty, "All tunnels:%s"
- "Legend: SGSN <-> GGSN, with each:%s"
+ "Legend: (expiry in minutes) SGSN <-> GGSN, with each:%s"
" <IP-Ctrl>[/<IP-User>] (<TEI-Ctrl>=<mapped>/<TEI-User>=<mapped>)%s",
VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
@@ -397,7 +395,7 @@ static void show_tunnels_all(struct vty *vty)
llist_for_each_entry(t, &g_hub->tunnels, entry) {
vty_out(vty,
"(%4dm) %s%s",
- -(int)((t->expiry_entry.expiry - now) / 60),
+ (int)((t->expiry_entry.expiry - now) / 60),
gtphub_tunnel_str(t),
VTY_NEWLINE);
count ++;