24 #include "ns3/assert.h"
26 #include "ns3/packet.h"
27 #include "ns3/simulator.h"
28 #include "ns3/sequence-number.h"
50 typedef std::list<Ptr<const Packet> >::const_iterator
FragmentsCI;
254 ", size=" << packet->
GetSize ());
288 ", size=" << packet->
GetSize ());
317 NS_LOG_DEBUG (
"Sequence numbers have looped back. last recorded=" << originator->GetLastSequenceControl () <<
uint16_t GetLastSequenceControl(void)
Return the last sequence control we received.
#define NS_LOG_FUNCTION(parameters)
void AccumulateFirstFragment(Ptr< const Packet > packet)
We have received a first fragmented packet.
uint16_t m_lastSequenceControl
void SetForwardCallback(ForwardUpCallback callback)
Set a callback to forward the packet up.
#define NS_ASSERT(condition)
uint32_t GetSize(void) const
std::map< std::pair< Mac48Address, uint8_t >, OriginatorRxStatus *, std::less< std::pair< Mac48Address, uint8_t > > >::iterator QosOriginatorsI
typedef for an interator for QosOriginators
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
Ptr< Packet > HandleFragments(Ptr< Packet > packet, const WifiMacHeader *hdr, OriginatorRxStatus *originator)
Check if the received packet is a fragment and handle it appropriately.
std::map< Mac48Address, OriginatorRxStatus *, std::less< Mac48Address > >::iterator OriginatorsI
typedef for an interator for Originators
void AccumulateFragment(Ptr< const Packet > packet)
We received a fragmented packet (not first and not last).
void AddAtEnd(Ptr< const Packet > packet)
Concatenate the input packet at the end of the current packet.
OriginatorRxStatus * Lookup(const WifiMacHeader *hdr)
Look up for OriginatorRxStatus associated with the sender address (by looking at ADDR2 field in the h...
Originators m_originatorStatus
bool IsNextFragment(uint16_t sequenceControl)
Check if the sequence control (i.e.
bool IsDuplicate(const WifiMacHeader *hdr, OriginatorRxStatus *originator) const
Check if we have already received the packet from the sender before (by looking at the sequence contr...
Generic "sequence number" class.
Ptr< Packet > AccumulateLastFragment(Ptr< const Packet > packet)
We have received a last fragment of the fragmented packets (indicated by the no more fragment field)...
void SetSequenceControl(uint16_t sequenceControl)
Set the last sequence control we received.
bool IsDeFragmenting(void)
Check if we are de-fragmenting packets.
std::list< Ptr< const Packet > > Fragments
typedef for a list of fragments (i.e.
ForwardUpCallback m_callback
#define NS_LOG_DEBUG(msg)
std::list< Ptr< const Packet > >::const_iterator FragmentsCI
typedef for a const iterator for Fragments
A class to keep track of the packet originator status.
NS_LOG_COMPONENT_DEFINE("MacRxMiddle")
QosOriginators m_qosOriginatorStatus