PcapPlusPlus
21.11
|
#include <GreLayer.h>
Public Member Functions | |
GREv1Layer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
GREv1Layer (uint16_t callID) | |
gre1_header * | getGreHeader () const |
bool | getAcknowledgmentNum (uint32_t &ackNum) const |
bool | setAcknowledgmentNum (uint32_t ackNum) |
bool | unsetAcknowledgmentNum () |
void | computeCalculateFields () |
std::string | toString () const |
Public Member Functions inherited from pcpp::GreLayer | |
bool | getSequenceNumber (uint32_t &seqNumber) const |
bool | setSequenceNumber (uint32_t seqNumber) |
bool | unsetSequenceNumber () |
void | parseNextLayer () |
size_t | getHeaderLen () 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::GreLayer | |
static ProtocolType | getGREVersion (uint8_t *greData, size_t greDataLen) |
Represents a GRE version 1 protocol
|
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 |
pcpp::GREv1Layer::GREv1Layer | ( | uint16_t | callID | ) |
A constructor that creates a new GREv1 header and allocates the data
[in] | callID | The call ID to set |
|
virtual |
Calculate the following fields:
Implements pcpp::Layer.
bool pcpp::GREv1Layer::getAcknowledgmentNum | ( | uint32_t & | ackNum | ) | const |
Get acknowledgment (ack) number value if field exists in layer
[out] | ackNum | The returned ack number value if exists in layer. Else remain unchanged |
|
inline |
Get a pointer to the basic GREv1 header containing all non-optional fields. Notice this points directly to the data, so every change will change the actual packet data. Also please notice that changing the set bits (gre_basic_header::strictSourceRouteBit, gre_basic_header::sequenceNumBit, gre_basic_header::keyBit, gre_basic_header::routingBit, gre_basic_header::checksumBit, gre_basic_header::ackSequenceNumBit) without using the proper set or unset methods (such as setAcknowledgmentNum(), unsetSequenceNumber(), etc.) may result to wrong calculation of header length or illegal GREv1 packet and to some really weird bugs. Please avoid doing so
bool pcpp::GREv1Layer::setAcknowledgmentNum | ( | uint32_t | ackNum | ) |
Set acknowledgment (ack) number value. If field already exists (gre_basic_header::ackSequenceNumBit is set) then only the new value is set. If field doesn't exist it will be added to the layer, gre_basic_header::ackSequenceNumBit will be set and the new value will be set
[in] | ackNum | The ack number value to set |
|
virtual |
Implements pcpp::Layer.
bool pcpp::GREv1Layer::unsetAcknowledgmentNum | ( | ) |
Unset acknowledgment (ack) number and remove it from the layer