[MERGED] osmo-mgw[master]: cosmetic: clearly mark endpoint numbers as hex

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 Dec 1 11:58:25 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: cosmetic: clearly mark endpoint numbers as hex
......................................................................


cosmetic: clearly mark endpoint numbers as hex

The log prints the endpoint numbers as hexadecimal numbers, but
it does not prefix them with "0x".

Add "0x" prefixes to all endpoint number outputs in the log

Change-Id: I284627de02cd140a894445375e9152ff007a71e6
---
M src/libosmo-mgcp/mgcp_conn.c
M src/libosmo-mgcp/mgcp_msg.c
M src/libosmo-mgcp/mgcp_network.c
M src/libosmo-mgcp/mgcp_protocol.c
4 files changed, 83 insertions(+), 83 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c
index dcfc2ff..ae3f026 100644
--- a/src/libosmo-mgcp/mgcp_conn.c
+++ b/src/libosmo-mgcp/mgcp_conn.c
@@ -61,7 +61,7 @@
 		}
 	}
 
-	LOGP(DLMGCP, LOGL_ERROR, "endpoint:%x, unable to generate a unique connectionIdentifier\n",
+	LOGP(DLMGCP, LOGL_ERROR, "endpoint:0x%x, unable to generate a unique connectionIdentifier\n",
 	     ENDPOINT_NUMBER(endp));
 
 	return -1;
diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c
index 9803921..17b1026 100644
--- a/src/libosmo-mgcp/mgcp_msg.c
+++ b/src/libosmo-mgcp/mgcp_msg.c
@@ -82,7 +82,7 @@
 
 	if (!mode) {
 		LOGP(DLMGCP, LOGL_ERROR,
-		     "endpoint:%x missing connection mode\n",
+		     "endpoint:0x%x missing connection mode\n",
 		     ENDPOINT_NUMBER(endp));
 		return -1;
 	}
@@ -101,7 +101,7 @@
 		conn->mode = MGCP_CONN_LOOPBACK;
 	else {
 		LOGP(DLMGCP, LOGL_ERROR,
-		     "endpoint:%x unknown connection mode: '%s'\n",
+		     "endpoint:0x%x unknown connection mode: '%s'\n",
 		     ENDPOINT_NUMBER(endp), mode);
 		ret = -1;
 	}
@@ -113,16 +113,16 @@
 	}
 
 	LOGP(DLMGCP, LOGL_DEBUG,
-	     "endpoint:%x conn:%s\n",
+	     "endpoint:0x%x conn:%s\n",
 	     ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn));
 
 	LOGP(DLMGCP, LOGL_DEBUG,
-	     "endpoint:%x connection mode '%s' %d\n",
+	     "endpoint:0x%x connection mode '%s' %d\n",
 	     ENDPOINT_NUMBER(endp), mode, conn->mode);
 
 	/* Special handling für RTP connections */
 	if (conn->type == MGCP_CONN_TYPE_RTP) {
-		LOGP(DLMGCP, LOGL_DEBUG, "endpoint:%x output_enabled %d\n",
+		LOGP(DLMGCP, LOGL_DEBUG, "endpoint:0x%x output_enabled %d\n",
 		     ENDPOINT_NUMBER(endp), conn->u.rtp.end.output_enabled);
 	}
 
@@ -318,7 +318,7 @@
 
 	if (strcmp(endp->callid, callid) != 0) {
 		LOGP(DLMGCP, LOGL_ERROR,
-		     "endpoint:%x CallIDs does not match '%s' != '%s'\n",
+		     "endpoint:0x%x CallIDs does not match '%s' != '%s'\n",
 		     ENDPOINT_NUMBER(endp), endp->callid, callid);
 		return -1;
 	}
@@ -335,7 +335,7 @@
 	/* Check for null identifiers */
 	if (!conn_id) {
 		LOGP(DLMGCP, LOGL_ERROR,
-		     "endpoint:%x invalid ConnectionIdentifier (missing)\n",
+		     "endpoint:0x%x invalid ConnectionIdentifier (missing)\n",
 		     ENDPOINT_NUMBER(endp));
 		return -1;
 	}
@@ -343,7 +343,7 @@
 	/* Check for empty connection identifiers */
 	if (strlen(conn_id) == 0) {
 		LOGP(DLMGCP, LOGL_ERROR,
-		     "endpoint:%x invalid ConnectionIdentifier (empty)\n",
+		     "endpoint:0x%x invalid ConnectionIdentifier (empty)\n",
 		     ENDPOINT_NUMBER(endp));
 		return -1;
 	}
@@ -351,7 +351,7 @@
 	/* Check for over long connection identifiers */
 	if (strlen(conn_id) > MGCP_CONN_ID_LENGTH) {
 		LOGP(DLMGCP, LOGL_ERROR,
-		     "endpoint:%x invalid ConnectionIdentifier (too long) 0x%s\n",
+		     "endpoint:0x%x invalid ConnectionIdentifier (too long) 0x%s\n",
 		     ENDPOINT_NUMBER(endp), conn_id);
 		return -1;
 	}
@@ -361,7 +361,7 @@
 		return 0;
 
 	LOGP(DLMGCP, LOGL_ERROR,
-	     "endpoint:%x no connection found under ConnectionIdentifier 0x%s\n",
+	     "endpoint:0x%x no connection found under ConnectionIdentifier 0x%s\n",
 	     ENDPOINT_NUMBER(endp), conn_id);
 
 	return -1;
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index 816f16b..eb44f9b 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -73,11 +73,11 @@
 		rc = osmo_sock_local_ip(addr, inet_ntoa(conn->end.addr));
 		if (rc < 0)
 			LOGP(DRTP, LOGL_ERROR,
-			     "endpoint:%x CI:%s local interface auto detection failed, using configured addresses...\n",
+			     "endpoint:0x%x CI:%s local interface auto detection failed, using configured addresses...\n",
 			     ENDPOINT_NUMBER(endp), conn->conn->id);
 		else {
 			LOGP(DRTP, LOGL_DEBUG,
-			     "endpoint:%x CI:%s selected local rtp bind ip %s by probing using remote ip %s\n",
+			     "endpoint:0x%x CI:%s selected local rtp bind ip %s by probing using remote ip %s\n",
 			     ENDPOINT_NUMBER(endp), conn->conn->id, addr,
 			     inet_ntoa(conn->end.addr));
 			return;
@@ -90,7 +90,7 @@
 		 * if so, use that IP-Address */
 		osmo_strlcpy(addr, endp->cfg->net_ports.bind_addr, INET_ADDRSTRLEN);
 		LOGP(DRTP, LOGL_DEBUG,
-		     "endpoint:%x CI:%s using configured rtp bind ip as local bind ip %s\n",
+		     "endpoint:0x%x CI:%s using configured rtp bind ip as local bind ip %s\n",
 		     ENDPOINT_NUMBER(endp), conn->conn->id, addr);
 	} else {
 		/* No specific bind IP is configured for the RTP traffic, so
@@ -98,7 +98,7 @@
 		 * as bind IP */
 		osmo_strlcpy(addr, endp->cfg->source_addr, INET_ADDRSTRLEN);
 		LOGP(DRTP, LOGL_DEBUG,
-		     "endpoint:%x CI:%s using mgcp bind ip as local rtp bind ip: %s\n",
+		     "endpoint:0x%x CI:%s using mgcp bind ip as local rtp bind ip: %s\n",
 		     ENDPOINT_NUMBER(endp), conn->conn->id, addr);
 	}
 }
@@ -162,8 +162,8 @@
 	OSMO_ASSERT(conn);
 
 	LOGP(DRTP, LOGL_DEBUG,
-	     "endpoint:%x sending dummy packet...\n", ENDPOINT_NUMBER(endp));
-	LOGP(DRTP, LOGL_DEBUG, "endpoint:%x conn:%s\n",
+	     "endpoint:0x%x sending dummy packet...\n", ENDPOINT_NUMBER(endp));
+	LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x conn:%s\n",
 	     ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn));
 
 	rc = mgcp_udp_send(conn->end.rtp.fd, &conn->end.addr,
@@ -184,7 +184,7 @@
 
 failed:
 	LOGP(DRTP, LOGL_ERROR,
-	     "endpoint:%x Failed to send dummy %s packet.\n",
+	     "endpoint:0x%x Failed to send dummy %s packet.\n",
 	     ENDPOINT_NUMBER(endp), was_rtcp ? "RTCP" : "RTP");
 
 	return -1;
@@ -393,7 +393,7 @@
 				struct mgcp_rtp_end *dst_end,
 				char *data, int *len, int buf_size)
 {
-	LOGP(DRTP, LOGL_DEBUG, "endpoint:%x transcoding disabled\n",
+	LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x transcoding disabled\n",
 	     ENDPOINT_NUMBER(endp));
 	return 0;
 }
@@ -407,7 +407,7 @@
 				      struct mgcp_rtp_end *dst_end,
 				      struct mgcp_rtp_end *src_end)
 {
-	LOGP(DRTP, LOGL_DEBUG, "endpoint:%x transcoding disabled\n",
+	LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x transcoding disabled\n",
 	     ENDPOINT_NUMBER(endp));
 	return 0;
 }
@@ -419,7 +419,7 @@
 					  struct mgcp_conn_rtp *conn)
 {
 	LOGP(DRTP, LOGL_DEBUG,
-	     "endpoint:%x conn:%s using format defaults\n",
+	     "endpoint:0x%x conn:%s using format defaults\n",
 	     ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn));
 
 	*payload_type = conn->end.codec.payload_type;
@@ -516,7 +516,7 @@
 		state->out_stream.last_timestamp = timestamp;
 		state->out_stream.ssrc = ssrc - 1;	/* force output SSRC change */
 		LOGP(DRTP, LOGL_INFO,
-		     "endpoint:%x initializing stream, SSRC: %u timestamp: %u "
+		     "endpoint:0x%x initializing stream, SSRC: %u timestamp: %u "
 		     "pkt-duration: %d, from %s:%d\n",
 		     ENDPOINT_NUMBER(endp), state->in_stream.ssrc,
 		     state->seq_offset, state->packet_duration,
@@ -525,14 +525,14 @@
 			state->packet_duration =
 			    rtp_end->codec.rate * 20 / 1000;
 			LOGP(DRTP, LOGL_NOTICE,
-			     "endpoint:%x fixed packet duration is not available, "
+			     "endpoint:0x%x fixed packet duration is not available, "
 			     "using fixed 20ms instead: %d from %s:%d\n",
 			     ENDPOINT_NUMBER(endp), state->packet_duration,
 			     inet_ntoa(addr->sin_addr), ntohs(addr->sin_port));
 		}
 	} else if (state->in_stream.ssrc != ssrc) {
 		LOGP(DRTP, LOGL_NOTICE,
-		     "endpoint:%x SSRC changed: %u -> %u  "
+		     "endpoint:0x%x SSRC changed: %u -> %u  "
 		     "from %s:%d\n",
 		     ENDPOINT_NUMBER(endp),
 		     state->in_stream.ssrc, rtp_hdr->ssrc,
@@ -561,7 +561,7 @@
 				rtp_end->force_constant_ssrc -= 1;
 
 			LOGP(DRTP, LOGL_NOTICE,
-			     "endpoint:%x SSRC patching enabled, SSRC: %u "
+			     "endpoint:0x%x SSRC patching enabled, SSRC: %u "
 			     "SeqNo offset: %d, TS offset: %d "
 			     "from %s:%d\n",
 			     ENDPOINT_NUMBER(endp), state->in_stream.ssrc,
@@ -619,7 +619,7 @@
 
 #if 0
 	DEBUGP(DRTP,
-	       "endpoint:%x payload hdr payload %u -> endp payload %u\n",
+	       "endpoint:0x%x payload hdr payload %u -> endp payload %u\n",
 	       ENDPOINT_NUMBER(endp), rtp_hdr->payload_type, payload);
 	rtp_hdr->payload_type = payload;
 #endif
@@ -670,16 +670,16 @@
 
 	if (is_rtp) {
 		LOGP(DRTP, LOGL_DEBUG,
-		     "endpoint:%x delivering RTP packet...\n",
+		     "endpoint:0x%x delivering RTP packet...\n",
 		     ENDPOINT_NUMBER(endp));
 	} else {
 		LOGP(DRTP, LOGL_DEBUG,
-		     "endpoint:%x delivering RTCP packet...\n",
+		     "endpoint:0x%x delivering RTCP packet...\n",
 		     ENDPOINT_NUMBER(endp));
 	}
 
 	LOGP(DRTP, LOGL_DEBUG,
-	     "endpoint:%x loop:%d, mode:%d ",
+	     "endpoint:0x%x loop:%d, mode:%d ",
 	     ENDPOINT_NUMBER(endp), tcfg->audio_loop, conn_src->conn->mode);
 	if (conn_src->conn->mode == MGCP_CONN_LOOPBACK)
 		LOGPC(DRTP, LOGL_DEBUG, "(loopback)\n");
@@ -695,7 +695,7 @@
 	if (!rtp_end->output_enabled) {
 		rtp_end->dropped_packets += 1;
 		LOGP(DRTP, LOGL_DEBUG,
-		     "endpoint:%x output disabled, drop to %s %s "
+		     "endpoint:0x%x output disabled, drop to %s %s "
 		     "rtp_port:%u rtcp_port:%u\n",
 		     ENDPOINT_NUMBER(endp),
 		     dest_name,
@@ -718,7 +718,7 @@
 				mgcp_patch_and_count(endp, rtp_state, rtp_end,
 						     addr, buf, buflen);
 			LOGP(DRTP, LOGL_DEBUG,
-			     "endpoint:%x process/send to %s %s "
+			     "endpoint:0x%x process/send to %s %s "
 			     "rtp_port:%u rtcp_port:%u\n",
 			     ENDPOINT_NUMBER(endp), dest_name,
 			     inet_ntoa(rtp_end->addr), ntohs(rtp_end->rtp_port),
@@ -757,7 +757,7 @@
 		return nbytes;
 	} else if (!tcfg->omit_rtcp) {
 		LOGP(DRTP, LOGL_DEBUG,
-		     "endpoint:%x send to %s %s rtp_port:%u rtcp_port:%u\n",
+		     "endpoint:0x%x send to %s %s rtp_port:%u rtcp_port:%u\n",
 		     ENDPOINT_NUMBER(endp),
 		     dest_name,
 		     inet_ntoa(rtp_end->addr),
@@ -804,13 +804,13 @@
 
 	if (rc < 0) {
 		LOGP(DRTP, LOGL_ERROR,
-		     "endpoint:%x failed to receive packet, errno: %d/%s\n",
+		     "endpoint:0x%x failed to receive packet, errno: %d/%s\n",
 		     ENDPOINT_NUMBER(endp), errno, strerror(errno));
 		return -1;
 	}
 
 	if (tossed) {
-		LOGP(DRTP, LOGL_ERROR, "endpoint:%x packet tossed\n",
+		LOGP(DRTP, LOGL_ERROR, "endpoint:0x%x packet tossed\n",
 		     ENDPOINT_NUMBER(endp));
 	}
 
@@ -830,11 +830,11 @@
 	if (memcmp(&addr->sin_addr, &conn->end.addr, sizeof(addr->sin_addr))
 	    != 0) {
 		LOGP(DRTP, LOGL_ERROR,
-		     "endpoint:%x data from wrong address: %s, ",
+		     "endpoint:0x%x data from wrong address: %s, ",
 		     ENDPOINT_NUMBER(endp), inet_ntoa(addr->sin_addr));
 		LOGPC(DRTP, LOGL_ERROR, "expected: %s\n",
 		      inet_ntoa(conn->end.addr));
-		LOGP(DRTP, LOGL_ERROR, "endpoint:%x packet tossed\n",
+		LOGP(DRTP, LOGL_ERROR, "endpoint:0x%x packet tossed\n",
 		     ENDPOINT_NUMBER(endp));
 		return -1;
 	}
@@ -846,12 +846,12 @@
 	if (conn->end.rtp_port != addr->sin_port &&
 	    conn->end.rtcp_port != addr->sin_port) {
 		LOGP(DRTP, LOGL_ERROR,
-		     "endpoint:%x data from wrong source port: %d, ",
+		     "endpoint:0x%x data from wrong source port: %d, ",
 		     ENDPOINT_NUMBER(endp), ntohs(addr->sin_port));
 		LOGPC(DRTP, LOGL_ERROR,
 		      "expected: %d for RTP or %d for RTCP\n",
 		      ntohs(conn->end.rtp_port), ntohs(conn->end.rtcp_port));
-		LOGP(DRTP, LOGL_ERROR, "endpoint:%x packet tossed\n",
+		LOGP(DRTP, LOGL_ERROR, "endpoint:0x%x packet tossed\n",
 		     ENDPOINT_NUMBER(endp));
 		return -1;
 	}
@@ -868,14 +868,14 @@
 
 	if (strcmp(inet_ntoa(conn->end.addr), "0.0.0.0") == 0) {
 		LOGP(DRTP, LOGL_ERROR,
-		     "endpoint:%x destination IP-address is invalid\n",
+		     "endpoint:0x%x destination IP-address is invalid\n",
 		     ENDPOINT_NUMBER(endp));
 		return -1;
 	}
 
 	if (conn->end.rtp_port == 0) {
 		LOGP(DRTP, LOGL_ERROR,
-		     "endpoint:%x destination rtp port is invalid\n",
+		     "endpoint:0x%x destination rtp port is invalid\n",
 		     ENDPOINT_NUMBER(endp));
 		return -1;
 	}
@@ -897,7 +897,7 @@
 	endp = conn->conn->endp;
 	tcfg = endp->tcfg;
 
-	LOGP(DRTP, LOGL_DEBUG, "endpoint:%x receiving RTP/RTCP packet...\n",
+	LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x receiving RTP/RTCP packet...\n",
 	     ENDPOINT_NUMBER(endp));
 
 	rc = receive_from(endp, fd->fd, addr, buf, buf_size);
@@ -905,11 +905,11 @@
 		return -1;
 	*proto = fd == &conn->end.rtp ? MGCP_PROTO_RTP : MGCP_PROTO_RTCP;
 
-	LOGP(DRTP, LOGL_DEBUG, "endpoint:%x ", ENDPOINT_NUMBER(endp));
+	LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x ", ENDPOINT_NUMBER(endp));
 	LOGPC(DRTP, LOGL_DEBUG, "receiveing from %s %s %d\n",
 	      conn->conn->name, inet_ntoa(addr->sin_addr),
 	      ntohs(addr->sin_port));
-	LOGP(DRTP, LOGL_DEBUG, "endpoint:%x conn:%s\n", ENDPOINT_NUMBER(endp),
+	LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x conn:%s\n", ENDPOINT_NUMBER(endp),
 	     mgcp_conn_dump(conn->conn));
 
 	/* Check if the origin of the RTP packet seems plausible */
@@ -921,10 +921,10 @@
 	/* Filter out dummy message */
 	if (rc == 1 && buf[0] == MGCP_DUMMY_LOAD) {
 		LOGP(DRTP, LOGL_NOTICE,
-		     "endpoint:%x dummy message received\n",
+		     "endpoint:0x%x dummy message received\n",
 		     ENDPOINT_NUMBER(endp));
 		LOGP(DRTP, LOGL_ERROR,
-		     "endpoint:%x packet tossed\n", ENDPOINT_NUMBER(endp));
+		     "endpoint:0x%x packet tossed\n", ENDPOINT_NUMBER(endp));
 		return 0;
 	}
 
@@ -948,7 +948,7 @@
 	struct mgcp_endpoint *endp;
 	endp = conn_src->conn->endp;
 
-	LOGP(DRTP, LOGL_DEBUG, "endpoint:%x destin conn:%s\n",
+	LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x destin conn:%s\n",
 	     ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn_dst->conn));
 
 	/* Before we try to deliver the packet, we check if the destination
@@ -962,7 +962,7 @@
 	switch (conn_dst->type) {
 	case MGCP_RTP_DEFAULT:
 		LOGP(DRTP, LOGL_DEBUG,
-		     "endpoint:%x endpoint type is MGCP_RTP_DEFAULT, "
+		     "endpoint:0x%x endpoint type is MGCP_RTP_DEFAULT, "
 		     "using mgcp_send() to forward data directly\n",
 		     ENDPOINT_NUMBER(endp));
 		return mgcp_send(endp, proto == MGCP_PROTO_RTP,
@@ -970,7 +970,7 @@
 	case MGCP_OSMUX_BSC_NAT:
 	case MGCP_OSMUX_BSC:
 		LOGP(DRTP, LOGL_DEBUG,
-		     "endpoint:%x endpoint type is MGCP_OSMUX_BSC_NAT, "
+		     "endpoint:0x%x endpoint type is MGCP_OSMUX_BSC_NAT, "
 		     "using osmux_xfrm_to_osmux() to forward data through OSMUX\n",
 		     ENDPOINT_NUMBER(endp));
 		return osmux_xfrm_to_osmux(buf, buf_size, conn_dst);
@@ -980,7 +980,7 @@
 	 * be discarded, this should not happen, normally the MGCP type
 	 * should be properly set */
 	LOGP(DRTP, LOGL_ERROR,
-	     "endpoint:%x bad MGCP type -- data discarded!\n",
+	     "endpoint:0x%x bad MGCP type -- data discarded!\n",
 	     ENDPOINT_NUMBER(endp));
 
 	return -1;
@@ -1025,7 +1025,7 @@
 	/* There is no destination conn, stop here */
 	if (!conn_dst) {
 		LOGP(DRTP, LOGL_ERROR,
-		     "endpoint:%x unable to find destination conn\n",
+		     "endpoint:0x%x unable to find destination conn\n",
 		     ENDPOINT_NUMBER(endp));
 		return -1;
 	}
@@ -1033,7 +1033,7 @@
 	/* The destination conn is not an RTP connection */
 	if (conn_dst->type != MGCP_CONN_TYPE_RTP) {
 		LOGP(DRTP, LOGL_ERROR,
-		     "endpoint:%x unable to find suitable destination conn\n",
+		     "endpoint:0x%x unable to find suitable destination conn\n",
 		     ENDPOINT_NUMBER(endp));
 		return -1;
 	}
@@ -1067,7 +1067,7 @@
 	endp = conn_src->conn->endp;
 	OSMO_ASSERT(endp);
 
-	LOGP(DRTP, LOGL_DEBUG, "endpoint:%x source conn:%s\n",
+	LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x source conn:%s\n",
 	     ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn_src->conn));
 
 	/* Receive packet */
@@ -1158,7 +1158,7 @@
 	if (mgcp_create_bind(source_addr, &rtp_end->rtp,
 			     rtp_end->local_port) != 0) {
 		LOGP(DRTP, LOGL_ERROR,
-		     "endpoint:%x failed to create RTP port: %s:%d\n", endpno,
+		     "endpoint:0x%x failed to create RTP port: %s:%d\n", endpno,
 		     source_addr, rtp_end->local_port);
 		goto cleanup0;
 	}
@@ -1166,7 +1166,7 @@
 	if (mgcp_create_bind(source_addr, &rtp_end->rtcp,
 			     rtp_end->local_port + 1) != 0) {
 		LOGP(DRTP, LOGL_ERROR,
-		     "endpoint:%x failed to create RTCP port: %s:%d\n", endpno,
+		     "endpoint:0x%x failed to create RTCP port: %s:%d\n", endpno,
 		     source_addr, rtp_end->local_port + 1);
 		goto cleanup1;
 	}
@@ -1178,7 +1178,7 @@
 	rtp_end->rtp.when = BSC_FD_READ;
 	if (osmo_fd_register(&rtp_end->rtp) != 0) {
 		LOGP(DRTP, LOGL_ERROR,
-		     "endpoint:%x failed to register RTP port %d\n", endpno,
+		     "endpoint:0x%x failed to register RTP port %d\n", endpno,
 		     rtp_end->local_port);
 		goto cleanup2;
 	}
@@ -1186,7 +1186,7 @@
 	rtp_end->rtcp.when = BSC_FD_READ;
 	if (osmo_fd_register(&rtp_end->rtcp) != 0) {
 		LOGP(DRTP, LOGL_ERROR,
-		     "endpoint:%x failed to register RTCP port %d\n", endpno,
+		     "endpoint:0x%x failed to register RTCP port %d\n", endpno,
 		     rtp_end->local_port + 1);
 		goto cleanup3;
 	}
@@ -1222,7 +1222,7 @@
 
 	if (end->rtp.fd != -1 || end->rtcp.fd != -1) {
 		LOGP(DRTP, LOGL_ERROR,
-		     "endpoint:%x %u was already bound on conn:%s\n",
+		     "endpoint:0x%x %u was already bound on conn:%s\n",
 		     ENDPOINT_NUMBER(endp), rtp_port,
 		     mgcp_conn_dump(conn->conn));
 
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index feca8da..a1ecce2 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -534,7 +534,7 @@
 	 * callids match up so that we are sure that this is our call */
 	if (endp->callid && mgcp_verify_call_id(endp, callid)) {
 		LOGP(DLMGCP, LOGL_ERROR,
-		     "CRCX: endpoint:%x allready seized by other call (%s)\n",
+		     "CRCX: endpoint:0x%x allready seized by other call (%s)\n",
 		     ENDPOINT_NUMBER(endp), endp->callid);
 		if (tcfg->force_realloc)
 			/* This is not our call, toss everything by releasing
@@ -560,7 +560,7 @@
 	_conn = mgcp_conn_alloc(NULL, endp, MGCP_CONN_TYPE_RTP, conn_name);
 	if (!_conn) {
 		LOGP(DLMGCP, LOGL_ERROR,
-		     "CRCX: endpoint:%x unable to allocate RTP connection\n",
+		     "CRCX: endpoint:0x%x unable to allocate RTP connection\n",
 		     ENDPOINT_NUMBER(endp));
 		goto error2;
 
@@ -581,7 +581,7 @@
 		conn->osmux.state = OSMUX_STATE_NEGOTIATING;
 	} else if (endp->cfg->osmux == OSMUX_USAGE_ONLY) {
 		LOGP(DLMGCP, LOGL_ERROR,
-		     "CRCX: endpoint:%x osmux only and no osmux offered\n",
+		     "CRCX: endpoint:0x%x osmux only and no osmux offered\n",
 		     ENDPOINT_NUMBER(endp));
 		goto error2;
 	}
@@ -608,7 +608,7 @@
 
 	if (setup_rtp_processing(endp, conn) != 0) {
 		LOGP(DLMGCP, LOGL_ERROR,
-		     "CRCX: endpoint:%x could not start RTP processing!\n",
+		     "CRCX: endpoint:0x%x could not start RTP processing!\n",
 		     ENDPOINT_NUMBER(endp));
 		goto error2;
 	}
@@ -621,7 +621,7 @@
 		switch (rc) {
 		case MGCP_POLICY_REJECT:
 			LOGP(DLMGCP, LOGL_NOTICE,
-			     "CRCX: endpoint:%x CRCX rejected by policy\n",
+			     "CRCX: endpoint:0x%x CRCX rejected by policy\n",
 			     ENDPOINT_NUMBER(endp));
 			mgcp_release_endp(endp);
 			return create_err_response(endp, 400, "CRCX", p->trans);
@@ -637,7 +637,7 @@
 	}
 
 	LOGP(DLMGCP, LOGL_DEBUG,
-	     "CRCX: endpoint:%x Creating connection: CI: %s port: %u\n",
+	     "CRCX: endpoint:0x%x Creating connection: CI: %s port: %u\n",
 	     ENDPOINT_NUMBER(endp), conn->conn->id, conn->end.local_port);
 	if (p->cfg->change_cb)
 		p->cfg->change_cb(tcfg, ENDPOINT_NUMBER(endp), MGCP_ENDP_CRCX);
@@ -649,13 +649,13 @@
 		send_dummy(endp, conn);
 
 	LOGP(DLMGCP, LOGL_NOTICE,
-	     "CRCX: endpoint:%x connection successfully created\n",
+	     "CRCX: endpoint:0x%x connection successfully created\n",
 	     ENDPOINT_NUMBER(endp));
 	return create_response_with_sdp(endp, conn, "CRCX", p->trans);
 error2:
 	mgcp_release_endp(endp);
 	LOGP(DLMGCP, LOGL_NOTICE,
-	     "CRCX: endpoint:%x unable to create connection resource error\n",
+	     "CRCX: endpoint:0x%x unable to create connection resource error\n",
 	     ENDPOINT_NUMBER(endp));
 	return create_err_response(endp, error_code, "CRCX", p->trans);
 }
@@ -680,7 +680,7 @@
 
 	if (llist_count(&endp->conns) <= 0) {
 		LOGP(DLMGCP, LOGL_ERROR,
-		     "MDCX: endpoint:%x endpoint is not holding a connection.\n",
+		     "MDCX: endpoint:0x%x endpoint is not holding a connection.\n",
 		     ENDPOINT_NUMBER(endp));
 		return create_err_response(endp, 400, "MDCX", p->trans);
 	}
@@ -714,7 +714,7 @@
 			break;
 		default:
 			LOGP(DLMGCP, LOGL_NOTICE,
-			     "MDCX: endpoint:%x Unhandled MGCP option: '%c'/%d\n",
+			     "MDCX: endpoint:0x%x Unhandled MGCP option: '%c'/%d\n",
 			     ENDPOINT_NUMBER(endp), line[0], line[0]);
 			break;
 		}
@@ -723,7 +723,7 @@
 mgcp_header_done:
 	if (!conn_id) {
 		LOGP(DLMGCP, LOGL_ERROR,
-		     "MDCX: endpoint:%x insufficient parameters, missing ci (connectionIdentifier)\n",
+		     "MDCX: endpoint:0x%x insufficient parameters, missing ci (connectionIdentifier)\n",
 		     ENDPOINT_NUMBER(endp));
 		return create_err_response(endp, 400, "MDCX", p->trans);
 	}
@@ -762,7 +762,7 @@
 		switch (rc) {
 		case MGCP_POLICY_REJECT:
 			LOGP(DLMGCP, LOGL_NOTICE,
-			     "MDCX: endpoint:%x rejected by policy\n",
+			     "MDCX: endpoint:0x%x rejected by policy\n",
 			     ENDPOINT_NUMBER(endp));
 			if (silent)
 				goto out_silent;
@@ -771,7 +771,7 @@
 		case MGCP_POLICY_DEFER:
 			/* stop processing */
 			LOGP(DLMGCP, LOGL_DEBUG,
-			     "MDCX: endpoint:%x defered by policy\n",
+			     "MDCX: endpoint:0x%x defered by policy\n",
 			     ENDPOINT_NUMBER(endp));
 			return NULL;
 			break;
@@ -785,7 +785,7 @@
 
 	/* modify */
 	LOGP(DLMGCP, LOGL_DEBUG,
-	     "MDCX: endpoint:%x modified conn:%s\n",
+	     "MDCX: endpoint:0x%x modified conn:%s\n",
 	     ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn));
 	if (p->cfg->change_cb)
 		p->cfg->change_cb(endp->tcfg, ENDPOINT_NUMBER(endp),
@@ -801,14 +801,14 @@
 		goto out_silent;
 
 	LOGP(DLMGCP, LOGL_NOTICE,
-	     "MDCX: endpoint:%x connection successfully modified\n",
+	     "MDCX: endpoint:0x%x connection successfully modified\n",
 	     ENDPOINT_NUMBER(endp));
 	return create_response_with_sdp(endp, conn, "MDCX", p->trans);
 error3:
 	return create_err_response(endp, error_code, "MDCX", p->trans);
 
 out_silent:
-	LOGP(DLMGCP, LOGL_DEBUG, "MDCX: endpoint:%x silent exit\n",
+	LOGP(DLMGCP, LOGL_DEBUG, "MDCX: endpoint:0x%x silent exit\n",
 	     ENDPOINT_NUMBER(endp));
 	return NULL;
 }
@@ -828,12 +828,12 @@
 		return create_err_response(NULL, error_code, "DLCX", p->trans);
 
 	LOGP(DLMGCP, LOGL_NOTICE,
-	     "DLCX: endpoint:%x deleting connection ...\n",
+	     "DLCX: endpoint:0x%x deleting connection ...\n",
 	     ENDPOINT_NUMBER(endp));
 
 	if (llist_count(&endp->conns) <= 0) {
 		LOGP(DLMGCP, LOGL_ERROR,
-		     "DLCX: endpoint:%x endpoint is not holding a connection.\n",
+		     "DLCX: endpoint:0x%x endpoint is not holding a connection.\n",
 		     ENDPOINT_NUMBER(endp));
 		return create_err_response(endp, 400, "DLCX", p->trans);
 	}
@@ -857,7 +857,7 @@
 			break;
 		default:
 			LOGP(DLMGCP, LOGL_NOTICE,
-			     "DLCX: endpoint:%x Unhandled MGCP option: '%c'/%d\n",
+			     "DLCX: endpoint:0x%x Unhandled MGCP option: '%c'/%d\n",
 			     ENDPOINT_NUMBER(endp), line[0], line[0]);
 			break;
 		}
@@ -871,7 +871,7 @@
 		switch (rc) {
 		case MGCP_POLICY_REJECT:
 			LOGP(DLMGCP, LOGL_NOTICE,
-			     "DLCX: endpoint:%x rejected by policy\n",
+			     "DLCX: endpoint:0x%x rejected by policy\n",
 			     ENDPOINT_NUMBER(endp));
 			if (silent)
 				goto out_silent;
@@ -892,7 +892,7 @@
 	 * RFC3435 Section F.7) */
 	if (!conn_id) {
 		LOGP(DLMGCP, LOGL_NOTICE,
-		     "DLCX: endpoint:%x missing ci (connectionIdentifier), will remove all connections at once\n",
+		     "DLCX: endpoint:0x%x missing ci (connectionIdentifier), will remove all connections at once\n",
 		     ENDPOINT_NUMBER(endp));
 
 		mgcp_release_endp(endp);
@@ -912,11 +912,11 @@
 	mgcp_format_stats(stats, sizeof(stats), conn->conn);
 
 	/* delete connection */
-	LOGP(DLMGCP, LOGL_DEBUG, "DLCX: endpoint:%x deleting conn:%s\n",
+	LOGP(DLMGCP, LOGL_DEBUG, "DLCX: endpoint:0x%x deleting conn:%s\n",
 	     ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn));
 	mgcp_conn_free(endp, conn_id);
 	LOGP(DLMGCP, LOGL_NOTICE,
-	     "DLCX: endpoint:%x connection successfully deleted\n",
+	     "DLCX: endpoint:0x%x connection successfully deleted\n",
 	     ENDPOINT_NUMBER(endp));
 
 	/* When all connections are closed, the endpoint will be released
@@ -924,7 +924,7 @@
 	if (llist_count(&endp->conns) <= 0) {
 		mgcp_release_endp(endp);
 		LOGP(DLMGCP, LOGL_DEBUG,
-		     "DLCX: endpoint:%x endpoint released\n",
+		     "DLCX: endpoint:0x%x endpoint released\n",
 		     ENDPOINT_NUMBER(endp));
 	}
 
@@ -940,7 +940,7 @@
 	return create_err_response(endp, error_code, "DLCX", p->trans);
 
 out_silent:
-	LOGP(DLMGCP, LOGL_DEBUG, "DLCX: endpoint:%x silent exit\n",
+	LOGP(DLMGCP, LOGL_DEBUG, "DLCX: endpoint:0x%x silent exit\n",
 	     ENDPOINT_NUMBER(endp));
 	return NULL;
 }
@@ -1188,7 +1188,7 @@
  *  \param[in] endp endpoint to release */
 void mgcp_release_endp(struct mgcp_endpoint *endp)
 {
-	LOGP(DLMGCP, LOGL_DEBUG, "Releasing endpoint:%x\n",
+	LOGP(DLMGCP, LOGL_DEBUG, "Releasing endpoint:0x%x\n",
 	     ENDPOINT_NUMBER(endp));
 
 	/* Normally this function should only be called wehen

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I284627de02cd140a894445375e9152ff007a71e6
Gerrit-PatchSet: 3
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list