aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-10-27 18:43:29 +0200
committerMax <msuraev@sysmocom.de>2017-10-27 18:49:52 +0200
commitc005db7019944efad854551d4a9d5de9a6f3ecf1 (patch)
tree1c583e062edf2ec5c5ef578c428c74476fc30075
parent869c3605e568ba6111d32b76c85739d0f327c05a (diff)
Log GTP-U endpoints update
* make gtp_ntoa() public after renaming it to sgsn_gtp_ntoa() to avoid confusion with libgtp functions * use it to log GTP-U endpoints address updates Change-Id: I96d0f3a63cce338471cc39cc33fd44c39cd2aa73 Related: SYS#3610
-rw-r--r--include/osmocom/sgsn/sgsn.h2
-rw-r--r--src/gprs/gprs_gmm.c2
-rw-r--r--src/gprs/sgsn_vty.c10
3 files changed, 9 insertions, 5 deletions
diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h
index e4eda17d..464a64fe 100644
--- a/include/osmocom/sgsn/sgsn.h
+++ b/include/osmocom/sgsn/sgsn.h
@@ -10,6 +10,7 @@
#include <osmocom/sgsn/common.h>
#include <ares.h>
+#include <gtp.h>
struct gprs_gsup_client;
struct hostent;
@@ -147,6 +148,7 @@ extern struct sgsn_instance *sgsn;
int sgsn_vty_init(struct sgsn_config *cfg);
int sgsn_parse_config(const char *config_file);
+char *sgsn_gtp_ntoa(struct ul16_t *ul);
/* sgsn.c */
diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c
index d11ecced..147e0017 100644
--- a/src/gprs/gprs_gmm.c
+++ b/src/gprs/gprs_gmm.c
@@ -120,6 +120,8 @@ static void mmctx_change_gtpu_endpoints_to_sgsn(struct sgsn_mm_ctx *mm_ctx)
{
struct sgsn_pdp_ctx *pdp;
llist_for_each_entry(pdp, &mm_ctx->pdp_list, list) {
+ LOGMMCTXP(LOGL_INFO, mm_ctx, "Changing GTP-U endpoints %s -> %s\n",
+ sgsn_gtp_ntoa(&pdp->lib->gsnlu), inet_ntoa(sgsn->cfg.gtp_listenaddr.sin_addr));
sgsn_pdp_upd_gtp_u(pdp,
&sgsn->cfg.gtp_listenaddr.sin_addr,
sizeof(sgsn->cfg.gtp_listenaddr.sin_addr));
diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c
index faac69b1..496bd680 100644
--- a/src/gprs/sgsn_vty.c
+++ b/src/gprs/sgsn_vty.c
@@ -425,7 +425,7 @@ const struct value_string gprs_mm_st_strs[] = {
{ 0, NULL }
};
-static char *gtp_ntoa(struct ul16_t *ul)
+char *sgsn_gtp_ntoa(struct ul16_t *ul)
{
if (ul->l == 4) {
struct in_addr *ia = (struct in_addr *) ul;
@@ -450,13 +450,13 @@ static void vty_dump_pdp(struct vty *vty, const char *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);
+ sgsn_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);
+ sgsn_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);
+ sgsn_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);
+ sgsn_gtp_ntoa(&pdp->lib->gsnru), pdp->lib->teid_gn, VTY_NEWLINE);
}
vty_out_rate_ctr_group(vty, " ", pdp->ctrg);