summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-12-15 19:48:58 +0100
committerHarald Welte <laforge@gnumonks.org>2017-01-07 11:46:18 +0100
commitf938f17717c45d79ce4b4b2656de1e8091d611cd (patch)
treef7d7d6be34b29d78d9418873b458b5d8a20bca3f
parent34be86b93c243d94619a36a6db6c50021b33d36e (diff)
sgsn: Add GTP information to "show pdp-context"
When displaying the PDP context, it is quite useful to also show IP address and TEI information about the GTP side of that PDP context. Change-Id: I56ea530240c15b26729e7a42e539020cb1e233e5
-rw-r--r--openbsc/src/gprs/sgsn_vty.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c
index 21c865b3d..4a97687e8 100644
--- a/openbsc/src/gprs/sgsn_vty.c
+++ b/openbsc/src/gprs/sgsn_vty.c
@@ -442,18 +442,37 @@ const struct value_string gprs_mm_st_strs[] = {
{ 0, NULL }
};
+static char *gtp_ntoa(struct ul16_t *ul)
+{
+ if (ul->l == 4) {
+ struct in_addr *ia = (struct in_addr *) ul;
+ return inet_ntoa(*ia);
+ } else {
+ return "UNKNOWN";
+ }
+}
+
static void vty_dump_pdp(struct vty *vty, const char *pfx,
struct sgsn_pdp_ctx *pdp)
{
const char *imsi = pdp->mm ? pdp->mm->imsi : "(detaching)";
- vty_out(vty, "%sPDP Context IMSI: %s, SAPI: %u, NSAPI: %u%s",
- pfx, imsi, pdp->sapi, pdp->nsapi, VTY_NEWLINE);
+ vty_out(vty, "%sPDP Context IMSI: %s, SAPI: %u, NSAPI: %u, TI: %u%s",
+ pfx, imsi, pdp->sapi, pdp->nsapi, pdp->ti, VTY_NEWLINE);
vty_out(vty, "%s APN: %s%s", pfx,
gprs_apn2str(pdp->lib->apn_use.v, pdp->lib->apn_use.l),
VTY_NEWLINE);
vty_out(vty, "%s PDP Address: %s%s", pfx,
gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l),
VTY_NEWLINE);
+ vty_out(vty, "%s GTP Local Control(%s / TEIC: 0x%08x) ", pfx,
+ gtp_ntoa(&pdp->lib->gsnlc), pdp->lib->teic_own);
+ vty_out(vty, "Data(%s / TEID: 0x%08x)%s",
+ gtp_ntoa(&pdp->lib->gsnlu), pdp->lib->teid_own, VTY_NEWLINE);
+ vty_out(vty, "%s GTP Remote Control(%s / TEIC: 0x%08x) ", pfx,
+ gtp_ntoa(&pdp->lib->gsnrc), pdp->lib->teic_gn);
+ vty_out(vty, "Data(%s / TEID: 0x%08x)%s",
+ gtp_ntoa(&pdp->lib->gsnru), pdp->lib->teid_gn, VTY_NEWLINE);
+
vty_out_rate_ctr_group(vty, " ", pdp->ctrg);
}