|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
21 #include "ns3/trace-source-accessor.h"
22 #include "ns3/traced-callback.h"
23 #include "ns3/pointer.h"
25 #include "ns3/assert.h"
104 .SetGroupName (
"Uan")
105 .AddAttribute (
"Channel",
"The channel attached to this device.",
108 MakePointerChecker<UanChannel> ())
109 .AddAttribute (
"Phy",
"The PHY layer attached to this device.",
112 MakePointerChecker<UanPhy> ())
113 .AddAttribute (
"Mac",
"The MAC layer attached to this device.",
116 MakePointerChecker<UanMac> ())
117 .AddAttribute (
"Transducer",
"The Transducer attached to this device.",
121 MakePointerChecker<UanTransducer> ())
122 .AddTraceSource (
"Rx",
"Received payload from the MAC layer.",
124 "ns3::UanNetDevice::RxTxTracedCallback")
125 .AddTraceSource (
"Tx",
"Send payload to the MAC layer.",
127 "ns3::UanNetDevice::RxTxTracedCallback")
235 return m_mac->GetAddress ();
242 NS_LOG_WARN (
"UanNetDevice: MTU is not implemented");
268 return m_mac->GetBroadcast ();
281 return m_mac->GetBroadcast ();
287 return m_mac->GetBroadcast ();
308 return m_mac->Enqueue (packet, protocolNumber, udest);
413 m_phy->SetSleepMode (sleep);
419 m_mac->SetTxModeIndex (txModeIndex);
425 return m_mac->GetTxModeIndex ();
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual Ptr< Node > GetNode(void) const
uint32_t m_ifIndex
The interface index of this device.
A class used for addressing MAC8 MAC's.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
virtual bool SetMtu(const uint16_t mtu)
void SetMac(Ptr< UanMac > mac)
Set the MAC layer for this device.
virtual ~UanNetDevice()
Dummy destructor, DoDispose.
uint16_t m_mtu
The device MTU value, in bytes.
virtual void AddLinkChangeCallback(Callback< void > callback)
static Mac8Address ConvertFrom(const Address &address)
Convert a generic address to a Mac8Address.
virtual Address GetBroadcast(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void ConnectWithoutContext(const CallbackBase &callback)
Append a Callback to the chain (without a context).
Ptr< UanTransducer > GetTransducer(void) const
Get the transducer associated with this device.
TracedCallback m_linkChanges
Callback to invoke when the link state changes to UP.
Ptr< UanTransducer > m_trans
The Transducer attached to this device.
virtual void DoInitialize(void)
Initialize() implementation.
ReceiveCallback m_forwardUp
The receive callback.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
virtual uint32_t GetIfIndex(void) const
Ipv4 addresses are stored in host order in this class.
Describes an IPv6 address.
Ptr< UanChannel > DoGetChannel(void) const
Hold objects of type Ptr<T>.
virtual bool IsLinkUp(void) const
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
void SetChannel(Ptr< UanChannel > channel)
Attach a channel.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
virtual bool IsMulticast(void) const
virtual bool NeedsArp(void) const
virtual void DoDispose(void)
Destructor implementation.
Ptr< UanMac > GetMac(void) const
Get the MAC used by this device.
Smart pointer class similar to boost::intrusive_ptr.
void SetTxModeIndex(uint32_t txModeIndex)
Set the Tx mode index (Modulation type).
bool m_linkup
The link state, true if up.
Ptr< UanPhy > m_phy
The PHY layer attached to this device.
a polymophic address class
void SetPhy(Ptr< UanPhy > phy)
Set the Phy layer for this device.
void SetTransducer(Ptr< UanTransducer > trans)
Set the transdcuer used by this device.
#define NS_UNUSED(x)
Mark a local variable as unused.
bool m_cleared
Flag when we've been cleared.
virtual void ForwardUp(Ptr< Packet > pkt, uint16_t protocolNumber, const Mac8Address &src)
Forward the packet to a higher level, set with SetReceiveCallback.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
virtual void DoInitialize(void)
Initialize() implementation.
static TypeId GetTypeId(void)
Register this type.
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
virtual uint16_t GetMtu(void) const
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
UanNetDevice()
Default constructor.
TracedCallback< Ptr< const Packet >, Mac8Address > m_txLogger
Trace source triggered when sending to the MAC layer.
uint32_t GetTxModeIndex()
Get the Tx mode index (Modulation type).
virtual Address GetAddress(void) const
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
virtual void SetIfIndex(const uint32_t index)
void SetSleepMode(bool sleep)
Set the Phy SLEEP mode.
uint32_t CopyTo(uint8_t buffer[MAX_SIZE]) const
Copy the address bytes into a buffer.
Ptr< UanPhy > GetPhy(void) const
Get the Phy used by this device.
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
virtual void SetAddress(Address address)
Set the address of this interface.
TracedCallback< Ptr< const Packet >, Mac8Address > m_rxLogger
Trace source triggered when forwarding up received payload from the MAC layer.
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
Ptr< UanChannel > m_channel
The channel attached to this device.
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
virtual Ptr< Channel > GetChannel(void) const
virtual void SetNode(Ptr< Node > node)
Ptr< UanMac > m_mac
The MAC layer attached to this device.
Ptr< Node > m_node
The node hosting this device.
virtual bool IsBroadcast(void) const
virtual void DoDispose(void)
Destructor implementation.
void Clear(void)
Clear all pointer references.
Network layer to device interface.
virtual bool SupportsSendFrom(void) const
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)