PcapPlusPlus
21.05
|
#include <IgmpLayer.h>
Public Member Functions | |
IgmpV3ReportLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
IgmpV3ReportLayer () | |
igmpv3_report_header * | getReportHeader () const |
uint16_t | getGroupRecordCount () const |
igmpv3_group_record * | getFirstGroupRecord () const |
igmpv3_group_record * | getNextGroupRecord (igmpv3_group_record *groupRecord) const |
igmpv3_group_record * | addGroupRecord (uint8_t recordType, const IPv4Address &multicastAddress, const std::vector< IPv4Address > &sourceAddresses) |
igmpv3_group_record * | addGroupRecordAtIndex (uint8_t recordType, const IPv4Address &multicastAddress, const std::vector< IPv4Address > &sourceAddresses, int index) |
bool | removeGroupRecordAtIndex (int index) |
bool | removeAllGroupRecords () |
void | computeCalculateFields () |
size_t | getHeaderLen () const |
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 () |
std::string | toString () const |
OsiModelLayer | getOsiModelLayer () const |
Public Member Functions inherited from pcpp::Layer | |
virtual | ~Layer () |
Layer * | getNextLayer () const |
Layer * | getPrevLayer () const |
ProtocolType | getProtocol () 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 |
Additional Inherited Members | |
Static Public Member Functions inherited from pcpp::IgmpLayer | |
static ProtocolType | getIGMPVerFromData (uint8_t *data, size_t dataLen, bool &isQuery) |
Represents an IGMPv3 (Internet Group Management Protocol ver 3) membership report message
|
inline |
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 |
|
inline |
A constructor that allocates a new IGMPv3 membership report with 0 group addresses
igmpv3_group_record* pcpp::IgmpV3ReportLayer::addGroupRecord | ( | uint8_t | recordType, |
const IPv4Address & | multicastAddress, | ||
const std::vector< IPv4Address > & | sourceAddresses | ||
) |
Add a new group record at a the end of the group record list. The igmpv3_report_header::numOfGroupRecords field will be incremented accordingly
[in] | recordType | The type of the new group record |
[in] | multicastAddress | The multicast address of the new group record |
[in] | sourceAddresses | A vector containing all the source addresses of the new group record |
igmpv3_group_record* pcpp::IgmpV3ReportLayer::addGroupRecordAtIndex | ( | uint8_t | recordType, |
const IPv4Address & | multicastAddress, | ||
const std::vector< IPv4Address > & | sourceAddresses, | ||
int | index | ||
) |
Add a new group record at a certain index of the group record list. The igmpv3_report_header::numOfGroupRecords field will be incremented accordingly
[in] | recordType | The type of the new group record |
[in] | multicastAddress | The multicast address of the new group record |
[in] | sourceAddresses | A vector containing all the source addresses of the new group record |
[in] | index | The index to add the new group address at |
|
virtual |
Calculate the IGMP checksum
Implements pcpp::Layer.
igmpv3_group_record* pcpp::IgmpV3ReportLayer::getFirstGroupRecord | ( | ) | const |
uint16_t pcpp::IgmpV3ReportLayer::getGroupRecordCount | ( | ) | const |
|
inlinevirtual |
Reimplemented from pcpp::IgmpLayer.
igmpv3_group_record* pcpp::IgmpV3ReportLayer::getNextGroupRecord | ( | igmpv3_group_record * | groupRecord | ) | const |
Get the group record that comes next to a given group record. If "groupRecord" is NULL then NULL will be returned. If "groupRecord" is the last group record or if it is out of layer bounds NULL will be returned also. Notice the return value is a pointer to the real data casted to igmpv3_group_record type (as opposed to a copy of the option data). So changes in the return value will affect the packet data
[in] | groupRecord | The group record to start searching from |
|
inline |
Get a pointer to the raw IGMPv3 membership report header. Notice this points directly to the data, so every change will change the actual packet data
bool pcpp::IgmpV3ReportLayer::removeAllGroupRecords | ( | ) |
Remove all group records in the message. The igmpv3_report_header::numOfGroupRecords field will be set to 0
bool pcpp::IgmpV3ReportLayer::removeGroupRecordAtIndex | ( | int | index | ) |
Remove a group record at a certain index. The igmpv3_report_header::numOfGroupRecords field will be decremented accordingly
[in] | index | The index of the group record to be removed |