23 #include "ns3/names.h"
26 #include "ns3/ipv6-route.h"
27 #include "ns3/ipv6-list-routing.h"
28 #include "ns3/assert.h"
29 #include "ns3/ipv6-address.h"
30 #include "ns3/ipv6-routing-protocol.h"
55 return CreateObject<Ipv6StaticRouting> ();
63 NS_ASSERT_MSG (ipv6rp,
"No routing protocol associated with Ipv6");
64 if (DynamicCast<Ipv6StaticRouting> (ipv6rp))
66 NS_LOG_LOGIC (
"Static routing found as the main IPv4 routing protocol.");
67 return DynamicCast<Ipv6StaticRouting> (ipv6rp);
69 if (DynamicCast<Ipv6ListRouting> (ipv6rp))
73 for (uint32_t i = 0; i < lrp->GetNRoutingProtocols (); i++)
77 if (DynamicCast<Ipv6StaticRouting> (temp))
80 return DynamicCast<Ipv6StaticRouting> (temp);
100 std::vector<uint32_t> outputInterfaces;
104 int32_t
interface = ipv6->GetInterfaceForDevice (nd);
106 "Ipv6StaticRoutingHelper::AddMulticastRoute (): "
107 "Expected an interface associated with the device nd");
108 outputInterfaces.push_back (interface);
111 int32_t inputInterface = ipv6->GetInterfaceForDevice (input);
113 "Ipv6StaticRoutingHelper::AddMulticastRoute (): "
114 "Expected an interface associated with the device input");
117 if (!ipv6StaticRouting)
120 "Ipv6StaticRoutingHelper::SetDefaultMulticastRoute (): "
121 "Expected an Ipv6StaticRouting associated with this node");
123 ipv6StaticRouting->AddMulticastRoute (source, group, inputInterface, outputInterfaces);
131 std::string inputName,
155 std::string inputName,
165 Ipv6StaticRoutingHelper::SetDefaultMulticastRoute (
170 int32_t interfaceSrc = ipv6->GetInterfaceForDevice (nd);
172 "Ipv6StaticRoutingHelper::SetDefaultMulticastRoute (): "
173 "Expected an interface associated with the device");
176 if (!ipv6StaticRouting)
179 "Ipv6StaticRoutingHelper::SetDefaultMulticastRoute (): "
180 "Expected an Ipv6StaticRouting associated with this node");
182 ipv6StaticRouting->SetDefaultMulticastRoute (interfaceSrc);
186 Ipv6StaticRoutingHelper::SetDefaultMulticastRoute (
190 Ptr<NetDevice> nd = Names::Find<NetDevice> (ndName);
191 SetDefaultMulticastRoute (
n, nd);
195 Ipv6StaticRoutingHelper::SetDefaultMulticastRoute (
199 Ptr<Node>
n = Names::Find<Node> (nName);
200 SetDefaultMulticastRoute (
n, nd);
204 Ipv6StaticRoutingHelper::SetDefaultMulticastRoute (
208 Ptr<Node>
n = Names::Find<Node> (nName);
209 Ptr<NetDevice> nd = Names::Find<NetDevice> (ndName);
210 SetDefaultMulticastRoute (
n, nd);