mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
Initial import of svn+ssh:://svn.icir.org/bro/trunk/bro as of r7088
This commit is contained in:
commit
61757ac78b
1383 changed files with 380824 additions and 0 deletions
48
src/PacketDumper.h
Normal file
48
src/PacketDumper.h
Normal file
|
@ -0,0 +1,48 @@
|
|||
// $Id:$
|
||||
//
|
||||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
|
||||
#ifndef packetdumper_h
|
||||
#define packetdumper_h
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include <queue>
|
||||
#include <set>
|
||||
|
||||
#include <pcap.h>
|
||||
|
||||
class PacketDumper {
|
||||
public:
|
||||
PacketDumper(pcap_dumper_t* pkt_dump);
|
||||
|
||||
void DumpPacket(const struct pcap_pkthdr* hdr,
|
||||
const u_char* pkt, int len);
|
||||
|
||||
protected:
|
||||
pcap_dumper_t* pkt_dump;
|
||||
struct timeval last_timestamp;
|
||||
|
||||
void SortTimeStamp(struct timeval* timestamp);
|
||||
};
|
||||
|
||||
struct IP_ID {
|
||||
uint32 ip, id;
|
||||
};
|
||||
|
||||
struct ltipid {
|
||||
bool operator()(IP_ID id1, IP_ID id2) const
|
||||
{
|
||||
return id1.ip != id2.ip ? (id1.ip < id2.ip) :
|
||||
(id1.id < id2.id);
|
||||
}
|
||||
};
|
||||
|
||||
typedef set<IP_ID, ltipid> IP_IDSet;
|
||||
uint16 NextIP_ID(const uint32 src_addr, const uint16 id);
|
||||
|
||||
extern PacketDumper* transformed_pkt_dump;
|
||||
extern PacketDumper* source_pkt_dump;
|
||||
extern int transformed_pkt_dump_MTU;
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue