1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Define default constructor for PKTAP

Fixes #106
This commit is contained in:
Matias Fontanini
2015-10-16 10:04:42 -07:00
parent 30445f1e97
commit 978041a9a2

View File

@@ -35,8 +35,11 @@
namespace Tins {
PKTAP::PKTAP(const uint8_t* buffer, uint32_t total_sz)
{
PKTAP::PKTAP() {
memset(&header_, 0, sizeof(header_));
}
PKTAP::PKTAP(const uint8_t* buffer, uint32_t total_sz) {
if (total_sz < sizeof(pktap_header)) {
throw malformed_packet();
}
@@ -58,13 +61,11 @@ PKTAP::PKTAP(const uint8_t* buffer, uint32_t total_sz)
}
}
uint32_t PKTAP::header_size() const
{
uint32_t PKTAP::header_size() const {
return sizeof(header_);
}
void PKTAP::write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *parent)
{
void PKTAP::write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *parent) {
throw std::runtime_error("PKTAP cannot be serialized");
}