[PATCH] libosmo-sccp[master]: sua.c: Print xUA IEI always in hex representation

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Feb 15 23:05:56 UTC 2017


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

sua.c: Print xUA IEI always in hex representation

... as that's what used in the IETF RFCs and thus more natural when
looking at documentation and logs.

Change-Id: I9aa8eac82748c4e7656a12c42d9ff28573d8413b
---
M src/sua.c
1 file changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/33/1833/1

diff --git a/src/sua.c b/src/sua.c
index fac3de1..4f18466 100644
--- a/src/sua.c
+++ b/src/sua.c
@@ -649,12 +649,12 @@
 	uint16_t par_tag, par_len, par_datalen;
 	uint32_t *p32;
 
-	LOGP(DSUA, LOGL_DEBUG, "%s(IEI=%d) (%d) %s\n", __func__,
+	LOGP(DSUA, LOGL_DEBUG, "%s(IEI=0x%04x) (%d) %s\n", __func__,
 	     param->tag, param->len,
 	     osmo_hexdump(param->dat, param->len));
 
 	if (param->len < 4) {
-		LOGP(DSUA, LOGL_ERROR, "SUA IEI %d: invalid address length: %d\n",
+		LOGP(DSUA, LOGL_ERROR, "SUA IEI 0x%04x: invalid address length: %d\n",
 		     param->tag, param->len);
 		return -EINVAL;
 	}
@@ -677,13 +677,13 @@
 		break;
 	case SUA_RI_HOST:
 	default:
-		LOGP(DSUA, LOGL_ERROR, "SUA IEI %d: Routing Indicator not supported yet: %d\n",
+		LOGP(DSUA, LOGL_ERROR, "SUA IEI 0x%04x: Routing Indicator not supported yet: %d\n",
 		     param->tag, ri);
 		return -ENOTSUP;
 	}
 
 	if (ai != 7) {
-		LOGP(DSUA, LOGL_ERROR, "SUA IEI %d: Address Indicator not supported yet: %x\n",
+		LOGP(DSUA, LOGL_ERROR, "SUA IEI 0x%04x: Address Indicator not supported yet: %x\n",
 		     param->tag, ai);
 		return -ENOTSUP;
 	}
@@ -702,7 +702,7 @@
 		par_len = ntohs(par->len);
 		par_datalen = par_len - sizeof(*par);
 
-		LOGP(DSUA, LOGL_DEBUG, "SUA IEI %hu pos %hu/%hu: subpart tag %hu, len %hu\n",
+		LOGP(DSUA, LOGL_DEBUG, "SUA IEI 0x%04x pos %hu/%hu: subpart tag 0x%04x, len %hu\n",
 		     param->tag, pos, param->len, par->tag, par->len);
 
 		switch (par_tag) {
@@ -725,7 +725,7 @@
 			out->presence |= OSMO_SCCP_ADDR_T_GT;
 			break;
 		default:
-			LOGP(DSUA, LOGL_ERROR, "SUA IEI %d: Unknown subpart tag %hd\n",
+			LOGP(DSUA, LOGL_ERROR, "SUA IEI 0x%04x: Unknown subpart tag %hd\n",
 			     param->tag, par_tag);
 			goto subpar_fail;
 		}
@@ -736,7 +736,7 @@
 	return 0;
 
 subpar_fail:
-	LOGP(DSUA, LOGL_ERROR, "Failed to parse subparts of address IEI=%d\n",
+	LOGP(DSUA, LOGL_ERROR, "Failed to parse subparts of address IEI=0x%04x\n",
 	     param->tag);
 	return -EINVAL;
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9aa8eac82748c4e7656a12c42d9ff28573d8413b
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list