aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo_ss7_hmrt.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-06-22 21:03:14 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-06-25 22:35:01 +0200
commit3468d5dce45e34a63b52061b8aaa9c095f473cf4 (patch)
treecb9b5108040ce263d7b41eefc1eef932d399e26c /src/osmo_ss7_hmrt.c
parent4e015f6664ce730e1b44107a0f2f05971ae628bd (diff)
add/tweak various logging to help figure out complex routing
Add function osmo_ss7_point_code_print2() to be able to print two point codes in the same log message. Change signatures of two static functions to aid logging: add invalid ref arg to sccp_scoc_rx_inval_src_ref(), pass conn instead of inst to sccp_scoc_rx_inval_opc(). Change-Id: Ia3243606d6cad7721f7da7f6caba2caa90ae2bbd
Diffstat (limited to 'src/osmo_ss7_hmrt.c')
-rw-r--r--src/osmo_ss7_hmrt.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/osmo_ss7_hmrt.c b/src/osmo_ss7_hmrt.c
index e66762d..8165a36 100644
--- a/src/osmo_ss7_hmrt.c
+++ b/src/osmo_ss7_hmrt.c
@@ -138,20 +138,33 @@ static int hmrt_message_for_routing(struct osmo_ss7_instance *inst,
/* FIXME: Transmit over respective Link */
if (rt->dest.as) {
struct osmo_ss7_as *as = rt->dest.as;
+ DEBUGP(DLSS7,
+ "Found route for dpc=%u=%s: pc=%u=%s mask=0x%x"
+ " via AS %s proto=%s\n",
+ dpc, osmo_ss7_pointcode_print(inst, dpc),
+ rt->cfg.pc, osmo_ss7_pointcode_print2(inst, rt->cfg.pc), rt->cfg.mask,
+ as->cfg.name, osmo_ss7_asp_protocol_name(as->cfg.proto));
+
switch (as->cfg.proto) {
case OSMO_SS7_ASP_PROT_M3UA:
+ DEBUGP(DLSS7, "rt->dest.as proto is M3UA for dpc=%u=%s\n",
+ dpc, osmo_ss7_pointcode_print(inst, dpc));
return m3ua_tx_xua_as(as,xua);
case OSMO_SS7_ASP_PROT_IPA:
return ipa_tx_xua_as(as, xua);
default:
LOGP(DLSS7, LOGL_ERROR, "MTP message "
- "for ASP of unknown protocol%u\n",
+ "for ASP of unknown protocol %u\n",
as->cfg.proto);
break;
}
} else if (rt->dest.linkset) {
- LOGP(DLSS7, LOGL_ERROR, "MTP-TRANSFER.req for linkset"
- "%s unsupported\n",rt->dest.linkset->cfg.name);
+ LOGP(DLSS7, LOGL_ERROR,
+ "Found route for dpc=%u=%s: pc=%u=%s mask=0x%x"
+ " via linkset %s, but MTP-TRANSFER.req unsupported for linkset.\n",
+ dpc, osmo_ss7_pointcode_print(inst, dpc),
+ rt->cfg.pc, osmo_ss7_pointcode_print2(inst, rt->cfg.pc), rt->cfg.mask,
+ rt->dest.linkset->cfg.name);
} else
OSMO_ASSERT(0);
} else {
@@ -171,8 +184,12 @@ int m3ua_hmdc_rx_from_l2(struct osmo_ss7_instance *inst, struct xua_msg *xua)
{
uint32_t dpc = xua->mtp.dpc;
if (osmo_ss7_pc_is_local(inst, dpc)) {
+ DEBUGP(DLSS7, "%s(): found dpc=%u=%s as local\n", __func__,
+ dpc, osmo_ss7_pointcode_print(inst, dpc));
return hmdt_message_for_distribution(inst, xua);
} else {
+ DEBUGP(DLSS7, "%s(): dpc=%u=%s not local, message is for routing\n", __func__,
+ dpc, osmo_ss7_pointcode_print(inst, dpc));
return hmrt_message_for_routing(inst, xua);
}
}