Sniffer rewritten in an better C++ style
[sniffer.git] / sniffer.h
blobd797aebb96441914af1da214042e374f3d43191a
1 #ifndef SNIFFER_H_35C874BC_4DD1_11E2_AD2F_1BC708A5F99E_
2 #define SNIFFER_H_35C874BC_4DD1_11E2_AD2F_1BC708A5F99E_
4 struct pcap_pkthdr;
6 namespace filter {
8 class Sniffer {
10 public:
11 Sniffer() {
13 virtual ~Sniffer() {
15 void loop(const char* devname);
17 protected:
18 virtual void newPacket(const unsigned char * buffer, int size);
20 private:
21 static void process_packet(unsigned char* arg, const struct pcap_pkthdr * header, const unsigned char * buffer);
26 #endif // SNIFFER_H_35C874BC_4DD1_11E2_AD2F_1BC708A5F99E_