|
PcapPlusPlus
20.08
|
Go to the documentation of this file.
82 bpf_program* m_Program;
83 std::string m_LastProgramString;
120 const std::string m_FilterStr;
123 BPFStringFilter(
const std::string& filterStr) : m_FilterStr(filterStr) {}
152 void parseDirection(std::string& directionAsString);
153 Direction getDir()
const {
return m_Dir; }
175 std::string parseOperator();
197 std::string m_Address;
198 std::string m_IPv4Mask;
200 void convertToIPAddressWithMask(std::string& ipAddrmodified, std::string& mask)
const;
201 void convertToIPAddressWithLen(std::string& ipAddrmodified)
const;
240 void setAddr(
const std::string& ipAddress) { m_Address = ipAddress; }
246 void setMask(
const std::string& ipv4Mask) { m_IPv4Mask = ipv4Mask; m_Len = 0; }
252 void setLen(
int len) { m_IPv4Mask =
""; m_Len = len; }
281 void setIpID(uint16_t ipID) { m_IpID = ipID; }
295 uint16_t m_TotalLength;
324 void portToString(uint16_t portAsInt);
339 void setPort(uint16_t port) { portToString(port); }
418 uint16_t m_EtherType;
448 std::vector<GeneralFilter*> m_FilterList;
460 AndFilter(std::vector<GeneralFilter*>& filters);
472 void setFilters(std::vector<GeneralFilter*>& filters);
490 std::vector<GeneralFilter*> m_FilterList;
502 OrFilter(std::vector<GeneralFilter*>& filters);
668 uint8_t m_TcpFlagsBitMask;
701 uint16_t m_WindowSize;
Definition: PcapFilter.h:147
ArpFilter(ArpOpcode opCode)
Definition: PcapFilter.h:588
void parseToString(std::string &result)
IPv4TotalLengthFilter(uint16_t totalLength, FilterOperator op)
Definition: PcapFilter.h:302
void setOperator(FilterOperator op)
Definition: PcapFilter.h:183
Definition: PcapFilter.h:698
@ DST
Definition: PcapFilter.h:48
void setEtherType(uint16_t etherType)
Definition: PcapFilter.h:432
AndFilter()
Definition: PcapFilter.h:454
Definition: PcapFilter.h:549
void parseToString(std::string &result)
void setTcpFlagsBitMask(uint8_t tcpFlagBitMask, MatchOptions matchOption)
Definition: PcapFilter.h:686
void setFromPort(uint16_t fromPort)
Definition: PcapFilter.h:370
void parseToString(std::string &result)
@ tcpSyn
Definition: PcapFilter.h:645
Definition: PcapFilter.h:263
void parseToString(std::string &result)
Definition: PcapFilter.h:634
@ LINKTYPE_ETHERNET
Definition: RawPacket.h:30
TcpFlagsFilter(uint8_t tcpFlagBitMask, MatchOptions matchOption)
Definition: PcapFilter.h:678
void setVlanID(uint16_t vlanId)
Definition: PcapFilter.h:624
ArpOpcode
Definition: ArpLayer.h:47
PortFilter(uint16_t port, Direction dir)
void parseToString(std::string &result)
@ MatchAll
Definition: PcapFilter.h:663
void setOpCode(ArpOpcode opCode)
Definition: PcapFilter.h:596
void parseToString(std::string &result)
void setFilters(std::vector< GeneralFilter * > &filters)
void setTotalLength(uint16_t totalLength)
Definition: PcapFilter.h:310
void setIpID(uint16_t ipID)
Definition: PcapFilter.h:281
bool matchPacketWithFilter(RawPacket *rawPacket)
Definition: PcapFilter.h:607
Definition: PcapFilter.h:727
void parseToString(std::string &result)
void parseToString(std::string &result)
void parseToString(std::string &result)
@ tcpFin
Definition: PcapFilter.h:643
void setAddr(const std::string &ipAddress)
Definition: PcapFilter.h:240
void parseToString(std::string &result)
@ SRC_OR_DST
Definition: PcapFilter.h:50
Definition: PcapFilter.h:292
ProtoFilter(ProtocolType proto)
Definition: PcapFilter.h:559
Definition: PcapFilter.h:386
@ tcpPush
Definition: PcapFilter.h:649
Definition: PcapFilter.h:117
virtual ~GeneralFilter()
Definition: PcapFilter.h:110
Definition: MacAddress.h:27
@ GREATER_THAN
Definition: PcapFilter.h:64
void setLength(uint16_t legnth)
Definition: PcapFilter.h:746
EtherTypeFilter(uint16_t etherType)
Definition: PcapFilter.h:424
uint64_t ProtocolType
Definition: ProtocolType.h:18
void setToPort(uint16_t toPort)
Definition: PcapFilter.h:376
Definition: PcapFilter.h:170
FilterOperator
Definition: PcapFilter.h:57
Direction
Definition: PcapFilter.h:43
void parseToString(std::string &result)
IPFilter(const std::string &ipAddress, Direction dir)
Definition: PcapFilter.h:209
NotFilter(GeneralFilter *filterToInverse)
Definition: PcapFilter.h:529
Definition: PcapFilter.h:320
Definition: PcapFilter.h:194
Definition: PcapFilter.h:520
void setMask(const std::string &ipv4Mask)
Definition: PcapFilter.h:246
@ MatchOneAtLeast
Definition: PcapFilter.h:665
Definition: PcapFilter.h:487
void parseToString(std::string &result)
IPv4IDFilter(uint16_t ipID, FilterOperator op)
Definition: PcapFilter.h:273
void parseToString(std::string &result)
@ LESS_THAN
Definition: PcapFilter.h:68
void setWindowSize(uint16_t windowSize)
Definition: PcapFilter.h:717
The main namespace for the PcapPlusPlus lib.
OrFilter()
Definition: PcapFilter.h:496
void parseToString(std::string &result)
MatchOptions
Definition: PcapFilter.h:660
void setLen(int len)
Definition: PcapFilter.h:252
MacAddressFilter(MacAddress address, Direction dir)
Definition: PcapFilter.h:396
Definition: PcapFilter.h:579
IPFilter(const std::string &ipAddress, Direction dir, int len)
Definition: PcapFilter.h:231
LinkLayerType
Definition: RawPacket.h:25
Definition: PcapFilter.h:350
void setProto(ProtocolType proto)
Definition: PcapFilter.h:568
void parseToString(std::string &result)
void parseToString(std::string &result)
@ SRC
Definition: PcapFilter.h:46
UdpLengthFilter(uint16_t legnth, FilterOperator op)
Definition: PcapFilter.h:738
virtual void parseToString(std::string &result)
PortRangeFilter(uint16_t fromPort, uint16_t toPort, Direction dir)
Definition: PcapFilter.h:362
TcpWindowSizeFilter(uint16_t windowSize, FilterOperator op)
Definition: PcapFilter.h:709
void setMacAddress(MacAddress address)
Definition: PcapFilter.h:404
void setDirection(Direction dir)
Definition: PcapFilter.h:160
@ EQUALS
Definition: PcapFilter.h:60
Definition: PcapFilter.h:415
@ tcpAck
Definition: PcapFilter.h:651
void setFilter(GeneralFilter *filterToInverse)
Definition: PcapFilter.h:537
@ NOT_EQUALS
Definition: PcapFilter.h:62
@ tcpUrg
Definition: PcapFilter.h:653
IPFilter(const std::string &ipAddress, Direction dir, const std::string &ipv4Mask)
Definition: PcapFilter.h:220
void addFilter(GeneralFilter *filter)
Definition: PcapFilter.h:466
Definition: PcapFilter.h:79
@ GREATER_OR_EQUAL
Definition: PcapFilter.h:66
TcpFlags
Definition: PcapFilter.h:640
virtual void parseToString(std::string &result)=0
@ tcpRst
Definition: PcapFilter.h:647
Definition: RawPacket.h:252
VlanFilter(uint16_t vlanId)
Definition: PcapFilter.h:616
Definition: PcapFilter.h:445
void setPort(uint16_t port)
Definition: PcapFilter.h:339
@ LESS_OR_EQUAL
Definition: PcapFilter.h:70
void addFilter(GeneralFilter *filter)
Definition: PcapFilter.h:508