aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2020-12-01 16:36:29 +0100
committerDaniel Willmann <dwillmann@sysmocom.de>2020-12-02 17:17:17 +0100
commit74187970276482595403fb7a91cee55e53280079 (patch)
tree310b58165bcd8bae8d27acbac4718f8362782e35
parentd97ff681c3c464e8c4da83cb5ecdeee4a721e1a9 (diff)
gbproxy: Add logging macros for NSE and BVC
-rw-r--r--include/osmocom/sgsn/gb_proxy.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/osmocom/sgsn/gb_proxy.h b/include/osmocom/sgsn/gb_proxy.h
index 9f91bd68..fae95c16 100644
--- a/include/osmocom/sgsn/gb_proxy.h
+++ b/include/osmocom/sgsn/gb_proxy.h
@@ -237,6 +237,17 @@ struct gbproxy_link_info {
bool is_matching[GBPROX_MATCH_LAST];
};
+/* Convenience logging macros for NSE/BVC */
+#define LOGPNSE_CAT(NSE, SUBSYS, LEVEL, FMT, ARGS...) \
+ LOGP(SUBSYS, LEVEL, "NSE(%05u/BSS) " FMT, (NSE)->nsei, ## ARGS)
+#define LOGPNSE(NSE, LEVEL, FMT, ARGS...) \
+ LOGPNSE_CAT(NSE, DGPRS, LEVEL, FMT, ## ARGS)
+
+#define LOGPBVC_CAT(BVC, SUBSYS, LEVEL, FMT, ARGS...) \
+ LOGP(SUBSYS, LEVEL, "NSE(%05u/BSS)-BVC(%05u/%s) " FMT, (BVC)->nse->nsei, (BVC)->bvci, \
+ (BVC)->blocked ? "BLOCKED" : "UNBLOCKED", ## ARGS)
+#define LOGPBVC(BVC, LEVEL, FMT, ARGS...) \
+ LOGPBVC_CAT(BVC, DGPRS, LEVEL, FMT, ## ARGS)
/* gb_proxy_vty .c */