File: packetsource.h

package info (click to toggle)
kismet 1.4.2-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 504 kB
  • ctags: 435
  • sloc: cpp: 2,741; makefile: 126; sh: 29
file content (32 lines) | stat: -rw-r--r-- 612 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef __PACKETSOURCE_H__
#define __PACKETSOURCE_H__

#include "packet.h"

// Packet capture source superclass
class PacketSource {
public:
    // Open the packet source
    virtual int OpenSource(const char *dev) = 0;

    virtual int CloseSource() = 0;

    // Get a packet from the medium
    virtual int FetchPacket(pkthdr *in_header, u_char *in_data) = 0;

    // Say what we are
    char *FetchType() { return(type); };

    // Get the error
    char *FetchError() { return(errstr); };

protected:
    char errstr[1024];
    pkthdr header;
    u_char data[MAX_PACKET_LEN];

    char type[64];

};

#endif