cleanup.lc 913 B

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