|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
22 #include "ns3/simulator.h"
23 #include "ns3/channel.h"
25 #include "ns3/packet.h"
38 .SetGroupName (
"Internet")
57 NS_LOG_FUNCTION (packet <<
" " << protocol <<
" " << to <<
" " << from);
192 NS_LOG_FUNCTION (packet <<
" " << source <<
" " << dest <<
" " << protocolNumber);
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
virtual bool SupportsSendFrom(void) const
static Mac48Address GetMulticast(Ipv4Address address)
static void ScheduleWithContext(uint32_t context, Time const &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
virtual bool NeedsArp(void) const
virtual void SetIfIndex(const uint32_t index)
uint32_t GetId(void) const
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual bool IsMulticast(void) const
bool IsNull(void) const
Check for null implementation.
virtual void DoDispose(void)
Destructor implementation.
Ipv4 addresses are stored in host order in this class.
Describes an IPv6 address.
@ PACKET_HOST
Packet addressed oo us.
virtual Ptr< Node > GetNode(void) const
virtual void SetNode(Ptr< Node > node)
virtual Ptr< Channel > GetChannel(void) const
virtual bool IsBroadcast(void) const
TypeId SetParent(TypeId tid)
Set the parent TypeId.
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
virtual uint16_t GetMtu(void) const
Ptr< Node > m_node
the node this NetDevice is associated with
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
void Receive(Ptr< Packet > packet, uint16_t protocol, Mac48Address to, Mac48Address from)
Receive a packet from tge Loopback NetDevice.
@ PACKET_OTHERHOST
Packet addressed to someone else.
a polymophic address class
static Mac48Address ConvertFrom(const Address &address)
bool IsBroadcast(void) const
virtual void AddLinkChangeCallback(Callback< void > callback)
virtual void SetAddress(Address address)
Set the address of this interface.
#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 Address GetBroadcast(void) const
static TypeId GetTypeId(void)
Get the type ID.
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
virtual bool SetMtu(const uint16_t mtu)
Time Seconds(double value)
Construct a Time in the indicated unit.
virtual bool IsLinkUp(void) const
virtual Address GetAddress(void) const
uint32_t m_ifIndex
interface index
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
NetDevice::ReceiveCallback m_rxCallback
The callback used to notify higher layers that a packet has been received.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
virtual uint32_t GetIfIndex(void) const
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
PacketType
Packet types are used as they are in Linux.
Mac48Address m_address
NetDevice MAC address.
virtual void DoDispose(void)
Destructor implementation.
Network layer to device interface.
Virtual network interface that loops back any data sent to it to be immediately received on the same ...
NetDevice::PromiscReceiveCallback m_promiscCallback
The callback used to notify higher layers that a packet has been received in promiscuous mode.
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
@ PACKET_MULTICAST
Packet addressed to multicast group.