|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
23 #ifndef LR_WPAN_NET_DEVICE_H
24 #define LR_WPAN_NET_DEVICE_H
26 #include <ns3/net-device.h>
27 #include <ns3/traced-callback.h>
28 #include <ns3/lr-wpan-mac.h>
34 class SpectrumChannel;
124 virtual void SetIfIndex (
const uint32_t index);
137 virtual bool SetMtu (
const uint16_t mtu);
138 virtual uint16_t
GetMtu (
void)
const;
a unique identifier for an interface.
virtual uint32_t GetIfIndex(void) const
@ RFC4944
YYYY:0000:XXXX (with U/L bit set to local)
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
virtual bool NeedsArp(void) const
bool m_useAcks
Configure the NetDevice to request MAC layer acknowledgments when sending packets using the Send() AP...
virtual void DoDispose(void)
Destructor implementation.
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
Ptr< SpectrumChannel > DoGetChannel(void) const
Attribute accessor method for the "Channel" attribute.
ReceiveCallback m_receiveCallback
Upper layer callback used for notification of new data packet arrivals.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetPhy(Ptr< LrWpanPhy > phy)
Set the PHY to be used by the MAC and this NetDevice.
PseudoMacAddressMode_e m_pseudoMacMode
How the pseudo MAC address is created.
void CompleteConfig(void)
Configure PHY, MAC and CSMA/CA.
This class can contain 16 bit addresses.
Mac48Address BuildPseudoMacAddress(uint16_t panId, Mac16Address shortAddr) const
Builds a "pseudo 48-bit address" from the PanId and Short Address The form is PanId : 0x0 : 0x0 : Sho...
void SetMac(Ptr< LrWpanMac > mac)
Set the MAC to be used by this NetDevice.
PseudoMacAddressMode_e
How the pseudo-MAC address is built from the short address (XXXX) and the PanId (YYYY).
Ipv4 addresses are stored in host order in this class.
Describes an IPv6 address.
virtual Address GetAddress(void) const
This method indirects to LrWpanMac::SetShortAddress ()
Ptr< LrWpanCsmaCa > GetCsmaCa(void) const
Get the CSMA/CA implementation used by this NetDevice.
virtual void SetIfIndex(const uint32_t index)
Ptr< LrWpanMac > m_mac
The MAC for this NetDevice.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
virtual bool IsLinkUp(void) const
Smart pointer class similar to boost::intrusive_ptr.
static TypeId GetTypeId(void)
Get the type ID.
virtual bool IsBroadcast(void) const
a polymophic address class
Callback< bool, Ptr< NetDevice >, Ptr< const Packet >, uint16_t, const Address & > ReceiveCallback
uint32_t m_ifIndex
The interface index of this NetDevice.
virtual void SetNode(Ptr< Node > node)
Callback< bool, Ptr< NetDevice >, Ptr< const Packet >, uint16_t, const Address &, const Address &, enum PacketType > PromiscReceiveCallback
Ptr< LrWpanPhy > GetPhy(void) const
Get the PHY used by this NetDevice.
virtual void DoInitialize(void)
Initialize() implementation.
bool m_configComplete
True if MAC, PHY and CSMA/CA where successfully configured and the NetDevice is ready for being used.
void LinkUp(void)
Mark NetDevice link as up.
virtual bool IsMulticast(void) const
virtual Address GetBroadcast(void) const
void LinkDown(void)
Mark NetDevice link as down.
virtual bool SetMtu(const uint16_t mtu)
void SetChannel(Ptr< SpectrumChannel > channel)
Set the channel to which the NetDevice, and therefore the PHY, should be attached to.
Ptr< Node > m_node
The node associated with this NetDevice.
bool m_linkUp
Is the link/device currently up and running?
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
virtual ~LrWpanNetDevice(void)
MCPS-DATA.indication params.
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
Network layer to device interface.
void McpsDataIndication(McpsDataIndicationParams params, Ptr< Packet > pkt)
The callback used by the MAC to hand over incoming packets to the NetDevice.
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
TracedCallback m_linkChanges
Trace source for link up/down changes.
Forward calls to a chain of Callback.
virtual void SetAddress(Address address)
This method indirects to LrWpanMac::SetShortAddress ()
virtual Ptr< Channel > GetChannel(void) const
Ptr< LrWpanMac > GetMac(void) const
Get the MAC used by this NetDevice.
virtual bool SupportsSendFrom(void) const
virtual void AddLinkChangeCallback(Callback< void > callback)
Ptr< LrWpanCsmaCa > m_csmaca
The CSMA/CA implementation for this NetDevice.
void SetCsmaCa(Ptr< LrWpanCsmaCa > csmaca)
Set the CSMA/CA implementation to be used by the MAC and this NetDevice.
virtual uint16_t GetMtu(void) const
virtual Ptr< Node > GetNode(void) const
Network layer to device interface.
Ptr< LrWpanPhy > m_phy
The PHY for this NetDevice.
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)