Change in ...osmo-sgsn[master]: Introduce log helper LOGGGSN and log category DGTP

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Sep 2 09:02:38 UTC 2019


laforge has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/15307 )

Change subject: Introduce log helper LOGGGSN and log category DGTP
......................................................................

Introduce log helper LOGGGSN and log category DGTP

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, 13 insertions(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved
  Jenkins Builder: Verified



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..17cafa3 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_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..9f2e111 100644
--- a/src/gprs/sgsn_main.c
+++ b/src/gprs/sgsn_main.c
@@ -340,7 +340,12 @@
 		.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,
+	},
 };
 
 static const struct log_info gprs_log_info = {

-- 
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: 4
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-CC: fixeria <axilirator at gmail.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190902/1efbbc69/attachment.htm>


More information about the gerrit-log mailing list