From 42755785707a11c8349b86c2afb98b7bc15c85dc Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Thu, 8 Jan 2015 12:02:12 +0100 Subject: [PATCH] gprs: Add LOGGSUBSCRP macro to log subscriber info This patch adds a new logging macro, that logs to DGPRS and provides a uniform prefix containing the IMSI without using the mm reference. This is an improvement over using LOGMMCTXP, since the new macro also provides an IMSI if no MM context is attached. Sponsored-by: On-Waves ehf --- openbsc/include/openbsc/gprs_sgsn.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/openbsc/include/openbsc/gprs_sgsn.h index 7416e8cf7..c92d1cc7b 100644 --- a/openbsc/include/openbsc/gprs_sgsn.h +++ b/openbsc/include/openbsc/gprs_sgsn.h @@ -278,6 +278,10 @@ struct sgsn_subscriber_data { int error_cause; }; +#define LOGGSUBSCRP(level, subscr, fmt, args...) \ + LOGP(DGPRS, level, "SUBSCR(%s) " fmt, (subscr)->imsi, \ + ## args) + struct sgsn_config; struct sgsn_instance; extern const struct value_string *sgsn_auth_state_names;