cleanup.c 368 B

123456789101112131415161718192021
  1. #include "udpcksum.h"
  2. /* include cleanup */
  3. void
  4. cleanup(int signo)
  5. {
  6. struct pcap_stat stat;
  7. putc('\n', stdout);
  8. if (verbose) {
  9. if (pcap_stats(pd, &stat) < 0)
  10. err_quit("pcap_stats: %s\n", pcap_geterr(pd));
  11. printf("%d packets received by filter\n", stat.ps_recv);
  12. printf("%d packets dropped by kernel\n", stat.ps_drop);
  13. }
  14. exit(0);
  15. }
  16. /* end cleanup */