Added {} in 'if' where ASSERT exists
This commit is contained in:
@@ -57,7 +57,9 @@ HwmpMacPlugin::Receive (Ptr<Packet> 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> 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());
|
||||
|
||||
@@ -186,7 +186,9 @@ HwmpProtocol::RequestRoute (
|
||||
// packet from level 3
|
||||
{
|
||||
if(packet->PeekPacketTag(tag))
|
||||
{
|
||||
NS_ASSERT (false);
|
||||
}
|
||||
//Filling TAG:
|
||||
if(destination == Mac48Address::GetBroadcast ())
|
||||
{
|
||||
|
||||
@@ -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 ();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 ());
|
||||
|
||||
@@ -82,7 +82,7 @@ MeshPointDevice::ReceiveFromDevice (Ptr<NetDevice> incomingPort, Ptr<const Packe
|
||||
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 @@ MeshPointDevice::AddInterface (Ptr<NetDevice> 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> 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
|
||||
|
||||
Reference in New Issue
Block a user