PcapPlusPlus
Next
|
#include <WireGuardLayer.h>
Public Member Functions | |
WireGuardTransportDataLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
WireGuardTransportDataLayer (uint32_t receiverIndex, uint64_t counter, const uint8_t *encryptedData, size_t encryptedDataLen) | |
uint32_t | getReceiverIndex () const |
uint64_t | getCounter () const |
const uint8_t * | getEncryptedData () const |
void | setReceiverIndex (uint32_t receiverIndex) |
void | setCounter (uint64_t counter) |
void | setEncryptedData (const uint8_t *encryptedData, size_t encryptedDataLen) |
WireGuardMessageType | getWireGuardMessageType () const override |
Public Member Functions inherited from pcpp::WireGuardLayer | |
WireGuardLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
std::string | getMessageTypeAsString () const |
uint8_t | getMessageType () const |
uint32_t | getReserved () const |
void | setReserved (const std::array< uint8_t, 3 > &reserved) |
void | parseNextLayer () override |
size_t | getHeaderLen () const override |
void | computeCalculateFields () 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 |
Additional Inherited Members | |
Public Types inherited from pcpp::WireGuardLayer | |
enum class | WireGuardMessageType { Unknown = 0 , HandshakeInitiation = 1 , HandshakeResponse = 2 , CookieReply = 3 , TransportData = 4 } |
Static Public Member Functions inherited from pcpp::WireGuardLayer | |
static bool | isWireGuardPorts (uint16_t portSrc, uint16_t portDst) |
static bool | isDataValid (const uint8_t *data, size_t dataLen) |
static WireGuardLayer * | parseWireGuardLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) |
Represents a Transport Data 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 |
pcpp::WireGuardTransportDataLayer::WireGuardTransportDataLayer | ( | uint32_t | receiverIndex, |
uint64_t | counter, | ||
const uint8_t * | encryptedData, | ||
size_t | encryptedDataLen | ||
) |
A constructor that creates a new Transport Data message
[in] | receiverIndex | The receiver index |
[in] | counter | The counter field |
[in] | encryptedData | The encrypted data |
[in] | encryptedDataLen | The length of the encrypted data |
uint64_t pcpp::WireGuardTransportDataLayer::getCounter | ( | ) | const |
const uint8_t* pcpp::WireGuardTransportDataLayer::getEncryptedData | ( | ) | const |
uint32_t pcpp::WireGuardTransportDataLayer::getReceiverIndex | ( | ) | const |
|
inlineoverridevirtual |
Reimplemented from pcpp::WireGuardLayer.
void pcpp::WireGuardTransportDataLayer::setCounter | ( | uint64_t | counter | ) |
counter | A 64-bit unsigned integer representing the counter field. |
void pcpp::WireGuardTransportDataLayer::setEncryptedData | ( | const uint8_t * | encryptedData, |
size_t | encryptedDataLen | ||
) |
encryptedData | A pointer to the encrypted data. |
encryptedDataLen | The length of the encrypted data. |
void pcpp::WireGuardTransportDataLayer::setReceiverIndex | ( | uint32_t | receiverIndex | ) |
receiverIndex | A 32-bit unsigned integer representing the receiver index. |