PcapPlusPlus
Next
|
#include <WireGuardLayer.h>
Public Member Functions | |
WireGuardHandshakeResponseLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
WireGuardHandshakeResponseLayer (uint32_t senderIndex, uint32_t receiverIndex, const uint8_t responderEphemeral[32], const uint8_t encryptedEmpty[16], const uint8_t mac1[16], const uint8_t mac2[16]) | |
uint32_t | getSenderIndex () const |
uint32_t | getReceiverIndex () const |
std::array< uint8_t, 32 > | getResponderEphemeral () const |
std::array< uint8_t, 16 > | getEncryptedEmpty () const |
std::array< uint8_t, 16 > | getMac1 () const |
std::array< uint8_t, 16 > | getMac2 () const |
void | setSenderIndex (uint32_t senderIndex) |
void | setReceiverIndex (uint32_t receiverIndex) |
void | setResponderEphemeral (const std::array< uint8_t, 32 > &responderEphemeral) |
void | setEncryptedEmpty (const std::array< uint8_t, 16 > &encryptedEmpty) |
void | setMac1 (const std::array< uint8_t, 16 > &mac1) |
void | setMac2 (const std::array< uint8_t, 16 > &mac2) |
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 Handshake Response 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::WireGuardHandshakeResponseLayer::WireGuardHandshakeResponseLayer | ( | uint32_t | senderIndex, |
uint32_t | receiverIndex, | ||
const uint8_t | responderEphemeral[32], | ||
const uint8_t | encryptedEmpty[16], | ||
const uint8_t | mac1[16], | ||
const uint8_t | mac2[16] | ||
) |
A constructor that creates a new Handshake Response message
[in] | senderIndex | The sender index |
[in] | receiverIndex | The receiver index |
[in] | responderEphemeral | The responder's ephemeral public key |
[in] | encryptedEmpty | The encrypted empty field |
[in] | mac1 | The MAC1 field |
[in] | mac2 | The MAC2 field |
std::array<uint8_t, 16> pcpp::WireGuardHandshakeResponseLayer::getEncryptedEmpty | ( | ) | const |
std::array<uint8_t, 16> pcpp::WireGuardHandshakeResponseLayer::getMac1 | ( | ) | const |
std::array<uint8_t, 16> pcpp::WireGuardHandshakeResponseLayer::getMac2 | ( | ) | const |
uint32_t pcpp::WireGuardHandshakeResponseLayer::getReceiverIndex | ( | ) | const |
std::array<uint8_t, 32> pcpp::WireGuardHandshakeResponseLayer::getResponderEphemeral | ( | ) | const |
uint32_t pcpp::WireGuardHandshakeResponseLayer::getSenderIndex | ( | ) | const |
|
inlineoverridevirtual |
Reimplemented from pcpp::WireGuardLayer.
void pcpp::WireGuardHandshakeResponseLayer::setEncryptedEmpty | ( | const std::array< uint8_t, 16 > & | encryptedEmpty | ) |
encryptedEmpty | An array containing the 16-byte encrypted empty field. |
void pcpp::WireGuardHandshakeResponseLayer::setMac1 | ( | const std::array< uint8_t, 16 > & | mac1 | ) |
mac1 | An array containing the 16-byte MAC1 field. |
void pcpp::WireGuardHandshakeResponseLayer::setMac2 | ( | const std::array< uint8_t, 16 > & | mac2 | ) |
mac2 | An array containing the 16-byte MAC2 field. |
void pcpp::WireGuardHandshakeResponseLayer::setReceiverIndex | ( | uint32_t | receiverIndex | ) |
receiverIndex | A 32-bit unsigned integer representing the receiver index. |
void pcpp::WireGuardHandshakeResponseLayer::setResponderEphemeral | ( | const std::array< uint8_t, 32 > & | responderEphemeral | ) |
responderEphemeral | An array containing the 32-byte responder ephemeral public key. |
void pcpp::WireGuardHandshakeResponseLayer::setSenderIndex | ( | uint32_t | senderIndex | ) |
senderIndex | A 32-bit unsigned integer representing the sender index. |