PcapPlusPlus
22.11
|
#include <PcapFilter.h>
Public Types | |
enum | TcpFlags { tcpFin = 1, tcpSyn = 2, tcpRst = 4, tcpPush = 8, tcpAck = 16, tcpUrg = 32 } |
enum | MatchOptions { MatchAll, MatchOneAtLeast } |
Public Member Functions | |
TcpFlagsFilter (uint8_t tcpFlagBitMask, MatchOptions matchOption) | |
void | setTcpFlagsBitMask (uint8_t tcpFlagBitMask, MatchOptions matchOption) |
void | parseToString (std::string &result) |
Public Member Functions inherited from pcpp::GeneralFilter | |
bool | matchPacketWithFilter (RawPacket *rawPacket) |
virtual | ~GeneralFilter () |
A class for filtering only TCP packets which certain TCP flags are set in them
For deeper understanding of the filter concept please refer to PcapFilter.h
An enum for representing 2 type of matches: match only packets that contain all flags defined in the filter or match packets that contain at least one of the flags defined in the filter
Enumerator | |
---|---|
MatchAll | Match only packets that contain all flags defined in the filter |
MatchOneAtLeast | Match packets that contain at least one of the flags defined in the filter |
|
inline |
A constructor that gets a 1-byte bitmask containing all TCP flags participating in the filter and the match option, and creates the filter
[in] | tcpFlagBitMask | A 1-byte bitmask containing all TCP flags participating in the filter. This parameter can contain the following value for example: TcpFlagsFilter::tcpSyn | TcpFlagsFilter::tcpAck | TcpFlagsFilter::tcpUrg |
[in] | matchOption | The match option: TcpFlagsFilter::MatchAll or TcpFlagsFilter::MatchOneAtLeast |
|
virtual |
A method that parses the class instance into BPF string format
[out] | result | An empty string that the parsing will be written into. If the string isn't empty, its content will be overridden |
Implements pcpp::GeneralFilter.
|
inline |
Set the TCP flags and the match option
[in] | tcpFlagBitMask | A 1-byte bitmask containing all TCP flags participating in the filter. This parameter can contain the following value for example: TcpFlagsFilter::tcpSyn | TcpFlagsFilter::tcpAck | TcpFlagsFilter::tcpUrg |
[in] | matchOption | The match option: TcpFlagsFilter::MatchAll or TcpFlagsFilter::MatchOneAtLeast |