23 #include "ns3/ipv4-address.h"
27 #include "ns3/net-device.h"
29 #include "ns3/packet.h"
31 #include "ns3/pointer.h"
44 .AddAttribute (
"ArpCache",
45 "The arp cache for this ipv4 interface",
49 MakePointerChecker<ArpCache> ())
208 if (DynamicCast<LoopbackNetDevice> (
m_device))
219 if (dest == (*i).GetLocal ())
240 hardwareDestination =
m_device->GetBroadcast ();
247 "ArpIpv4Interface::SendTo (): Sending multicast packet over "
248 "non-multicast device");
250 hardwareDestination =
m_device->GetMulticast (dest);
260 hardwareDestination =
m_device->GetBroadcast ();
268 found = arp->Lookup (p, dest,
m_device,
m_cache, &hardwareDestination);
275 m_device->Send (p, hardwareDestination,
329 NS_ASSERT_MSG (
false,
"Bug in Ipv4Interface::RemoveAddress");
362 if((*it).GetLocal() ==
address)
void SetForwarding(bool val)
#define NS_LOG_FUNCTION(parameters)
void Send(Ptr< Packet > p, Ipv4Address dest)
#define NS_ASSERT(condition)
#define NS_LOG_COMPONENT_DEFINE(name)
Ptr< ArpCache > GetArpCache() const
bool IsMulticast(void) const
Ipv4InterfaceAddress RemoveAddress(uint32_t index)
virtual void DoDispose(void)
bool AddAddress(Ipv4InterfaceAddress address)
Ptr< NetDevice > m_device
void SetNode(Ptr< Node > node)
a polymophic address class
std::list< Ipv4InterfaceAddress >::const_iterator Ipv4InterfaceAddressListCI
bool IsSubnetDirectedBroadcast(Ipv4Mask const &mask) const
Generate subnet-directed broadcast address corresponding to mask.
static TypeId GetTypeId(void)
NS_OBJECT_ENSURE_REGISTERED(AntennaModel)
bool IsBroadcast(void) const
void SetDevice(Ptr< NetDevice > device)
Ipv4InterfaceAddressList m_ifaddrs
#define NS_LOG_LOGIC(msg)
Ipv4InterfaceAddress GetAddress(uint32_t index) const
Implement the Ipv4 layer.
hold objects of type Ptr<T>
std::list< Ipv4InterfaceAddress >::iterator Ipv4InterfaceAddressListI
void SetArpCache(Ptr< ArpCache >)
static Ipv4Address GetLoopback(void)
uint16_t GetMetric(void) const
#define NS_ASSERT_MSG(condition, message)
Ipv4 addresses are stored in host order in this class.
a class to store IPv4 address information on an interface
Ptr< NetDevice > GetDevice(void) const
An implementation of the ARP protocol.
void SetMetric(uint16_t metric)
a base class which provides memory management and object aggregation
virtual void DoDispose(void)
Ptr< T > GetObject(void) const
uint32_t GetNAddresses(void) const
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
bool IsForwarding(void) const
static const uint16_t PROT_NUMBER