11#include "ns3/assert.h"
12#include "ns3/channel-list.h"
16#include "ns3/net-device.h"
19#include "ns3/simulator.h"
52 for (std::size_t
i = 0;
i < channel->GetNDevices(); ++
i)
58 if (node->GetObject<
Ipv4>())
63 if (node->GetObject<
Ipv6>())
68 for (std::size_t
j = 0;
j < channel->GetNDevices(); ++
j)
128 if (node->GetObject<
Ipv4>())
133 if (node->GetObject<
Ipv6>())
138 for (std::size_t
j = 0;
j < channel->GetNDevices(); ++
j)
201 for (std::size_t
j = 0;
j < channel->GetNDevices(); ++
j)
236 for (std::size_t
j = 0;
j < channel->GetNDevices(); ++
j)
356 "ArpCache doesn't exist, might be a point-to-point NetDevice without ArpCache");
366 entry->MarkAutoGenerated();
379 "NdiscCache doesn't exist, might be a point-to-point NetDevice without NdiscCache");
389 entry->MarkAutoGenerated();
412 arpCache->RemoveAutoGeneratedEntries();
437 for (std::size_t
i = 0;
i < channel->GetNDevices(); ++
i)
469 for (std::size_t
i = 0;
i < channel->GetNDevices(); ++
i)
503 for (std::size_t
i = 0;
i < channel->GetNDevices(); ++
i)
535 for (std::size_t
i = 0;
i < channel->GetNDevices(); ++
i)
a polymophic address class
A record that that holds information about an ArpCache entry.
static Ptr< Channel > GetChannel(uint32_t n)
static uint32_t GetNChannels()
Ipv4 addresses are stored in host order in this class.
Access to the IPv4 forwarding table, interfaces, and configuration.
a class to store IPv4 address information on an interface
Ipv4Address GetAddress() const
Get the local address.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Implement the IPv4 layer.
Describes an IPv6 address.
Access to the IPv6 forwarding table, interfaces, and configuration.
IPv6 address associated with an interface.
Ipv6Address GetAddress() const
Get the IPv6 address.
@ LINKLOCAL
Link-local address (fe80::/64)
@ HOST
Localhost (::1/128)
Keep track of a set of IPv6 interfaces.
IPv6 layer implementation.
A record that holds information about a NdiscCache entry.
bool m_globalNeighborCache
flag will set true if neighbor caches were generated for all devices
void UpdateCacheByIpv6AddressAdded(const Ptr< Ipv6Interface > interface, const Ipv6InterfaceAddress ifAddr) const
Update neighbor cache when an address is added to a Ipv6Interface with auto generated neighbor cache.
void AddEntry(Ptr< Ipv4Interface > netDeviceInterface, Ipv4Address ipv4Address, Address macAddress) const
Add an auto_generated entry to the ARP cache of an interface.
void PopulateNeighborCache()
Populate neighbor ARP and NDISC caches for all devices.
bool m_dynamicNeighborCache
flag will set true if dynamic neighbor cache is enabled.
NeighborCacheHelper()
Construct a helper class to make life easier while creating neighbor cache.
void PopulateNeighborEntriesIpv4(Ptr< Ipv4Interface > ipv4Interface, Ptr< Ipv4Interface > neighborDeviceInterface) const
Populate neighbor ARP entries for given IPv4 interface.
void SetDynamicNeighborCache(bool enable)
Enable/disable dynamic neighbor cache, auto-generated neighbor cache will update by IP addresses chan...
void PopulateNeighborEntriesIpv6(Ptr< Ipv6Interface > ipv6Interface, Ptr< Ipv6Interface > neighborDeviceInterface) const
Populate neighbor NDISC entries for given IPv6 interface.
void UpdateCacheByIpv6AddressRemoved(const Ptr< Ipv6Interface > interface, const Ipv6InterfaceAddress ifAddr) const
Update neighbor caches when an address is removed from a Ipv6Interface with auto generated neighbor c...
void FlushAutoGenerated() const
Remove entries generated from NeighborCacheHelper from ARP cache and NDISC cache.
void UpdateCacheByIpv4AddressAdded(const Ptr< Ipv4Interface > interface, const Ipv4InterfaceAddress ifAddr) const
Update neighbor caches when an address is added to a Ipv4Interface with auto generated neighbor cache...
void UpdateCacheByIpv4AddressRemoved(const Ptr< Ipv4Interface > interface, const Ipv4InterfaceAddress ifAddr) const
Update neighbor caches when an address is removed from a Ipv4Interface with auto generated neighbor c...
holds a vector of ns3::NetDevice pointers
static uint32_t GetNNodes()
static Ptr< Node > GetNode(uint32_t n)
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...