Exemple #1
0
void pfring_close(pfring *ring) {
  if(!ring)
    return;

  pfring_shutdown(ring);

  if(ring->close)
    ring->close(ring);
 
  if(ring->reentrant)
    pthread_spin_destroy(&ring->spinlock);

  free(ring->device_name);
  free(ring);
}
void sigproc(int sig) {
  static int called = 0;
  int i;

  fprintf(stderr, "Leaving...\n");
  if(called) return; else called = 1;
  do_shutdown = 1;
  print_stats();

  fprintf(stderr, "Shutting down sockets...\n");
  for(i=0; i<num_channels; i++) {
    pfring_shutdown(ring[i]);
    printf("\t%d...\n", i);
  }

  exit(0);
}
void sigproc(int sig) {
  static int called = 0;
  int i;

  fprintf(stderr, "Leaving...\n");

  if(called) return;
  else called = 1;

  dna_cluster_disable(dna_cluster_handle);

  print_stats();

  for(i=0; i<num_threads; i++)
    pfring_shutdown(thread_stats[i].ring);

  do_shutdown = 1;
}
Exemple #4
0
void pfring_close(pfring *ring) {
  if(!ring)
    return;

  if(ring->one_copy_rx_pfring)
    pfring_close(ring->one_copy_rx_pfring);

  pfring_shutdown(ring);

  if(ring->close)
    ring->close(ring);

  if(unlikely(ring->reentrant)) {
    pthread_rwlock_destroy(&ring->rx_lock);
    pthread_rwlock_destroy(&ring->tx_lock);
  }

  free(ring->device_name);
  free(ring);
}