|
PcapPlusPlus
Next
|
#include <VrrpLayer.h>
Public Types | |
| enum class | VrrpAuthType : uint8_t { NoAuthentication = 0 , SimpleTextPassword = 1 , IPAuthenticationHeader = 2 , MD5 = 3 , Other = 4 } |
| VRRP v2 authentication types. More... | |
Public Types inherited from pcpp::VrrpLayer | |
| enum | VrrpType { VrrpType_Unknown = 0 , VrrpType_Advertisement = 1 } |
| VRRP message types. More... | |
| enum | VrrpPriority { Default , Stop , Owner , Other } |
| An enum describing VRRP special priority values. More... | |
Public Member Functions | |
| VrrpV2Layer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
| VrrpV2Layer (uint8_t virtualRouterId, uint8_t priority, uint8_t advInt, uint8_t authType=0) | |
| ~VrrpV2Layer () override=default | |
| A destructor for this layer (does nothing) | |
| uint8_t | getAdvInt () const |
| void | setAdvInt (uint8_t advInt) |
| uint8_t | getAuthType () const |
| VrrpAuthType | getAuthTypeAsEnum () const |
| void | setAuthType (uint8_t authType) |
| uint16_t | calculateChecksum () const override |
Public Member Functions inherited from pcpp::VrrpLayer | |
| 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 () |
| Fill the checksum from header and data and write the result to vrrp_header::checksum. | |
| 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 |
| Does nothing for this layer (VRRP layer is always last) | |
| void | computeCalculateFields () override |
| Calculate the VRRP checksum. | |
| size_t | getHeaderLen () const override |
| 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::VrrpLayer | |
| static ProtocolType | getVersionFromData (uint8_t *data, size_t dataLen) |
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 VRRPv2 (Virtual Router Redundancy Protocol ver 2) layer. This class represents all the different messages of VRRPv2
|
strong |
|
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 |
|
explicit |
A constructor that allocates a new VRRP v2 layer
| virtualRouterId | Virtual router ID |
| priority | Priority |
| advInt | Advertisement interval |
| authType | Authentication type (default value is 0) |
|
overridevirtual |
Calculate the checksum from header and data and write the result to vrrp_header::checksum
Implements pcpp::VrrpLayer.
| uint8_t pcpp::VrrpV2Layer::getAdvInt | ( | ) | const |
| uint8_t pcpp::VrrpV2Layer::getAuthType | ( | ) | const |
| VrrpAuthType pcpp::VrrpV2Layer::getAuthTypeAsEnum | ( | ) | const |
|
inlinestatic |
A static method that validates the input data
| [in] | data | The pointer to the beginning of a byte stream of an VRRPv2 layer |
| [in] | dataLen | The length of the byte stream |
| void pcpp::VrrpV2Layer::setAdvInt | ( | uint8_t | advInt | ) |
Set advertisement interval value in this message
| advInt | value to set |
| void pcpp::VrrpV2Layer::setAuthType | ( | uint8_t | authType | ) |
Set VRRP authentication type
| authType | value to set |