23 #include "ns3/llc-snap-header.h"
24 #include "ns3/simulator.h"
25 #include "ns3/callback.h"
27 #include "ns3/packet.h"
30 #include "ns3/packet-burst.h"
34 #include "ns3/uinteger.h"
35 #include "ns3/trace-source-accessor.h"
36 #include "ns3/pointer.h"
57 TypeId (
"ns3::WimaxNetDevice")
61 .AddAttribute (
"Mtu",
"The MAC-level Maximum Transmission Unit",
68 "The PHY layer attached to this device.",
71 MakePointerChecker<WimaxPhy> ())
73 .AddAttribute (
"Channel",
74 "The channel attached to this device.",
77 MakePointerChecker<WimaxChannel> ())
80 "receive/transmit transition gap.",
83 MakeUintegerChecker<uint16_t> (0, 120))
86 "transmit/receive transition gap.",
89 MakeUintegerChecker<uint16_t> (0, 120))
91 .AddAttribute (
"ConnectionManager",
92 "The connection manager attached to this device.",
96 MakePointerChecker<ConnectionManager> ())
98 .AddAttribute (
"BurstProfileManager",
99 "The burst profile manager attached to this device.",
103 MakePointerChecker<BurstProfileManager> ())
105 .AddAttribute (
"BandwidthManager",
106 "The bandwidth manager attached to this device.",
110 MakePointerChecker<BandwidthManager> ())
112 .AddAttribute (
"InitialRangingConnection",
113 "Initial ranging connection",
116 MakePointerChecker<WimaxConnection> ())
118 .AddAttribute (
"BroadcastConnection",
119 "Broadcast connection",
122 MakePointerChecker<WimaxConnection> ())
301 llcHdr.
SetType (protocolNumber);
351 m_phy->Attach (channel);
371 m_phy->Attach (channel);
526 return m_phy->GetChannel ();
543 llcHdr.
SetType (protocolNumber);
547 return DoSend (packet, from, to, protocolNumber);
578 m_phy->Send (params);
592 uint64_t frequency = 5000;
594 for (uint8_t i = 0; i < 200; i++)
642 NS_FATAL_ERROR (
"Not implemented-- please implement and contribute a patch");
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
void SetRtg(uint16_t rtg)
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
uint16_t GetRtg(void) const
NetDevice::PromiscReceiveCallback m_promiscRx
virtual bool DoSend(Ptr< Packet > packet, const Mac48Address &source, const Mac48Address &dest, uint16_t protocolNumber)=0
virtual ~WimaxNetDevice(void)
bool IsNull(void) const
Check for null implementation.
Ptr< WimaxConnection > m_broadcastConnection
void ForwardUp(Ptr< Packet > packet, const Mac48Address &source, const Mac48Address &dest)
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
Ptr< BurstProfileManager > m_burstProfileManager
Callback< void > m_linkChange
Dcd GetCurrentDcd(void) const
Ptr< WimaxConnection > GetBroadcastConnection(void) const
void Receive(Ptr< const PacketBurst > burst)
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
Ptr< ConnectionManager > GetConnectionManager(void) const
#define NS_FATAL_ERROR(msg)
fatal error handling
a polymophic address class
static const uint16_t DEFAULT_MSDU_SIZE
virtual bool IsMulticast(void) const
uint32_t GetNrFrames(void) const
virtual Ptr< Channel > GetChannel(void) const
TracedCallback< Ptr< const Packet >, const Mac48Address & > m_traceTx
virtual bool SetMtu(const uint16_t mtu)
static TypeId GetTypeId(void)
virtual Address GetMulticast(void) const
uint16_t GetTtg(void) const
void SetCurrentDcd(Dcd dcd)
static Mac48Address GetMulticast(Ipv4Address address)
The SendParams class defines the parameters with which Send() function of a particular PHY is called...
void SetTtg(uint16_t ttg)
static Cid Broadcast(void)
Ptr< ConnectionManager > m_connectionManager
static Cid InitialRanging(void)
Hold an unsigned integer type.
Ptr< WimaxConnection > m_initialRangingConnection
virtual void SetIfIndex(const uint32_t index)
Doxygen introspection did not find any typical Config paths.
std::vector< uint64_t > m_dlChannels
virtual Ptr< WimaxChannel > DoGetChannel(void) const
virtual Address GetBroadcast(void) const
static Mac48Address GetBroadcast(void)
Ptr< WimaxConnection > GetInitialRangingConnection(void) const
Ptr< BandwidthManager > GetBandwidthManager(void) const
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
static uint32_t m_nrFrames
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
virtual void SetConnectionManager(Ptr< ConnectionManager > connectionManager)
Doxygen introspection did not find any typical Config paths.
Mac48Address GetMacAddress(void) const
#define NS_LOG_LOGIC(msg)
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
static Mac48Address ConvertFrom(const Address &address)
virtual uint32_t GetIfIndex(void) const
virtual Ptr< Node > GetNode(void) const
NS_LOG_COMPONENT_DEFINE("WimaxNetDevice")
void SetBandwidthManager(Ptr< BandwidthManager > bandwidthManager)
virtual Address GetAddress(void) const
virtual void SetLinkChangeCallback(Callback< void > callback)
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
virtual bool IsBroadcast(void) const
void SetBurstProfileManager(Ptr< BurstProfileManager > burstProfileManager)
Ucd GetCurrentUcd(void) const
void SetMacAddress(Mac48Address address)
virtual void DoReceive(Ptr< Packet > packet)=0
void SetChannel(Ptr< WimaxChannel > wimaxChannel)
void SetPhy(Ptr< WimaxPhy > phy)
virtual bool IsLinkUp(void) const
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
void NotifyPromiscTrace(Ptr< Packet > p)
virtual bool SupportsSendFrom(void) const
Ptr< BurstProfileManager > GetBurstProfileManager(void) const
Describes an IPv6 address.
Ipv4 addresses are stored in host order in this class.
virtual void AddLinkChangeCallback(Callback< void > callback)
void SetNrFrames(uint32_t nrFrames)
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
Network layer to device interface.
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
void SetCurrentUcd(Ucd ucd)
virtual uint16_t GetMtu(void) const
void ForwardDown(Ptr< PacketBurst > burst, WimaxPhy::ModulationType modulationType)
Ptr< WimaxPhy > GetPhy(void) const
virtual Ptr< Channel > GetPhyChannel(void) const
#define NS_LOG_DEBUG(msg)
void CreateDefaultConnections(void)
NetDevice::ReceiveCallback m_forwardUp
virtual Address MakeMulticastAddress(Ipv4Address multicastGroup) const
void Attach(Ptr< WimaxChannel > channel)
void SetState(uint8_t state)
void InitializeChannels(void)
virtual std::string GetName(void) const
static const uint16_t MAX_MSDU_SIZE
virtual void SetName(const std::string name)
virtual void SetAddress(Address address)
Set the address of this interface.
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
virtual void SetNode(Ptr< Node > node)
virtual bool NeedsArp(void) const
Ptr< BandwidthManager > m_bandwidthManager
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
void SetReceiveCallback(void)
static Time m_frameStartTime
void AddHeader(const Header &header)
Add header to this packet.
uint8_t GetState(void) const
TracedCallback< Ptr< const Packet >, const Mac48Address & > m_traceRx
static uint8_t m_direction