From c3614318af03527a3ed12a9835adbe1f3966b215 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 3 Jul 2017 14:34:38 +0200 Subject: [PATCH] rua_to_scu(), rua_rx_init_connect(): add debug logging In rua_to_scu(), log domain indicator and remote address. In rua_rx_init_connect(), add domain indicator to log. Change-Id: Ibe510bf0aca5eadbc0ce6031d3026e770de6559f --- src/hnbgw_rua.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index 329f990a..54c455b7 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -38,6 +38,18 @@ #include #include +static const char *cn_domain_indicator_to_str(CN_DomainIndicator_t cN_DomainIndicator) +{ + switch (cN_DomainIndicator) { + case RUA_CN_DomainIndicator_cs_domain: + return "IuCS"; + case RUA_CN_DomainIndicator_ps_domain: + return "IuPS"; + default: + return "(unknown-domain)"; + } +} + static int hnbgw_rua_tx(struct hnb_context *ctx, struct msgb *msg) { if (!msg) @@ -202,6 +214,11 @@ static int rua_to_scu(struct hnb_context *hnb, map = context_map_alloc_by_hnb(hnb, context_id, is_ps, cn); OSMO_ASSERT(map); + DEBUGP(DRUA, "rua_to_scu() %s to %s, rua_ctx_id %u scu_conn_id %u\n", + cn_domain_indicator_to_str(cN_DomainIndicator), + osmo_sccp_addr_dump(remote_addr), + map->rua_ctx_id, map->scu_conn_id); + /* add primitive header */ switch (type) { case OSMO_SCU_PRIM_N_CONNECT: @@ -311,8 +328,10 @@ static int rua_rx_init_connect(struct msgb *msg, ANY_t *in) context_id = asn1bitstr_to_u24(&ies.context_ID); - DEBUGP(DRUA, "RUA Connect.req(ctx=0x%x, %s)\n", context_id, - ies.establishment_Cause == RUA_Establishment_Cause_emergency_call + DEBUGP(DRUA, "RUA %s Connect.req(ctx=0x%x, %s)\n", + cn_domain_indicator_to_str(ies.cN_DomainIndicator), + context_id, + ies.establishment_Cause == RUA_Establishment_Cause_emergency_call ? "emergency" : "normal"); rc = rua_to_scu(hnb, ies.cN_DomainIndicator, OSMO_SCU_PRIM_N_CONNECT,