PcapPlusPlus  Next
pcpp::IgmpV2Layer Class Reference

#include <IgmpLayer.h>

Inheritance diagram for pcpp::IgmpV2Layer:
pcpp::IgmpLayer pcpp::Layer pcpp::IDataContainer

Public Member Functions

 IgmpV2Layer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
 IgmpV2Layer (IgmpType type, const IPv4Address &groupAddr=IPv4Address(), uint8_t maxResponseTime=0)
 
 ~IgmpV2Layer () override=default
 
void computeCalculateFields () override
 
- Public Member Functions inherited from pcpp::IgmpLayer
igmp_headergetIgmpHeader () const
 
IPv4Address getGroupAddress () const
 
void setGroupAddress (const IPv4Address &groupAddr)
 
IgmpType getType () const
 
void setType (IgmpType type)
 
void parseNextLayer () override
 
size_t getHeaderLen () const override
 
std::string toString () const override
 
OsiModelLayer getOsiModelLayer () const override
 
- Public Member Functions inherited from pcpp::Layer
 ~Layer () override
 
LayergetNextLayer () const
 
LayergetPrevLayer () const
 
ProtocolType getProtocol () const
 
bool isMemberOfProtocolFamily (ProtocolTypeFamily protocolTypeFamily) const
 
uint8_t * getData () const
 
size_t getDataLen () const
 
uint8_t * getLayerPayload () const
 
size_t getLayerPayloadSize () const
 
bool isAllocatedToPacket () const
 
void copyData (uint8_t *toArr) const
 
uint8_t * getDataPtr (size_t offset=0) const override
 

Additional Inherited Members

- Static Public Member Functions inherited from pcpp::IgmpLayer
static ProtocolType getIGMPVerFromData (uint8_t *data, size_t dataLen, bool &isQuery)
 

Detailed Description

Represents IGMPv2 (Internet Group Management Protocol ver 2) layer. This class represents all the different messages of IGMPv2

Constructor & Destructor Documentation

◆ IgmpV2Layer() [1/2]

pcpp::IgmpV2Layer::IgmpV2Layer ( uint8_t *  data,
size_t  dataLen,
Layer prevLayer,
Packet packet 
)
inline

A constructor that creates the layer from an existing packet raw data

Parameters
[in]dataA pointer to the raw data
[in]dataLenSize of the data in bytes
[in]prevLayerA pointer to the previous layer
[in]packetA pointer to the Packet instance where layer will be stored in

◆ IgmpV2Layer() [2/2]

pcpp::IgmpV2Layer::IgmpV2Layer ( IgmpType  type,
const IPv4Address groupAddr = IPv4Address(),
uint8_t  maxResponseTime = 0 
)
inlineexplicit

A constructor that allocates a new IGMPv2 header

Parameters
[in]typeThe message type to set
[in]groupAddrThe multicast address to set. This is an optional parameter and has a default value of unspecified/zero IPv4 address
[in]maxResponseTimeThe max response time to set. This is an optional parameter and has a default value of 0 if not provided

◆ ~IgmpV2Layer()

pcpp::IgmpV2Layer::~IgmpV2Layer ( )
overridedefault

A destructor for this layer (does nothing)

Member Function Documentation

◆ computeCalculateFields()

void pcpp::IgmpV2Layer::computeCalculateFields ( )
overridevirtual

Calculate the IGMP checksum

Implements pcpp::Layer.