|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
27 #include "ns3/net-device.h"
29 #include "ns3/packet.h"
31 #include "ns3/pointer.h"
32 #include "ns3/traffic-control-layer.h"
46 .SetGroupName (
"Internet")
47 .AddAttribute (
"ArpCache",
48 "The arp cache for this ipv4 interface",
52 MakePointerChecker<ArpCache> ())
223 if (DynamicCast<LoopbackNetDevice> (
m_device))
237 if (dest == (*i).GetLocal ())
263 "ArpIpv4Interface::SendTo (): Sending multicast packet over "
264 "non-multicast device");
284 found = arp->Lookup (p, hdr, dest,
m_device,
m_cache, &hardwareDestination);
379 if((*it).GetLocal() ==
address)
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual bool IsMulticast(void) const =0
Ptr< TrafficControlLayer > m_tc
The associated TrafficControlLayer.
#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,...
Ptr< Node > m_node
The associated node.
uint16_t GetMetric(void) const
bool IsUp(void) const
These are IP interface states and may be distinct from NetDevice states, such as found in real implem...
void AddHeader(const Header &header)
Add header to this packet.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint16_t m_metric
Interface metric.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Ptr< NetDevice > GetDevice(void) const
void SetArpCache(Ptr< ArpCache > arpCache)
Set ARP cache used by this interface.
Ptr< ArpCache > GetArpCache() const
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
bool IsForwarding(void) const
Ipv4 addresses are stored in host order in this class.
@ PACKET_HOST
Packet addressed oo us.
Hold objects of type Ptr<T>.
uint32_t GetNAddresses(void) const
bool m_ifup
The state of this interface.
std::list< Ipv4InterfaceAddress >::iterator Ipv4InterfaceAddressListI
Const Container Iterator for the Ipv4InterfaceAddresses.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
An implementation of the ARP protocol.
void DoSetup(void)
Initialize interface.
bool IsMulticast(void) const
void SetMetric(uint16_t metric)
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
virtual void DoDispose(void)
Destructor implementation.
void SetDown(void)
Disable this interface.
void SetForwarding(bool val)
a polymophic address class
a class to store IPv4 address information on an interface
A base class which provides memory management and object aggregation.
virtual bool NeedsArp(void) const =0
Ipv4Interface()
By default, Ipv4 interface are created in the "down" state with no IP addresses.
void Send(Ptr< Packet > p, const Ipv4Header &hdr, Ipv4Address dest)
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)=0
bool IsBroadcast(void) const
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
void SetUp(void)
Enable this interface.
virtual Address GetMulticast(Ipv4Address multicastGroup) const =0
Make and return a MAC multicast address using the provided multicast group.
static const uint16_t PROT_NUMBER
Protocol number (0x0800)
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ipv4InterfaceAddress RemoveAddress(uint32_t index)
bool AddAddress(Ipv4InterfaceAddress address)
Ipv4InterfaceAddress GetAddress(uint32_t index) const
Ptr< ArpCache > m_cache
ARP cache.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
std::list< Ipv4InterfaceAddress >::const_iterator Ipv4InterfaceAddressListCI
Container Iterator for the Ipv4InterfaceAddresses.
void SetNode(Ptr< Node > node)
Set node associated with interface.
void SetTrafficControl(Ptr< TrafficControlLayer > tc)
Set the TrafficControlLayer.
virtual Address GetBroadcast(void) const =0
static TypeId GetTypeId(void)
Get the type ID.
Ptr< NetDevice > m_device
The associated NetDevice.
bool m_forwarding
Forwarding state.
virtual void DoDispose(void)
Destructor implementation.
void SetDevice(Ptr< NetDevice > device)
Set the NetDevice.
Ipv4InterfaceAddressList m_ifaddrs
Address list.
bool IsSubnetDirectedBroadcast(Ipv4Mask const &mask) const
Generate subnet-directed broadcast address corresponding to mask.