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"
45 .AddConstructor<WifiNetDevice> ()
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 ();
190 return m_mac->GetAddress ();
262 m_mac->NotifyTx (packet);
263 m_mac->Enqueue (packet, realTo);
302 else if (to ==
m_mac->GetAddress ())
313 m_mac->NotifyRx (packet);
319 m_mac->NotifyPromiscRx (packet);
350 m_mac->NotifyTx (packet);
351 m_mac->Enqueue (packet, realTo, realFrom);
366 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.
Packet addressed to someone else.
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)
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
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)
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.
void ForwardUp(Ptr< Packet > packet, Mac48Address from, Mac48Address to)
Receive a packet from the lower layer and pass the packet up the stack.
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)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
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
TracedCallback m_linkChanges
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
virtual uint32_t GetIfIndex(void) const
static const uint16_t MAX_MSDU_SIZE
virtual void DoInitialize(void)
This method is called only once by Object::Initialize.
virtual bool NeedsArp(void) const
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
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)
Network layer to device interface.
virtual bool IsLinkUp(void) const
void Initialize(void)
This method calls the virtual DoInitialize method on all the objects aggregated to this object...
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.
PacketType
Packet types are used as they are in Linux.
void LinkDown(void)
Set that the link is down (i.e.
NS_LOG_COMPONENT_DEFINE("WifiNetDevice")
Packet addressed to multicast group.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
void Dispose(void)
Run the DoDispose methods of this object and all the objects aggregated to it.
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)
This method is called only once by Object::Initialize.
virtual void SetAddress(Address address)
Set the address of this interface.