25 #include "ns3/llc-snap-header.h"
26 #include "ns3/packet.h"
27 #include "ns3/uinteger.h"
28 #include "ns3/pointer.h"
30 #include "ns3/trace-source-accessor.h"
44 .AddConstructor<WifiNetDevice> ()
45 .SetGroupName (
"Wifi")
46 .AddAttribute (
"Mtu",
"The MAC-level Maximum Transmission Unit",
51 .AddAttribute (
"Channel",
"The channel attached to this device",
54 MakePointerChecker<WifiChannel> ())
55 .AddAttribute (
"Phy",
"The PHY layer attached to this device.",
59 MakePointerChecker<WifiPhy> ())
60 .AddAttribute (
"Mac",
"The MAC layer attached to this device.",
64 MakePointerChecker<WifiMac> ())
65 .AddAttribute (
"RemoteStationManager",
"The station manager attached to this device.",
69 MakePointerChecker<WifiRemoteStationManager> ())
75 : m_configComplete (false)
103 m_mac->Initialize ();
191 return m_mac->GetAddress ();
263 m_mac->NotifyTx (packet);
264 m_mac->Enqueue (packet, realTo);
303 else if (to ==
m_mac->GetAddress ())
314 m_mac->NotifyRx (packet);
320 m_mac->NotifyPromiscRx (packet);
351 m_mac->NotifyTx (packet);
352 m_mac->Enqueue (packet, realTo, realFrom);
367 return m_mac->SupportsSendFrom ();
virtual void SetNode(Ptr< Node > node)
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
static bool IsMatchingType(const Address &address)
virtual Ptr< WifiChannel > GetChannel(void) const =0
Return the WifiChannel this WifiPhy is connected to.
virtual bool SetMtu(const uint16_t mtu)
Smart pointer class similar to boost::intrusive_ptr.
void LinkUp(void)
Set that the link is up.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
virtual uint16_t GetMtu(void) const
virtual Address GetAddress(void) const
Ptr< WifiRemoteStationManager > m_stationManager
bool IsNull(void) const
Check for null implementation.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
PacketType
Packet types are used as they are in Linux.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
bool IsBroadcast(void) const
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
virtual void DoDispose(void)
Destructor implementation.
Packet addressed to multicast group.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
void ForwardUp(Ptr< Packet > packet, Mac48Address from, Mac48Address to)
Receive a packet from the lower layer and pass the packet up the stack.
virtual void SetupPhy(Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
virtual Ptr< Channel > GetChannel(void) const
virtual bool IsBroadcast(void) const
a polymophic address class
void SetMac(Ptr< WifiMac > mac)
virtual bool IsMulticast(void) const
Ptr< WifiPhy > GetPhy(void) const
virtual void DoDispose(void)
Destructor implementation.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Ptr< WifiRemoteStationManager > GetRemoteStationManager(void) const
static Mac48Address GetMulticast(Ipv4Address address)
void SetPhy(Ptr< WifiPhy > phy)
Hold an unsigned integer type.
Ptr< WifiChannel > DoGetChannel(void) const
Return the WifiChannel this device is connected to.
virtual bool SupportsSendFrom(void) const
static Mac48Address GetBroadcast(void)
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
void SetRemoteStationManager(Ptr< WifiRemoteStationManager > manager)
static Mac48Address ConvertFrom(const Address &address)
static const uint16_t LLC_SNAP_HEADER_LENGTH
The length in octects of the LLC/SNAP header.
virtual Ptr< Node > GetNode(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
TracedCallback m_linkChanges
Hold objects of type Ptr.
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
Packet addressed to someone else.
virtual uint32_t GetIfIndex(void) const
static const uint16_t MAX_MSDU_SIZE
virtual void DoInitialize(void)
Initialize() implementation.
virtual bool NeedsArp(void) const
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
virtual void SetupMac(Ptr< WifiMac > mac)
Set up MAC associated with this device since it is the object that knows the full set of timing param...
virtual Address GetBroadcast(void) const
Describes an IPv6 address.
Ipv4 addresses are stored in host order in this class.
virtual void SetIfIndex(const uint32_t index)
NetDevice::ReceiveCallback m_forwardUp
void ConnectWithoutContext(const CallbackBase &callback)
Append a Callback to the chain (without a context).
Network layer to device interface.
virtual bool IsLinkUp(void) const
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
virtual void AddLinkChangeCallback(Callback< void > callback)
void CompleteConfig(void)
Complete the configuration of this Wi-Fi device by connecting all lower components (e...
Ptr< WifiMac > GetMac(void) const
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
void LinkDown(void)
Set that the link is down (i.e.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
void Dispose(void)
Dispose of this Object.
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
static TypeId GetTypeId(void)
NetDevice::PromiscReceiveCallback m_promiscRx
void AddHeader(const Header &header)
Add header to this packet.
virtual void DoInitialize(void)
Initialize() implementation.
virtual void SetAddress(Address address)
Set the address of this interface.