diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2015-12-06 16:39:23 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2015-12-07 13:37:03 +0100 |
commit | ba0525e3d8b7ca5e9d1cd3aeb342f09ba142bccb (patch) | |
tree | 6a0259eb07be8b824a8c25b9024cc98e30d6eaa3 /openbsc/src/gprs | |
parent | 28a70f20cdb5507feacac48cc4e0833f6b1e9afd (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')
-rw-r--r-- | openbsc/src/gprs/gtphub.c | 6 | ||||
-rw-r--r-- | openbsc/src/gprs/gtphub_vty.c | 24 |
2 files changed, 14 insertions, 16 deletions
diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c index 5736b896a..eb463d7ed 100644 --- a/openbsc/src/gprs/gtphub.c +++ b/openbsc/src/gprs/gtphub.c @@ -986,15 +986,15 @@ static const char *gtphub_tunnel_side_str(struct gtphub_tunnel *tun, if (!u->peer) { if (c->peer) { - APPEND(" / (uninitialized)"); + APPEND("/(uninitialized)"); } } else if ((!c->peer) || (!gsn_addr_same(&u->peer->peer_addr->addr, &c->peer->peer_addr->addr))) { - APPEND(" / %s", gsn_addr_to_str(&u->peer->peer_addr->addr)); + APPEND("/%s", gsn_addr_to_str(&u->peer->peer_addr->addr)); } - APPEND(" (TEI C %x=%x / U %x=%x)", + APPEND(" (TEI C %x=%x/U %x=%x)", c->tei_orig, c->tei_repl, u->tei_orig, u->tei_repl); return buf; 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 ++; |