From 0fb33d2ed21ea7860bc073dbdb58177d920e280b Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Mon, 25 Jan 2021 22:58:59 +0100 Subject: 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 --- src/gb/gprs_bssgp.c | 8 ++++++-- src/gb/gprs_bssgp_util.c | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index 6fdacce6..4154c4b5 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -653,8 +653,8 @@ static int bssgp_rx_rim(struct msgb *msg, struct tlv_parsed *tp, uint16_t bvci) 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 @@ static int bssgp_rx_rim(struct msgb *msg, struct tlv_parsed *tp, uint16_t bvci) 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 d93c9df9..e00aed96 100644 --- a/src/gb/gprs_bssgp_util.c +++ b/src/gb/gprs_bssgp_util.c @@ -594,6 +594,8 @@ int bssgp_tx_rim(const struct bssgp_ran_information_pdu *pdu, uint16_t nsei) { 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 @@ int bssgp_tx_rim(const struct bssgp_ran_information_pdu *pdu, uint16_t nsei) 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); } -- cgit v1.2.3