aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-08-28 16:52:56 +0200
committerlaforge <laforge@gnumonks.org>2019-09-02 09:02:38 +0000
commit6ec5dc26b394e060287da260f9a6a655278a23f8 (patch)
treec8fedae60d829b00b50b2980452d82bae8ca05d3 /include
parent4ec21769b2e0779894895ef3942d3a5237b9f1a7 (diff)
Introduce log helper LOGGGSN and log category DGTP
It will be used in forthcoming commits. Change-Id: I30f46f44af1d0eee324b1a995c1dad2e1315af7c
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/sgsn/debug.h1
-rw-r--r--include/osmocom/sgsn/gprs_sgsn.h6
2 files changed, 7 insertions, 0 deletions
diff --git a/include/osmocom/sgsn/debug.h b/include/osmocom/sgsn/debug.h
index 4d0fc698..29d500da 100644
--- a/include/osmocom/sgsn/debug.h
+++ b/include/osmocom/sgsn/debug.h
@@ -39,6 +39,7 @@ enum {
DVLR,
DIUCS,
DSIGTRAN,
+ DGTP,
Debug_LastEntry,
};
diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h
index 48c063d0..17cafa3d 100644
--- a/include/osmocom/sgsn/gprs_sgsn.h
+++ b/include/osmocom/sgsn/gprs_sgsn.h
@@ -3,6 +3,7 @@
#include <stdint.h>
#include <netinet/in.h>
+#include <inttypes.h>
#include <osmocom/core/fsm.h>
#include <osmocom/core/timer.h>
@@ -405,6 +406,11 @@ void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp);
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;