1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-26 12:01:34 +01:00

Removed the useless PDU::flag member. Added a PDU concatenation operator.

This commit is contained in:
Matias Fontanini
2012-10-07 18:51:06 -03:00
parent da60d99f98
commit 153bcecc35
24 changed files with 169 additions and 89 deletions

View File

@@ -32,13 +32,15 @@
#include "eapol.h"
Tins::SNAP::SNAP(PDU *child) : PDU(0xff, child) {
Tins::SNAP::SNAP(PDU *child) : PDU(child)
{
std::memset(&_snap, 0, sizeof(_snap));
_snap.dsap = _snap.ssap = 0xaa;
_snap.control = 3;
}
Tins::SNAP::SNAP(const uint8_t *buffer, uint32_t total_sz) : PDU(0xff) {
Tins::SNAP::SNAP(const uint8_t *buffer, uint32_t total_sz)
{
if(total_sz < sizeof(_snap))
throw std::runtime_error("Not enough size for a SNAP header in the buffer.");
std::memcpy(&_snap, buffer, sizeof(_snap));