diff --git a/src/devices/mesh/dot11s/hwmp-mac-plugin.cc b/src/devices/mesh/dot11s/hwmp-mac-plugin.cc index c7b749f27..6a92caa62 100644 --- a/src/devices/mesh/dot11s/hwmp-mac-plugin.cc +++ b/src/devices/mesh/dot11s/hwmp-mac-plugin.cc @@ -57,7 +57,9 @@ HwmpMacPlugin::Receive (Ptr packet, const WifiMacHeader & header) WifiMeshHeader meshHdr; HwmpTag tag; if(packet->PeekPacketTag (tag)) + { NS_ASSERT (false); + } packet->RemoveHeader(meshHdr); //TODO: address extension Mac48Address destination; @@ -136,7 +138,9 @@ HwmpMacPlugin::UpdateOutcomingFrame (Ptr packet, WifiMacHeader & header, HwmpTag tag; bool tagExists = packet->RemovePacketTag(tag); if (!tagExists) + { NS_ASSERT (false); + } WifiMeshHeader meshHdr; meshHdr.SetMeshSeqno(tag.GetSeqno()); meshHdr.SetMeshTtl(tag.GetTtl()); diff --git a/src/devices/mesh/dot11s/hwmp-protocol.cc b/src/devices/mesh/dot11s/hwmp-protocol.cc index 37055e2a9..be7917611 100644 --- a/src/devices/mesh/dot11s/hwmp-protocol.cc +++ b/src/devices/mesh/dot11s/hwmp-protocol.cc @@ -186,7 +186,9 @@ HwmpProtocol::RequestRoute ( // packet from level 3 { if(packet->PeekPacketTag(tag)) + { NS_ASSERT (false); + } //Filling TAG: if(destination == Mac48Address::GetBroadcast ()) { diff --git a/src/devices/mesh/dot11s/ie-dot11s-peer-management.cc b/src/devices/mesh/dot11s/ie-dot11s-peer-management.cc index 8c0801c38..6e1e36b8e 100644 --- a/src/devices/mesh/dot11s/ie-dot11s-peer-management.cc +++ b/src/devices/mesh/dot11s/ie-dot11s-peer-management.cc @@ -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 @@ IePeerManagement::DeserializeInformation (Buffer::Iterator start, uint8_t length 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 (); diff --git a/src/devices/mesh/dot11s/peer-link.cc b/src/devices/mesh/dot11s/peer-link.cc index 8e75b09f9..53f51c9bc 100644 --- a/src/devices/mesh/dot11s/peer-link.cc +++ b/src/devices/mesh/dot11s/peer-link.cc @@ -196,7 +196,9 @@ PeerLink::OpenAccept (uint16_t localLinkId, IeConfiguration conf, Mac48Address 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 @@ PeerLink::OpenReject (uint16_t localLinkId, IeConfiguration conf, Mac48Address 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 @@ PeerLink::ConfirmAccept (uint16_t localLinkId, uint16_t peerLinkId, uint16_t pee 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 @@ PeerLink::ConfirmReject (uint16_t localLinkId, uint16_t peerLinkId, return; m_configuration = conf; if(m_peerMeshPointAddress != Mac48Address::GetBroadcast ()) + { NS_ASSERT(m_peerMeshPointAddress == peerMp); + } m_peerMeshPointAddress = peerMp; StateMachine (CNF_RJCT, reason); } diff --git a/src/devices/mesh/dot11s/peer-management-plugin.cc b/src/devices/mesh/dot11s/peer-management-plugin.cc index 261355a14..ed6aeb631 100644 --- a/src/devices/mesh/dot11s/peer-management-plugin.cc +++ b/src/devices/mesh/dot11s/peer-management-plugin.cc @@ -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 protocol) diff --git a/src/devices/mesh/dot11s/peer-management-protocol.cc b/src/devices/mesh/dot11s/peer-management-protocol.cc index e649cd168..a3fccf25f 100644 --- a/src/devices/mesh/dot11s/peer-management-protocol.cc +++ b/src/devices/mesh/dot11s/peer-management-protocol.cc @@ -293,7 +293,9 @@ PeerManagementProtocol::InitiateLink ( 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 ()); diff --git a/src/devices/mesh/mesh-point-device.cc b/src/devices/mesh/mesh-point-device.cc index af532c69a..28efcf1cb 100644 --- a/src/devices/mesh/mesh-point-device.cc +++ b/src/devices/mesh/mesh-point-device.cc @@ -82,7 +82,7 @@ MeshPointDevice::ReceiveFromDevice (Ptr incomingPort, PtrGetUid ()); const Mac48Address src48 = Mac48Address::ConvertFrom (src); const Mac48Address dst48 = Mac48Address::ConvertFrom (dst); - NS_LOG_DEBUG("SRC="< iface) 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 @@ MeshPointDevice::DoSend (bool success, Ptr packet, Mac48Address src, Mac 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