|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
21 #include "ns3/llc-snap-header.h"
22 #include "ns3/channel.h"
23 #include "ns3/pointer.h"
26 #include "ns3/uinteger.h"
30 #include "ns3/ht-configuration.h"
31 #include "ns3/vht-configuration.h"
32 #include "ns3/he-configuration.h"
45 .AddConstructor<WifiNetDevice> ()
46 .SetGroupName (
"Wifi")
47 .AddAttribute (
"Mtu",
"The MAC-level Maximum Transmission Unit",
52 .AddAttribute (
"Channel",
"The channel attached to this device",
55 MakePointerChecker<Channel> ())
56 .AddAttribute (
"Phy",
"The PHY layer attached to this device.",
60 MakePointerChecker<WifiPhy> ())
61 .AddAttribute (
"Mac",
"The MAC layer attached to this device.",
65 MakePointerChecker<WifiMac> ())
66 .AddAttribute (
"RemoteStationManager",
"The station manager attached to this device.",
70 MakePointerChecker<WifiRemoteStationManager> ())
71 .AddAttribute (
"HtConfiguration",
72 "The HtConfiguration object.",
75 MakePointerChecker<HtConfiguration> ())
76 .AddAttribute (
"VhtConfiguration",
77 "The VhtConfiguration object.",
80 MakePointerChecker<VhtConfiguration> ())
81 .AddAttribute (
"HeConfiguration",
82 "The HeConfiguration object.",
85 MakePointerChecker<HeConfiguration> ())
91 : m_configComplete (false)
149 m_mac->Initialize ();
245 return m_mac->GetAddress ();
330 m_mac->NotifyTx (packet);
331 m_mac->Enqueue (packet, realTo);
374 else if (to ==
m_mac->GetAddress ())
386 m_mac->NotifyRx (packet);
397 m_mac->NotifyPromiscRx (copy);
430 m_mac->NotifyTx (packet);
431 m_mac->Enqueue (packet, realTo, realFrom);
440 m_mac->SetPromisc ();
446 return m_mac->SupportsSendFrom ();
a unique identifier for an interface.
@ PACKET_BROADCAST
Packet addressed to all.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void Dispose(void)
Dispose of this Object.
void DoInitialize(void) override
Initialize() implementation.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
bool SupportsSendFrom(void) const override
uint32_t m_ifIndex
IF index.
static Mac48Address GetMulticast(Ipv4Address address)
Ptr< HtConfiguration > GetHtConfiguration(void) const
void CompleteConfig(void)
Complete the configuration of this Wi-Fi device by connecting all lower components (e....
void AddLinkChangeCallback(Callback< void > callback) override
static bool IsMatchingType(const Address &address)
void AddHeader(const Header &header)
Add header to this packet.
bool m_configComplete
configuration complete
Ptr< WifiPhy > GetPhy(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetMac(const Ptr< WifiMac > mac)
void LinkDown(void)
Set that the link is down (i.e.
bool IsNull(void) const
Check for null implementation.
virtual Ptr< Channel > GetChannel(void) const =0
Return the Channel this WifiPhy is connected to.
void ConnectWithoutContext(const CallbackBase &callback)
Append a Callback to the chain (without a context).
Ptr< Node > m_node
the node
bool NeedsArp(void) const override
void SetHeConfiguration(Ptr< HeConfiguration > heConfiguration)
void SetVhtConfiguration(Ptr< VhtConfiguration > vhtConfiguration)
Ptr< WifiPhy > m_phy
the phy
void SetNode(const Ptr< Node > node) override
Ipv4 addresses are stored in host order in this class.
Describes an IPv6 address.
@ PACKET_HOST
Packet addressed oo us.
Hold objects of type Ptr<T>.
bool IsPointToPoint(void) const override
Return true if the net device is on a point-to-point link.
Address GetAddress(void) const override
static const uint16_t MAX_MSDU_SIZE
This value conforms to the 802.11 specification.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
NetDevice::ReceiveCallback m_forwardUp
forward up callback
Ptr< VhtConfiguration > m_vhtConfiguration
the VhtConfiguration
Ptr< HeConfiguration > GetHeConfiguration(void) const
void SetHtConfiguration(Ptr< HtConfiguration > htConfiguration)
Smart pointer class similar to boost::intrusive_ptr.
static TypeId GetTypeId(void)
Get the type ID.
static Mac48Address GetBroadcast(void)
bool IsBridge(void) const override
Return true if the net device is acting as a bridge.
void SetPromiscReceiveCallback(PromiscReceiveCallback cb) override
Address GetMulticast(Ipv4Address multicastGroup) const override
Make and return a MAC multicast address using the provided multicast group.
@ PACKET_OTHERHOST
Packet addressed to someone else.
bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber) override
Ptr< HtConfiguration > m_htConfiguration
the HtConfiguration
a polymophic address class
static Mac48Address ConvertFrom(const Address &address)
Ptr< VhtConfiguration > GetVhtConfiguration(void) const
bool IsBroadcast(void) const
void ForwardUp(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Receive a packet from the lower layer and pass the packet up the stack.
Ptr< Node > GetNode(void) const override
void LinkUp(void)
Set that the link is up.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
void DoDispose(void) override
Destructor implementation.
Ptr< WifiRemoteStationManager > GetRemoteStationManager(void) const
bool IsMulticast(void) const override
bool IsLinkUp(void) const override
virtual void SetupPhy(const Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
virtual void DoInitialize(void)
Initialize() implementation.
Ptr< WifiRemoteStationManager > m_stationManager
the station manager
uint16_t GetMtu(void) const override
void SetAddress(Address address) override
Set the address of this interface.
NetDevice::PromiscReceiveCallback m_promiscRx
promiscuous receive callback
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...
uint32_t GetIfIndex(void) const override
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
TracedCallback m_linkChanges
link change callback
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
void SetRemoteStationManager(const Ptr< WifiRemoteStationManager > manager)
bool IsBroadcast(void) const override
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
PacketType
Packet types are used as they are in Linux.
Hold an unsigned integer type.
static const uint16_t LLC_SNAP_HEADER_LENGTH
The length in octects of the LLC/SNAP header.
bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber) override
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
Ptr< HeConfiguration > m_heConfiguration
the HeConfiguration
Address GetBroadcast(void) const override
virtual void SetupMac(const Ptr< WifiMac > mac)
Set up MAC associated with this device since it is the object that knows the full set of timing param...
void SetIfIndex(const uint32_t index) override
virtual void DoDispose(void)
Destructor implementation.
void SetPhy(const Ptr< WifiPhy > phy)
void SetReceiveCallback(NetDevice::ReceiveCallback cb) override
Network layer to device interface.
Ptr< WifiMac > m_mac
the MAC
bool SetMtu(const uint16_t mtu) override
Ptr< WifiMac > GetMac(void) const
Ptr< Channel > GetChannel(void) const override
@ PACKET_MULTICAST
Packet addressed to multicast group.