23 #include "ns3/assert.h" 24 #include "ns3/radvd.h" 25 #include "ns3/radvd-interface.h" 26 #include "ns3/radvd-prefix.h" 42 if (prefixLength != 64)
44 NS_LOG_WARN(
"Adding a non-64 prefix is generally a bad idea. Autoconfiguration might not work.");
47 bool prefixFound =
false;
56 for (iter=prefixList.begin(); iter!=prefixList.end(); iter++)
58 if ((*iter)->GetNetwork() == prefix)
60 NS_LOG_LOGIC(
"Not adding the same prefix twice, skipping " << prefix <<
" " <<
int(prefixLength));
79 uint32_t maxRtrAdvInterval =
m_radvdInterfaces[interface]->GetMaxRtrAdvInterval();
117 if (!iter->second->GetPrefixes().empty())
119 radvd->AddConfiguration(iter->second);
holds a vector of ns3::Application pointers.
void EnableDefaultRouterForInterface(uint32_t interface)
Enable the router as default router for the interface.
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
Ptr< RadvdInterface > GetRadvdInterface(uint32_t interface)
Get the low-level RadvdInterface specification for an interface.
Router advertisement daemon.
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container. ...
Hold a value for an Attribute.
RadvdHelper()
Constructor.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
std::map< uint32_t, Ptr< RadvdInterface > >::iterator RadvdInterfaceMapI
Container Iterator: interface index, RadvdInterface.
ApplicationContainer Install(Ptr< Node > node)
Install the application in a Node.
void ClearPrefixes()
Clear the stored Prefixes.
ObjectFactory m_factory
An object factory.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
std::list< Ptr< RadvdPrefix > > RadvdPrefixList
Container: Ptr to RadvdPrefix.
void SetAttribute(std::string name, const AttributeValue &value)
Set some attributes.
void DisableDefaultRouterForInterface(uint32_t interface)
Disable the router as default router for the interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void AddAnnouncedPrefix(uint32_t interface, Ipv6Address prefix, uint32_t prefixLength)
Add a new prefix to be announced through an interface.
RadvdInterfaceMap m_radvdInterfaces
RadvdInterface(s)
void Set(std::string name, const AttributeValue &value)
Set an attribute to be set during construction.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
Describes an IPv6 address.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
static TypeId GetTypeId(void)
Get the type ID.
std::list< Ptr< RadvdPrefix > >::const_iterator RadvdPrefixListCI
Container Const Iterator: Ptr to RadvdPrefix.