|
PcapPlusPlus
19.12
|
Go to the documentation of this file.
81 bpf_program* m_program;
82 std::string m_lastProgramString;
118 const std::string m_filterStr;
121 BPFStringFilter(
const std::string& filterStr) : m_filterStr(filterStr) {}
150 void parseDirection(std::string& directionAsString);
151 Direction getDir()
const {
return m_Dir; }
173 std::string parseOperator();
195 std::string m_Address;
196 std::string m_IPv4Mask;
198 void convertToIPAddressWithMask(std::string& ipAddrmodified, std::string& mask)
const;
199 void convertToIPAddressWithLen(std::string& ipAddrmodified,
int& len)
const;
238 void setAddr(
const std::string& ipAddress) { m_Address = ipAddress; }
244 void setMask(
const std::string& ipv4Mask) { m_IPv4Mask = ipv4Mask; m_Len = 0; }
250 void setLen(
int len) { m_IPv4Mask =
""; m_Len = len; }
279 void setIpID(uint16_t ipID) { m_IpID = ipID; }
293 uint16_t m_TotalLength;
322 void portToString(uint16_t portAsInt);
337 void setPort(uint16_t port) { portToString(port); }
416 uint16_t m_EtherType;
446 std::vector<GeneralFilter*> m_FilterList;
458 AndFilter(std::vector<GeneralFilter*>& filters);
470 void setFilters(std::vector<GeneralFilter*>& filters);
488 std::vector<GeneralFilter*> m_FilterList;
500 OrFilter(std::vector<GeneralFilter*>& filters);
666 uint8_t m_TcpFlagsBitMask;
699 uint16_t m_WindowSize;
Definition: PcapFilter.h:145
ArpFilter(ArpOpcode opCode)
Definition: PcapFilter.h:586
void parseToString(std::string &result)
IPv4TotalLengthFilter(uint16_t totalLength, FilterOperator op)
Definition: PcapFilter.h:300
void setOperator(FilterOperator op)
Definition: PcapFilter.h:181
Definition: PcapFilter.h:696
Definition: PcapFilter.h:47
void setEtherType(uint16_t etherType)
Definition: PcapFilter.h:430
AndFilter()
Definition: PcapFilter.h:452
Definition: PcapFilter.h:547
void parseToString(std::string &result)
void setTcpFlagsBitMask(uint8_t tcpFlagBitMask, MatchOptions matchOption)
Definition: PcapFilter.h:684
void setFromPort(uint16_t fromPort)
Definition: PcapFilter.h:368
void parseToString(std::string &result)
Definition: PcapFilter.h:643
Definition: PcapFilter.h:261
void parseToString(std::string &result)
Definition: PcapFilter.h:632
TcpFlagsFilter(uint8_t tcpFlagBitMask, MatchOptions matchOption)
Definition: PcapFilter.h:676
void setVlanID(uint16_t vlanId)
Definition: PcapFilter.h:622
ArpOpcode
Definition: ArpLayer.h:47
PortFilter(uint16_t port, Direction dir)
void parseToString(std::string &result)
Definition: PcapFilter.h:661
void setOpCode(ArpOpcode opCode)
Definition: PcapFilter.h:594
void parseToString(std::string &result)
void setFilters(std::vector< GeneralFilter * > &filters)
void setTotalLength(uint16_t totalLength)
Definition: PcapFilter.h:308
void setIpID(uint16_t ipID)
Definition: PcapFilter.h:279
bool matchPacketWithFilter(RawPacket *rawPacket)
Definition: PcapFilter.h:605
Definition: PcapFilter.h:725
void parseToString(std::string &result)
void parseToString(std::string &result)
void parseToString(std::string &result)
Definition: PcapFilter.h:641
void setAddr(const std::string &ipAddress)
Definition: PcapFilter.h:238
void parseToString(std::string &result)
Definition: PcapFilter.h:49
Definition: PcapFilter.h:290
ProtoFilter(ProtocolType proto)
Definition: PcapFilter.h:557
Definition: PcapFilter.h:384
Definition: PcapFilter.h:647
Definition: PcapFilter.h:115
virtual ~GeneralFilter()
Definition: PcapFilter.h:108
Definition: MacAddress.h:27
Definition: PcapFilter.h:63
void setLength(uint16_t legnth)
Definition: PcapFilter.h:744
EtherTypeFilter(uint16_t etherType)
Definition: PcapFilter.h:422
ProtocolType
Definition: ProtocolType.h:16
void setToPort(uint16_t toPort)
Definition: PcapFilter.h:374
Definition: PcapFilter.h:168
FilterOperator
Definition: PcapFilter.h:56
Direction
Definition: PcapFilter.h:42
void parseToString(std::string &result)
IPFilter(const std::string &ipAddress, Direction dir)
Definition: PcapFilter.h:207
NotFilter(GeneralFilter *filterToInverse)
Definition: PcapFilter.h:527
Definition: PcapFilter.h:318
Definition: PcapFilter.h:192
Definition: PcapFilter.h:518
void setMask(const std::string &ipv4Mask)
Definition: PcapFilter.h:244
Definition: PcapFilter.h:663
Definition: PcapFilter.h:485
void parseToString(std::string &result)
IPv4IDFilter(uint16_t ipID, FilterOperator op)
Definition: PcapFilter.h:271
void parseToString(std::string &result)
Definition: PcapFilter.h:67
void setWindowSize(uint16_t windowSize)
Definition: PcapFilter.h:715
The main namespace for the PcapPlusPlus lib.
OrFilter()
Definition: PcapFilter.h:494
void parseToString(std::string &result)
MatchOptions
Definition: PcapFilter.h:658
void setLen(int len)
Definition: PcapFilter.h:250
MacAddressFilter(MacAddress address, Direction dir)
Definition: PcapFilter.h:394
Definition: PcapFilter.h:577
IPFilter(const std::string &ipAddress, Direction dir, int len)
Definition: PcapFilter.h:229
Definition: PcapFilter.h:348
void setProto(ProtocolType proto)
Definition: PcapFilter.h:566
void parseToString(std::string &result)
void parseToString(std::string &result)
Definition: PcapFilter.h:45
UdpLengthFilter(uint16_t legnth, FilterOperator op)
Definition: PcapFilter.h:736
virtual void parseToString(std::string &result)
PortRangeFilter(uint16_t fromPort, uint16_t toPort, Direction dir)
Definition: PcapFilter.h:360
TcpWindowSizeFilter(uint16_t windowSize, FilterOperator op)
Definition: PcapFilter.h:707
void setMacAddress(MacAddress address)
Definition: PcapFilter.h:402
void setDirection(Direction dir)
Definition: PcapFilter.h:158
Definition: PcapFilter.h:59
Definition: PcapFilter.h:413
Definition: PcapFilter.h:649
void setFilter(GeneralFilter *filterToInverse)
Definition: PcapFilter.h:535
Definition: PcapFilter.h:61
Definition: PcapFilter.h:651
IPFilter(const std::string &ipAddress, Direction dir, const std::string &ipv4Mask)
Definition: PcapFilter.h:218
void addFilter(GeneralFilter *filter)
Definition: PcapFilter.h:464
Definition: PcapFilter.h:78
Definition: PcapFilter.h:65
TcpFlags
Definition: PcapFilter.h:638
virtual void parseToString(std::string &result)=0
Definition: PcapFilter.h:645
Definition: RawPacket.h:219
VlanFilter(uint16_t vlanId)
Definition: PcapFilter.h:614
Definition: PcapFilter.h:443
void setPort(uint16_t port)
Definition: PcapFilter.h:337
Definition: PcapFilter.h:69
void addFilter(GeneralFilter *filter)
Definition: PcapFilter.h:506