From 7a94e1c4e874a8bea2e459a5a1ee5812fb9b3060 Mon Sep 17 00:00:00 2001 From: Andrey Mazo Date: Sun, 1 Mar 2009 02:39:10 +0300 Subject: [PATCH] Remove some temporary defines. --- src/devices/wifi/mesh-wifi-preq-information-element.cc | 2 +- src/devices/wifi/mesh-wifi-preq-information-element.h | 3 +-- src/devices/wifi/wifi-mac-header.cc | 10 +++++----- src/devices/wifi/wifi-mac-header.h | 2 -- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/devices/wifi/mesh-wifi-preq-information-element.cc b/src/devices/wifi/mesh-wifi-preq-information-element.cc index 716472818..2c87e3196 100644 --- a/src/devices/wifi/mesh-wifi-preq-information-element.cc +++ b/src/devices/wifi/mesh-wifi-preq-information-element.cc @@ -116,7 +116,7 @@ WifiPreqInformationElement::WifiPreqInformationElement() m_originatorSeqNumber = 0; m_metric = 0; m_destCount = 0; - m_maxSize = DEF_MAX_SIZE; + m_maxSize = 32; } void WifiPreqInformationElement::SetUnicastPreq() diff --git a/src/devices/wifi/mesh-wifi-preq-information-element.h b/src/devices/wifi/mesh-wifi-preq-information-element.h index ddc7af268..a00b5561c 100644 --- a/src/devices/wifi/mesh-wifi-preq-information-element.h +++ b/src/devices/wifi/mesh-wifi-preq-information-element.h @@ -115,8 +115,7 @@ class WifiPreqInformationElement : public Header uint32_t m_originatorSeqNumber; uint32_t m_lifetime; uint32_t m_metric; - uint8_t m_destCount; -#define DEF_MAX_SIZE 32 + uint8_t m_destCount; }; } //namespace ns3 diff --git a/src/devices/wifi/wifi-mac-header.cc b/src/devices/wifi/wifi-mac-header.cc index 3dc8e8c9c..cecc56895 100644 --- a/src/devices/wifi/wifi-mac-header.cc +++ b/src/devices/wifi/wifi-mac-header.cc @@ -1073,20 +1073,20 @@ WifiMeshHeader::SetAddressExt (uint8_t num_of_addresses) { if (num_of_addresses > 3) return; - m_meshFlags = MESH_AE_MASK| (num_of_addresses << MESH_AE_SHIFT); + m_meshFlags = 0xc0 | (num_of_addresses << 6); } uint8_t WifiMeshHeader::GetAddressExt () { - return ((MESH_AE_MASK & m_meshFlags) >> MESH_AE_SHIFT); + return ((0xc0 & m_meshFlags) >> 6); } uint32_t WifiMeshHeader::GetSerializedSize (void) const { - return 6 + ((MESH_AE_MASK & m_meshFlags) >> MESH_AE_SHIFT)*6; + return 6 + ((0xc0 & m_meshFlags) >> 6)*6; } void @@ -1096,7 +1096,7 @@ WifiMeshHeader::Serialize (Buffer::Iterator start) const i.WriteU8(m_meshFlags); i.WriteU8(m_meshTtl); i.WriteU32(m_meshSeqno); - uint8_t addresses_to_add = (m_meshFlags & MESH_AE_MASK) >> MESH_AE_SHIFT; + uint8_t addresses_to_add = (m_meshFlags & 0xc0) >> 6; //Writing Address extensions: if(addresses_to_add > 0) WriteTo (i, m_addr5); @@ -1114,7 +1114,7 @@ WifiMeshHeader::Deserialize (Buffer::Iterator start) m_meshFlags = i.ReadU8(); m_meshTtl = i.ReadU8(); m_meshSeqno = i.ReadU32(); - addresses_to_read = (m_meshFlags & MESH_AE_MASK) >> MESH_AE_SHIFT; + addresses_to_read = (m_meshFlags & 0xc0) >> 6; if(addresses_to_read > 0) ReadFrom (i, m_addr5); if(addresses_to_read > 1) diff --git a/src/devices/wifi/wifi-mac-header.h b/src/devices/wifi/wifi-mac-header.h index 324c316d4..5808718a2 100644 --- a/src/devices/wifi/wifi-mac-header.h +++ b/src/devices/wifi/wifi-mac-header.h @@ -202,8 +202,6 @@ class WifiMeshHeader : public Header //7.1.3.5b void SetMeshTtl (uint8_t TTL); uint8_t GetMeshTtl (); -#define MESH_AE_MASK 0xc0 -#define MESH_AE_SHIFT 6 void SetAddressExt (uint8_t num_of_addresses); uint8_t GetAddressExt ();