[PATCH] osmo-msc[master]: cosmetic: Use msgb_hexdump*() rather than manual osmo_hexdum...

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
Fri Feb 9 01:22:31 UTC 2018


cosmetic: Use msgb_hexdump*() rather than manual osmo_hexdump() on msg

This requires libosmocore Change-Id I98e85397fb541ee0fd711f2e1852f63f3bb87359

Change-Id: Ieeb97a9f1eba2fdef84294b8c8c7ac0984ae5c70
---
M src/libcommon/gsup_test_client.c
M src/libmsc/a_iface.c
M src/libmsc/a_iface_bssap.c
M src/libmsc/gsm_04_11.c
M src/libmsc/smpp_smsc.c
M src/osmo-msc/msc_main.c
6 files changed, 16 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/29/6329/2

diff --git a/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c
index 963b495..8b6199e 100644
--- a/src/libcommon/gsup_test_client.c
+++ b/src/libcommon/gsup_test_client.c
@@ -220,7 +220,7 @@
 	struct imsi_op *io;
 	int rc;
 
-	DEBUGP(DLGSUP, "Rx GSUP %s\n", osmo_hexdump(msgb_l2(msg), msgb_l2len(msg)));
+	DEBUGP(DLGSUP, "Rx GSUP %s\n", msgb_hexdump(msg));
 
 	rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup_msg);
 	if (rc < 0)
diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c
index 600dbb8..f4706e5 100644
--- a/src/libmsc/a_iface.c
+++ b/src/libmsc/a_iface.c
@@ -173,7 +173,7 @@
 		return -EINVAL;
 	}
 
-	LOGPCONN(conn, LOGL_DEBUG, "N-DATA.req(%s)\n", osmo_hexdump(msg_resp->data, msg_resp->len));
+	LOGPCONN(conn, LOGL_DEBUG, "N-DATA.req(%s)\n", msgb_hexdump_l2(msg_resp));
 	/* osmo_sccp_tx_data_msg() takes ownership of msg_resp */
 	return osmo_sccp_tx_data_msg(conn->a.scu, conn->a.conn_id, msg_resp);
 }
@@ -192,7 +192,7 @@
 	LOGPC(DMSC, LOGL_DEBUG, " key %s\n", osmo_hexdump_nospc(ei->key, ei->key_len));
 
 	msg_resp = gsm0808_create_cipher(ei, include_imeisv ? &crm : NULL);
-	LOGPCONN(conn, LOGL_DEBUG, "N-DATA.req(%s)\n", osmo_hexdump(msg_resp->data, msg_resp->len));
+	LOGPCONN(conn, LOGL_DEBUG, "N-DATA.req(%s)\n", msgb_hexdump_l2(msg_resp));
 
 	return osmo_sccp_tx_data_msg(conn->a.scu, conn->a.conn_id, msg_resp);
 }
@@ -424,7 +424,7 @@
 
 	msg = gsm0808_create_ass(&ct, NULL, &rtp_addr, &scl, ci_ptr);
 
-	LOGPCONN(conn, LOGL_DEBUG, "N-DATA.req(%s)\n", osmo_hexdump(msg->data, msg->len));
+	LOGPCONN(conn, LOGL_DEBUG, "N-DATA.req(%s)\n", msgb_hexdump_l2(msg));
 	return osmo_sccp_tx_data_msg(conn->a.scu, conn->a.conn_id, msg);
 }
 
@@ -537,7 +537,7 @@
 			/* This BSC is already known to us, check if we have been through reset yet */
 			if (a_reset_conn_ready(a_conn_info.bsc->reset) == false) {
 				LOGP(DMSC, LOGL_NOTICE, "Refusing N-CONNECT.ind(%u, %s), BSC not reset yet\n",
-				     scu_prim->u.connect.conn_id, osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg)));
+				     scu_prim->u.connect.conn_id, msgb_hexdump_l2(oph->msg));
 				rc = osmo_sccp_tx_disconn(scu, a_conn_info.conn_id, &a_conn_info.bsc->msc_addr,
 							  SCCP_RETURN_CAUSE_UNQUALIFIED);
 				break;
@@ -546,7 +546,7 @@
 			osmo_sccp_tx_conn_resp(scu, scu_prim->u.connect.conn_id, &scu_prim->u.connect.called_addr, NULL, 0);
 			if (msgb_l2len(oph->msg) > 0) {
 				LOGP(DMSC, LOGL_DEBUG, "N-CONNECT.ind(%u, %s)\n",
-				     scu_prim->u.connect.conn_id, osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg)));
+				     scu_prim->u.connect.conn_id, msgb_hexdump_l2(oph->msg));
 				rc = a_sccp_rx_dt(scu, &a_conn_info, oph->msg);
 			} else
 				LOGP(DMSC, LOGL_DEBUG, "N-CONNECT.ind(%u)\n", scu_prim->u.connect.conn_id);
@@ -560,13 +560,13 @@
 		bsc_con = find_bsc_con(scu_prim->u.data.conn_id);
 		if (!bsc_con) {
 			LOGP(DMSC, LOGL_ERROR, "N-DATA.ind(%u, %s) for unknown conn_id\n",
-				scu_prim->u.data.conn_id, osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg)));
+				scu_prim->u.data.conn_id, msgb_hexdump_l2(oph->msg));
 			break;
 		}
 		a_conn_info.conn_id = scu_prim->u.data.conn_id;
 		a_conn_info.bsc = bsc_con->bsc;
 		LOGP(DMSC, LOGL_DEBUG, "N-DATA.ind(%u, %s)\n",
-		     scu_prim->u.data.conn_id, osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg)));
+		     scu_prim->u.data.conn_id, msgb_hexdump_l2(oph->msg));
 		a_sccp_rx_dt(scu, &a_conn_info, oph->msg);
 		break;
 
@@ -580,7 +580,7 @@
 			/* if this not an inbound RESET, trigger an outbound RESET */
 			if (!bssmap_is_reset(oph->msg)) {
 				LOGP(DMSC, LOGL_NOTICE, "Ignoring N-UNITDATA.ind(%s), BSC not reset yet\n",
-					osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg)));
+					msgb_hexdump_l2(oph->msg));
 				a_start_reset(a_conn_info.bsc, false);
 				break;
 			}
@@ -588,11 +588,11 @@
 			/* This BSC is already known to us, check if we have been through reset yet */
 			if (a_reset_conn_ready(a_conn_info.bsc->reset) == false) {
 				LOGP(DMSC, LOGL_NOTICE, "Ignoring N-UNITDATA.ind(%s), BSC not reset yet\n",
-					osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg)));
+					msgb_hexdump_l2(oph->msg));
 				break;
 			}
 		}
-		DEBUGP(DMSC, "N-UNITDATA.ind(%s)\n", osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg)));
+		DEBUGP(DMSC, "N-UNITDATA.ind(%s)\n", msgb_hexdump_l2(oph->msg));
 		a_sccp_rx_udt(scu, &a_conn_info, oph->msg);
 		break;
 
diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c
index 7f0350b..1feecde 100644
--- a/src/libmsc/a_iface_bssap.c
+++ b/src/libmsc/a_iface_bssap.c
@@ -191,7 +191,7 @@
 	OSMO_ASSERT(a_conn_info);
 	OSMO_ASSERT(msg);
 
-	LOGP(DMSC, LOGL_NOTICE, "Rx BSC UDT: %s\n", osmo_hexdump(msgb_l2(msg), msgb_l2len(msg)));
+	LOGP(DMSC, LOGL_NOTICE, "Rx BSSMAP UDT: %s\n", msgb_hexdump_l2(msg));
 
 	if (msgb_l2len(msg) < sizeof(*bs)) {
 		LOGP(DMSC, LOGL_ERROR, "Error: Header is too short -- discarding message!\n");
@@ -698,7 +698,7 @@
 	OSMO_ASSERT(a_conn_info);
 	OSMO_ASSERT(msg);
 
-	LOGP(DMSC, LOGL_NOTICE, "Rx BSC DT: %s\n", osmo_hexdump(msgb_l2(msg), msgb_l2len(msg)));
+	LOGP(DMSC, LOGL_NOTICE, "Rx BSC DT: %s\n", msgb_hexdump(msg));
 
 	if (msgb_l2len(msg) < sizeof(struct bssmap_header)) {
 		LOGP(DMSC, LOGL_NOTICE, "The header is too short -- discarding message!\n");
diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c
index 62c2902..45b56d2 100644
--- a/src/libmsc/gsm_04_11.c
+++ b/src/libmsc/gsm_04_11.c
@@ -122,7 +122,7 @@
 
 static int gsm411_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg)
 {
-	DEBUGP(DLSMS, "GSM4.11 TX %s\n", osmo_hexdump(msg->data, msg->len));
+	DEBUGP(DLSMS, "GSM4.11 TX %s\n", msgb_hexdump(msg));
 	msg->l3h = msg->data;
 	return msc_tx_dtap(conn, msg);
 }
diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c
index f9fef8b..b889b52 100644
--- a/src/libmsc/smpp_smsc.c
+++ b/src/libmsc/smpp_smsc.c
@@ -742,7 +742,7 @@
 	int rc = 0;
 
 	LOGP(DSMPP, LOGL_DEBUG, "[%s] smpp_pdu_rx(%s)\n", esme->system_id,
-	     osmo_hexdump(msgb_data(msg), msgb_length(msg)));
+	     msgb_hexdump(msg));
 
 	switch (cmd_id) {
 	case GENERIC_NACK:
diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c
index 98f1920..2413c43 100644
--- a/src/osmo-msc/msc_main.c
+++ b/src/osmo-msc/msc_main.c
@@ -278,9 +278,7 @@
 #ifdef BUILD_IU
 static int rcvmsg_iu_cs(struct msgb *msg, struct gprs_ra_id *ra_id, uint16_t *sai)
 {
-	DEBUGP(DIUCS, "got IuCS message"
-	       " %d bytes: %s\n",
-	       msg->len, osmo_hexdump(msg->data, msg->len));
+	DEBUGP(DIUCS, "got IuCS message %d bytes: %s\n", msg->len, msgb_hexdump(msg));
 	if (ra_id) {
 		DEBUGP(DIUCS, "got IuCS message on"
 		       " MNC %d MCC %d LAC %d RAC %d\n",

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ieeb97a9f1eba2fdef84294b8c8c7ac0984ae5c70
Gerrit-PatchSet: 2
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list