22 #include "ns3/assert.h"
23 #include "ns3/radvd.h"
24 #include "ns3/radvd-interface.h"
25 #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)
#define NS_LOG_FUNCTION(parameters)
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.
void SetTypeId(TypeId tid)
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.
NS_LOG_COMPONENT_DEFINE("RadvdHelper")
ObjectFactory m_factory
An object factory.
Ptr< Object > Create(void) const
std::list< Ptr< RadvdPrefix > > RadvdPrefixList
Container: Ptr to RadvdPrefix.
void SetAttribute(std::string name, const AttributeValue &value)
Set some attributes.
#define NS_LOG_LOGIC(msg)
void DisableDefaultRouterForInterface(uint32_t interface)
Disable the router as default router for the interface.
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)
Describes an IPv6 address.
static TypeId GetTypeId(void)
Get the type ID.
std::list< Ptr< RadvdPrefix > >::const_iterator RadvdPrefixListCI
Container Const Iterator: Ptr to RadvdPrefix.