PcapPlusPlus
Next
|
#include <WireGuardLayer.h>
Public Member Functions | |
WireGuardHandshakeInitiationLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
WireGuardHandshakeInitiationLayer (uint32_t senderIndex, const uint8_t initiatorEphemeral[32], const uint8_t encryptedInitiatorStatic[48], const uint8_t encryptedTimestamp[28], const uint8_t mac1[16], const uint8_t mac2[16]) | |
uint32_t | getSenderIndex () const |
std::array< uint8_t, 32 > | getInitiatorEphemeral () const |
std::array< uint8_t, 48 > | getEncryptedInitiatorStatic () const |
std::array< uint8_t, 28 > | getEncryptedTimestamp () const |
std::array< uint8_t, 16 > | getMac1 () const |
std::array< uint8_t, 16 > | getMac2 () const |
void | setSenderIndex (uint32_t senderIndex) |
void | setInitiatorEphemeral (const std::array< uint8_t, 32 > &initiatorEphemeral) |
void | setEncryptedInitiatorStatic (const std::array< uint8_t, 48 > &encryptedInitiatorStatic) |
void | setEncryptedTimestamp (const std::array< uint8_t, 28 > &encryptedTimestamp) |
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 the Handshake Initiation message layer
|
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::WireGuardHandshakeInitiationLayer::WireGuardHandshakeInitiationLayer | ( | uint32_t | senderIndex, |
const uint8_t | initiatorEphemeral[32], | ||
const uint8_t | encryptedInitiatorStatic[48], | ||
const uint8_t | encryptedTimestamp[28], | ||
const uint8_t | mac1[16], | ||
const uint8_t | mac2[16] | ||
) |
A constructor that creates a new Handshake Initiation message
[in] | senderIndex | The sender's index |
[in] | initiatorEphemeral | The initiator's ephemeral public key |
[in] | encryptedInitiatorStatic | The encrypted initiator's static key |
[in] | encryptedTimestamp | The encrypted timestamp |
[in] | mac1 | The MAC1 field |
[in] | mac2 | The MAC2 field |
std::array<uint8_t, 48> pcpp::WireGuardHandshakeInitiationLayer::getEncryptedInitiatorStatic | ( | ) | const |
std::array<uint8_t, 28> pcpp::WireGuardHandshakeInitiationLayer::getEncryptedTimestamp | ( | ) | const |
std::array<uint8_t, 32> pcpp::WireGuardHandshakeInitiationLayer::getInitiatorEphemeral | ( | ) | const |
std::array<uint8_t, 16> pcpp::WireGuardHandshakeInitiationLayer::getMac1 | ( | ) | const |
std::array<uint8_t, 16> pcpp::WireGuardHandshakeInitiationLayer::getMac2 | ( | ) | const |
uint32_t pcpp::WireGuardHandshakeInitiationLayer::getSenderIndex | ( | ) | const |
|
inlineoverridevirtual |
Reimplemented from pcpp::WireGuardLayer.
void pcpp::WireGuardHandshakeInitiationLayer::setEncryptedInitiatorStatic | ( | const std::array< uint8_t, 48 > & | encryptedInitiatorStatic | ) |
encryptedInitiatorStatic | An array containing the 48-byte encrypted initiator's static key. |
void pcpp::WireGuardHandshakeInitiationLayer::setEncryptedTimestamp | ( | const std::array< uint8_t, 28 > & | encryptedTimestamp | ) |
encryptedTimestamp | An array containing the 28-byte encrypted timestamp. |
void pcpp::WireGuardHandshakeInitiationLayer::setInitiatorEphemeral | ( | const std::array< uint8_t, 32 > & | initiatorEphemeral | ) |
initiatorEphemeral | An array containing the 32-byte initiator ephemeral public key. |
void pcpp::WireGuardHandshakeInitiationLayer::setMac1 | ( | const std::array< uint8_t, 16 > & | mac1 | ) |
mac1 | An array containing the 16-byte MAC1 field. |
void pcpp::WireGuardHandshakeInitiationLayer::setMac2 | ( | const std::array< uint8_t, 16 > & | mac2 | ) |
mac2 | An array containing the 16-byte MAC2 field. |
void pcpp::WireGuardHandshakeInitiationLayer::setSenderIndex | ( | uint32_t | senderIndex | ) |
senderIndex | A 32-bit integer representing the sender index. |