aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2019-01-04 17:42:05 +0100
committerHarald Welte <laforge@gnumonks.org>2019-01-12 09:51:22 +0000
commit46c06e28c18241b586ecb5847daa6a5ab6b49b84 (patch)
treef8292008fcf31097489fac240a415418b42a17b3 /include
parent55d22d9e5e0176370c52932ef1928dc8386e9260 (diff)
add LOG_RAN_CONN() to use the conn->fi->id for context
For each conn, set a default logging category, to distinguish categories for BSSMAP and RANAP based conns. LOG_RAN_CONN(): log with the conn's default category, LOG_RAN_CONN_CAT(): log with a manually set category (mostly for keeping previous DMM logging on the same category). In some places, replace LOGP() using manual context with LOG_RAN_CONN(), and remove the manual context info, now provided by the conn->fi->id. This is loosely related to inter-BSC and inter-MSC handover: to speed up refactoring, I want to avoid the need for manual logging context and just use this LOG_RAN_CONN(). Change-Id: I0a7809840428b1e028df6eb683bc5ffcc8df474a
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/msc/a_iface.h8
-rw-r--r--include/osmocom/msc/ran_conn.h8
2 files changed, 8 insertions, 8 deletions
diff --git a/include/osmocom/msc/a_iface.h b/include/osmocom/msc/a_iface.h
index b1b6c1cc3..2d11ccabd 100644
--- a/include/osmocom/msc/a_iface.h
+++ b/include/osmocom/msc/a_iface.h
@@ -25,14 +25,6 @@
#include <osmocom/msc/vlr.h>
#include <osmocom/gsm/protocol/gsm_08_08.h>
-#define LOGPCONN(conn, level, fmt, args...) \
- LOGP(DBSSAP, level, "(subscr %s, conn_id %d) " fmt, \
- vlr_subscr_name(conn ? conn->vsub : NULL), conn ? conn->a.conn_id : -1, \
- ## args)
-
-#define LOGPBSCCONN(conn, level, fmt, args...) \
- LOGP(DBSSAP, level, "(conn_id %u) " fmt, conn ? conn->conn_id : (uint32_t)(-1), ## args)
-
/* A struct to keep a context information about the BSCs we are associated with */
struct bsc_context {
struct llist_head list;
diff --git a/include/osmocom/msc/ran_conn.h b/include/osmocom/msc/ran_conn.h
index 4aa771e3f..d134c30c5 100644
--- a/include/osmocom/msc/ran_conn.h
+++ b/include/osmocom/msc/ran_conn.h
@@ -8,6 +8,12 @@
#include <osmocom/mgcp_client/mgcp_client.h>
#include <osmocom/gsm/gsm_utils.h>
+#define LOG_RAN_CONN(conn, level, fmt, args ...) \
+ LOG_RAN_CONN_CAT(conn, (conn) ? (conn)->log_subsys : DMSC, level, fmt, ## args)
+
+#define LOG_RAN_CONN_CAT(conn, subsys, level, fmt, args ...) \
+ LOGPFSMSL((conn)? (conn)->fi : NULL, subsys, level, fmt, ## args)
+
enum ran_conn_fsm_event {
/* Accepted the initial Complete Layer 3 (starting to evaluate Authentication and Ciphering) */
RAN_CONN_E_COMPLETE_LAYER_3,
@@ -107,6 +113,8 @@ struct ran_conn {
/* connected via 2G or 3G? */
enum osmo_rat_type via_ran;
+ /* whether to log on DBSSAP, DIUCS, ... */
+ int log_subsys;
uint16_t lac;
struct geran_encr geran_encr;