Esempio n. 1
0
File: dpid.c Progetto: epitron/dillo
/*! Registers available dpis and stops active non-filter dpis.
 * Called when dpid receives
 * cmd='register' service='all'
 * command
 * \Return
 * Number of available dpis
 */
int register_all_cmd()
{
   stop_active_dpis(dpi_attr_list, numdpis);
   free_plugin_list(&dpi_attr_list, numdpis);
   free_services_list(services_list);
   services_list = NULL;
   numdpis = 0;
   numsocks = 1;                /* the srs socket */
   FD_ZERO(&sock_set);
   FD_SET(srs_fd, &sock_set);
   numdpis = register_all(&dpi_attr_list);
   fill_services_list(dpi_attr_list, numdpis, &services_list);
   numsocks = init_all_dpi_sockets(dpi_attr_list);
   return (numdpis);
}
Esempio n. 2
0
void globals_free(void)
{
 
   GBL_FREE(gbls->pcap);
   GBL_FREE(gbls->lnet);
   GBL_FREE(gbls->iface);
   GBL_FREE(gbls->bridge);
   GBL_FREE(gbls->sm);
   GBL_FREE(gbls->filters);

   free_ip_list(gbls->t1);
   GBL_FREE(gbls->t1);
   free_ip_list(gbls->t2);
   GBL_FREE(gbls->t2);
   
   GBL_FREE(gbls->env->name);
   GBL_FREE(gbls->env->version);
   GBL_FREE(gbls->env->debug_file);
   GBL_FREE(gbls->env);
   
   free_plugin_list(gbls->options->plugins);
   GBL_FREE(gbls->options->proto);
   GBL_FREE(gbls->options->pcapfile_in);
   GBL_FREE(gbls->options->pcapfile_out);
   GBL_FREE(gbls->options->iface);
   GBL_FREE(gbls->options->iface_bridge);
   GBL_FREE(gbls->options->target1);
   GBL_FREE(gbls->options->target2);
   GBL_FREE(gbls->stats);
   GBL_FREE(gbls->options);
   GBL_FREE(gbls->conf);
   /* destroy the list structure */
   filter_clear();
   
   GBL_FREE(gbls);
   
   return;
}