[PATCH] osmo-iuh[master]: rua_to_scu(), rua_rx_init_connect(): add debug logging

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon Jul 3 20:49:21 UTC 2017


Review at  https://gerrit.osmocom.org/3111

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
---
M src/hnbgw_rua.c
1 file changed, 21 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/11/3111/1

diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c
index 329f990..54c455b 100644
--- a/src/hnbgw_rua.c
+++ b/src/hnbgw_rua.c
@@ -38,6 +38,18 @@
 #include <osmocom/iuh/context_map.h>
 #include <osmocom/hnbap/CN-DomainIndicator.h>
 
+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 @@
 	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 @@
 
 	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,

-- 
To view, visit https://gerrit.osmocom.org/3111
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe510bf0aca5eadbc0ce6031d3026e770de6559f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list