mirror of
https://github.com/mfontanini/libtins
synced 2026-01-27 20:24:26 +01:00
Added Sniffer class. Added a constructor to eery PDU subclass which creates an instance of the PDU from a byte array.
This commit is contained in:
@@ -24,11 +24,13 @@
|
||||
#include "rawpdu.h"
|
||||
|
||||
|
||||
Tins::RawPDU::RawPDU(uint8_t *pload, uint32_t size, bool copy) : PDU(255), _payload(pload), _payload_size(size), _owns_payload(copy) {
|
||||
if(copy) {
|
||||
_payload = new uint8_t[size];
|
||||
std::memcpy(_payload, pload, size);
|
||||
}
|
||||
Tins::RawPDU::RawPDU(const uint8_t *pload, uint32_t size) : PDU(255), _payload_size(size), _owns_payload(true) {
|
||||
_payload = new uint8_t[size];
|
||||
std::memcpy(_payload, pload, size);
|
||||
}
|
||||
|
||||
Tins::RawPDU::RawPDU(uint8_t *pload, uint32_t size) : PDU(255), _payload(pload), _payload_size(size), _owns_payload(false) {
|
||||
|
||||
}
|
||||
|
||||
Tins::RawPDU::~RawPDU() {
|
||||
|
||||
Reference in New Issue
Block a user