/* clear resources for interception */ void interception_over() { #if (INTERCEPT_NFQUEUE) if (srv_settings.nfq_q_handler != NULL) { tc_log_info(LOG_NOTICE, 0, "unbinding from queue"); nfq_destroy_queue(srv_settings.nfq_q_handler); srv_settings.nfq_q_handler = NULL; } if (srv_settings.nfq_handler != NULL) { tc_log_info(LOG_NOTICE, 0, "closing nfq library handle"); nfq_close(srv_settings.nfq_handler); srv_settings.nfq_handler = NULL; } #endif #if (INTERCEPT_COMBINED) release_combined_resouces(); #endif #if (!TCPCOPY_SINGLE) router_destroy(); delay_table_destroy(); #endif }
/* clear resources for interception */ void interception_over() { int i; router_destroy(); delay_table_destroy(); if (srv_settings.targets.mappings != NULL) { for (i = 0; i < srv_settings.targets.num; i++) { if (srv_settings.targets.mappings[i] != NULL) { free(srv_settings.targets.mappings[i]); srv_settings.targets.mappings[i] = NULL; } } free(srv_settings.targets.mappings); srv_settings.targets.mappings = NULL; } #if (TCPCOPY_PCAP) for (i = 0; i < MAX_FD_NUM; i++) { if (pcap_map[i] != NULL) { pcap_close(pcap_map[i]); pcap_map[i] = NULL; } } #endif }
void server_over() { int i; router_destroy(srv_settings.pool); delay_table_destroy(); for (i = 0; i < MAX_FD_NUM; i++) { if (pcap_map[i] != NULL) { pcap_close(pcap_map[i]); pcap_map[i] = NULL; } } }
/* Clear resources for interception */ void interception_over() { if(firewall_sock != -1){ close(firewall_sock); firewall_sock = -1; log_info(LOG_NOTICE, "firewall sock is closed"); } if(msg_listen_sock != -1){ close(msg_listen_sock); msg_listen_sock = -1; log_info(LOG_NOTICE, "msg listen sock is closed"); } router_destroy(); delay_table_destroy(); }
/* Destroy router table */ void router_destroy() { #if (INTERCEPT_THREAD) pthread_mutex_lock(&mutex); #endif if (table != NULL) { tc_log_info(LOG_NOTICE, 0, "destroy router table"); hash_destroy(table); free(table); table = NULL; delay_table_destroy(); } #if (INTERCEPT_THREAD) pthread_mutex_unlock(&mutex); #endif }
/* clear resources for interception */ void interception_over() { int i; #if (INTERCEPT_COMBINED) release_combined_resouces(); #endif router_destroy(); delay_table_destroy(); if (srv_settings.targets.mappings != NULL) { for (i = 0; i < srv_settings.targets.num; i++) { if (srv_settings.targets.mappings[i] != NULL) { free(srv_settings.targets.mappings[i]); srv_settings.targets.mappings[i] = NULL; } } free(srv_settings.targets.mappings); srv_settings.targets.mappings = NULL; } }