From 6ec5dc26b394e060287da260f9a6a655278a23f8 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 28 Aug 2019 16:52:56 +0200 Subject: Introduce log helper LOGGGSN and log category DGTP It will be used in forthcoming commits. Change-Id: I30f46f44af1d0eee324b1a995c1dad2e1315af7c --- include/osmocom/sgsn/debug.h | 1 + include/osmocom/sgsn/gprs_sgsn.h | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'include') diff --git a/include/osmocom/sgsn/debug.h b/include/osmocom/sgsn/debug.h index 4d0fc6987..29d500da7 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 48c063d07..17cafa3d1 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -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; -- cgit v1.2.3