22 #include "ns3/ipv6-route.h"
24 #include "ns3/ipv6-static-routing.h"
26 #include "ns3/simulator.h"
39 .AddConstructor<Ipv6ListRouting> ()
66 (*rprotoIter).second = 0;
81 NS_LOG_LOGIC (
"Checking protocol " << (*i).second->GetInstanceTypeId () <<
" with priority " << (*i).first);
83 route = (*i).second->RouteOutput (p, header, oif, sockerr);
118 if (
m_ipv6->MulticastCheckGroup (iif, dst))
122 NS_LOG_LOGIC (
"Multicast packet for me-- local deliver");
126 lcb (packetCopy, header, iif);
137 for (Ipv6RoutingProtocolList::const_iterator rprotoIter =
141 NS_LOG_LOGIC (
"Multicast packet for me-- trying to forward");
142 if ((*rprotoIter).second->RouteInput (p, header, idev, ucb, mcb, lcb, ecb))
166 NS_LOG_LOGIC (
"For me (destination " << addr <<
" match)");
172 lcb (p, header, iif);
181 NS_LOG_LOGIC (
"Forwarding disabled for this interface");
186 for (Ipv6RoutingProtocolList::const_iterator rprotoIter =
191 if ((*rprotoIter).second->RouteInput (p, header, idev, ucb, mcb, lcb, ecb))
204 for (Ipv6RoutingProtocolList::const_iterator rprotoIter =
209 (*rprotoIter).second->NotifyInterfaceUp (interface);
216 for (Ipv6RoutingProtocolList::const_iterator rprotoIter =
221 (*rprotoIter).second->NotifyInterfaceDown (interface);
228 for (Ipv6RoutingProtocolList::const_iterator rprotoIter =
233 (*rprotoIter).second->NotifyAddAddress (interface, address);
240 for (Ipv6RoutingProtocolList::const_iterator rprotoIter =
245 (*rprotoIter).second->NotifyRemoveAddress (interface, address);
252 for (Ipv6RoutingProtocolList::const_iterator rprotoIter =
257 (*rprotoIter).second->NotifyAddRoute (dst, mask, nextHop, interface, prefixToUse);
264 for (Ipv6RoutingProtocolList::const_iterator rprotoIter =
269 (*rprotoIter).second->NotifyRemoveRoute (dst, mask, nextHop, interface, prefixToUse);
280 <<
"Ipv6ListRouting table" << std::endl;
284 *stream->
GetStream () <<
" Priority: " << (*i).first <<
" Protocol: " << (*i).second->GetInstanceTypeId () << std::endl;
285 (*i).second->PrintRoutingTable (stream);
295 for (Ipv6RoutingProtocolList::const_iterator rprotoIter =
300 (*rprotoIter).second->SetIpv6 (ipv6);
330 NS_FATAL_ERROR (
"Ipv6ListRouting::GetRoutingProtocol (): index " << index <<
" out of range");
333 for (Ipv6RoutingProtocolList::const_iterator rprotoIter =
m_routingProtocols.begin ();
338 priority = (*rprotoIter).first;
339 return (*rprotoIter).second;
348 return a.first > b.first;