--- a/src/devices/mesh/dot11s/hwmp-mac-plugin.cc Thu Apr 09 12:53:26 2009 +0400
+++ b/src/devices/mesh/dot11s/hwmp-mac-plugin.cc Thu Apr 09 13:16:27 2009 +0400
@@ -57,7 +57,9 @@
WifiMeshHeader meshHdr;
HwmpTag tag;
if(packet->PeekPacketTag (tag))
+ {
NS_ASSERT (false);
+ }
packet->RemoveHeader(meshHdr);
//TODO: address extension
Mac48Address destination;
@@ -136,7 +138,9 @@
HwmpTag tag;
bool tagExists = packet->RemovePacketTag(tag);
if (!tagExists)
+ {
NS_ASSERT (false);
+ }
WifiMeshHeader meshHdr;
meshHdr.SetMeshSeqno(tag.GetSeqno());
meshHdr.SetMeshTtl(tag.GetTtl());
--- a/src/devices/mesh/dot11s/hwmp-protocol.cc Thu Apr 09 12:53:26 2009 +0400
+++ b/src/devices/mesh/dot11s/hwmp-protocol.cc Thu Apr 09 13:16:27 2009 +0400
@@ -186,7 +186,9 @@
// packet from level 3
{
if(packet->PeekPacketTag(tag))
+ {
NS_ASSERT (false);
+ }
//Filling TAG:
if(destination == Mac48Address::GetBroadcast ())
{
--- a/src/devices/mesh/dot11s/ie-dot11s-peer-management.cc Thu Apr 09 12:53:26 2009 +0400
+++ b/src/devices/mesh/dot11s/ie-dot11s-peer-management.cc Thu Apr 09 13:16:27 2009 +0400
@@ -24,7 +24,6 @@
#include "ns3/assert.h"
#include "ns3/test.h"
#include "ns3/packet.h"
-//NS_LOG_COMPONENT_DEFINE ("MeshPeerLinkManagementelement");
namespace ns3 {
namespace dot11s {
@@ -121,11 +120,17 @@
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 ();
--- a/src/devices/mesh/dot11s/peer-link.cc Thu Apr 09 12:53:26 2009 +0400
+++ b/src/devices/mesh/dot11s/peer-link.cc Thu Apr 09 13:16:27 2009 +0400
@@ -196,7 +196,9 @@
m_peerLinkId = localLinkId;
m_configuration = conf;
if(m_peerMeshPointAddress != Mac48Address::GetBroadcast ())
+ {
NS_ASSERT(m_peerMeshPointAddress == peerMp);
+ }
else
m_peerMeshPointAddress = peerMp;
StateMachine (OPN_ACPT);
@@ -208,7 +210,9 @@
m_peerLinkId = localLinkId;
m_configuration = conf;
if(m_peerMeshPointAddress != Mac48Address::GetBroadcast ())
+ {
NS_ASSERT(m_peerMeshPointAddress == peerMp);
+ }
else
m_peerMeshPointAddress = peerMp;
StateMachine (OPN_RJCT, reason);
@@ -225,7 +229,9 @@
m_configuration = conf;
m_peerAssocId = peerAid;
if(m_peerMeshPointAddress != Mac48Address::GetBroadcast ())
+ {
NS_ASSERT(m_peerMeshPointAddress == peerMp);
+ }
else
m_peerMeshPointAddress = peerMp;
StateMachine (CNF_ACPT);
@@ -242,7 +248,9 @@
return;
m_configuration = conf;
if(m_peerMeshPointAddress != Mac48Address::GetBroadcast ())
+ {
NS_ASSERT(m_peerMeshPointAddress == peerMp);
+ }
m_peerMeshPointAddress = peerMp;
StateMachine (CNF_RJCT, reason);
}
--- a/src/devices/mesh/dot11s/peer-management-plugin.cc Thu Apr 09 12:53:26 2009 +0400
+++ b/src/devices/mesh/dot11s/peer-management-plugin.cc Thu Apr 09 13:16:27 2009 +0400
@@ -27,9 +27,7 @@
#include "ns3/mesh-wifi-interface-mac.h"
#include "ns3/simulator.h"
#include "ns3/wifi-mac-header.h"
-#include "ns3/log.h"
-NS_LOG_COMPONENT_DEFINE("PeerManager");
namespace ns3 {
namespace dot11s {
PeerManagerMacPlugin::PeerManagerMacPlugin (uint32_t interface, Ptr<PeerManagementProtocol> protocol)
--- a/src/devices/mesh/dot11s/peer-management-protocol.cc Thu Apr 09 12:53:26 2009 +0400
+++ b/src/devices/mesh/dot11s/peer-management-protocol.cc Thu Apr 09 13:16:27 2009 +0400
@@ -293,7 +293,9 @@
beacon = beaconsOnInterface->second.find (peerAddress);
//find a peer link - it must not exist
if(FindPeerLink(interface, peerAddress) != 0)
+ {
NS_ASSERT (false);
+ }
// Plugin must exist
PeerManagerPluginMap::iterator plugin = m_plugins.find (interface);
NS_ASSERT(plugin != m_plugins.end ());
--- a/src/devices/mesh/mesh-point-device.cc Thu Apr 09 12:53:26 2009 +0400
+++ b/src/devices/mesh/mesh-point-device.cc Thu Apr 09 13:16:27 2009 +0400
@@ -82,7 +82,7 @@
NS_LOG_DEBUG ("UID is " << packet->GetUid ());
const Mac48Address src48 = Mac48Address::ConvertFrom (src);
const Mac48Address dst48 = Mac48Address::ConvertFrom (dst);
- NS_LOG_DEBUG("SRC="<<src48<<", DST = "<<dst48<<", I am: "<<m_address);
+ NS_LOG_DEBUG ("SRC="<<src48<<", DST = "<<dst48<<", I am: "<<m_address);
if (!m_promiscRxCallback.IsNull ())
m_promiscRxCallback (this, packet, protocol, src, dst, packetType);
if(dst48.IsBroadcast () || dst48.IsMulticast ())
@@ -315,9 +315,13 @@
NS_ASSERT (iface != this);
if (!Mac48Address::IsMatchingType (iface->GetAddress ()))
+ {
NS_FATAL_ERROR ("Device does not support eui 48 addresses: cannot be added to bridge.");
+ }
if (!iface->SupportsSendFrom ())
+ {
NS_FATAL_ERROR ("Device does not support SendFrom: cannot be added to bridge.");
+ }
m_address = Mac48Address::ConvertFrom (iface->GetAddress ());
NS_LOG_DEBUG ("RegisterProtocolHandler for " << iface->GetName ());
@@ -358,12 +362,9 @@
if (!success)
{
NS_LOG_UNCOND ("Resolve failed");
- //TODO: SendError callback
return;
}
-
// Ok, now I know the route, just SendFrom
-
if (outIface != 0xffffffff)
GetInterface (outIface)->SendFrom(packet, src, dst, protocol);
else