22 #include "ns3/queue.h"
23 #include "ns3/simulator.h"
25 #include "ns3/boolean.h"
26 #include "ns3/uinteger.h"
27 #include "ns3/pointer.h"
28 #include "ns3/channel.h"
29 #include "ns3/trace-source-accessor.h"
32 #include "ns3/llc-snap-header.h"
65 .AddConstructor<AlohaNoackNetDevice> ()
66 .AddAttribute (
"Address",
67 "The MAC address of this device.",
70 MakeMac48AddressChecker ())
71 .AddAttribute (
"Queue",
72 "packets being transmitted get queued here",
75 MakePointerChecker<Queue> ())
76 .AddAttribute (
"Mtu",
"The Maximum Transmission Unit",
80 MakeUintegerChecker<uint16_t> (1,65535))
81 .AddAttribute (
"Phy",
"The PHY layer attached to this device.",
85 MakePointerChecker<Object> ())
86 .AddTraceSource (
"MacTx",
87 "Trace source indicating a packet has arrived for transmission by this device",
89 .AddTraceSource (
"MacTxDrop",
90 "Trace source indicating a packet has been dropped by the device before transmission",
92 .AddTraceSource (
"MacPromiscRx",
93 "A packet has been received by this device, has been passed up from the physical layer "
94 "and is being forwarded up the local protocol stack. This is a promiscuous trace,",
96 .AddTraceSource (
"MacRx",
97 "A packet has been received by this device, has been passed up from the physical layer "
98 "and is being forwarded up the local protocol stack. This is a non-promiscuous trace,",
359 NS_LOG_LOGIC (
"new packet is head of queue, starting TX immediately");
366 if (
m_queue->Enqueue (packet) ==
false)
377 if (
m_queue->Enqueue (packet) ==
false)
420 if (
m_queue->IsEmpty () ==
false)
uint32_t RemoveHeader(Header &header)
virtual void SetIfIndex(const uint32_t index)
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
void NotifyReceptionStart()
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
virtual Address GetMulticast(Ipv4Address addr) const
Make and return a MAC multicast address using the provided multicast group.
void SetGenericPhyTxStartCallback(GenericPhyTxStartCallback c)
virtual Address GetBroadcast(void) const
#define NS_ASSERT(condition)
TracedCallback< Ptr< const Packet > > m_macTxDropTrace
#define NS_LOG_COMPONENT_DEFINE(name)
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
TracedCallback< Ptr< const Packet > > m_macPromiscRxTrace
bool IsBroadcast(void) const
virtual void AddLinkChangeCallback(Callback< void > callback)
virtual void DoDispose(void)
TracedCallback m_linkChangeCallbacks
a polymophic address class
virtual Ptr< Node > GetNode(void) const
void NotifyReceptionEndOk(Ptr< Packet > p)
GenericPhyTxStartCallback m_phyMacTxStartCallback
static Mac48Address GetMulticast(Ipv4Address address)
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
Hold an unsigned integer type.
NS_OBJECT_ENSURE_REGISTERED(AntennaModel)
virtual uint16_t GetMtu(void) const
virtual bool IsBroadcast(void) const
void NotifyTransmissionEnd(Ptr< const Packet >)
virtual bool SetMtu(const uint16_t mtu)
#define NS_LOG_LOGIC(msg)
static Mac48Address ConvertFrom(const Address &address)
virtual void DoDispose(void)
TracedCallback< Ptr< const Packet > > m_macRxTrace
std::ostream & operator<<(std::ostream &os, const Angles &a)
Ptr< Packet > Copy(void) const
virtual bool IsLinkUp(void) const
hold objects of type Ptr<T>
virtual bool SupportsSendFrom(void) const
TracedCallback< Ptr< const Packet > > m_macTxTrace
void SetChannel(Ptr< Channel > c)
static TypeId GetTypeId(void)
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
virtual bool NeedsArp(void) const
Ptr< Object > GetPhy() const
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
virtual void SetQueue(Ptr< Queue > queue)
virtual bool IsMulticast(void) const
NetDevice::PromiscReceiveCallback m_promiscRxCallback
#define NS_ASSERT_MSG(condition, message)
void NotifyReceptionEndError()
Describes an IPv6 address.
Ipv4 addresses are stored in host order in this class.
Ptr< Packet > m_currentPkt
void ConnectWithoutContext(const CallbackBase &callback)
Network layer to device interface.
hold objects of type ns3::Mac48Address
void SetPhy(Ptr< Object > phy)
virtual ~AlohaNoackNetDevice()
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
a unique identifier for an interface.
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
virtual uint32_t GetIfIndex(void) const
TypeId SetParent(TypeId tid)
virtual void SetNode(Ptr< Node > node)
NetDevice::ReceiveCallback m_rxCallback
void AddHeader(const Header &header)
virtual Ptr< Channel > GetChannel(void) const
virtual Address GetAddress(void) const
virtual void SetAddress(Address address)