[PATCH] osmo-sgsn[master]: Log GTP-U endpoints update

Max gerrit-no-reply at lists.osmocom.org
Fri Oct 27 17:00:38 UTC 2017


Review at  https://gerrit.osmocom.org/4451

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
---
M include/osmocom/sgsn/sgsn.h
M src/gprs/gprs_gmm.c
M src/gprs/sgsn_vty.c
3 files changed, 9 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/51/4451/1

diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h
index e4eda17..464a64f 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 @@
 
 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 d11ecce..147e001 100644
--- a/src/gprs/gprs_gmm.c
+++ b/src/gprs/gprs_gmm.c
@@ -120,6 +120,8 @@
 {
 	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 faac69b..496bd68 100644
--- a/src/gprs/sgsn_vty.c
+++ b/src/gprs/sgsn_vty.c
@@ -425,7 +425,7 @@
 	{ 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 @@
 			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);

-- 
To view, visit https://gerrit.osmocom.org/4451
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I96d0f3a63cce338471cc39cc33fd44c39cd2aa73
Gerrit-PatchSet: 1
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>


More information about the gerrit-log mailing list