PcapPlusPlus
22.11
|
#include <WakeOnLanLayer.h>
Classes | |
struct | wol_header |
Public Member Functions | |
WakeOnLanLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
WakeOnLanLayer (const pcpp::MacAddress &targetAddr) | |
WakeOnLanLayer (const pcpp::MacAddress &targetAddr, uint8_t *password, uint8_t len) | |
WakeOnLanLayer (const pcpp::MacAddress &targetAddr, const pcpp::MacAddress &password) | |
WakeOnLanLayer (const pcpp::MacAddress &targetAddr, const IPv4Address &password) | |
wol_header * | getWakeOnLanHeader () const |
pcpp::MacAddress | getTargetAddr () const |
void | setTargetAddr (const pcpp::MacAddress &targetAddr) |
std::string | getPassword () const |
bool | setPassword (const uint8_t *password, uint8_t len) |
bool | setPassword (const std::string &password) |
bool | setPassword (const MacAddress &addr) |
bool | setPassword (const IPv4Address &addr) |
void | parseNextLayer () |
Parses the next layer. Wake on LAN is the always last so does nothing for this layer. | |
size_t | getHeaderLen () const |
void | computeCalculateFields () |
Does nothing for this layer. | |
OsiModelLayer | getOsiModelLayer () const |
std::string | toString () 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 |
Static Public Member Functions | |
static bool | isWakeOnLanPort (uint16_t port) |
static bool | isDataValid (const uint8_t *data, size_t dataSize) |
Class for representing the Wake on LAN 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::WakeOnLanLayer::WakeOnLanLayer | ( | const pcpp::MacAddress & | targetAddr | ) |
Construct a new Wake On Lan Layer with provided values
[in] | targetAddr | Target MAC address |
pcpp::WakeOnLanLayer::WakeOnLanLayer | ( | const pcpp::MacAddress & | targetAddr, |
uint8_t * | password, | ||
uint8_t | len | ||
) |
Construct a new Wake On Lan Layer with provided values
[in] | targetAddr | Target MAC address |
[in] | password | Password as array |
[in] | len | Length of the password array, length of the password should be less than 6 bytes |
pcpp::WakeOnLanLayer::WakeOnLanLayer | ( | const pcpp::MacAddress & | targetAddr, |
const pcpp::MacAddress & | password | ||
) |
Construct a new Wake On Lan Layer with provided values
[in] | targetAddr | Target MAC address |
[in] | password | Password as MAC address |
pcpp::WakeOnLanLayer::WakeOnLanLayer | ( | const pcpp::MacAddress & | targetAddr, |
const IPv4Address & | password | ||
) |
Construct a new Wake On Lan Layer with provided values
[in] | targetAddr | Target MAC address |
[in] | password | Password as IPv4 address |
|
inlinevirtual |
Implements pcpp::Layer.
|
inlinevirtual |
Implements pcpp::Layer.
std::string pcpp::WakeOnLanLayer::getPassword | ( | ) | const |
Get the password of the command
pcpp::MacAddress pcpp::WakeOnLanLayer::getTargetAddr | ( | ) | const |
Get the target MAC address of the command
|
inline |
Get a pointer to the Wake On LAN header. Notice this points directly to the data, so every change will change the actual packet data
|
static |
A static method that takes a byte array and detects whether it is a Wake on LAN message
[in] | data | A byte array |
[in] | dataSize | The byte array size (in bytes) |
|
inlinestatic |
A static method that checks whether the port is considered as Wake on LAN
[in] | port | The port number to be checked |
bool pcpp::WakeOnLanLayer::setPassword | ( | const uint8_t * | password, |
uint8_t | len | ||
) |
Set the password of the command
[in] | password | Password as array |
[in] | len | Length of the password array, length of the password should be less than 6 bytes |
bool pcpp::WakeOnLanLayer::setPassword | ( | const std::string & | password | ) |
Set the password of the command
[in] | password | Password as string. Length of the password should be less than 6 bytes |
bool pcpp::WakeOnLanLayer::setPassword | ( | const MacAddress & | addr | ) |
Set the password of the command
[in] | addr | Password as MAC address |
bool pcpp::WakeOnLanLayer::setPassword | ( | const IPv4Address & | addr | ) |
Set the password of the command
addr | Password as IPv4 address |
void pcpp::WakeOnLanLayer::setTargetAddr | ( | const pcpp::MacAddress & | targetAddr | ) |
Set the target MAC address
[in] | targetAddr | MAC address of the target |
|
virtual |
Implements pcpp::Layer.