Commit e22ad3bc authored by Lionel Gauthier's avatar Lionel Gauthier

Can disable SGI interface

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5132 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent b4538302
...@@ -246,20 +246,24 @@ int sgi_init(const pgw_config_t *pgw_config_p) ...@@ -246,20 +246,24 @@ int sgi_init(const pgw_config_t *pgw_config_p)
sgi_data_p->interface_name[len] = '\0'; sgi_data_p->interface_name[len] = '\0';
sgi_data_p->ipv4_addr = pgw_config_p->ipv4.pgw_ipv4_address_for_SGI; sgi_data_p->ipv4_addr = pgw_config_p->ipv4.pgw_ipv4_address_for_SGI;
if (strcmp(sgi_data_p->interface_name, PGW_CONFIG_STRING_INTERFACE_DISABLED) != 0) {
sgi_data_p->interface_index = if_nametoindex(sgi_data_p->interface_name); sgi_data_p->interface_index = if_nametoindex(sgi_data_p->interface_name);
if (sgi_create_sockets(sgi_data_p) < 0) { if (sgi_create_sockets(sgi_data_p) < 0) {
SGI_IF_ERROR("Could not create socket, leaving thread %s\n", __FUNCTION__); SGI_IF_ERROR("Could not create socket, leaving thread %s\n", __FUNCTION__);
free(sgi_data_p); free(sgi_data_p);
return -1; return -1;
} }
} else {
SGI_IF_WARNING("SGI interface disabled by config file\n");
}
if (pthread_create(&fw_2_sgi_task_thread, NULL, &sgi_task_thread, (void *)sgi_data_p) < 0) { if (pthread_create(&fw_2_sgi_task_thread, NULL, &sgi_task_thread, (void *)sgi_data_p) < 0) {
SGI_IF_ERROR("sgi_task_thread pthread_create: %s", strerror(errno)); SGI_IF_ERROR("sgi_task_thread pthread_create: %s", strerror(errno));
return -1; return -1;
} }
if (strcmp(sgi_data_p->interface_name, PGW_CONFIG_STRING_INTERFACE_DISABLED) != 0) {
#ifdef ENABLE_USE_PCAP_FOR_SGI #ifdef ENABLE_USE_PCAP_FOR_SGI
if (pthread_create(&sgi_data_p->capture_on_sgi_if_thread, NULL, &sgi_pcap_fw_2_gtpv1u_thread, (void *)sgi_data_p) < 0) { if (pthread_create(&sgi_data_p->capture_on_sgi_if_thread, NULL, &sgi_pcap_fw_2_gtpv1u_thread, (void *)sgi_data_p) < 0) {
SGI_IF_ERROR("sgi_pcap_fw_2_gtpv1u_thread pthread_create: %s", strerror(errno)); SGI_IF_ERROR("sgi_pcap_fw_2_gtpv1u_thread pthread_create: %s", strerror(errno));
...@@ -283,6 +287,7 @@ int sgi_init(const pgw_config_t *pgw_config_p) ...@@ -283,6 +287,7 @@ int sgi_init(const pgw_config_t *pgw_config_p)
} }
} }
#endif #endif
}
while (sgi_data_p->thread_started != SGI_MAX_EPS_BEARERS_PER_USER ) { while (sgi_data_p->thread_started != SGI_MAX_EPS_BEARERS_PER_USER ) {
usleep(1000); usleep(1000);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment