#include <mac-rx-middle.h>
Public Types | |
typedef Callback< void, Ptr < Packet >, const WifiMacHeader * > | ForwardUpCallback |
Public Member Functions | |
MacRxMiddle () | |
~MacRxMiddle () | |
void | Receive (Ptr< Packet > packet, const WifiMacHeader *hdr) |
void | SetForwardCallback (ForwardUpCallback callback) |
Private Types | |
typedef std::map< Mac48Address, OriginatorRxStatus *, std::less< Mac48Address > > | Originators |
typedef std::map< Mac48Address, OriginatorRxStatus *, std::less< Mac48Address > >::iterator | OriginatorsI |
typedef std::map< std::pair < Mac48Address, uint8_t > , OriginatorRxStatus *, std::less< std::pair < Mac48Address, uint8_t > > > | QosOriginators |
typedef std::map< std::pair < Mac48Address, uint8_t > , OriginatorRxStatus *, std::less< std::pair < Mac48Address, uint8_t > > >::iterator | QosOriginatorsI |
Private Member Functions | |
Ptr< Packet > | HandleFragments (Ptr< Packet > packet, const WifiMacHeader *hdr, OriginatorRxStatus *originator) |
bool | IsDuplicate (const WifiMacHeader *hdr, OriginatorRxStatus *originator) const |
OriginatorRxStatus * | Lookup (const WifiMacHeader *hdr) |
Private Attributes | |
ForwardUpCallback | m_callback |
Originators | m_originatorStatus |
QosOriginators | m_qosOriginatorStatus |
Friends | |
class | MacRxMiddleTest |
This class handles duplicate detection and recomposition of fragments.
Definition at line 40 of file mac-rx-middle.h.
typedef Callback<void, Ptr<Packet>, const WifiMacHeader*> ns3::MacRxMiddle::ForwardUpCallback |
Definition at line 43 of file mac-rx-middle.h.
|
private |
Definition at line 58 of file mac-rx-middle.h.
|
private |
Definition at line 60 of file mac-rx-middle.h.
|
private |
Definition at line 59 of file mac-rx-middle.h.
|
private |
Definition at line 61 of file mac-rx-middle.h.
ns3::MacRxMiddle::MacRxMiddle | ( | ) |
Definition at line 108 of file mac-rx-middle.cc.
References NS_LOG_FUNCTION_NOARGS.
ns3::MacRxMiddle::~MacRxMiddle | ( | ) |
Definition at line 113 of file mac-rx-middle.cc.
References m_originatorStatus, m_qosOriginatorStatus, and NS_LOG_FUNCTION_NOARGS.
|
private |
Definition at line 187 of file mac-rx-middle.cc.
References ns3::OriginatorRxStatus::AccumulateFirstFragment(), ns3::OriginatorRxStatus::AccumulateFragment(), ns3::OriginatorRxStatus::AccumulateLastFragment(), ns3::WifiMacHeader::GetFragmentNumber(), ns3::WifiMacHeader::GetSequenceControl(), ns3::WifiMacHeader::GetSequenceNumber(), ns3::WifiMacHeader::GetSize(), ns3::Packet::GetSize(), ns3::OriginatorRxStatus::IsDeFragmenting(), ns3::WifiMacHeader::IsMoreFragments(), ns3::OriginatorRxStatus::IsNextFragment(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::OriginatorRxStatus::SetSequenceControl().
Referenced by Receive().
|
private |
Definition at line 174 of file mac-rx-middle.cc.
References ns3::OriginatorRxStatus::GetLastSequenceControl(), ns3::WifiMacHeader::GetSequenceControl(), ns3::WifiMacHeader::IsRetry(), and NS_LOG_FUNCTION.
Referenced by Receive().
|
private |
Definition at line 140 of file mac-rx-middle.cc.
References ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::GetQosTid(), ns3::Mac48Address::IsGroup(), ns3::WifiMacHeader::IsQosData(), m_originatorStatus, m_qosOriginatorStatus, and NS_LOG_FUNCTION.
Referenced by Receive().
void ns3::MacRxMiddle::Receive | ( | Ptr< Packet > | packet, |
const WifiMacHeader * | hdr | ||
) |
The check below is really uneeded because it can fail in a lot of normal cases. Specifically, it is possible for sequence numbers to loop back to zero once they reach 0xfff0 and to go up to 0xf7f0 in which case the check below will report the two sequence numbers to not have the correct order relationship. So, this check cannot be used to discard old duplicate frames. It is thus here only for documentation purposes.
Definition at line 246 of file mac-rx-middle.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::GetFragmentNumber(), ns3::WifiMacHeader::GetSequenceControl(), ns3::WifiMacHeader::GetSequenceNumber(), HandleFragments(), ns3::WifiMacHeader::IsData(), IsDuplicate(), ns3::Mac48Address::IsGroup(), ns3::WifiMacHeader::IsMgt(), Lookup(), m_callback, NS_ASSERT, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ns3::RegularWifiMac::RegularWifiMac().
void ns3::MacRxMiddle::SetForwardCallback | ( | ForwardUpCallback | callback | ) |
Definition at line 133 of file mac-rx-middle.cc.
References m_callback, and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::RegularWifiMac::RegularWifiMac().
|
friend |
Definition at line 52 of file mac-rx-middle.h.
|
private |
Definition at line 64 of file mac-rx-middle.h.
Referenced by Receive(), and SetForwardCallback().
|
private |
Definition at line 62 of file mac-rx-middle.h.
Referenced by Lookup(), and ~MacRxMiddle().
|
private |
Definition at line 63 of file mac-rx-middle.h.
Referenced by Lookup(), and ~MacRxMiddle().