mgcp: Rename transcoder_end to trans_net

Packets arriving for trans_net will be send out to the
networking. We will introduce a trans_bts in a second.
diff --git a/openbsc/src/mgcp/mgcp_network.c b/openbsc/src/mgcp/mgcp_network.c
index 6c6c336..f78e42a 100644
--- a/openbsc/src/mgcp/mgcp_network.c
+++ b/openbsc/src/mgcp/mgcp_network.c
@@ -176,7 +176,7 @@
 	struct mgcp_config *cfg = endp->cfg;
 	struct sockaddr_in addr;
 
-	if (endp->transcoder_end.rtp_port == 0) {
+	if (endp->trans_net.rtp_port == 0) {
 		LOGP(DMGCP, LOGL_ERROR, "Transcoder port not known on 0x%x\n",
 			ENDPOINT_NUMBER(endp));
 		return -1;
@@ -404,7 +404,7 @@
 	if (rc <= 0)
 		return -1;
 
-	proto = fd == &endp->transcoder_end.rtp ? PROTO_RTP : PROTO_RTCP;
+	proto = fd == &endp->trans_net.rtp ? PROTO_RTP : PROTO_RTCP;
 
 	if (memcmp(&addr.sin_addr, &cfg->transcoder_in, sizeof(addr.sin_addr)) != 0) {
 		LOGP(DMGCP, LOGL_ERROR,
@@ -413,8 +413,8 @@
 		return -1;
 	}
 
-	if (endp->transcoder_end.rtp_port != addr.sin_port &&
-	    endp->transcoder_end.rtcp_port != addr.sin_port) {
+	if (endp->trans_net.rtp_port != addr.sin_port &&
+	    endp->trans_net.rtcp_port != addr.sin_port) {
 		LOGP(DMGCP, LOGL_ERROR,
 			"Data from wrong transcoder source port %d on 0x%x\n",
 			ntohs(addr.sin_port), ENDPOINT_NUMBER(endp));
@@ -428,7 +428,7 @@
 		return 0;
 	}
 
-	endp->transcoder_end.packets += 1;
+	endp->trans_net.packets += 1;
 	return send_to(endp, DEST_NETWORK, proto == PROTO_RTP, &addr, &buf[0], rc);
 }
 
@@ -545,18 +545,18 @@
 
 int mgcp_bind_transcoder_rtp_port(struct mgcp_endpoint *endp, int rtp_port)
 {
-	if (endp->transcoder_end.rtp.fd != -1 || endp->transcoder_end.rtcp.fd != -1) {
+	if (endp->trans_net.rtp.fd != -1 || endp->trans_net.rtcp.fd != -1) {
 		LOGP(DMGCP, LOGL_ERROR, "Previous net-port was still bound on %d\n",
 			ENDPOINT_NUMBER(endp));
-		mgcp_free_rtp_port(&endp->transcoder_end);
+		mgcp_free_rtp_port(&endp->trans_net);
 	}
 
-	endp->transcoder_end.local_port = rtp_port;
-	endp->transcoder_end.rtp.cb = rtp_data_transcoder;
-	endp->transcoder_end.rtp.data = endp;
-	endp->transcoder_end.rtcp.data = endp;
-	endp->transcoder_end.rtcp.cb = rtp_data_transcoder;
-	return bind_rtp(endp->cfg, &endp->transcoder_end, ENDPOINT_NUMBER(endp));
+	endp->trans_net.local_port = rtp_port;
+	endp->trans_net.rtp.cb = rtp_data_transcoder;
+	endp->trans_net.rtp.data = endp;
+	endp->trans_net.rtcp.data = endp;
+	endp->trans_net.rtcp.cb = rtp_data_transcoder;
+	return bind_rtp(endp->cfg, &endp->trans_net, ENDPOINT_NUMBER(endp));
 }
 
 int mgcp_free_rtp_port(struct mgcp_rtp_end *end)
diff --git a/openbsc/src/mgcp/mgcp_protocol.c b/openbsc/src/mgcp/mgcp_protocol.c
index 4e7ebf8..435ceee 100644
--- a/openbsc/src/mgcp/mgcp_protocol.c
+++ b/openbsc/src/mgcp/mgcp_protocol.c
@@ -422,7 +422,7 @@
 	}
 
 	if (endp->cfg->transcoder_ip) {
-		if (allocate_port(endp, &endp->transcoder_end,
+		if (allocate_port(endp, &endp->trans_net,
 				  &endp->cfg->transcoder_ports,
 				  mgcp_bind_transcoder_rtp_port) != 0) {
 			mgcp_rtp_end_reset(&endp->net_end);
@@ -828,7 +828,7 @@
 		cfg->endpoints[i].cfg = cfg;
 		mgcp_rtp_end_init(&cfg->endpoints[i].net_end);
 		mgcp_rtp_end_init(&cfg->endpoints[i].bts_end);
-		mgcp_rtp_end_init(&cfg->endpoints[i].transcoder_end);
+		mgcp_rtp_end_init(&cfg->endpoints[i].trans_net);
 	}
 
 	return 0;
@@ -852,7 +852,7 @@
 
 	mgcp_rtp_end_reset(&endp->bts_end);
 	mgcp_rtp_end_reset(&endp->net_end);
-	mgcp_rtp_end_reset(&endp->transcoder_end);
+	mgcp_rtp_end_reset(&endp->trans_net);
 	endp->is_transcoded = 0;
 
 	memset(&endp->net_state, 0, sizeof(endp->net_state));
@@ -938,12 +938,12 @@
 
 	send_msg(endp, in_endp, endp->bts_end.local_port, "CRCX", "recvonly");
 	send_msg(endp, in_endp, endp->bts_end.local_port, "MDCX", "recvonly");
-	send_msg(endp, out_endp, endp->transcoder_end.local_port, "CRCX", "sendrecv");
-	send_msg(endp, out_endp, endp->transcoder_end.local_port, "MDCX", "sendrecv");
+	send_msg(endp, out_endp, endp->trans_net.local_port, "CRCX", "sendrecv");
+	send_msg(endp, out_endp, endp->trans_net.local_port, "MDCX", "sendrecv");
 
 	port = rtp_calculate_port(out_endp, endp->cfg->transcoder_remote_base);
-	endp->transcoder_end.rtp_port = htons(port);
-	endp->transcoder_end.rtcp_port = htons(port + 1);
+	endp->trans_net.rtp_port = htons(port);
+	endp->trans_net.rtcp_port = htons(port + 1);
 }
 
 static void delete_transcoder(struct mgcp_endpoint *endp)
diff --git a/openbsc/src/mgcp/mgcp_vty.c b/openbsc/src/mgcp/mgcp_vty.c
index d284abf..f173882 100644
--- a/openbsc/src/mgcp/mgcp_vty.c
+++ b/openbsc/src/mgcp/mgcp_vty.c
@@ -106,7 +106,7 @@
 			inet_ntoa(endp->bts_end.addr),
 			endp->bts_end.packets, endp->bts_state.lost_no,
 			endp->net_end.packets, endp->net_state.lost_no,
-			endp->transcoder_end.packets,
+			endp->trans_net.packets,
 			VTY_NEWLINE);
 	}
 
@@ -529,7 +529,7 @@
 				LOGP(DMGCP, LOGL_FATAL, "Failed to bind: %d\n", rtp_port);
 				return -1;
 			}
-			endp->transcoder_end.local_alloc = PORT_ALLOC_STATIC;
+			endp->trans_net.local_alloc = PORT_ALLOC_STATIC;
 		}
 	}