PcapPlusPlus
24.09
|
#include <VrrpLayer.h>
Public Types | |
enum | VrrpType { VrrpType_Unknown = 0 , VrrpType_Advertisement = 1 } |
enum | VrrpPriority { Default , Stop , Owner , Other } |
Public Member Functions | |
IPAddress::AddressType | getAddressType () const |
uint8_t | getVersion () const |
VrrpType | getType () const |
uint8_t | getVirtualRouterID () const |
void | setVirtualRouterID (uint8_t virtualRouterID) |
uint8_t | getPriority () const |
VrrpPriority | getPriorityAsEnum () const |
void | setPriority (uint8_t priority) |
uint16_t | getChecksum () const |
void | calculateAndSetChecksum () |
virtual uint16_t | calculateChecksum () const =0 |
bool | isChecksumCorrect () const |
uint8_t | getIPAddressesCount () const |
std::vector< IPAddress > | getIPAddresses () const |
bool | addIPAddresses (const std::vector< IPAddress > &ipAddresses) |
bool | addIPAddress (const IPAddress &ipAddress) |
bool | removeIPAddressAtIndex (int index) |
bool | removeAllIPAddresses () |
void | parseNextLayer () override |
void | computeCalculateFields () override |
size_t | getHeaderLen () const override |
std::string | toString () const override |
OsiModelLayer | getOsiModelLayer () const override |
Public Member Functions inherited from pcpp::Layer | |
virtual | ~Layer () |
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 |
Static Public Member Functions | |
static ProtocolType | getVersionFromData (uint8_t *data, size_t dataLen) |
A base class for all VRRP (Virtual Router Redundancy Protocol) protocol classes. This is an abstract class and cannot be instantiated, only its child classes can be instantiated. The inherited classes represent the different versions of the protocol: VRRPv2 and VRRPv3
bool pcpp::VrrpLayer::addIPAddress | ( | const IPAddress & | ipAddress | ) |
Add a virtual IP address at a the end of the virtual IP address list. The vrrp_header::ipAddressCount field will be incremented accordingly
[in] | ipAddress | Virtual IP address to add |
bool pcpp::VrrpLayer::addIPAddresses | ( | const std::vector< IPAddress > & | ipAddresses | ) |
Add a list of virtual IP addresses at a the end of the virtual IP address list. The vrrp_header::ipAddressCount field will be incremented accordingly
[in] | ipAddresses | A vector containing all the virtual IP address |
void pcpp::VrrpLayer::calculateAndSetChecksum | ( | ) |
Fill the checksum from header and data and write the result to vrrp_header::checksum
|
pure virtual |
Calculate the checksum from header and data and write the result to vrrp_header::checksum
Implemented in pcpp::VrrpV3Layer, and pcpp::VrrpV2Layer.
|
overridevirtual |
Calculate the VRRP checksum
Implements pcpp::Layer.
IPAddress::AddressType pcpp::VrrpLayer::getAddressType | ( | ) | const |
uint16_t pcpp::VrrpLayer::getChecksum | ( | ) | const |
|
inlineoverridevirtual |
Implements pcpp::Layer.
std::vector<IPAddress> pcpp::VrrpLayer::getIPAddresses | ( | ) | const |
uint8_t pcpp::VrrpLayer::getIPAddressesCount | ( | ) | const |
|
inlineoverridevirtual |
Implements pcpp::Layer.
uint8_t pcpp::VrrpLayer::getPriority | ( | ) | const |
VrrpPriority pcpp::VrrpLayer::getPriorityAsEnum | ( | ) | const |
VrrpType pcpp::VrrpLayer::getType | ( | ) | const |
uint8_t pcpp::VrrpLayer::getVersion | ( | ) | const |
|
static |
A static method that validates the input data
[in] | data | VRRP raw data (byte stream) |
[in] | dataLen | The length of the byte stream |
uint8_t pcpp::VrrpLayer::getVirtualRouterID | ( | ) | const |
bool pcpp::VrrpLayer::isChecksumCorrect | ( | ) | const |
|
inlineoverridevirtual |
Does nothing for this layer (VRRP layer is always last)
Implements pcpp::Layer.
bool pcpp::VrrpLayer::removeAllIPAddresses | ( | ) |
Remove all virtual IP addresses in the message. The vrrp_header::ipAddressCount field will be set to 0
bool pcpp::VrrpLayer::removeIPAddressAtIndex | ( | int | index | ) |
Remove a virtual IP address at a certain index. The vrrp_header::ipAddressCount field will be decremented accordingly
[in] | index | The index of the virtual IP address to be removed |
void pcpp::VrrpLayer::setPriority | ( | uint8_t | priority | ) |
Set the priority
priority | new priority to set |
void pcpp::VrrpLayer::setVirtualRouterID | ( | uint8_t | virtualRouterID | ) |
Set the virtual router ID
virtualRouterID | new ID to set |
|
overridevirtual |
Implements pcpp::Layer.