1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-28 20:44:26 +01:00

Port Dot11 classes to use OutputMemoryStream

This commit is contained in:
Matias Fontanini
2015-12-26 16:54:35 -08:00
parent 02e2b278de
commit 31ca9a6cc8
16 changed files with 71 additions and 146 deletions

View File

@@ -35,6 +35,7 @@
#include "memory_helpers.h"
using Tins::Memory::InputMemoryStream;
using Tins::Memory::OutputMemoryStream;
namespace Tins {
/* Auth */
@@ -72,13 +73,8 @@ uint32_t Dot11Authentication::header_size() const {
return Dot11ManagementFrame::header_size() + sizeof(_body);
}
uint32_t Dot11Authentication::write_fixed_parameters(uint8_t *buffer, uint32_t total_sz) {
uint32_t sz = sizeof(this->_body);
#ifdef TINS_DEBUG
assert(sz <= total_sz);
#endif
memcpy(buffer, &this->_body, sz);
return sz;
void Dot11Authentication::write_fixed_parameters(OutputMemoryStream& stream) {
stream.write(_body);
}
/* Deauth */
@@ -107,13 +103,8 @@ uint32_t Dot11Deauthentication::header_size() const {
return Dot11ManagementFrame::header_size() + sizeof(this->_body);
}
uint32_t Dot11Deauthentication::write_fixed_parameters(uint8_t *buffer, uint32_t total_sz) {
uint32_t sz = sizeof(this->_body);
#ifdef TINS_DEBUG
assert(sz <= total_sz);
#endif
memcpy(buffer, &this->_body, sz);
return sz;
void Dot11Deauthentication::write_fixed_parameters(OutputMemoryStream& stream) {
stream.write(_body);
}
} // namespace Tins