summaryrefslogtreecommitdiffstats
path: root/src/gb/gprs_ns_vty.c
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-10-24 15:54:28 +0200
committerHarald Welte <laforge@gnumonks.org>2017-10-24 14:33:31 +0000
commit95308596540b0733a43d9db5dc6ab0c4f5e2d08f (patch)
tree66ae35669ef7828542fe973e6a70d8b1da807d6d /src/gb/gprs_ns_vty.c
parentc513c0f562b193a8e710b904b980bfa9b3d08b56 (diff)
GPRS: clarify ip/frgre union use
* add comment about underlying assumption that structs in ip/frgre union members in gprs_nsvc struct have the same memory layout * remove such assumption from gprs_ns_ll_str() * use gprs_ns_ll_str() for NSE dump Change-Id: Idcb912b7b3f7460fd2b058e16650c0bde8f757ee
Diffstat (limited to 'src/gb/gprs_ns_vty.c')
-rw-r--r--src/gb/gprs_ns_vty.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c
index 317a6a10..4ed4fefb 100644
--- a/src/gb/gprs_ns_vty.c
+++ b/src/gb/gprs_ns_vty.c
@@ -165,12 +165,11 @@ static void dump_nse(struct vty *vty, struct gprs_nsvc *nsvc, int stats)
nsvc->remote_end_is_sgsn ? "SGSN" : "BSS",
NS_DESC_A(nsvc->remote_state),
NS_DESC_B(nsvc->remote_state));
- if (nsvc->ll == GPRS_NS_LL_UDP || nsvc->ll == GPRS_NS_LL_FR_GRE)
- vty_out(vty, ", %s %15s:%u",
- nsvc->ll == GPRS_NS_LL_UDP ? "UDP " : "FR-GRE",
- inet_ntoa(nsvc->ip.bts_addr.sin_addr),
- osmo_ntohs(nsvc->ip.bts_addr.sin_port));
- vty_out(vty, "%s", VTY_NEWLINE);
+
+ vty_out(vty, ", %s %s%s",
+ nsvc->ll == GPRS_NS_LL_UDP ? "UDP " : "FR-GRE",
+ gprs_ns_ll_str(nsvc), VTY_NEWLINE);
+
if (stats) {
vty_out_rate_ctr_group(vty, " ", nsvc->ctrg);
vty_out_stat_item_group(vty, " ", nsvc->statg);