summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2019-10-19 12:19:15 +0200
committerHarald Welte <laforge@osmocom.org>2019-10-19 12:19:15 +0200
commit1c197af06c0fad5d3310bf1fca59fdfb77b8f0bc (patch)
treeab81d89789e5041ad44ecea920523ffec8e4cd8d
parent87c1550d7056a711317b04af184292ed7c7c86a8 (diff)
Move definition of LOGSS7() to header file; add LOGPAS() like LOGPASP()
-rw-r--r--include/osmocom/sigtran/osmo_ss7.h8
-rw-r--r--src/osmo_ss7.c3
2 files changed, 7 insertions, 4 deletions
diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h
index f448ce7..14e2b7c 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -430,8 +430,14 @@ typedef int osmo_ss7_asp_rx_unknown_cb(struct osmo_ss7_asp *asp, int ppid_mux, s
void osmo_ss7_register_rx_unknown_cb(osmo_ss7_asp_rx_unknown_cb *cb);
+#define _LOGSS7(inst, subsys, level, fmt, args ...) \
+ LOGP(subsys, level, "%u: " fmt, inst ? (inst)->cfg.id : 0, ## args)
+#define LOGSS7(inst, level, fmt, args ...) _LOGSS7(inst, DLSS7, level, fmt, ## args)
+
#define LOGPASP(asp, subsys, level, fmt, args ...) \
- LOGP(subsys, level, "asp-%s: " fmt, (asp)->cfg.name, ## args)
+ _LOGSS7((asp)->inst, subsys, level, "asp-%s: " fmt, (asp)->cfg.name, ## args)
+#define LOGPAS(as, subsys, level, fmt, args ...) \
+ _LOGSS7((as)->inst, subsys, level, "as-%s: " fmt, (as)->cfg.name, ## args)
/***********************************************************************
* xUA Servers
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 053feca..8519ced 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -74,9 +74,6 @@ struct value_string osmo_ss7_asp_protocol_vals[] = {
{ 0, NULL }
};
-#define LOGSS7(inst, level, fmt, args ...) \
- LOGP(DLSS7, level, "%u: " fmt, inst ? (inst)->cfg.id : 0, ## args)
-
static int asp_proto_to_ip_proto(enum osmo_ss7_asp_protocol proto)
{
switch (proto) {