--- a/src/devices/mesh/802.11s/ie-dot11s-beacon-timing.cc Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/802.11s/ie-dot11s-beacon-timing.cc Wed Mar 18 17:41:01 2009 +0300
@@ -145,7 +145,7 @@
}
-uint16_t
+uint8_t
IeDot11sBeaconTiming::GetInformationSize () const
{
return (5*m_numOfUnits);
@@ -167,7 +167,7 @@
i.WriteHtonU16 ((*j)->GetBeaconInterval());
}
}
-uint16_t
+uint8_t
IeDot11sBeaconTiming::DeserializeInformation (Buffer::Iterator start, uint8_t length)
{
Buffer::Iterator i = start;
--- a/src/devices/mesh/802.11s/ie-dot11s-beacon-timing.h Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/802.11s/ie-dot11s-beacon-timing.h Wed Mar 18 17:41:01 2009 +0300
@@ -90,9 +90,9 @@
return IE11S_BEACON_TIMING;
}
//Serialize-deserialize methods:
- uint16_t GetInformationSize () const;
+ uint8_t GetInformationSize () const;
void SerializeInformation (Buffer::Iterator i) const;
- uint16_t DeserializeInformation (Buffer::Iterator i, uint8_t length);
+ uint8_t DeserializeInformation (Buffer::Iterator i, uint8_t length);
void PrintInformation(std::ostream& os) const;
private:
static uint16_t TimestampToU16(Time x);
--- a/src/devices/mesh/802.11s/ie-dot11s-configuration.cc Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/802.11s/ie-dot11s-configuration.cc Wed Mar 18 17:41:01 2009 +0300
@@ -21,9 +21,6 @@
#include "ns3/ie-dot11s-configuration.h"
-#include "ns3/assert.h"
-
-//NS_LOG_COMPONENT_DEFINE ("IeDot11sConfiguration");
namespace ns3 {
@@ -98,7 +95,7 @@
{
return GetTypeId();
}
-uint16_t
+uint8_t
IeDot11sConfiguration::GetInformationSize () const
{
return 1 // Version
@@ -124,7 +121,7 @@
m_meshCap.Serialize (i);
}
-uint16_t
+uint8_t
IeDot11sConfiguration::DeserializeInformation (Buffer::Iterator i, uint8_t length)
{
Buffer::Iterator start = i;
--- a/src/devices/mesh/802.11s/ie-dot11s-configuration.h Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/802.11s/ie-dot11s-configuration.h Wed Mar 18 17:41:01 2009 +0300
@@ -23,9 +23,6 @@
#ifndef MESH_CONFIGURATION_H
#define MESH_CONFIGURATION_H
-#include <stdint.h>
-#include "ns3/buffer.h"
-#include "ns3/dot11s-codes.h"
#include "ns3/wifi-information-element.h"
namespace ns3 {
@@ -102,10 +99,9 @@
{
return IE11S_MESH_CONFIGURATION;
}
-
- uint16_t GetInformationSize () const;
+ uint8_t GetInformationSize () const;
void SerializeInformation (Buffer::Iterator i) const;
- uint16_t DeserializeInformation (Buffer::Iterator i, uint8_t length);
+ uint8_t DeserializeInformation (Buffer::Iterator i, uint8_t length);
void PrintInformation(std::ostream& os) const;
// TODO: Release and fill other fields in configuration
// element
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/devices/mesh/802.11s/ie-dot11s-peer-management.cc Wed Mar 18 17:41:01 2009 +0300
@@ -0,0 +1,140 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2008,2009 IITP RAS
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Authors: Kirill Andreev <andreev@iitp.ru>
+ * Aleksey Kovalenko <kovalenko@iitp.ru>
+ */
+
+
+#include "ns3/ie-dot11s-peer-management.h"
+#include "ns3/assert.h"
+
+
+//NS_LOG_COMPONENT_DEFINE ("MeshPeerLinkManagementelement");
+
+namespace ns3 {
+
+IeDot11sPeerManagement::IeDot11sPeerManagement ():
+ m_length(0),
+ m_subtype(PEER_OPEN),
+ m_localLinkId(0),
+ m_peerLinkId(0),
+ m_reasonCode(REASON11S_RESERVED)
+{}
+
+
+void
+IeDot11sPeerManagement::SetPeerOpen(uint16_t localLinkId)
+{
+ m_length = 3;
+ m_subtype = PEER_OPEN;
+ m_localLinkId = localLinkId;
+}
+void
+IeDot11sPeerManagement::SetPeerClose(uint16_t localLinkId, uint16_t peerLinkId, dot11sReasonCode reasonCode)
+{
+ m_length = 7;
+ m_subtype = PEER_CLOSE;
+ m_localLinkId = localLinkId;
+ m_peerLinkId = peerLinkId;
+ m_reasonCode = reasonCode;
+}
+
+void
+IeDot11sPeerManagement::SetPeerConfirm(uint16_t localLinkId, uint16_t peerLinkId)
+{
+ m_length = 5;
+ m_subtype = PEER_CONFIRM;
+ m_localLinkId = localLinkId;
+ m_peerLinkId = peerLinkId;
+}
+
+dot11sReasonCode
+IeDot11sPeerManagement::GetReasonCode() const
+ {
+ return m_reasonCode;
+ }
+
+uint16_t
+IeDot11sPeerManagement::GetLocalLinkId() const
+ {
+ return m_localLinkId;
+ }
+
+uint16_t
+IeDot11sPeerManagement::GetPeerLinkId() const
+ {
+ return m_peerLinkId;
+ }
+
+uint8_t
+IeDot11sPeerManagement::GetInformationSize (void) const
+ {
+ return m_length;
+ }
+
+bool
+IeDot11sPeerManagement::SubtypeIsOpen() const
+ {
+ return (m_subtype == PEER_OPEN);
+ }
+bool
+IeDot11sPeerManagement::SubtypeIsClose() const
+ {
+ return (m_subtype == PEER_CLOSE);
+ }
+bool
+IeDot11sPeerManagement::SubtypeIsConfirm() const
+ {
+ return (m_subtype == PEER_CONFIRM);
+ }
+
+void
+IeDot11sPeerManagement::SerializeInformation (Buffer::Iterator i) const
+ {
+ i.WriteU8(m_subtype);
+ i.WriteHtonU16(m_localLinkId);
+ if (m_length > 3)
+ i.WriteHtonU16(m_peerLinkId);
+ if (m_length > 5)
+ i.WriteHtonU16(m_reasonCode);
+ }
+uint8_t
+IeDot11sPeerManagement::DeserializeInformation (Buffer::Iterator start, uint8_t length)
+{
+ Buffer::Iterator i = start;
+ m_subtype = i.ReadU8();
+ m_length = length;
+ if (m_subtype == PEER_OPEN)
+ NS_ASSERT(length == 3);
+ if (m_subtype == PEER_CONFIRM)
+ NS_ASSERT(length == 5);
+ if (m_subtype == PEER_CLOSE)
+ NS_ASSERT(length == 7);
+ m_localLinkId = i.ReadNtohU16();
+ if (m_length > 3)
+ m_peerLinkId = i.ReadNtohU16();
+ if (m_length > 5)
+ m_reasonCode = (dot11sReasonCode)i.ReadNtohU16();
+ return i.GetDistanceFrom(start);
+}
+void
+IeDot11sPeerManagement::PrintInformation(std::ostream& os) const
+{
+ //TODO
+}
+} //namespace NS3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/devices/mesh/802.11s/ie-dot11s-peer-management.h Wed Mar 18 17:41:01 2009 +0300
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2008,2009 IITP RAS
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Authors: Kirill Andreev <andreev@iitp.ru>
+ * Aleksey Kovalenko <kovalenko@iitp.ru>
+ */
+
+
+#ifndef MESH_PEER_MAN_ELEMENT
+#define MESH_PEER_MAN_ELEMENT
+
+#include "ns3/dot11s-codes.h"
+#include "ns3/wifi-information-element.h"
+
+namespace ns3 {
+/**
+ * \ingroup mesh
+ */
+class IeDot11sPeerManagement : public WifiInformationElement
+{
+public:
+ enum Subtype {
+ PEER_OPEN = 0,
+ PEER_CLOSE = 1,
+ PEER_CONFIRM = 2,
+ };
+public:
+ IeDot11sPeerManagement ();
+
+ void SetPeerOpen(uint16_t localLinkId);
+ void SetPeerClose(uint16_t localLinkID, uint16_t peerLinkId, dot11sReasonCode reasonCode);
+ void SetPeerConfirm(uint16_t localLinkID, uint16_t peerLinkId);
+
+ dot11sReasonCode GetReasonCode() const;
+ uint16_t GetLocalLinkId() const;
+ uint16_t GetPeerLinkId() const;
+ bool SubtypeIsOpen() const;
+ bool SubtypeIsClose() const;
+ bool SubtypeIsConfirm() const ;
+protected:
+ WifiElementId ElementId() const{
+ return IE11S_PEER_LINK_MANAGEMENT;
+ }
+ uint8_t GetInformationSize (void) const;
+ void SerializeInformation (Buffer::Iterator i) const;
+ uint8_t DeserializeInformation (Buffer::Iterator i, uint8_t length);
+ void PrintInformation(std::ostream& os) const;
+private:
+ uint8_t m_length;
+ uint8_t m_subtype;
+ uint16_t m_localLinkId; //always is present
+ uint16_t m_peerLinkId; //only in confirm and may be present in close frame
+ dot11sReasonCode m_reasonCode; //only in close frame
+};
+} //namespace NS3
+#endif
--- a/src/devices/mesh/802.11s/ie-dot11s-perr.cc Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/802.11s/ie-dot11s-perr.cc Wed Mar 18 17:41:01 2009 +0300
@@ -21,6 +21,7 @@
#include "ns3/ie-dot11s-perr.h"
#include "ns3/address-utils.h"
+#include "ns3/node.h"
namespace ns3 {
IeDot11sPerr::~IeDot11sPerr()
@@ -65,7 +66,7 @@
i.WriteHtonU32 (m_addressUnits[j].seqnum);
}
}
-uint16_t
+uint8_t
IeDot11sPerr::DeserializeInformation(Buffer::Iterator start, uint8_t length)
{
Buffer::Iterator i = start;
@@ -83,10 +84,10 @@
return i.GetDistanceFrom(start);
}
-uint16_t
+uint8_t
IeDot11sPerr::GetInformationSize() const
{
- uint16_t retval =
+ uint8_t retval =
1 //ModeFlags
+1 //NumOfDests
+6*m_numOfDest
--- a/src/devices/mesh/802.11s/ie-dot11s-perr.h Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/802.11s/ie-dot11s-perr.h Wed Mar 18 17:41:01 2009 +0300
@@ -22,12 +22,8 @@
#ifndef PERR_INFORMATION_ELEMENT_H
#define PERR_INFORMATION_ELEMENT_H
-#include <stdint.h>
-#include "ns3/node.h"
-#include "ns3/buffer.h"
#include "ns3/mac48-address.h"
#include "ns3/hwmp-rtable.h"
-#include "ns3/header.h"
#include "ns3/dot11s-codes.h"
#include "ns3/wifi-information-element.h"
@@ -59,9 +55,9 @@
return IE11S_PERR;
};
void SerializeInformation(Buffer::Iterator i) const;
- uint16_t DeserializeInformation(Buffer::Iterator start, uint8_t length);
+ uint8_t DeserializeInformation(Buffer::Iterator start, uint8_t length);
void PrintInformation(std::ostream& os) const;
- uint16_t GetInformationSize() const;
+ uint8_t GetInformationSize() const;
private:
uint8_t m_numOfDest;
std::vector<HwmpRtable::FailedDestination>
--- a/src/devices/mesh/802.11s/ie-dot11s-prep.cc Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/802.11s/ie-dot11s-prep.cc Wed Mar 18 17:41:01 2009 +0300
@@ -21,6 +21,7 @@
#include "ns3/ie-dot11s-prep.h"
#include "ns3/address-utils.h"
+#include "ns3/node.h"
#include "ns3/assert.h"
namespace ns3 {
/********************************
@@ -175,7 +176,7 @@
WriteTo (i, m_originatorAddress);
i.WriteHtonU32 (m_originatorSeqNumber);
}
-uint16_t
+uint8_t
IeDot11sPrep::DeserializeInformation(Buffer::Iterator start, uint8_t length)
{
Buffer::Iterator i = start;
@@ -190,7 +191,7 @@
m_originatorSeqNumber = i.ReadNtohU32();
return i.GetDistanceFrom(start);
}
-uint16_t
+uint8_t
IeDot11sPrep::GetInformationSize() const
{
uint32_t retval =
--- a/src/devices/mesh/802.11s/ie-dot11s-prep.h Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/802.11s/ie-dot11s-prep.h Wed Mar 18 17:41:01 2009 +0300
@@ -23,11 +23,7 @@
#define WIFI_PREP_INFORMATION_ELEMENT_H
-#include <stdint.h>
-#include "ns3/node.h"
-#include "ns3/buffer.h"
#include "ns3/mac48-address.h"
-#include "ns3/header.h"
#include "ns3/dot11s-codes.h"
#include "ns3/wifi-information-element.h"
@@ -70,8 +66,8 @@
return IE11S_PREP;
}
void SerializeInformation(Buffer::Iterator i) const;
- uint16_t DeserializeInformation(Buffer::Iterator start, uint8_t length);
- uint16_t GetInformationSize() const;
+ uint8_t DeserializeInformation(Buffer::Iterator start, uint8_t length);
+ uint8_t GetInformationSize() const;
void PrintInformation(std::ostream& os) const;
private:
uint8_t m_flags;
--- a/src/devices/mesh/802.11s/ie-dot11s-preq.cc Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/802.11s/ie-dot11s-preq.cc Wed Mar 18 17:41:01 2009 +0300
@@ -21,6 +21,7 @@
#include "ns3/ie-dot11s-preq.h"
#include "ns3/address-utils.h"
+#include "ns3/node.h"
#include "ns3/assert.h"
namespace ns3 {
@@ -275,7 +276,7 @@
}
}
-uint16_t
+uint8_t
IeDot11sPreq::DeserializeInformation(Buffer::Iterator start, uint8_t length)
{
Buffer::Iterator i = start;
@@ -311,10 +312,10 @@
}
return i.GetDistanceFrom(start);
}
-uint16_t
+uint8_t
IeDot11sPreq::GetInformationSize() const
{
- uint32_t retval =
+ uint8_t retval =
1 //Flags
+1 //Hopcount
+1 //TTL
--- a/src/devices/mesh/802.11s/ie-dot11s-preq.h Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/802.11s/ie-dot11s-preq.h Wed Mar 18 17:41:01 2009 +0300
@@ -22,13 +22,9 @@
#ifndef WIFI_PREQ_INFORMATION_ELEMENT_H
#define WIFI_PREQ_INFORMATION_ELEMENT_H
-#include <stdint.h>
#include <vector>
-#include "ns3/node.h"
-#include "ns3/buffer.h"
#include "ns3/mac48-address.h"
-#include "ns3/header.h"
#include "ns3/dot11s-codes.h"
#include "ns3/wifi-information-element.h"
@@ -108,8 +104,8 @@
return IE11S_PREQ;
}
void SerializeInformation(Buffer::Iterator i) const;
- uint16_t DeserializeInformation(Buffer::Iterator i, uint8_t length);
- uint16_t GetInformationSize() const;
+ uint8_t DeserializeInformation(Buffer::Iterator i, uint8_t length);
+ uint8_t GetInformationSize() const;
void PrintInformation(std::ostream& os) const;
private:
//how many destinations we support
--- a/src/devices/mesh/802.11s/ie-dot11s-rann.cc Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/802.11s/ie-dot11s-rann.cc Wed Mar 18 17:41:01 2009 +0300
@@ -22,6 +22,7 @@
#include "ns3/ie-dot11s-rann.h"
#include "ns3/assert.h"
#include "ns3/address-utils.h"
+#include "ns3/node.h"
namespace ns3 {
@@ -124,7 +125,7 @@
i.WriteHtonU32 (m_destSeqNumber);
i.WriteHtonU32 (m_metric);
}
-uint16_t
+uint8_t
IeDot11sRann::DeserializeInformation(Buffer::Iterator start, uint8_t length)
{
Buffer::Iterator i = start;
@@ -136,10 +137,10 @@
m_metric = i.ReadNtohU32();
return i.GetDistanceFrom(start);
}
-uint16_t
+uint8_t
IeDot11sRann::GetInformationSize() const
{
- uint16_t retval =
+ uint8_t retval =
1//Flags
+1//Hopcount
+1//TTL
--- a/src/devices/mesh/802.11s/ie-dot11s-rann.h Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/802.11s/ie-dot11s-rann.h Wed Mar 18 17:41:01 2009 +0300
@@ -22,12 +22,7 @@
#ifndef RANN_INFORMATION_ELEMENT_H
#define RANN_INFORMATION_ELEMENT_H
-#include <stdint.h>
-
-#include "ns3/buffer.h"
#include "ns3/mac48-address.h"
-#include "ns3/node.h"
-#include "ns3/header.h"
#include "ns3/dot11s-codes.h"
#include "ns3/wifi-information-element.h"
@@ -62,8 +57,8 @@
return IE11S_RANN;
}
void SerializeInformation(Buffer::Iterator i) const;
- uint16_t DeserializeInformation(Buffer::Iterator start, uint8_t length);
- uint16_t GetInformationSize() const;
+ uint8_t DeserializeInformation(Buffer::Iterator start, uint8_t length);
+ uint8_t GetInformationSize() const;
private:
uint8_t m_flags;
uint8_t m_hopcount;
--- a/src/devices/mesh/802.11s/wscript Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/802.11s/wscript Wed Mar 18 17:41:01 2009 +0300
@@ -5,6 +5,7 @@
obj.source = [
'ie-dot11s-beacon-timing.cc',
'ie-dot11s-configuration.cc',
+ 'ie-dot11s-peer-management.cc',
'ie-dot11s-preq.cc',
'ie-dot11s-prep.cc',
'ie-dot11s-perr.cc',
@@ -15,6 +16,7 @@
headers.source = [
'ie-dot11s-beacon-timing.h',
'ie-dot11s-configuration.h',
+ 'ie-dot11s-peer-management.h',
'ie-dot11s-preq.h',
'ie-dot11s-prep.h',
'ie-dot11s-perr.h',
--- a/src/devices/mesh/dot11s-peer-management-element.cc Wed Mar 18 17:40:38 2009 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2008,2009 IITP RAS
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Authors: Kirill Andreev <andreev@iitp.ru>
- * Aleksey Kovalenko <kovalenko@iitp.ru>
- */
-
-
-#include "ns3/dot11s-peer-management-element.h"
-#include "ns3/assert.h"
-
-
-//NS_LOG_COMPONENT_DEFINE ("MeshPeerLinkManagementelement");
-
-namespace ns3 {
-
-PeerLinkManagementElement::PeerLinkManagementElement ():
- m_length(0),
- m_subtype(PEER_OPEN),
- m_localLinkId(0),
- m_peerLinkId(0),
- m_reasonCode(REASON11S_RESERVED)
-{}
-
-
-void
-PeerLinkManagementElement::SetPeerOpen(uint16_t localLinkId)
-{
- m_length = 3;
- m_subtype = PEER_OPEN;
- m_localLinkId = localLinkId;
-}
-void
-PeerLinkManagementElement::SetPeerClose(uint16_t localLinkId, uint16_t peerLinkId, dot11sReasonCode reasonCode)
-{
- m_length = 7;
- m_subtype = PEER_CLOSE;
- m_localLinkId = localLinkId;
- m_peerLinkId = peerLinkId;
- m_reasonCode = reasonCode;
-}
-
-void
-PeerLinkManagementElement::SetPeerConfirm(uint16_t localLinkId, uint16_t peerLinkId)
-{
- m_length = 5;
- m_subtype = PEER_CONFIRM;
- m_localLinkId = localLinkId;
- m_peerLinkId = peerLinkId;
-}
-
-dot11sReasonCode
-PeerLinkManagementElement::GetReasonCode() const
- {
- return m_reasonCode;
- }
-
-uint16_t
-PeerLinkManagementElement::GetLocalLinkId() const
- {
- return m_localLinkId;
- }
-
-uint16_t
-PeerLinkManagementElement::GetPeerLinkId() const
- {
- return m_peerLinkId;
- }
-
-uint32_t
-PeerLinkManagementElement::GetSerializedSize (void) const
- {
- return m_length+2;
- }
-
-bool
-PeerLinkManagementElement::SubtypeIsOpen() const
- {
- return (m_subtype == PEER_OPEN);
- }
-bool
-PeerLinkManagementElement::SubtypeIsClose() const
- {
- return (m_subtype == PEER_CLOSE);
- }
-bool
-PeerLinkManagementElement::SubtypeIsConfirm() const
- {
- return (m_subtype == PEER_CONFIRM);
- }
-
-Buffer::Iterator
-PeerLinkManagementElement::Serialize (Buffer::Iterator i) const
- {
- i.WriteU8(ElementId());
- i.WriteU8(m_length);
- i.WriteU8(m_subtype);
- i.WriteHtonU16(m_localLinkId);
- if (m_length > 3)
- i.WriteHtonU16(m_peerLinkId);
- if (m_length > 5)
- i.WriteHtonU16(m_reasonCode);
- return i;
- }
-Buffer::Iterator
-PeerLinkManagementElement::Deserialize (Buffer::Iterator i)
-{
- NS_ASSERT(ElementId() == i.ReadU8());
- m_length = i.ReadU8();
- m_subtype = i.ReadU8();
- m_localLinkId = i.ReadNtohU16();
- if (m_length > 3)
- m_peerLinkId = i.ReadNtohU16();
- if (m_length > 5)
- m_reasonCode = (dot11sReasonCode)i.ReadNtohU16();
- return i;
-}
-} //namespace NS3
--- a/src/devices/mesh/dot11s-peer-management-element.h Wed Mar 18 17:40:38 2009 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2008,2009 IITP RAS
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Authors: Kirill Andreev <andreev@iitp.ru>
- * Aleksey Kovalenko <kovalenko@iitp.ru>
- */
-
-
-#ifndef MESH_PEER_MAN_ELEMENT
-#define MESH_PEER_MAN_ELEMENT
-
-#include <stdint.h>
-#include "ns3/buffer.h"
-#include "ns3/dot11s-codes.h"
-
-namespace ns3 {
-/**
- * \ingroup mesh
- */
-class PeerLinkManagementElement
-{
-public:
- enum Subtype {
- PEER_OPEN = 0,
- PEER_CLOSE = 1,
- PEER_CONFIRM = 2,
- };
-public:
- PeerLinkManagementElement ();
-
- void SetPeerOpen(uint16_t localLinkId);
- void SetPeerClose(uint16_t localLinkID, uint16_t peerLinkId, dot11sReasonCode reasonCode);
- void SetPeerConfirm(uint16_t localLinkID, uint16_t peerLinkId);
-
- dot11sReasonCode GetReasonCode() const;
- uint16_t GetLocalLinkId() const;
- uint16_t GetPeerLinkId() const;
- bool SubtypeIsOpen() const;
- bool SubtypeIsClose() const;
- bool SubtypeIsConfirm() const ;
-
- uint32_t GetSerializedSize (void) const;
- Buffer::Iterator Serialize (Buffer::Iterator i) const;
- Buffer::Iterator Deserialize (Buffer::Iterator i);
-private:
- static uint8_t ElementId() {
- return (uint8_t)IE11S_PEER_LINK_MANAGEMENT;
- }
- uint8_t m_length;
- uint8_t m_subtype;
- uint16_t m_localLinkId; //always is present
- uint16_t m_peerLinkId; //only in confirm and may be present in close frame
- dot11sReasonCode m_reasonCode; //only in close frame
-};
-} //namespace NS3
-#endif
--- a/src/devices/mesh/hwmp-rtable.cc Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/hwmp-rtable.cc Wed Mar 18 17:41:01 2009 +0300
@@ -70,7 +70,7 @@
uint32_t seqnum
)
{
- std::map<Mac48Address, ReactiveRoute, mac48addrComparator>::iterator i = m_routes.find(destination);
+ std::map<Mac48Address, ReactiveRoute>::iterator i = m_routes.find(destination);
if (i == m_routes.end())
{
ReactiveRoute newroute;
@@ -135,7 +135,7 @@
HwmpRtable::AddPrecursor(Mac48Address destination, uint32_t port, Mac48Address precursor)
{
bool should_add = true;
- std::map<Mac48Address, ReactiveRoute, mac48addrComparator>::iterator i = m_routes.find(destination);
+ std::map<Mac48Address, ReactiveRoute>::iterator i = m_routes.find(destination);
if ((i != m_routes.end()) && (i->second.port == port))
{
for (unsigned int j = 0 ; j < i->second.precursors.size(); j ++)
@@ -178,7 +178,7 @@
void
HwmpRtable::DeleteReactivePath(Mac48Address destination, uint32_t port)
{
- std::map<Mac48Address, ReactiveRoute, mac48addrComparator>::iterator i = m_routes.find(destination);
+ std::map<Mac48Address, ReactiveRoute>::iterator i = m_routes.find(destination);
if (i != m_routes.end())
if (i->second.port == port)
m_routes.erase(i);
@@ -192,7 +192,7 @@
result.metric = MAX_METRIC;
result.ifIndex = PORT_ANY;
- std::map<Mac48Address, ReactiveRoute, mac48addrComparator>::iterator i = m_routes.find(destination);
+ std::map<Mac48Address, ReactiveRoute>::iterator i = m_routes.find(destination);
if (i == m_routes.end())
return result;
result.ifIndex = i->second.port;
@@ -213,7 +213,7 @@
result.retransmitter = Mac48Address::GetBroadcast();
result.metric = MAX_METRIC;
result.ifIndex = PORT_ANY;
- std::map<uint32_t, ProactiveRoute, mac48addrComparator>::iterator i = m_roots.find(port);
+ std::map<uint32_t, ProactiveRoute>::iterator i = m_roots.find(port);
if (i == m_roots.end())
return result;
result.ifIndex = i->first;
@@ -229,7 +229,7 @@
HwmpRtable::GetUnreachableDestinations(Mac48Address peerAddress, uint32_t port)
{
std::vector<FailedDestination> retval;
- for (std::map<Mac48Address, ReactiveRoute, mac48addrComparator>::iterator i = m_routes.begin(); i!= m_routes.end(); i++)
+ for (std::map<Mac48Address, ReactiveRoute>::iterator i = m_routes.begin(); i!= m_routes.end(); i++)
if ((i->second.retransmitter == peerAddress)&&(i->second.port == port))
{
FailedDestination dst;
@@ -241,7 +241,7 @@
/**
* Lookup a path to root
*/
- std::map<uint32_t, ProactiveRoute, mac48addrComparator>::iterator i = m_roots.find(port);
+ std::map<uint32_t, ProactiveRoute>::iterator i = m_roots.find(port);
if ((i != m_roots.end())&&(i->second.retransmitter == peerAddress))
{
FailedDestination dst;
@@ -254,7 +254,7 @@
uint32_t
HwmpRtable::RequestSeqnum(Mac48Address destination)
{
- std::map<Mac48Address, ReactiveRoute, mac48addrComparator>::iterator i = m_routes.find(destination);
+ std::map<Mac48Address, ReactiveRoute>::iterator i = m_routes.find(destination);
if (i == m_routes.end())
return 0;
return i->second.seqnum;
@@ -264,13 +264,13 @@
HwmpRtable::GetPrecursors(Mac48Address destination, uint32_t port)
{
std::vector<Mac48Address> retval;
- std::map<uint32_t, ProactiveRoute, mac48addrComparator>::iterator root = m_roots.find(port);
+ std::map<uint32_t, ProactiveRoute>::iterator root = m_roots.find(port);
if ((root != m_roots.end()) &&(root->second.root == destination))
{
for (unsigned int i = 0; i < root->second.precursors.size(); i ++)
retval.push_back(root->second.precursors[i]);
}
- std::map<Mac48Address, ReactiveRoute, mac48addrComparator>::iterator route = m_routes.find(destination);
+ std::map<Mac48Address, ReactiveRoute>::iterator route = m_routes.find(destination);
if ( (route != m_routes.end()) && (route->second.port == port) )
{
for (unsigned int i = 0; i < route->second.precursors.size(); i ++)
--- a/src/devices/mesh/hwmp-rtable.h Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/hwmp-rtable.h Wed Mar 18 17:41:01 2009 +0300
@@ -26,7 +26,6 @@
#include <map>
#include "ns3/nstime.h"
#include "ns3/mac48-address.h"
-#include "ns3/mac48-address-comparator.h"
#include "ns3/net-device.h"
#include "ns3/event-id.h"
#include "ns3/packet.h"
@@ -101,7 +100,7 @@
uint32_t seqnum;
std::vector<Mac48Address> precursors;
};
- std::map<Mac48Address, ReactiveRoute, mac48addrComparator> m_routes;
+ std::map<Mac48Address, ReactiveRoute> m_routes;
std::map<uint32_t, ProactiveRoute> m_roots;
};
} //namespace ns3
--- a/src/devices/mesh/hwmp-state.cc Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/hwmp-state.cc Wed Mar 18 17:41:01 2009 +0300
@@ -184,7 +184,7 @@
if (preq.GetTtl() == 0)
return;
//acceptance cretirea:
- std::map<Mac48Address, uint32_t, mac48addrComparator>::iterator i = m_dsnDatabase.find(preq.GetOriginatorAddress());
+ std::map<Mac48Address, uint32_t>::iterator i = m_dsnDatabase.find(preq.GetOriginatorAddress());
if (i == m_dsnDatabase.end())
{
m_dsnDatabase[preq.GetOriginatorAddress()] = preq.GetOriginatorSeqNumber();
@@ -197,7 +197,7 @@
if (i->second == preq.GetOriginatorSeqNumber())
{
//find metric
- std::map<Mac48Address, uint32_t, mac48addrComparator>::iterator j =
+ std::map<Mac48Address, uint32_t>::iterator j =
m_preqMetricDatabase.find(preq.GetOriginatorAddress());
NS_ASSERT(j != m_dsnDatabase.end());
if (j->second <= preq.GetMetric())
@@ -319,7 +319,7 @@
prep.DecrementTtl();
prep.IncrementMetric(metric);
//acceptance cretirea:
- std::map<Mac48Address, uint32_t, mac48addrComparator>::iterator i = m_dsnDatabase.find(prep.GetDestinationAddress());
+ std::map<Mac48Address, uint32_t>::iterator i = m_dsnDatabase.find(prep.GetDestinationAddress());
if (i == m_dsnDatabase.end())
{
m_dsnDatabase[prep.GetDestinationAddress()] = prep.GetDestinationSeqNumber();
--- a/src/devices/mesh/hwmp-state.h Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/hwmp-state.h Wed Mar 18 17:41:01 2009 +0300
@@ -22,16 +22,14 @@
#ifndef HWMP_STATE_H
#define HWMP_STATE_H
#include <map>
-#include "ns3/event-id.h"
-#include "ns3/ptr.h"
#include "ns3/hwmp-rtable.h"
#include "ns3/packet.h"
-#include "ns3/wifi-net-device.h"
#include "ns3/mesh-wifi-mac.h"
#include "ns3/ie-dot11s-preq.h"
#include "ns3/ie-dot11s-prep.h"
#include "ns3/ie-dot11s-perr.h"
#include "ns3/dot11s-parameters.h"
+#include "ns3/wifi-net-device.h"
namespace ns3 {
/**
* \ingroup mesh
@@ -161,8 +159,8 @@
uint32_t m_preqId;
uint32_t m_myDsn;
//Seqno and metric database
- std::map<Mac48Address, uint32_t, mac48addrComparator> m_dsnDatabase;
- std::map<Mac48Address, uint32_t, mac48addrComparator> m_preqMetricDatabase;
+ std::map<Mac48Address, uint32_t> m_dsnDatabase;
+ std::map<Mac48Address, uint32_t> m_preqMetricDatabase;
//Disable/enable functionality
bool m_disabled;
//Proactive PREQ mechanism:
--- a/src/devices/mesh/hwmp.cc Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/hwmp.cc Wed Mar 18 17:41:01 2009 +0300
@@ -172,7 +172,7 @@
void
Hwmp::DoDispose()
{
- for (std::map<Mac48Address, EventId, mac48addrComparator>::iterator i = m_timeoutDatabase.begin(); i != m_timeoutDatabase.end(); i ++)
+ for (std::map<Mac48Address, EventId>::iterator i = m_timeoutDatabase.begin(); i != m_timeoutDatabase.end(); i ++)
i->second.Cancel();
m_timeoutDatabase.clear();
m_seqnoDatabase.clear();
@@ -234,7 +234,7 @@
//check seqno!
if (destination == Mac48Address::GetBroadcast())
{
- std::map<Mac48Address, uint32_t, mac48addrComparator>::iterator i = m_seqnoDatabase.find(source);
+ std::map<Mac48Address, uint32_t>::iterator i = m_seqnoDatabase.find(source);
if (i == m_seqnoDatabase.end())
m_seqnoDatabase[source] = tag.GetSeqno();
else
@@ -608,7 +608,7 @@
MeshL2RoutingProtocol::QueuedPacket retval;
retval.pkt = NULL;
//Ptr<Packet> in this structure is NULL when queue is empty
- std::map<Mac48Address, std::queue<QueuedPacket>, mac48addrComparator>:: iterator i = m_rqueue.find(dst);
+ std::map<Mac48Address, std::queue<QueuedPacket> >:: iterator i = m_rqueue.find(dst);
if (i == m_rqueue.end())
return retval;
if ((int)m_rqueue[dst].size() == 0)
@@ -648,7 +648,7 @@
bool
Hwmp::ShouldSendPreq(Mac48Address dst)
{
- std::map<Mac48Address, EventId, mac48addrComparator>::iterator i = m_timeoutDatabase.find(dst);
+ std::map<Mac48Address, EventId>::iterator i = m_timeoutDatabase.find(dst);
if (i == m_timeoutDatabase.end())
{
m_timeoutDatabase[dst] = Simulator::Schedule(
@@ -664,7 +664,7 @@
HwmpRtable::LookupResult result = m_rtable->LookupReactive(dst);
if (result.retransmitter != Mac48Address::GetBroadcast())
{
- std::map<Mac48Address, EventId, mac48addrComparator>::iterator i = m_timeoutDatabase.find(dst);
+ std::map<Mac48Address, EventId>::iterator i = m_timeoutDatabase.find(dst);
NS_ASSERT(i != m_timeoutDatabase.end());
m_timeoutDatabase.erase(i);
return;
@@ -681,7 +681,7 @@
break;
packet.reply(false, packet.pkt, packet.src, packet.dst, packet.protocol, HwmpRtable::MAX_METRIC);
}
- std::map<Mac48Address, EventId, mac48addrComparator>::iterator i = m_timeoutDatabase.find(dst);
+ std::map<Mac48Address, EventId>::iterator i = m_timeoutDatabase.find(dst);
NS_ASSERT(i != m_timeoutDatabase.end());
m_timeoutDatabase.erase(i);
return;
--- a/src/devices/mesh/hwmp.h Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/hwmp.h Wed Mar 18 17:41:01 2009 +0300
@@ -23,15 +23,14 @@
#ifndef HWMP_H
#define HWMP_H
+
#include <map>
#include <queue>
#include "ns3/tag.h"
#include "ns3/object.h"
#include "ns3/mac48-address.h"
-#include "ns3/mac48-address-comparator.h"
#include "ns3/mesh-l2-routing-protocol.h"
#include "ns3/packet.h"
-#include "ns3/ptr.h"
#include "ns3/hwmp-state.h"
namespace ns3 {
class HwmpState;
@@ -249,7 +248,7 @@
* \attention mesh seqno is processed at HWMP
*/
uint32_t m_seqno;
- std::map<Mac48Address, uint32_t/*, mac48addrComparator*/>
+ std::map<Mac48Address, uint32_t/**/>
m_seqnoDatabase;
//Timers:
/**
@@ -269,7 +268,7 @@
* Keeps PREQ retry timers for every
* destination
*/
- std::map<Mac48Address, EventId, mac48addrComparator>
+ std::map<Mac48Address, EventId>
m_timeoutDatabase;
/**
* Configurable parameters:
--- a/src/devices/mesh/mac48-address-comparator.h Wed Mar 18 17:40:38 2009 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2008,2009 IITP RAS
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Author: Kirill Andreev <andreev@iitp.ru>
- */
-
-
-#ifndef MAC48ADDRESS_COMPARATOR
-#define MAC48ADDRESS_COMPARATOR
-#include "ns3/mac48-address.h"
-namespace ns3 {
-struct mac48addrComparator
-{
- bool operator()(const Mac48Address addr1, Mac48Address addr2) const
- {
- uint8_t s1[6], s2[6];
- addr1.CopyTo(s1);
- addr2.CopyTo(s2);
- for (int i = 0; i < 6; i ++)
- if (s1[i] > s2[i])
- return true;
- return false;
- }
-};
-}//namespace ns3
-#endif
--- a/src/devices/mesh/mesh-l2-routing-protocol.h Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/mesh-l2-routing-protocol.h Wed Mar 18 17:41:01 2009 +0300
@@ -24,7 +24,6 @@
#include "ns3/object.h"
#include "ns3/mac48-address.h"
-#include "ns3/ptr.h"
namespace ns3 {
--- a/src/devices/mesh/mesh-mgt-headers.cc Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/mesh-mgt-headers.cc Wed Mar 18 17:41:01 2009 +0300
@@ -22,12 +22,7 @@
#include "ns3/mesh-mgt-headers.h"
#include "ns3/address-utils.h"
-#include "ns3/simulator.h"
#include "ns3/assert.h"
-#include "ns3/log.h"
-
-NS_LOG_COMPONENT_DEFINE("MeshMgtHeaders");
-
namespace ns3 {
/***********************************************************
@@ -72,7 +67,6 @@
MgtMeshBeaconHeader::Serialize (Buffer::Iterator start) const
{
//First we pack Beacon:
- NS_LOG_DEBUG("Serialization beacon");
Buffer::Iterator i = start;
MgtBeaconHeader::Serialize(i);
i.Next (MgtBeaconHeader::GetSerializedSize());
@@ -86,7 +80,6 @@
uint32_t
MgtMeshBeaconHeader::Deserialize (Buffer::Iterator start)
{
- NS_LOG_DEBUG("Deserialization beacon");
Buffer::Iterator i = start;
MgtBeaconHeader::Deserialize(start);
i.Next (MgtBeaconHeader::GetSerializedSize());
@@ -138,9 +131,9 @@
}
void
-MeshMgtPeerLinkManFrame::SetPeerLinkManagementElement(PeerLinkManagementElement MeshPeerElement)
+MeshMgtPeerLinkManFrame::SetIeDot11sPeerManagement(IeDot11sPeerManagement meshPeerElement)
{
- PeerLinkMan = MeshPeerElement;
+ PeerLinkMan = meshPeerElement;
}
uint16_t
@@ -173,8 +166,8 @@
return MeshConfig;
}
-PeerLinkManagementElement
-MeshMgtPeerLinkManFrame::GetPeerLinkManagementElement()
+IeDot11sPeerManagement
+MeshMgtPeerLinkManFrame::GetIeDot11sPeerManagement()
{
return PeerLinkMan;
}
@@ -236,7 +229,8 @@
MeshConfig.Serialize (i);
i.Next(MeshConfig.GetSerializedSize());
}
- i = PeerLinkMan.Serialize (i);
+ PeerLinkMan.Serialize (i);
+ i.Next(PeerLinkMan.GetSerializedSize());
}
uint32_t
@@ -254,7 +248,8 @@
MeshConfig.Deserialize (i);
i.Next(MeshConfig.GetSerializedSize());
}
- i = PeerLinkMan.Deserialize (i);
+ PeerLinkMan.Deserialize (i);
+ i.Next(PeerLinkMan.GetSerializedSize());
return i.GetDistanceFrom (start);
}
void
--- a/src/devices/mesh/mesh-mgt-headers.h Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/mesh-mgt-headers.h Wed Mar 18 17:41:01 2009 +0300
@@ -23,16 +23,9 @@
#ifndef MESH_MGT_HEADERS_H
#define MESH_MGT_HEADERS_H
-#include <stdint.h>
-
#include "ns3/header.h"
-#include "ns3/status-code.h"
-#include "ns3/dot11s-peer-management-element.h"
#include "ns3/supported-rates.h"
-#include "ns3/ie-dot11s-preq.h"
-#include "ns3/ie-dot11s-prep.h"
-#include "ns3/ie-dot11s-perr.h"
-#include "ns3/ie-dot11s-rann.h"
+#include "ns3/ie-dot11s-peer-management.h"
#include "ns3/ie-dot11s-configuration.h"
#include "ns3/ie-dot11s-beacon-timing.h"
#include "ns3/mgt-headers.h"
@@ -70,14 +63,14 @@
void SetQosField(uint16_t qos);
void SetMeshId(Ssid Id);
void SetIeDot11sConfiguration(IeDot11sConfiguration MeshConf);
- void SetPeerLinkManagementElement(PeerLinkManagementElement MeshPeerElement);
+ void SetIeDot11sPeerManagement(IeDot11sPeerManagement meshPeerElement);
uint16_t GetAid();
SupportedRates GetSupportedRates();
uint16_t GetQosField();
Ssid GetMeshId();
IeDot11sConfiguration GetIeDot11sConfiguration();
- PeerLinkManagementElement GetPeerLinkManagementElement();
+ IeDot11sPeerManagement GetIeDot11sPeerManagement();
static TypeId GetTypeId();
virtual TypeId GetInstanceTypeId() const;
@@ -101,14 +94,14 @@
static const uint8_t MESH_MGT_HEADER_PEER_CLOSE = 3;
// Standart is also requires a ReasonCode to be within
// PeerLinkClose frame format, but it is present within
- // PeerLinkManagementElement, so we did not duplicate
+ // IeDot11sPeerManagement, so we did not duplicate
// it.
uint16_t Aid; //only in Confirm
SupportedRates Rates; //only in Open and Confirm
uint16_t QoS; //only in Open and Confirm
Ssid MeshId; //only in Open and Confirm
IeDot11sConfiguration MeshConfig; //only in Open and Confirm
- PeerLinkManagementElement PeerLinkMan; //in all types of frames
+ IeDot11sPeerManagement PeerLinkMan; //in all types of frames
};
}//namespace NS3
--- a/src/devices/mesh/mesh-point-device.cc Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/mesh-point-device.cc Wed Mar 18 17:41:01 2009 +0300
@@ -21,11 +21,8 @@
#include "ns3/node.h"
-#include "ns3/channel.h"
#include "ns3/packet.h"
#include "ns3/log.h"
-#include "ns3/boolean.h"
-#include "ns3/simulator.h"
#include "ns3/mesh-point-device.h"
NS_LOG_COMPONENT_DEFINE ("MeshPointDevice");
--- a/src/devices/mesh/mesh-point-device.h Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/mesh-point-device.h Wed Mar 18 17:41:01 2009 +0300
@@ -25,8 +25,6 @@
#include "ns3/net-device.h"
#include "ns3/mac48-address.h"
-#include "ns3/nstime.h"
-#include "ns3/bridge-net-device.h"
#include "ns3/bridge-channel.h"
#include "ns3/mesh-l2-routing-protocol.h"
--- a/src/devices/mesh/mesh-wifi-mac-header.h Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/mesh-wifi-mac-header.h Wed Mar 18 17:41:01 2009 +0300
@@ -24,8 +24,6 @@
#include "ns3/header.h"
#include "ns3/mac48-address.h"
-#include "ns3/nstime.h"
-#include <stdint.h>
namespace ns3 {
/**
--- a/src/devices/mesh/mesh-wifi-mac.cc Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/mesh-wifi-mac.cc Wed Mar 18 17:41:01 2009 +0300
@@ -35,6 +35,10 @@
#include "ns3/mac-low.h"
#include "ns3/tx-statistics.h"
#include "ns3/hwmp.h"
+#include "ns3/ie-dot11s-beacon-timing.h"
+#include "ns3/mgt-headers.h"
+#include "ns3/wifi-remote-station-manager.h"
+#include "ns3/mesh-wifi-peer-manager.h"
NS_LOG_COMPONENT_DEFINE ("MeshWifiMac");
@@ -578,7 +582,7 @@
GetAddress(),
peerAddress,
peer_frame.GetAid(),
- peer_frame.GetPeerLinkManagementElement(),
+ peer_frame.GetIeDot11sPeerManagement(),
m_meshConfig
);
return;
@@ -586,7 +590,7 @@
m_peerManager->SetOpenReceived(
GetAddress(),
peerAddress,
- peer_frame.GetPeerLinkManagementElement(),
+ peer_frame.GetIeDot11sPeerManagement(),
m_meshConfig
);
return;
@@ -594,7 +598,7 @@
m_peerManager->SetCloseReceived(
GetAddress(),
peerAddress,
- peer_frame.GetPeerLinkManagementElement()
+ peer_frame.GetIeDot11sPeerManagement()
);
return;
default:
@@ -677,34 +681,34 @@
}
void
-MeshWifiMac::SendPeerLinkOpen(PeerLinkManagementElement peer_element, Mac48Address peerAddress)
+MeshWifiMac::SendPeerLinkOpen(IeDot11sPeerManagement peer_element, Mac48Address peerAddress)
{
MeshMgtPeerLinkManFrame open;
open.SetOpen();
open.SetIeDot11sConfiguration(m_meshConfig);
- open.SetPeerLinkManagementElement(peer_element);
+ open.SetIeDot11sPeerManagement(peer_element);
Simulator::Schedule(CalcSwDelay() ,&MeshWifiMac::QueuePeerLinkFrame, this, open, peerAddress);
}
void
-MeshWifiMac::SendPeerLinkConfirm(PeerLinkManagementElement peer_element, Mac48Address peerAddress, uint16_t aid)
+MeshWifiMac::SendPeerLinkConfirm(IeDot11sPeerManagement peer_element, Mac48Address peerAddress, uint16_t aid)
{
MeshMgtPeerLinkManFrame confirm;
confirm.SetConfirm();
confirm.SetIeDot11sConfiguration(m_meshConfig);
- confirm.SetPeerLinkManagementElement(peer_element);
+ confirm.SetIeDot11sPeerManagement(peer_element);
confirm.SetAid(aid);
Simulator::Schedule(CalcSwDelay() ,&MeshWifiMac::QueuePeerLinkFrame, this, confirm, peerAddress);
}
void
-MeshWifiMac::SendPeerLinkClose(PeerLinkManagementElement peer_element, Mac48Address peerAddress)
+MeshWifiMac::SendPeerLinkClose(IeDot11sPeerManagement peer_element, Mac48Address peerAddress)
{
MeshMgtPeerLinkManFrame close;
close.SetClose();
close.SetIeDot11sConfiguration(m_meshConfig);
- close.SetPeerLinkManagementElement(peer_element);
+ close.SetIeDot11sPeerManagement(peer_element);
Simulator::Schedule(CalcSwDelay() ,&MeshWifiMac::QueuePeerLinkFrame, this, close, peerAddress);
}
--- a/src/devices/mesh/mesh-wifi-mac.h Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/mesh-wifi-mac.h Wed Mar 18 17:41:01 2009 +0300
@@ -22,19 +22,13 @@
#ifndef MAC_HIGH_MESH_H
#define MAC_HIGH_MESH_H
-#include <stdint.h>
#include <map>
#include "ns3/mac48-address.h"
-#include "ns3/mac48-address-comparator.h"
-#include "ns3/mgt-headers.h"
#include "ns3/mesh-mgt-headers.h"
-#include "ns3/callback.h"
-#include "ns3/packet.h"
-#include "ns3/nstime.h"
-#include "ns3/ie-dot11s-beacon-timing.h"
-#include "ns3/wifi-remote-station-manager.h"
-#include "ns3/mesh-wifi-peer-manager.h"
#include "ns3/wifi-mac.h"
+#include "ns3/ie-dot11s-preq.h"
+#include "ns3/ie-dot11s-prep.h"
+#include "ns3/ie-dot11s-perr.h"
namespace ns3 {
@@ -63,31 +57,31 @@
MeshWifiMac ();
~MeshWifiMac ();
// inherited from WifiMac.
- virtual void SetSlot (Time slotTime);
- virtual void SetSifs (Time sifs);
- virtual void SetPifs (Time pifs);
- virtual void SetCtsTimeout (Time ctsTimeout);
- virtual void SetAckTimeout (Time ackTimeout);
- virtual void SetEifsNoDifs (Time eifsNoDifs);
- virtual Time GetSlot () const;
- virtual Time GetSifs () const;
- virtual Time GetPifs () const;
- virtual Time GetCtsTimeout () const;
- virtual Time GetAckTimeout () const;
- virtual Time GetEifsNoDifs () const;
- virtual void SetWifiPhy (Ptr<WifiPhy> phy);
- virtual void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> stationManager);
- virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to, Mac48Address from);
- virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to);
- virtual bool SupportsSendFrom () const;
- virtual void SetForwardUpCallback (Callback<void,Ptr<Packet>, Mac48Address, Mac48Address> upCallback);
- virtual void SetLinkUpCallback (Callback<void> linkUp);
- virtual void SetLinkDownCallback (Callback<void> linkDown);
- virtual Mac48Address GetAddress () const;
- virtual Mac48Address GetBssid () const;
- virtual Ssid GetSsid () const;
- virtual void SetAddress (Mac48Address address);
- virtual void SetSsid (Ssid ssid);
+ void SetSlot (Time slotTime);
+ void SetSifs (Time sifs);
+ void SetPifs (Time pifs);
+ void SetCtsTimeout (Time ctsTimeout);
+ void SetAckTimeout (Time ackTimeout);
+ void SetEifsNoDifs (Time eifsNoDifs);
+ Time GetSlot () const;
+ Time GetSifs () const;
+ Time GetPifs () const;
+ Time GetCtsTimeout () const;
+ Time GetAckTimeout () const;
+ Time GetEifsNoDifs () const;
+ void SetWifiPhy (Ptr<WifiPhy> phy);
+ void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> stationManager);
+ void Enqueue (Ptr<const Packet> packet, Mac48Address to, Mac48Address from);
+ void Enqueue (Ptr<const Packet> packet, Mac48Address to);
+ bool SupportsSendFrom () const;
+ void SetForwardUpCallback (Callback<void,Ptr<Packet>, Mac48Address, Mac48Address> upCallback);
+ void SetLinkUpCallback (Callback<void> linkUp);
+ void SetLinkDownCallback (Callback<void> linkDown);
+ Mac48Address GetAddress () const;
+ Mac48Address GetBssid () const;
+ Ssid GetSsid () const;
+ void SetAddress (Mac48Address address);
+ void SetSsid (Ssid ssid);
/**
* \param interval is an interval between two
* successive beacons
@@ -131,7 +125,7 @@
* a given peer manager
*/
void SetPeerLinkManager(Ptr<WifiPeerManager> manager);
- virtual void SetPreqReceivedCallback(
+ void SetPreqReceivedCallback(
Callback<void, IeDot11sPreq&, const Mac48Address&, const uint32_t&> cb);
/**
* \brief this callback is set by Hwmp routing
@@ -140,7 +134,7 @@
* \param cb is a callback to be executed when
* receiving PREP.
*/
- virtual void SetPrepReceivedCallback(
+ void SetPrepReceivedCallback(
Callback<void, IeDot11sPrep&, const Mac48Address&, const uint32_t&> cb);
/**
* \brief this callback is set by Hwmp routing
@@ -149,7 +143,7 @@
* \param cb is a callback to be executed when
* receiving PERR.
*/
- virtual void SetPerrReceivedCallback(
+ void SetPerrReceivedCallback(
Callback<void, IeDot11sPerr&, const Mac48Address&> cb);
/**
@@ -159,7 +153,7 @@
* \param cb is a callback to be executed when
* peer failure has ben detected
*/
- virtual void SetPeerStatusCallback(
+ void SetPeerStatusCallback(
Callback<void, Mac48Address, bool, uint32_t> cb);
/**
* \brief Sends a PREQ frame.
@@ -169,7 +163,7 @@
* \attention This method is public, because
* HWMP makes a callback using this method
*/
- virtual void SendPreq(const IeDot11sPreq& preq);
+ void SendPreq(const IeDot11sPreq& preq);
/**
* \brief Sends a PREP frame.
* \param prep is prep information element
@@ -181,7 +175,7 @@
* HWMP makes a callback using this method
*/
- virtual void SendPrep(const IeDot11sPrep& prep, const Mac48Address& to);
+ void SendPrep(const IeDot11sPrep& prep, const Mac48Address& to);
/**
* \brief Sends a PERR frame.
* \param perr is perr information element
@@ -192,7 +186,7 @@
* \attention This method is public, because
* HWMP makes a callback using this method
*/
- virtual void SendPerr(const IeDot11sPerr& perr, std::vector<Mac48Address> receivers);
+ void SendPerr(const IeDot11sPerr& perr, std::vector<Mac48Address> receivers);
/**
* \brief Sends PeerLinkOpen frame to a given
* address. Mac only forms a proper
@@ -203,7 +197,7 @@
* destination of given frame
*/
void SendPeerLinkOpen(
- PeerLinkManagementElement peer_element,
+ IeDot11sPeerManagement peer_element,
Mac48Address peerAddress
);
/**
@@ -218,7 +212,7 @@
* peer manager
*/
void SendPeerLinkConfirm(
- PeerLinkManagementElement peer_element,
+ IeDot11sPeerManagement peer_element,
Mac48Address peerAddress,
uint16_t aid
);
@@ -232,7 +226,7 @@
* destination of given frame
*/
void SendPeerLinkClose(
- PeerLinkManagementElement peer_element,
+ IeDot11sPeerManagement peer_element,
Mac48Address peerAddress
);
/**
@@ -243,7 +237,7 @@
* \param peerAddress is the address of
* destination of given frame
*/
- virtual void PeerLinkStatus(Mac48Address peerAddress, bool status);
+ void PeerLinkStatus(Mac48Address peerAddress, bool status);
/**
* \brief Peer Manager notifyes MAC about new
@@ -262,7 +256,7 @@
);
private:
void Receive (Ptr<Packet> packet, WifiMacHeader const *hdr);
- virtual void ForwardUp (Ptr<Packet> packet, Mac48Address src, Mac48Address dst);
+ void ForwardUp (Ptr<Packet> packet, Mac48Address src, Mac48Address dst);
void ForwardDown(
Ptr<const Packet> packet,
Mac48Address from,
@@ -306,7 +300,7 @@
void SetBeaconGeneration (bool enable);
bool GetBeaconGeneration () const;
SupportedRates GetSupportedRates () const;
- virtual void DoDispose ();
+ void DoDispose ();
Ptr<DcaTxop> m_BE;
Ptr<DcaTxop> m_BK;
@@ -370,7 +364,7 @@
* \brief metric calculation parameters
*/
uint32_t CalculateMetric(Mac48Address peerAddress);
- std::map<Mac48Address, uint32_t, mac48addrComparator>
+ std::map<Mac48Address, uint32_t>
m_metricDatabase;
};
--- a/src/devices/mesh/mesh-wifi-peer-manager.cc Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/mesh-wifi-peer-manager.cc Wed Mar 18 17:41:01 2009 +0300
@@ -498,14 +498,14 @@
void WifiPeerLinkDescriptor::SendPeerLinkClose(dot11sReasonCode reasoncode)
{
- PeerLinkManagementElement peerElement;
+ IeDot11sPeerManagement peerElement;
peerElement.SetPeerClose(m_localLinkId, m_peerLinkId, reasoncode);
m_mac->SendPeerLinkClose(peerElement,m_peerAddress);
}
void WifiPeerLinkDescriptor::SendPeerLinkOpen()
{
- PeerLinkManagementElement peerElement;
+ IeDot11sPeerManagement peerElement;
peerElement.SetPeerOpen(m_localLinkId);
NS_ASSERT(m_mac != NULL);
m_mac->SendPeerLinkOpen(peerElement, m_peerAddress);
@@ -513,7 +513,7 @@
void WifiPeerLinkDescriptor::SendPeerLinkConfirm()
{
- PeerLinkManagementElement peerElement;
+ IeDot11sPeerManagement peerElement;
peerElement.SetPeerConfirm(m_localLinkId, m_peerLinkId);
m_mac->SendPeerLinkConfirm(peerElement, m_peerAddress, m_assocId);
}
@@ -694,7 +694,7 @@
WifiPeerManager::SetOpenReceived(
Mac48Address portAddress,
Mac48Address peerAddress,
- PeerLinkManagementElement peerMan,
+ IeDot11sPeerManagement peerMan,
IeDot11sConfiguration conf
)
{
@@ -724,7 +724,7 @@
Mac48Address portAddress,
Mac48Address peerAddress,
uint16_t peerAid,
- PeerLinkManagementElement peerMan,
+ IeDot11sPeerManagement peerMan,
IeDot11sConfiguration meshConfig
)
{
@@ -739,7 +739,7 @@
WifiPeerManager::SetCloseReceived(
Mac48Address portAddress,
Mac48Address peerAddress,
- PeerLinkManagementElement peerMan
+ IeDot11sPeerManagement peerMan
)
{
PeerDescriptorsMap::iterator port = m_peerDescriptors.find(portAddress);
--- a/src/devices/mesh/mesh-wifi-peer-manager.h Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/mesh-wifi-peer-manager.h Wed Mar 18 17:41:01 2009 +0300
@@ -23,13 +23,9 @@
#ifndef WIFI_PEER_MAN_H
#define WIFI_PEER_MAN_H
-#include "ns3/event-id.h"
-#include "ns3/ptr.h"
-#include "ns3/nstime.h"
#include "ns3/mac48-address.h"
-#include "ns3/uinteger.h"
#include "ns3/wifi-net-device.h"
-#include "ns3/dot11s-peer-management-element.h"
+#include "ns3/ie-dot11s-peer-management.h"
#include "ns3/ie-dot11s-beacon-timing.h"
#include "ns3/mesh-wifi-mac.h"
@@ -69,7 +65,7 @@
void SetPeerAid(uint16_t aid);
void SetBeaconTimingElement(IeDot11sBeaconTiming beaconTiming);
void SetPeerLinkDescriptorElement(
- PeerLinkManagementElement peerLinkElement
+ IeDot11sPeerManagement peerLinkElement
);
Mac48Address GetPeerAddress()const;
/**
@@ -81,7 +77,7 @@
Time GetBeaconInterval()const;
IeDot11sBeaconTiming
GetBeaconTimingElement()const;
- PeerLinkManagementElement
+ IeDot11sPeerManagement
GetPeerLinkDescriptorElement()const;
void ClearTimingElement();
/* MLME */
@@ -232,7 +228,7 @@
void SetOpenReceived(
Mac48Address portAddress,
Mac48Address peerAddress,
- PeerLinkManagementElement
+ IeDot11sPeerManagement
peerMan,
IeDot11sConfiguration conf
);
@@ -240,14 +236,14 @@
Mac48Address portAddress,
Mac48Address peerAddress,
uint16_t peerAid,
- PeerLinkManagementElement
+ IeDot11sPeerManagement
peerMan,
IeDot11sConfiguration meshConfig
);
void SetCloseReceived(
Mac48Address portAddress,
Mac48Address peerAddress,
- PeerLinkManagementElement peerMan
+ IeDot11sPeerManagement peerMan
);
//Using this function MAC
void ConfigurationMismatch(
--- a/src/devices/mesh/wifi-information-element.h Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/wifi-information-element.h Wed Mar 18 17:41:01 2009 +0300
@@ -136,11 +136,11 @@
/// Own unique Element ID
virtual WifiElementId ElementId () const = 0;
/// Length of serialized information
- virtual uint16_t GetInformationSize () const = 0;
+ virtual uint8_t GetInformationSize () const = 0;
/// Serialize information
virtual void SerializeInformation (Buffer::Iterator start) const = 0;
/// Deserialize information
- virtual uint16_t DeserializeInformation (Buffer::Iterator start, uint8_t length) = 0;
+ virtual uint8_t DeserializeInformation (Buffer::Iterator start, uint8_t length) = 0;
/// Print information
virtual void PrintInformation (std::ostream &os) const = 0;
//\}
--- a/src/devices/mesh/wscript Wed Mar 18 17:40:38 2009 +0300
+++ b/src/devices/mesh/wscript Wed Mar 18 17:41:01 2009 +0300
@@ -19,7 +19,6 @@
'hwmp.cc',
'mesh-wifi-mac.cc',
'hwmp-state.cc',
- 'dot11s-peer-management-element.cc',
'mesh-mgt-headers.cc',
]
headers = bld.new_task_gen('ns3header')
@@ -39,8 +38,6 @@
'mesh-mgt-headers.h',
'hwmp.h',
'tx-statistics.h',
- 'dot11s-peer-management-element.h',
- 'mac48-address-comparator.h',
'hwmp-rtable.h',
'mesh-wifi-peer-manager.h',
'mesh-wifi-mac-header.h',