Branch data Line data Source code
1 : : // $Id:$
2 : : //
3 : : // See the file "COPYING" in the main distribution directory for copyright.
4 : :
5 : : #ifndef packetdumper_h
6 : : #define packetdumper_h
7 : :
8 : : using namespace std;
9 : :
10 : : #include <queue>
11 : : #include <set>
12 : :
13 : : #include <pcap.h>
14 : :
15 : : class PacketDumper {
16 : : public:
17 : : PacketDumper(pcap_dumper_t* pkt_dump);
18 : :
19 : : void DumpPacket(const struct pcap_pkthdr* hdr,
20 : : const u_char* pkt, int len);
21 : :
22 : : protected:
23 : : pcap_dumper_t* pkt_dump;
24 : : struct timeval last_timestamp;
25 : :
26 : : void SortTimeStamp(struct timeval* timestamp);
27 : : };
28 : :
29 : 0 : struct IP_ID {
30 : : uint32 ip, id;
31 : : };
32 : :
33 : : struct ltipid {
34 : 0 : bool operator()(IP_ID id1, IP_ID id2) const
35 : : {
36 : : return id1.ip != id2.ip ? (id1.ip < id2.ip) :
37 [ # # ]: 0 : (id1.id < id2.id);
38 : : }
39 : : };
40 : :
41 : : typedef set<IP_ID, ltipid> IP_IDSet;
42 : : uint16 NextIP_ID(const uint32 src_addr, const uint16 id);
43 : :
44 : : extern PacketDumper* transformed_pkt_dump;
45 : : extern PacketDumper* source_pkt_dump;
46 : : extern int transformed_pkt_dump_MTU;
47 : :
48 : : #endif
|