pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/15307


Change subject: Introduce log helper LOGGGSN
......................................................................

Introduce log helper LOGGGSN

It will be used in forthcoming commits.

Change-Id: I30f46f44af1d0eee324b1a995c1dad2e1315af7c
---
M include/osmocom/sgsn/debug.h
M include/osmocom/sgsn/gprs_sgsn.h
M src/gprs/sgsn_main.c
3 files changed, 11 insertions(+), 0 deletions(-)



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

diff --git a/include/osmocom/sgsn/debug.h b/include/osmocom/sgsn/debug.h
index 4d0fc69..29d500d 100644
--- a/include/osmocom/sgsn/debug.h
+++ b/include/osmocom/sgsn/debug.h
@@ -39,6 +39,7 @@
        DVLR,
        DIUCS,
        DSIGTRAN,
+       DGTP,
        Debug_LastEntry,
 };

diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h
index 48c063d..55aae86 100644
--- a/include/osmocom/sgsn/gprs_sgsn.h
+++ b/include/osmocom/sgsn/gprs_sgsn.h
@@ -405,6 +405,11 @@
 void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx 
*pdp);
 void sgsn_ggsn_ctx_check_echo_timer(struct sgsn_ggsn_ctx *ggc);

+#define LOGGGSN(ggc, level, fmt, args...) { \
+       char _buf[INET_ADDRSTRLEN]; \
+       LOGP(DGTP, level, "GGSN(%" PRIu32 ":%s): " fmt, ggc->id, 
inet_ntop(AF_INET, &(ggc)->remote_addr, _buf, sizeof(_buf)), ## args); \
+       } while (0)
+
 struct apn_ctx {
        struct llist_head list;
        struct sgsn_ggsn_ctx *ggsn;
diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c
index 4232e23..fe6823e 100644
--- a/src/gprs/sgsn_main.c
+++ b/src/gprs/sgsn_main.c
@@ -340,6 +340,11 @@
                .name = "DV42BIS",
                .description = "V.42bis data compression (SNDCP)",
                .enabled = 1, .loglevel = LOGL_NOTICE,
+       },
+       [DGTP] = {
+               .name = "DGTP",
+               .description = "GPRS Tunnelling Protocol (GTP)",
+               .enabled = 1, .loglevel = LOGL_NOTICE,
        }
 };


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/15307
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I30f46f44af1d0eee324b1a995c1dad2e1315af7c
Gerrit-Change-Number: 15307
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pes...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to