mirror of
https://github.com/mfontanini/libtins
synced 2026-01-28 04:34:27 +01:00
Code cleanup and use same syntax on the entire project
Initial code cleanup More code cleanup Cleanup more code Cleanup Dot11 code Fix OSX build issue Cleanup examples Fix ref and pointer declaration syntax Fix braces
This commit is contained in:
@@ -37,40 +37,39 @@ using Tins::Memory::InputMemoryStream;
|
||||
using Tins::Memory::OutputMemoryStream;
|
||||
|
||||
namespace Tins {
|
||||
/* Dot11Beacon */
|
||||
|
||||
Dot11Beacon::Dot11Beacon(const address_type &dst_hw_addr,
|
||||
const address_type &src_hw_addr)
|
||||
: Dot11ManagementFrame(dst_hw_addr, src_hw_addr)
|
||||
{
|
||||
// Dot11Beacon
|
||||
|
||||
Dot11Beacon::Dot11Beacon(const address_type& dst_hw_addr,
|
||||
const address_type& src_hw_addr)
|
||||
: Dot11ManagementFrame(dst_hw_addr, src_hw_addr), body_() {
|
||||
subtype(Dot11::BEACON);
|
||||
std::memset(&_body, 0, sizeof(_body));
|
||||
}
|
||||
|
||||
Dot11Beacon::Dot11Beacon(const uint8_t *buffer, uint32_t total_sz)
|
||||
: Dot11ManagementFrame(buffer, total_sz)
|
||||
{
|
||||
Dot11Beacon::Dot11Beacon(const uint8_t* buffer, uint32_t total_sz)
|
||||
: Dot11ManagementFrame(buffer, total_sz) {
|
||||
InputMemoryStream stream(buffer, total_sz);
|
||||
stream.skip(management_frame_size());
|
||||
stream.read(_body);
|
||||
stream.read(body_);
|
||||
parse_tagged_parameters(stream);
|
||||
}
|
||||
|
||||
void Dot11Beacon::timestamp(uint64_t new_timestamp) {
|
||||
this->_body.timestamp = Endian::host_to_le(new_timestamp);
|
||||
body_.timestamp = Endian::host_to_le(new_timestamp);
|
||||
}
|
||||
|
||||
void Dot11Beacon::interval(uint16_t new_interval) {
|
||||
this->_body.interval = Endian::host_to_le(new_interval);
|
||||
body_.interval = Endian::host_to_le(new_interval);
|
||||
}
|
||||
|
||||
uint32_t Dot11Beacon::header_size() const {
|
||||
return Dot11ManagementFrame::header_size() + sizeof(_body);
|
||||
return Dot11ManagementFrame::header_size() + sizeof(body_);
|
||||
}
|
||||
|
||||
void Dot11Beacon::write_fixed_parameters(OutputMemoryStream& stream) {
|
||||
stream.write(_body);
|
||||
stream.write(body_);
|
||||
}
|
||||
} // namespace Tins
|
||||
|
||||
} // Tins
|
||||
|
||||
#endif // HAVE_DOT11
|
||||
|
||||
Reference in New Issue
Block a user