Filtering outgoing frames if peer link does not exist. Fixed order of going
through plugins
This commit is contained in:
@@ -131,7 +131,8 @@ bool
|
||||
HwmpMacPlugin::UpdateOutcomingFrame (Ptr<Packet> packet, WifiMacHeader & header, Mac48Address from, Mac48Address to) const
|
||||
{
|
||||
//TODO: add a mesh header and remove a TAG
|
||||
NS_ASSERT(header.IsData ());
|
||||
if(!header.IsData ())
|
||||
return true;
|
||||
HwmpTag tag;
|
||||
bool tagExists = packet->RemovePacketTag(tag);
|
||||
NS_ASSERT (tagExists);
|
||||
|
||||
@@ -133,8 +133,14 @@ PeerManagerMacPlugin::Receive (Ptr<Packet> const_packet, const WifiMacHeader & h
|
||||
bool
|
||||
PeerManagerMacPlugin::UpdateOutcomingFrame (Ptr<Packet> packet, WifiMacHeader & header, Mac48Address from, Mac48Address to) const
|
||||
{
|
||||
if(header.IsData ())
|
||||
return true;
|
||||
if(header.IsAction ())
|
||||
{
|
||||
WifiMeshActionHeader actionHdr;
|
||||
packet->PeekHeader (actionHdr);
|
||||
WifiMeshActionHeader::ActionValue actionValue = actionHdr.GetAction ();
|
||||
if(actionHdr.GetCategory () == WifiMeshActionHeader::MESH_PEER_LINK_MGT)
|
||||
return true;
|
||||
}
|
||||
if(header.GetAddr1 ().IsGroup ())
|
||||
return true;
|
||||
else
|
||||
|
||||
@@ -388,7 +388,7 @@ MeshWifiInterfaceMac::ForwardDown (Ptr<const Packet> const_packet, Mac48Address
|
||||
hdr.SetAddr1 (Mac48Address ());
|
||||
|
||||
// Filter packet through all installed plugins
|
||||
for (PluginList::const_iterator i = m_plugins.begin(); i != m_plugins.end(); ++i)
|
||||
for (PluginList::const_iterator i = m_plugins.end()-1; i != m_plugins.begin()-1; i--)
|
||||
{
|
||||
bool drop = ! ((*i)->UpdateOutcomingFrame(packet, hdr, from, to));
|
||||
if (drop) return; // plugin drops frame
|
||||
@@ -416,7 +416,15 @@ MeshWifiInterfaceMac::ForwardDown (Ptr<const Packet> const_packet, Mac48Address
|
||||
void
|
||||
MeshWifiInterfaceMac::SendManagementFrame (Ptr<Packet> packet, const WifiMacHeader& hdr)
|
||||
{
|
||||
m_VO->Queue (packet, hdr);
|
||||
//Filter management frames:
|
||||
WifiMacHeader header = hdr;
|
||||
for (PluginList::const_iterator i = m_plugins.end()-1; i != m_plugins.begin()-1; i--)
|
||||
{
|
||||
bool drop = ! ((*i)->UpdateOutcomingFrame(packet, header, Mac48Address (), Mac48Address ()));
|
||||
if (drop) return; // plugin drops frame
|
||||
}
|
||||
|
||||
m_VO->Queue (packet, header);
|
||||
}
|
||||
|
||||
SupportedRates
|
||||
|
||||
Reference in New Issue
Block a user