* apply patches
* test pre-ci passed git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6498 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -100,68 +100,69 @@ multicast_link_init(void)
|
||||
// struct ifreq ifr;
|
||||
|
||||
for (group = 0; group < MULTICAST_LINK_NUM_GROUPS; group++) {
|
||||
strcpy (group_list[group].host_addr, multicast_group_list[group]);
|
||||
group_list[group].port = 46014 + group;
|
||||
group_list[group].socket = make_socket_inet(
|
||||
SOCK_DGRAM,
|
||||
&group_list[group].port, &sin);
|
||||
|
||||
LOG_D(EMU, "multicast_link_init(): Created socket %d for group %d, port %d\n",
|
||||
group_list[group].socket,group,group_list[group].port);
|
||||
//strcpy (group_list[group].host_addr, multicast_group_list[group]);
|
||||
strncpy (group_list[group].host_addr, multicast_group_list[group], sizeof(group_list[group].host_addr));
|
||||
group_list[group].host_addr[sizeof(group_list[group].host_addr) - 1] = 0; // terminate string
|
||||
group_list[group].port = 46014 + group;
|
||||
group_list[group].socket = make_socket_inet(
|
||||
SOCK_DGRAM,
|
||||
&group_list[group].port, &sin);
|
||||
|
||||
LOG_D(EMU, "multicast_link_init(): Created socket %d for group %d, port %d\n",
|
||||
group_list[group].socket,group,group_list[group].port);
|
||||
|
||||
/* Used so we can re-bind to our port while a previous connection is still
|
||||
* in TIME_WAIT state.
|
||||
*/
|
||||
if (setsockopt(group_list[group].socket, SOL_SOCKET, SO_REUSEADDR,
|
||||
&reuse_addr, sizeof (reuse_addr)) < 0) {
|
||||
LOG_E(EMU, "[MULTICAST] ERROR : setsockopt:SO_REUSEADDR, exiting ...");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
if (multicast_if != NULL) {
|
||||
if (setsockopt(group_list[group].socket, SOL_SOCKET,SO_BINDTODEVICE,
|
||||
multicast_if, 4) < 0) {
|
||||
LOG_E(EMU,
|
||||
"[MULTICAST] ERROR : setsockopt:SO_BINDTODEVICE on interface %s, exiting ...\n",
|
||||
multicast_if);
|
||||
LOG_E(EMU,
|
||||
"[MULTICAST] make sure that you have a root privilage or run with sudo -E \n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
if (setsockopt(group_list[group].socket, SOL_SOCKET, SO_REUSEADDR,
|
||||
&reuse_addr, sizeof (reuse_addr)) < 0) {
|
||||
LOG_E(EMU, "[MULTICAST] ERROR : setsockopt:SO_REUSEADDR, exiting ...");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
if (multicast_if != NULL) {
|
||||
if (setsockopt(group_list[group].socket, SOL_SOCKET,SO_BINDTODEVICE,
|
||||
multicast_if, 4) < 0) {
|
||||
LOG_E(EMU,
|
||||
"[MULTICAST] ERROR : setsockopt:SO_BINDTODEVICE on interface %s, exiting ...\n",
|
||||
multicast_if);
|
||||
LOG_E(EMU,
|
||||
"[MULTICAST] make sure that you have a root privilage or run with sudo -E \n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(ENABLE_NEW_MULTICAST)
|
||||
/* Make the socket blocking */
|
||||
socket_setnonblocking(group_list[group].socket);
|
||||
/* Make the socket blocking */
|
||||
socket_setnonblocking(group_list[group].socket);
|
||||
#endif
|
||||
|
||||
multicast_loop = 0;
|
||||
if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_MULTICAST_LOOP,
|
||||
&multicast_loop, sizeof (multicast_loop)) < 0) {
|
||||
LOG_E(EMU,
|
||||
"[MULTICAST] ERROR: %s line %d multicast_link_main_loop() IP_MULTICAST_LOOP %m",
|
||||
__FILE__, __LINE__);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Join the broadcast group:
|
||||
command.imr_multiaddr.s_addr = inet_addr (group_list[group].host_addr);
|
||||
command.imr_interface.s_addr = htonl (INADDR_ANY);
|
||||
if (command.imr_multiaddr.s_addr == -1) {
|
||||
LOG_E(EMU, "[MULTICAST] ERROR: %s line %d NO MULTICAST", __FILE__, __LINE__);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_ADD_MEMBERSHIP,
|
||||
&command, sizeof (command)) < 0) {
|
||||
LOG_E(EMU, "[MULTICAST] ERROR: %s line %d IP_ADD_MEMBERSHIP %m", __FILE__,
|
||||
__LINE__);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
memset (&group_list[group].sock_remote_addr, 0, sizeof (struct sockaddr_in));
|
||||
group_list[group].sock_remote_addr.sin_family = AF_INET;
|
||||
group_list[group].sock_remote_addr.sin_addr.s_addr = inet_addr (
|
||||
multicast_group_list[group]);
|
||||
group_list[group].sock_remote_addr.sin_port = htons (group_list[group].port);
|
||||
|
||||
multicast_loop = 0;
|
||||
if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_MULTICAST_LOOP,
|
||||
&multicast_loop, sizeof (multicast_loop)) < 0) {
|
||||
LOG_E(EMU,
|
||||
"[MULTICAST] ERROR: %s line %d multicast_link_main_loop() IP_MULTICAST_LOOP %m",
|
||||
__FILE__, __LINE__);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Join the broadcast group:
|
||||
command.imr_multiaddr.s_addr = inet_addr (group_list[group].host_addr);
|
||||
command.imr_interface.s_addr = htonl (INADDR_ANY);
|
||||
if (command.imr_multiaddr.s_addr == -1) {
|
||||
LOG_E(EMU, "[MULTICAST] ERROR: %s line %d NO MULTICAST", __FILE__, __LINE__);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_ADD_MEMBERSHIP,
|
||||
&command, sizeof (command)) < 0) {
|
||||
LOG_E(EMU, "[MULTICAST] ERROR: %s line %d IP_ADD_MEMBERSHIP %m", __FILE__,
|
||||
__LINE__);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
memset (&group_list[group].sock_remote_addr, 0, sizeof (struct sockaddr_in));
|
||||
group_list[group].sock_remote_addr.sin_family = AF_INET;
|
||||
group_list[group].sock_remote_addr.sin_addr.s_addr = inet_addr (multicast_group_list[group]);
|
||||
group_list[group].sock_remote_addr.sin_port = htons (group_list[group].port);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -189,6 +189,8 @@ double compute_sinr(channel_desc_t *desc,
|
||||
struct complex S_i1;
|
||||
struct complex S_i2;
|
||||
|
||||
DevAssert( nb_rb > 0 );
|
||||
|
||||
avg_sinr=0.0;
|
||||
// printf("nb_rb %d\n",nb_rb);
|
||||
for (f=0;f<2*nb_rb;f++) {
|
||||
|
||||
@@ -471,7 +471,7 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
for (i = 0; i<chan_desc->nb_taps; i++)
|
||||
chan_desc->a[i] = (struct complex*) malloc(nb_tx*nb_rx * sizeof(struct complex));
|
||||
|
||||
chan_desc->R_sqrt = (struct complex**) malloc(6*sizeof(struct complex**));
|
||||
chan_desc->R_sqrt = (struct complex**) malloc(6*sizeof(struct complex*));
|
||||
for (i = 0; i<6; i++) {
|
||||
chan_desc->R_sqrt[i] = (struct complex*) malloc(nb_tx*nb_rx*nb_tx*nb_rx * sizeof(struct complex));
|
||||
for (j = 0; j<nb_tx*nb_rx*nb_tx*nb_rx; j+=(nb_tx*nb_rx+1)) {
|
||||
|
||||
Reference in New Issue
Block a user