Example #1
0
/* net_init:
 *  Initialises the libnet library.
 */
int net_init (void) {
  if (!initialised) {
    initialised = 1;
    
    if (!__libnet_internal__mutex_create)
        net_set_mutex_funcs (NULL, NULL, NULL, NULL);
    if (!__libnet_timer_func)
        net_set_timer_func (NULL);
    __libnet_timer_func();
    
    detected_drivers = net_driverlist_create();
    initialised_drivers = net_driverlist_create();
    temp_detected_list = net_driverlist_create();
    net_drivers_all = net_driverlist_create();

    __libnet_internal__classes_init();
    __libnet_internal__drivers_init();
    __libnet_internal__channels_init();
    __libnet_internal__conns_init();
    
    if (!done_atexit) {
      if (atexit(exitfunc)) {
	exitfunc();
	return 1;
      }
      done_atexit = 1;
    } 
  }
  return 0;
}
Example #2
0
static void sigint(int maybe_unused sig)
{
	exitfunc();
	syscall(__NR_exit);
}
static void sigint(int sig)
{
	exitfunc();
	syscall(__NR_exit);
}