|
PcapPlusPlus
Next
|
#include <IgmpLayer.h>
Public Member Functions | |
| IgmpV3QueryLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
| IgmpV3QueryLayer (const IPv4Address &multicastAddr=IPv4Address(), uint8_t maxResponseTime=0, uint8_t s_qrv=0) | |
| igmpv3_query_header * | getIgmpV3QueryHeader () const |
| uint16_t | getSourceAddressCount () const |
| IPv4Address | getSourceAddressAtIndex (int index) const |
| bool | addSourceAddress (const IPv4Address &addr) |
| bool | addSourceAddressAtIndex (const IPv4Address &addr, int index) |
| bool | removeSourceAddressAtIndex (int index) |
| bool | removeAllSourceAddresses () |
| void | computeCalculateFields () override |
| Calculate the IGMP checksum. | |
| size_t | getHeaderLen () const override |
Public Member Functions inherited from pcpp::IgmpLayer | |
| igmp_header * | getIgmpHeader () const |
| IPv4Address | getGroupAddress () const |
| void | setGroupAddress (const IPv4Address &groupAddr) |
| IgmpType | getType () const |
| void | setType (IgmpType type) |
| void | parseNextLayer () override |
| Does nothing for this layer (IGMP layer is always last) | |
| std::string | toString () const override |
| OsiModelLayer | getOsiModelLayer () const override |
Public Member Functions inherited from pcpp::Layer | |
| ~Layer () override | |
| Layer * | getNextLayer () const |
| Layer * | getPrevLayer () 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 |
Static Public Member Functions | |
| static bool | isDataValid (uint8_t const *data, size_t dataLen) |
Static Public Member Functions inherited from pcpp::IgmpLayer | |
| static ProtocolType | getIGMPVerFromData (uint8_t *data, size_t dataLen, bool &isQuery) |
Additional Inherited Members | |
Protected Member Functions inherited from pcpp::Layer | |
| template<typename T , typename... Args> | |
| Layer * | constructNextLayer (uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
| template<typename T , typename TFallback , typename... Args> | |
| Layer * | tryConstructNextLayerWithFallback (uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
Static Protected Member Functions inherited from pcpp::Layer | |
| template<typename T > | |
| static bool | canReinterpretAs (const uint8_t *data, size_t dataLen) |
| Check if the data is large enough to reinterpret as a type. More... | |
Represents an IGMPv3 (Internet Group Management Protocol ver 3) membership query message
| pcpp::IgmpV3QueryLayer::IgmpV3QueryLayer | ( | uint8_t * | data, |
| size_t | dataLen, | ||
| Layer * | prevLayer, | ||
| Packet * | packet | ||
| ) |
A constructor that creates the layer from an existing packet raw data
| [in] | data | A pointer to the raw data |
| [in] | dataLen | Size of the data in bytes |
| [in] | prevLayer | A pointer to the previous layer |
| [in] | packet | A pointer to the Packet instance where layer will be stored in |
|
explicit |
A constructor that allocates a new IGMPv3 membership query
| [in] | multicastAddr | The multicast address to set. This is an optional parameter and has a default value of unspecified/zero IPv4 address if not provided |
| [in] | maxResponseTime | The max response time to set. This is an optional parameter and has a default value of 0 if not provided |
| [in] | s_qrv | A 1-byte value representing the value in Suppress Router-side Processing Flag + Querier's Robustness Variable (igmpv3_query_header::s_qrv field). This is an optional parameter and has a default value of 0 if not provided |
| bool pcpp::IgmpV3QueryLayer::addSourceAddress | ( | const IPv4Address & | addr | ) |
Add a new source address at the end of the source address list. The igmpv3_query_header::numOfSources field will be incremented accordingly
| [in] | addr | The IPv4 source address to add |
| bool pcpp::IgmpV3QueryLayer::addSourceAddressAtIndex | ( | const IPv4Address & | addr, |
| int | index | ||
| ) |
Add a new source address at a certain index of the source address list. The igmpv3_query_header::numOfSources field will be incremented accordingly
| [in] | addr | The IPv4 source address to add |
| [in] | index | The index to add the new source address at |
|
overridevirtual |
Reimplemented from pcpp::IgmpLayer.
|
inline |
Get a pointer to the raw IGMPv3 membership query header. Notice this points directly to the data, so every change will change the actual packet data
| IPv4Address pcpp::IgmpV3QueryLayer::getSourceAddressAtIndex | ( | int | index | ) | const |
Get the IPV4 source address in a certain index
| [in] | index | The requested index of the source address |
| uint16_t pcpp::IgmpV3QueryLayer::getSourceAddressCount | ( | ) | const |
|
inlinestatic |
A static method that validates the input data
| [in] | data | The pointer to the beginning of a byte stream of an IGMPv3 Query layer |
| [in] | dataLen | The length of the byte stream |
| bool pcpp::IgmpV3QueryLayer::removeAllSourceAddresses | ( | ) |
Remove all source addresses in the message. The igmpv3_query_header::numOfSources field will be set to 0
| bool pcpp::IgmpV3QueryLayer::removeSourceAddressAtIndex | ( | int | index | ) |
Remove a source address at a certain index. The igmpv3_query_header::numOfSources field will be decremented accordingly
| [in] | index | The index of the source address to be removed |