bug 1901: set MeshControlPresent flag in the QoS Control field
authorTom Henderson <tomh@tomh.org>
Mon, 17 Aug 2015 13:45:08 -0700
changeset 11585 a4ee9fd2ae07
parent 11584 42b7c1e05e11
child 11586 daf6c89d9b2d
bug 1901: set MeshControlPresent flag in the QoS Control field
src/mesh/model/dot11s/hwmp-protocol-mac.cc
src/wifi/model/wifi-mac-header.cc
src/wifi/model/wifi-mac-header.h
--- a/src/mesh/model/dot11s/hwmp-protocol-mac.cc	Mon Aug 17 13:44:25 2015 -0700
+++ b/src/mesh/model/dot11s/hwmp-protocol-mac.cc	Mon Aug 17 13:45:08 2015 -0700
@@ -203,6 +203,7 @@
   meshHdr.SetMeshTtl (tag.GetTtl ());
   packet->AddHeader (meshHdr);
   header.SetAddr1 (tag.GetAddress ());
+  header.SetQosMeshControlPresent ();
   return true;
 }
 WifiActionHeader
--- a/src/wifi/model/wifi-mac-header.cc	Mon Aug 17 13:44:25 2015 -0700
+++ b/src/wifi/model/wifi-mac-header.cc	Mon Aug 17 13:45:08 2015 -0700
@@ -447,6 +447,21 @@
   m_qosStuff = txop;
 }
 
+void WifiMacHeader::SetQosMeshControlPresent (void)
+{
+  // mark bit 0 of this variable instead of bit 8, since m_qosStuff is
+  // shifted by one byte when serialized
+  m_qosStuff = m_qosStuff | 0x01; // bit 8 of QoS Control Field
+}
+
+void WifiMacHeader::SetQosNoMeshControlPresent ()
+{
+  // clear bit 0 of this variable instead of bit 8, since m_qosStuff is
+  // shifted by one byte when serialized
+  m_qosStuff = m_qosStuff & 0xfe; // bit 8 of QoS Control Field
+}
+
+
 Mac48Address
 WifiMacHeader::GetAddr1 (void) const
 {
--- a/src/wifi/model/wifi-mac-header.h	Mon Aug 17 13:44:25 2015 -0700
+++ b/src/wifi/model/wifi-mac-header.h	Mon Aug 17 13:45:08 2015 -0700
@@ -294,6 +294,14 @@
    */
   void SetQosTxopLimit (uint8_t txop);
   /**
+   * Set the Mesh Control Present flag for the QoS header.
+   */
+  void SetQosMeshControlPresent ();
+  /**
+   * Clear the Mesh Control Present flag for the QoS header.
+   */
+  void SetQosNoMeshControlPresent ();
+  /**
    * Set order bit in the frame control field.
    */
   void SetOrder (void);