From 16929dc75c8c8e507565b6a6b6a52ba5140c63a9 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Fri, 2 Mar 2018 16:12:02 +0100 Subject: ipac: fix log output The current log output logs connect_ip connect_port speech mode and payload type over multiple lines and without logging context (lchan name). Also the logging level incorrectly set. - shrink log output into one line. - add context (lchan name) - encode ip/port into human readable form Change-Id: I61044edc0672b268aeebf48b59a772887703399f Closes: OS#3001 --- src/common/rsl.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/common/rsl.c b/src/common/rsl.c index 98e8913b..d048c82c 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1689,6 +1689,7 @@ static int rsl_rx_ipac_XXcx(struct msgb *msg) int rc, inc_ip_port = 0, port; char *name; struct in_addr ia; + struct in_addr addr; if (dch->c.msg_type == RSL_MT_IPAC_CRCX) name = "CRCX"; @@ -1705,31 +1706,28 @@ static int rsl_rx_ipac_XXcx(struct msgb *msg) return tx_ipac_XXcx_nack(lchan, RSL_ERR_MAND_IE_ERROR, 0, dch->c.msg_type); + LOGP(DRSL, LOGL_DEBUG, "%s IPAC_%s: ", gsm_lchan_name(lchan), name); if (TLVP_PRES_LEN(&tp, RSL_IE_IPAC_REMOTE_IP, 4)) { connect_ip = tlvp_val32_unal(&tp, RSL_IE_IPAC_REMOTE_IP); - LOGP(DRSL, LOGL_NOTICE, "connect_ip %d \n", connect_ip ); + addr.s_addr = connect_ip; + LOGPC(DRSL, LOGL_DEBUG, "connect_ip=%s ", inet_ntoa(addr)); } - else - LOGP(DRSL, LOGL_NOTICE, "CRCX does not specify a remote IP\n"); if (TLVP_PRES_LEN(&tp, RSL_IE_IPAC_REMOTE_PORT, 2)) { connect_port = tlvp_val16_unal(&tp, RSL_IE_IPAC_REMOTE_PORT); - LOGP(DRSL, LOGL_NOTICE, "connect_port %d \n", connect_port ); + LOGPC(DRSL, LOGL_DEBUG, "connect_port=%u ", + ntohs(connect_port)); } - else - LOGP(DRSL, LOGL_NOTICE, "CRCX does not specify a remote port\n"); speech_mode = TLVP_VAL(&tp, RSL_IE_IPAC_SPEECH_MODE); if (speech_mode) - LOGP(DRSL, LOGL_NOTICE, "speech mode: %d\n", *speech_mode); - else - LOGP(DRSL, LOGL_NOTICE, "speech mode: none\n"); + LOGPC(DRSL, LOGL_DEBUG, "speech_mode=%u ", *speech_mode); payload_type = TLVP_VAL(&tp, RSL_IE_IPAC_RTP_PAYLOAD); if (payload_type) - LOGP(DRSL, LOGL_NOTICE, "payload type: %d\n",*payload_type); - else - LOGP(DRSL, LOGL_NOTICE, "payload type: none\n"); + LOGPC(DRSL, LOGL_DEBUG, "payload_type=%u ", *payload_type); + + LOGPC(DRSL, LOGL_DEBUG, "\n"); payload_type2 = TLVP_VAL(&tp, RSL_IE_IPAC_RTP_PAYLOAD2); -- cgit v1.2.3