Change in libosmocore[master]: gprs_bssgp: log source and destination RIM routing information

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

pespin gerrit-no-reply at lists.osmocom.org
Wed Jan 27 11:59:27 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/22440 )

Change subject: gprs_bssgp: log source and destination RIM routing information
......................................................................

gprs_bssgp: log source and destination RIM routing information

Whenever a RIM PDU is received, log to which RIM routing information
(address) it is going to and where it is comming from.

Change-Id: Ia08d3b162a4f6257cccaa7f0764fa7ea498355ef
Related: SYS#5103
---
M src/gb/gprs_bssgp.c
M src/gb/gprs_bssgp_util.c
2 files changed, 12 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved



diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c
index 6fdacce..4154c4b 100644
--- a/src/gb/gprs_bssgp.c
+++ b/src/gb/gprs_bssgp.c
@@ -653,8 +653,8 @@
 	uint16_t nsei = msgb_nsei(msg);
 	struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *)msgb_bssgph(msg);
 	enum bssgp_prim prim;
-
-	DEBUGP(DLBSSGP, "BSSGP BVCI=%u Rx RIM-PDU:%s\n", bvci, bssgp_pdu_str(bgph->pdu_type));
+	char ri_src_str[64];
+	char ri_dest_str[64];
 
 	/* Specify PRIM type based on the RIM PDU */
 	switch (bgph->pdu_type) {
@@ -677,6 +677,10 @@
 	nmp.tp = tp;
 	if (bssgp_parse_rim_pdu(&nmp.u.rim_pdu, msg) < 0)
 		return bssgp_tx_status(BSSGP_CAUSE_MISSING_MAND_IE, NULL, msg);
+	DEBUGP(DLBSSGP, "BSSGP BVCI=%u Rx RIM-PDU:%s, src=%s, dest=%s\n",
+	       bvci, bssgp_pdu_str(bgph->pdu_type),
+	       bssgp_rim_ri_name_buf(ri_src_str, sizeof(ri_src_str), &nmp.u.rim_pdu.routing_info_src),
+	       bssgp_rim_ri_name_buf(ri_dest_str, sizeof(ri_dest_str), &nmp.u.rim_pdu.routing_info_dest));
 	osmo_prim_init(&nmp.oph, SAP_BSSGP_RIM, prim, PRIM_OP_INDICATION, msg);
 	bssgp_prim_cb(&nmp.oph, NULL);
 
diff --git a/src/gb/gprs_bssgp_util.c b/src/gb/gprs_bssgp_util.c
index d93c9df..e00aed9 100644
--- a/src/gb/gprs_bssgp_util.c
+++ b/src/gb/gprs_bssgp_util.c
@@ -594,6 +594,8 @@
 {
 	struct msgb *msg;
 	struct bssgp_normal_hdr *bgph;
+	char ri_src_str[64];
+	char ri_dest_str[64];
 
 	/* Encode RIM PDU into mesage buffer */
 	msg = bssgp_encode_rim_pdu(pdu);
@@ -607,7 +609,10 @@
 	msgb_bvci(msg) = 0;	/* Signalling */
 
 	bgph = (struct bssgp_normal_hdr *)msgb_bssgph(msg);
-	DEBUGP(DLBSSGP, "BSSGP BVCI=0 Tx RIM-PDU:%s\n", bssgp_pdu_str(bgph->pdu_type));
+	DEBUGP(DLBSSGP, "BSSGP BVCI=0 Tx RIM-PDU:%s, src=%s, dest=%s\n",
+	       bssgp_pdu_str(bgph->pdu_type),
+	       bssgp_rim_ri_name_buf(ri_src_str, sizeof(ri_src_str), &pdu->routing_info_src),
+	       bssgp_rim_ri_name_buf(ri_dest_str, sizeof(ri_dest_str), &pdu->routing_info_dest));
 
 	return bssgp_ns_send(bssgp_ns_send_data, msg);
 }

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/22440
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia08d3b162a4f6257cccaa7f0764fa7ea498355ef
Gerrit-Change-Number: 22440
Gerrit-PatchSet: 4
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210127/b85d910b/attachment.htm>


More information about the gerrit-log mailing list