PcapPlusPlus
pcpp::ProtoFilter Class Reference

#include <PcapFilter.h>

Inheritance diagram for pcpp::ProtoFilter:
pcpp::GeneralFilter

Public Member Functions

 ProtoFilter (ProtocolType proto)
 
void parseToString (std::string &result)
 
void setProto (ProtocolType proto)
 
- Public Member Functions inherited from pcpp::GeneralFilter
virtual ~GeneralFilter ()
 

Detailed Description

A class for filtering traffic by protocol. Notice not all protocols are supported, only the following are supported: TCP, UDP, ICMP, VLAN, IPv4, IPv6, ARP, Ethernet.
For deeper understanding of the filter concept please refer to PcapFilter.h

Constructor & Destructor Documentation

pcpp::ProtoFilter::ProtoFilter ( ProtocolType  proto)
inline

A constructor that gets the protocol and creates the filter

Parameters
[in]protoThe protocol to filter, only packets matching this protocol will be received. Please note not all protocols are supported. List of supported protocols is found in the class description

Member Function Documentation

void pcpp::ProtoFilter::parseToString ( std::string &  result)
virtual

A method that parses the class instance into BPF string format

Parameters
[out]resultAn empty string that the parsing will be written into. If the string isn't empty, its content will be overridden

Implements pcpp::GeneralFilter.

void pcpp::ProtoFilter::setProto ( ProtocolType  proto)
inline

Set the protocol to filter with

Parameters
[in]protoThe protocol to filter, only packets matching this protocol will be received. Please note not all protocols are supported. List of supported protocols is found in the class description