Capturing with libpcap
 All Classes Files Functions Variables
pcapwrapper.h
Go to the documentation of this file.
1 #include <iostream>
2 #include <stdlib.h>
3 #include <pcap.h>
4 #include <signal.h>
5 #include <unistd.h>
6 
7 using namespace std;
8 
14 class PcapWrapper {
15 
16  public:
17 
18  PcapWrapper (char * = NULL);
19  ~PcapWrapper ();
20 
21  void run (int = 0) ;
22 
23  void setFilter (char *);
24 
25  private:
26  char * dev, * filter;
27  char errbuf [PCAP_ERRBUF_SIZE];
28  bpf_u_int32 mask, net;
29  struct bpf_program fp;
30  pcap_t * handle;
31 };
32