zeek/src/Discard.h
Jon Siwek 0b32c980bf Update PacketFilter/Discarder code for IP version independence.
The signatures of script-layer functions 'discarder_check_ip',
'discarder_check_tcp', 'discarder_check_udp', and 'discarder_check_icmp'
were changed to use the more general 'pkt_hdr' type as a parameter
instead of individual header types.
2012-03-08 13:12:04 -06:00

39 lines
636 B
C++

// See the file "COPYING" in the main distribution directory for copyright.
#ifndef discard_h
#define discard_h
#include "IP.h"
#include "Func.h"
struct ip;
struct tcphdr;
struct udphdr;
struct icmp;
class Val;
class RecordType;
class Func;
class Discarder {
public:
Discarder();
~Discarder();
int IsActive();
int NextPacket(const IP_Hdr* ip, int len, int caplen);
protected:
Val* BuildData(const u_char* data, int hdrlen, int len, int caplen);
Func* check_ip;
Func* check_tcp;
Func* check_udp;
Func* check_icmp;
// Maximum amount of application data passed to filtering functions.
int discarder_maxlen;
};
#endif