aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-01-13 22:49:55 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-01-13 22:49:55 +0100
commitb2a96b1be7e4536e227164068a10a727703686fd (patch)
treef2c5cee42c9e67384172ab03e2d6737a062a31a6
parentd4c29c1574435041f59f9e101f9285b8b335fc11 (diff)
[mgcp] Rename rtp and rtcp variables to net_rtp and net_rtcp
Rename the variables to refer to the fact that they are the ports of the remote. So we have: rtp_port as the local address we are binding to net_rtp for the network rtp bsc_rtp for the bsc rtp
-rw-r--r--openbsc/src/bsc_mgcp.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/openbsc/src/bsc_mgcp.c b/openbsc/src/bsc_mgcp.c
index 760d8c912..a15f1a04f 100644
--- a/openbsc/src/bsc_mgcp.c
+++ b/openbsc/src/bsc_mgcp.c
@@ -97,7 +97,7 @@ struct mgcp_endpoint {
char *local_options;
int conn_mode;
- /* the local rtp port */
+ /* the local rtp port we are binding to */
int rtp_port;
/*
@@ -112,7 +112,7 @@ struct mgcp_endpoint {
struct in_addr bts;
/* in network byte order */
- int rtp, rtcp;
+ int net_rtp, net_rtcp;
int bts_rtp, bts_rtcp;
};
@@ -275,7 +275,7 @@ static int rtp_data_cb(struct bsc_fd *fd, unsigned int what)
if (dest == DEST_NETWORK) {
return _send(fd->fd, &endp->remote,
- proto == PROTO_RTP ? endp->rtp : endp->rtcp,
+ proto == PROTO_RTP ? endp->net_rtp : endp->net_rtcp,
buf, rc);
} else {
return _send(fd->fd, &endp->bts,
@@ -640,7 +640,7 @@ static void handle_create_con(struct msgb *msg, struct sockaddr_in *source)
MSG_TOKENIZE_END
/* initialize */
- endp->rtp = endp->rtcp = endp->bts_rtp = endp->bts_rtcp = 0;
+ endp->net_rtp = endp->net_rtcp = endp->bts_rtp = endp->bts_rtcp = 0;
/* bind to the port now */
endp->rtp_port = rtp_calculate_port(ENDPOINT_NUMBER(endp), rtp_base_port);
@@ -720,8 +720,8 @@ static void handle_modify_con(struct msgb *msg, struct sockaddr_in *source)
const char *param = (const char *)&msg->l3h[line_start];
if (sscanf(param, "m=audio %d RTP/AVP %*d", &port) == 1) {
- endp->rtp = htons(port);
- endp->rtcp = htons(port + 1);
+ endp->net_rtp = htons(port);
+ endp->net_rtcp = htons(port + 1);
}
break;
}
@@ -744,7 +744,7 @@ static void handle_modify_con(struct msgb *msg, struct sockaddr_in *source)
/* modify */
DEBUGP(DMGCP, "Modified endpoint on: 0x%x Server: %s:%u\n",
- ENDPOINT_NUMBER(endp), inet_ntoa(endp->remote), endp->rtp);
+ ENDPOINT_NUMBER(endp), inet_ntoa(endp->remote), endp->net_rtp);
return send_with_sdp(endp, "MDCX", trans_id, source);
error:
@@ -806,7 +806,7 @@ static void handle_delete_con(struct msgb *msg, struct sockaddr_in *source)
bsc_unregister_fd(&endp->local_rtcp);
}
- endp->rtp = endp->rtcp = endp->bts_rtp = endp->bts_rtcp = 0;
+ endp->net_rtp = endp->net_rtcp = endp->bts_rtp = endp->bts_rtcp = 0;
return send_response(250, "DLCX", trans_id, source);
@@ -930,7 +930,7 @@ DEFUN(show_mcgp, show_mgcp_cmd, "show mgcp",
struct mgcp_endpoint *endp = &endpoints[i];
vty_out(vty, " Endpoint 0x%.2x: CI: %d net: %u/%u bts: %u/%u%s",
i, endp->ci,
- ntohs(endp->rtp), ntohs(endp->rtcp),
+ ntohs(endp->net_rtp), ntohs(endp->net_rtcp),
ntohs(endp->bts_rtp), ntohs(endp->bts_rtcp), VTY_NEWLINE);
}
@@ -1154,8 +1154,8 @@ int main(int argc, char** argv)
struct mgcp_endpoint *endp = &endpoints[i];
inet_aton(forward_ip, &endp->remote);
endp->ci = CI_UNUSED + 23;
- endp->rtp = htons(rtp_calculate_port(ENDPOINT_NUMBER(endp), rtp_base_port));
- endp->rtcp = htons(rtp_calculate_port(ENDPOINT_NUMBER(endp), rtp_base_port) + 1);
+ endp->net_rtp = htons(rtp_calculate_port(ENDPOINT_NUMBER(endp), rtp_base_port));
+ endp->net_rtcp = htons(rtp_calculate_port(ENDPOINT_NUMBER(endp), rtp_base_port) + 1);
}
DEBUGP(DMGCP, "Configured for Audio Forwarding.\n");