#include "wimax-mac-queue.h"
Classes | |
struct | QueueElement |
Public Member Functions | |
WimaxMacQueue (void) | |
WimaxMacQueue (uint32_t maxSize) | |
~WimaxMacQueue (void) | |
bool | CheckForFragmentation (MacHeaderType::HeaderType packetType) |
Fragmentation utilities. More... | |
Ptr< Packet > | Dequeue (MacHeaderType::HeaderType packetType) |
Dequeue a packet of type packetType from the queue. More... | |
Ptr< Packet > | Dequeue (MacHeaderType::HeaderType packetType, uint32_t availableByte) |
Dequeue a fragment of size availableByte from the queue. More... | |
bool | Enqueue (Ptr< Packet > packet, const MacHeaderType &hdrType, const GenericMacHeader &hdr) |
Enqueue a packet. More... | |
uint32_t | GetFirstPacketHdrSize (MacHeaderType::HeaderType packetType) |
uint32_t | GetFirstPacketPayloadSize (MacHeaderType::HeaderType packetType) |
uint32_t | GetFirstPacketRequiredByte (MacHeaderType::HeaderType packetType) |
uint32_t | GetMaxSize (void) const |
uint32_t | GetNBytes (void) const |
const WimaxMacQueue::PacketQueue & | GetPacketQueue (void) const |
uint32_t | GetQueueLengthWithMACOverhead (void) |
uint32_t | GetSize (void) const |
bool | IsEmpty (void) const |
bool | IsEmpty (MacHeaderType::HeaderType packetType) const |
Ptr< Packet > | Peek (GenericMacHeader &hdr) const |
Same as Dequeue but does not pop from queue. More... | |
Ptr< Packet > | Peek (GenericMacHeader &hdr, Time &timeStamp) const |
Ptr< Packet > | Peek (MacHeaderType::HeaderType packetType) const |
Two versions for SS without Generic MAC Header parameter, as SS's scheduler does not require to know the CID in Generic MAC Header. More... | |
Ptr< Packet > | Peek (MacHeaderType::HeaderType packetType, Time &timeStamp) const |
void | SetFragmentation (MacHeaderType::HeaderType packetType) |
void | SetFragmentNumber (MacHeaderType::HeaderType packetType) |
void | SetFragmentOffset (MacHeaderType::HeaderType packetType, uint32_t offset) |
void | SetMaxSize (uint32_t maxSize) |
set the maximum queue size More... | |
![]() | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Implement the GetInstanceTypeId method defined in ObjectBase. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized (void) const |
Check if the object has been initialized. More... | |
![]() | |
SimpleRefCount () | |
Constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
![]() | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
![]() | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static void | Cleanup (void) |
Noop. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Private Types | |
typedef std::deque< QueueElement > | PacketQueue |
Private Member Functions | |
WimaxMacQueue::QueueElement | Front (MacHeaderType::HeaderType packetType) const |
void | Pop (MacHeaderType::HeaderType packetType) |
Private Attributes | |
uint32_t | m_bytes |
uint32_t | m_maxSize |
uint32_t | m_nrDataPackets |
uint32_t | m_nrRequestPackets |
PacketQueue | m_queue |
TracedCallback< Ptr< const Packet > > | m_traceDequeue |
TracedCallback< Ptr< const Packet > > | m_traceDrop |
TracedCallback< Ptr< const Packet > > | m_traceEnqueue |
Additional Inherited Members | |
![]() | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoDispose (void) |
Destructor implementation. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
![]() | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
ns3::WimaxMacQueue is accessible through the following paths with Config::Set and Config::Connect:
Size of this type is 176 bytes (on a 64-bit architecture).
Definition at line 37 of file wimax-mac-queue.h.
|
private |
Definition at line 161 of file wimax-mac-queue.h.
ns3::WimaxMacQueue::WimaxMacQueue | ( | void | ) |
Definition at line 106 of file wimax-mac-queue.cc.
ns3::WimaxMacQueue::WimaxMacQueue | ( | uint32_t | maxSize | ) |
Definition at line 114 of file wimax-mac-queue.cc.
ns3::WimaxMacQueue::~WimaxMacQueue | ( | void | ) |
Definition at line 122 of file wimax-mac-queue.cc.
bool ns3::WimaxMacQueue::CheckForFragmentation | ( | MacHeaderType::HeaderType | packetType | ) |
Fragmentation utilities.
Definition at line 496 of file wimax-mac-queue.cc.
References ns3::MacHeaderType::GetType(), ns3::WimaxMacQueue::QueueElement::m_fragmentation, ns3::WimaxMacQueue::QueueElement::m_hdrType, m_queue, and NS_LOG_INFO.
Referenced by GetFirstPacketHdrSize(), GetFirstPacketPayloadSize(), and GetQueueLengthWithMACOverhead().
Ptr< Packet > ns3::WimaxMacQueue::Dequeue | ( | MacHeaderType::HeaderType | packetType | ) |
Dequeue a packet of type packetType from the queue.
packetType | the type of the packet |
Definition at line 168 of file wimax-mac-queue.cc.
References ns3::Packet::AddHeader(), ns3::Packet::CreateFragment(), Front(), ns3::GenericMacHeader::GetSerializedSize(), ns3::FragmentationSubheader::GetSerializedSize(), ns3::WimaxMacQueue::QueueElement::GetSize(), ns3::Packet::GetSize(), ns3::MacHeaderType::GetType(), ns3::GenericMacHeader::GetType(), ns3::MacHeaderType::HEADER_TYPE_GENERIC, IsEmpty(), m_bytes, ns3::WimaxMacQueue::QueueElement::m_fragmentation, ns3::WimaxMacQueue::QueueElement::m_fragmentNumber, ns3::WimaxMacQueue::QueueElement::m_fragmentOffset, ns3::WimaxMacQueue::QueueElement::m_hdr, ns3::WimaxMacQueue::QueueElement::m_hdrType, m_nrDataPackets, m_nrRequestPackets, ns3::WimaxMacQueue::QueueElement::m_packet, m_traceDequeue, NS_ASSERT_MSG, NS_LOG_INFO, Pop(), ns3::FragmentationSubheader::SetFc(), ns3::FragmentationSubheader::SetFsn(), ns3::GenericMacHeader::SetLen(), and ns3::GenericMacHeader::SetType().
Ptr< Packet > ns3::WimaxMacQueue::Dequeue | ( | MacHeaderType::HeaderType | packetType, |
uint32_t | availableByte | ||
) |
Dequeue a fragment of size availableByte from the queue.
packetType | the type of the packet |
availableByte | the size of the fragment |
Definition at line 261 of file wimax-mac-queue.cc.
References ns3::Packet::Copy(), ns3::Packet::CreateFragment(), Front(), ns3::MacHeaderType::GetSerializedSize(), ns3::GenericMacHeader::GetSerializedSize(), ns3::FragmentationSubheader::GetSerializedSize(), ns3::Packet::GetSize(), ns3::MacHeaderType::GetType(), ns3::GenericMacHeader::GetType(), ns3::MacHeaderType::HEADER_TYPE_GENERIC, IsEmpty(), m_bytes, ns3::WimaxMacQueue::QueueElement::m_fragmentation, ns3::WimaxMacQueue::QueueElement::m_fragmentNumber, ns3::WimaxMacQueue::QueueElement::m_fragmentOffset, ns3::WimaxMacQueue::QueueElement::m_hdr, ns3::WimaxMacQueue::QueueElement::m_hdrType, ns3::WimaxMacQueue::QueueElement::m_packet, m_traceDequeue, NS_LOG_INFO, ns3::FragmentationSubheader::SetFc(), SetFragmentation(), SetFragmentNumber(), SetFragmentOffset(), ns3::FragmentationSubheader::SetFsn(), ns3::GenericMacHeader::SetLen(), and ns3::GenericMacHeader::SetType().
bool ns3::WimaxMacQueue::Enqueue | ( | Ptr< Packet > | packet, |
const MacHeaderType & | hdrType, | ||
const GenericMacHeader & | hdr | ||
) |
Enqueue a packet.
packet | the packet to enqueue |
hdrType | the mac header type of the packet |
hdr | the header of the packet |
Definition at line 139 of file wimax-mac-queue.cc.
References ns3::WimaxMacQueue::QueueElement::GetSize(), ns3::MacHeaderType::GetType(), ns3::MacHeaderType::HEADER_TYPE_GENERIC, m_bytes, m_maxSize, m_nrDataPackets, m_nrRequestPackets, m_queue, m_traceDrop, m_traceEnqueue, and ns3::Simulator::Now().
|
private |
Definition at line 434 of file wimax-mac-queue.cc.
References ns3::MacHeaderType::GetType(), ns3::WimaxMacQueue::QueueElement::m_hdrType, and m_queue.
Referenced by Dequeue(), and Peek().
uint32_t ns3::WimaxMacQueue::GetFirstPacketHdrSize | ( | MacHeaderType::HeaderType | packetType | ) |
Definition at line 519 of file wimax-mac-queue.cc.
References CheckForFragmentation(), ns3::MacHeaderType::GetSerializedSize(), ns3::GenericMacHeader::GetSerializedSize(), ns3::MacHeaderType::GetType(), ns3::MacHeaderType::HEADER_TYPE_GENERIC, ns3::WimaxMacQueue::QueueElement::m_hdr, ns3::WimaxMacQueue::QueueElement::m_hdrType, m_queue, and NS_LOG_INFO.
Referenced by GetFirstPacketRequiredByte().
uint32_t ns3::WimaxMacQueue::GetFirstPacketPayloadSize | ( | MacHeaderType::HeaderType | packetType | ) |
Definition at line 558 of file wimax-mac-queue.cc.
References CheckForFragmentation(), ns3::Packet::GetSize(), ns3::MacHeaderType::GetType(), ns3::WimaxMacQueue::QueueElement::m_fragmentOffset, ns3::WimaxMacQueue::QueueElement::m_hdrType, ns3::WimaxMacQueue::QueueElement::m_packet, m_queue, and NS_LOG_INFO.
Referenced by GetFirstPacketRequiredByte().
uint32_t ns3::WimaxMacQueue::GetFirstPacketRequiredByte | ( | MacHeaderType::HeaderType | packetType | ) |
Definition at line 589 of file wimax-mac-queue.cc.
References GetFirstPacketHdrSize(), GetFirstPacketPayloadSize(), and NS_LOG_INFO.
uint32_t ns3::WimaxMacQueue::GetMaxSize | ( | void | ) | const |
Definition at line 133 of file wimax-mac-queue.cc.
References m_maxSize.
Referenced by GetTypeId().
uint32_t ns3::WimaxMacQueue::GetNBytes | ( | void | ) | const |
Definition at line 415 of file wimax-mac-queue.cc.
References m_bytes.
Referenced by GetQueueLengthWithMACOverhead().
const WimaxMacQueue::PacketQueue & ns3::WimaxMacQueue::GetPacketQueue | ( | void | ) | const |
Definition at line 490 of file wimax-mac-queue.cc.
References m_queue.
uint32_t ns3::WimaxMacQueue::GetQueueLengthWithMACOverhead | ( | void | ) |
Definition at line 420 of file wimax-mac-queue.cc.
References CheckForFragmentation(), GetNBytes(), GetSize(), and ns3::MacHeaderType::HEADER_TYPE_GENERIC.
uint32_t ns3::WimaxMacQueue::GetSize | ( | void | ) | const |
Definition at line 409 of file wimax-mac-queue.cc.
References m_queue.
Referenced by GetQueueLengthWithMACOverhead().
|
static |
Definition at line 78 of file wimax-mac-queue.cc.
References GetMaxSize(), m_traceDequeue, m_traceDrop, m_traceEnqueue, ns3::MakeTraceSourceAccessor(), ns3::MakeUintegerAccessor(), SetMaxSize(), and ns3::TypeId::SetParent().
bool ns3::WimaxMacQueue::IsEmpty | ( | void | ) | const |
Definition at line 469 of file wimax-mac-queue.cc.
References m_queue.
Referenced by Dequeue(), and Peek().
bool ns3::WimaxMacQueue::IsEmpty | ( | MacHeaderType::HeaderType | packetType | ) | const |
Definition at line 475 of file wimax-mac-queue.cc.
References ns3::MacHeaderType::HEADER_TYPE_GENERIC, m_nrDataPackets, and m_nrRequestPackets.
Ptr< Packet > ns3::WimaxMacQueue::Peek | ( | GenericMacHeader & | hdr | ) | const |
Same as Dequeue but does not pop from queue.
Exclusive for BS. Two versions of Peek function (with Generic MAC Header as parameter) only for BS, as BS's scheduler needs to know the CID in Generic MAC Header.
Definition at line 330 of file wimax-mac-queue.cc.
References ns3::Packet::AddHeader(), ns3::Packet::Copy(), IsEmpty(), ns3::WimaxMacQueue::QueueElement::m_hdr, ns3::WimaxMacQueue::QueueElement::m_packet, and m_queue.
Ptr< Packet > ns3::WimaxMacQueue::Peek | ( | GenericMacHeader & | hdr, |
Time & | timeStamp | ||
) | const |
Definition at line 347 of file wimax-mac-queue.cc.
References ns3::Packet::AddHeader(), ns3::Packet::Copy(), IsEmpty(), ns3::WimaxMacQueue::QueueElement::m_hdr, ns3::WimaxMacQueue::QueueElement::m_packet, m_queue, and ns3::WimaxMacQueue::QueueElement::m_timeStamp.
Ptr< Packet > ns3::WimaxMacQueue::Peek | ( | MacHeaderType::HeaderType | packetType | ) | const |
Two versions for SS without Generic MAC Header parameter, as SS's scheduler does not require to know the CID in Generic MAC Header.
Definition at line 365 of file wimax-mac-queue.cc.
References ns3::Packet::AddHeader(), ns3::Packet::Copy(), Front(), ns3::MacHeaderType::GetType(), ns3::MacHeaderType::HEADER_TYPE_GENERIC, IsEmpty(), ns3::WimaxMacQueue::QueueElement::m_hdr, ns3::WimaxMacQueue::QueueElement::m_hdrType, and ns3::WimaxMacQueue::QueueElement::m_packet.
Ptr< Packet > ns3::WimaxMacQueue::Peek | ( | MacHeaderType::HeaderType | packetType, |
Time & | timeStamp | ||
) | const |
Definition at line 386 of file wimax-mac-queue.cc.
References ns3::Packet::AddHeader(), ns3::Packet::Copy(), Front(), ns3::MacHeaderType::GetType(), ns3::MacHeaderType::HEADER_TYPE_GENERIC, IsEmpty(), ns3::WimaxMacQueue::QueueElement::m_hdr, ns3::WimaxMacQueue::QueueElement::m_hdrType, ns3::WimaxMacQueue::QueueElement::m_packet, and ns3::WimaxMacQueue::QueueElement::m_timeStamp.
|
private |
Definition at line 452 of file wimax-mac-queue.cc.
References ns3::MacHeaderType::GetType(), ns3::WimaxMacQueue::QueueElement::m_hdrType, and m_queue.
Referenced by Dequeue().
void ns3::WimaxMacQueue::SetFragmentation | ( | MacHeaderType::HeaderType | packetType | ) |
Definition at line 602 of file wimax-mac-queue.cc.
References m_queue.
Referenced by Dequeue().
void ns3::WimaxMacQueue::SetFragmentNumber | ( | MacHeaderType::HeaderType | packetType | ) |
Definition at line 616 of file wimax-mac-queue.cc.
References m_queue.
Referenced by Dequeue().
void ns3::WimaxMacQueue::SetFragmentOffset | ( | MacHeaderType::HeaderType | packetType, |
uint32_t | offset | ||
) |
Definition at line 630 of file wimax-mac-queue.cc.
References m_queue.
Referenced by Dequeue().
void ns3::WimaxMacQueue::SetMaxSize | ( | uint32_t | maxSize | ) |
set the maximum queue size
maxSize | the max queue size |
Definition at line 127 of file wimax-mac-queue.cc.
References m_maxSize.
Referenced by GetTypeId().
|
private |
Definition at line 164 of file wimax-mac-queue.h.
Referenced by Dequeue(), Enqueue(), and GetNBytes().
|
private |
Definition at line 163 of file wimax-mac-queue.h.
Referenced by Enqueue(), GetMaxSize(), and SetMaxSize().
|
private |
Definition at line 165 of file wimax-mac-queue.h.
|
private |
Definition at line 166 of file wimax-mac-queue.h.
|
private |
Definition at line 162 of file wimax-mac-queue.h.
Referenced by CheckForFragmentation(), Enqueue(), Front(), GetFirstPacketHdrSize(), GetFirstPacketPayloadSize(), GetPacketQueue(), GetSize(), IsEmpty(), Peek(), Pop(), SetFragmentation(), SetFragmentNumber(), and SetFragmentOffset().
|
private |
Definition at line 169 of file wimax-mac-queue.h.
Referenced by Dequeue(), and GetTypeId().
|
private |
Definition at line 170 of file wimax-mac-queue.h.
Referenced by Enqueue(), and GetTypeId().
|
private |
Definition at line 168 of file wimax-mac-queue.h.
Referenced by Enqueue(), and GetTypeId().