aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/iuh/hnbgw.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-12-30 13:36:20 +0100
committerHarald Welte <laforge@osmocom.org>2020-12-30 14:23:54 +0100
commitc6d93452b2f96e1e4e556457320a5e552ea9817d (patch)
tree7e5f93d50325e543e4e1883cdaada5151b48d9a7 /include/osmocom/iuh/hnbgw.h
parentdc529f3d787ec9f1e2a68c9029bbb2b6c1fd9087 (diff)
hnbgw: Introduce LOGHNB() macro for log context information
So far we don't really have any way of matching a given log message to a specific hNB. Let's introduce a new log macro, together with a configuration directive to select whether the hNB-ID or the UMTS CellID shall be used. Change-Id: I6113925216c6f88add2c6d27bdf47ccbb017f293
Diffstat (limited to 'include/osmocom/iuh/hnbgw.h')
-rw-r--r--include/osmocom/iuh/hnbgw.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/osmocom/iuh/hnbgw.h b/include/osmocom/iuh/hnbgw.h
index 4848c2f..fc8298d 100644
--- a/include/osmocom/iuh/hnbgw.h
+++ b/include/osmocom/iuh/hnbgw.h
@@ -18,6 +18,9 @@ enum {
DRANAP,
};
+#define LOGHNB(x, ss, lvl, fmt, args ...) \
+ LOGP(ss, lvl, "%s " fmt, hnb_context_name(x), ## args)
+
enum hnb_ctrl_node {
CTRL_NODE_HNB = _LAST_CTRL_NODE,
_LAST_CTRL_NODE_HNB
@@ -128,6 +131,8 @@ struct hnb_gw {
const char *iups_remote_addr_name;
uint16_t rnc_id;
bool hnbap_allow_tmsi;
+ /*! print hnb-id (true) or MCC-MNC-LAC-RAC-SAC (false) in logs */
+ bool log_prefix_hnb_id;
} config;
/*! SCTP listen socket for incoming connections */
struct osmo_stream_srv_link *iuh;
@@ -152,6 +157,7 @@ extern void *talloc_asn1_ctx;
struct hnb_context *hnb_context_by_id(struct hnb_gw *gw, uint32_t cid);
struct hnb_context *hnb_context_by_identity_info(struct hnb_gw *gw, const char *identity_info);
+const char *hnb_context_name(struct hnb_context *ctx);
unsigned hnb_contexts(const struct hnb_gw *gw);
struct ue_context *ue_context_by_id(struct hnb_gw *gw, uint32_t id);