changeset 5891 | 09a575cdf8db |
parent 5856 | 7fd20c798a7d |
5890:9c48446a0946 | 5891:09a575cdf8db |
---|---|
40 return tid; |
40 return tid; |
41 } |
41 } |
42 |
42 |
43 |
43 |
44 Ipv6ListRouting::Ipv6ListRouting () |
44 Ipv6ListRouting::Ipv6ListRouting () |
45 : m_ipv6 (0) |
45 : m_ipv6 (0) |
46 { |
46 { |
47 NS_LOG_FUNCTION_NOARGS (); |
47 NS_LOG_FUNCTION_NOARGS (); |
48 } |
48 } |
49 |
49 |
50 Ipv6ListRouting::~Ipv6ListRouting () |
50 Ipv6ListRouting::~Ipv6ListRouting () |
114 if (dst.IsMulticast ()) |
114 if (dst.IsMulticast ()) |
115 { |
115 { |
116 #ifdef NOTYET |
116 #ifdef NOTYET |
117 if (m_ipv6->MulticastCheckGroup (iif, dst)) |
117 if (m_ipv6->MulticastCheckGroup (iif, dst)) |
118 #endif |
118 #endif |
119 if (true) |
119 if (true) |
120 { |
120 { |
121 NS_LOG_LOGIC ("Multicast packet for me-- local deliver"); |
121 NS_LOG_LOGIC ("Multicast packet for me-- local deliver"); |
122 Ptr<Packet> packetCopy = p->Copy (); |
122 Ptr<Packet> packetCopy = p->Copy (); |
123 // Here may want to disable lcb callback in recursive RouteInput |
123 // Here may want to disable lcb callback in recursive RouteInput |
124 // call below |
124 // call below |
125 lcb (packetCopy, header, iif); |
125 lcb (packetCopy, header, iif); |
126 // Fall through-- we may also need to forward this |
126 // Fall through-- we may also need to forward this |
127 retVal = true; |
127 retVal = true; |
128 } |
128 } |
129 |
129 |
130 /* do not forward link-local multicast address */ |
130 /* do not forward link-local multicast address */ |
131 if (dst == Ipv6Address::GetAllNodesMulticast () || dst == Ipv6Address::GetAllRoutersMulticast () || dst == Ipv6Address::GetAllHostsMulticast ()) |
131 if (dst == Ipv6Address::GetAllNodesMulticast () || dst == Ipv6Address::GetAllRoutersMulticast () || dst == Ipv6Address::GetAllHostsMulticast ()) |
132 { |
132 { |
133 return retVal; |
133 return retVal; |
134 } |
134 } |
135 |
135 |
136 for (Ipv6RoutingProtocolList::const_iterator rprotoIter = |
136 for (Ipv6RoutingProtocolList::const_iterator rprotoIter = |
137 m_routingProtocols.begin (); rprotoIter != m_routingProtocols.end (); |
137 m_routingProtocols.begin (); rprotoIter != m_routingProtocols.end (); |
138 rprotoIter++) |
138 rprotoIter++) |
139 { |
139 { |
140 NS_LOG_LOGIC ("Multicast packet for me-- trying to forward"); |
140 NS_LOG_LOGIC ("Multicast packet for me-- trying to forward"); |
141 if ((*rprotoIter).second->RouteInput (p, header, idev, ucb, mcb, lcb, ecb)) |
141 if ((*rprotoIter).second->RouteInput (p, header, idev, ucb, mcb, lcb, ecb)) |
142 { |
142 { |
144 } |
144 } |
145 } |
145 } |
146 return retVal; |
146 return retVal; |
147 } |
147 } |
148 |
148 |
149 // TODO: Configurable option to enable RFC 1222 Strong End System Model |
149 // TODO: Configurable option to enable RFC 1222 Strong End System Model |
150 // Right now, we will be permissive and allow a source to send us |
150 // Right now, we will be permissive and allow a source to send us |
151 // a packet to one of our other interface addresses; that is, the |
151 // a packet to one of our other interface addresses; that is, the |
152 // destination unicast address does not match one of the iif addresses, |
152 // destination unicast address does not match one of the iif addresses, |
153 // but we check our other interfaces. This could be an option |
153 // but we check our other interfaces. This could be an option |
154 // (to remove the outer loop immediately below and just check iif). |
154 // (to remove the outer loop immediately below and just check iif). |
155 for (uint32_t j = 0; j < m_ipv6->GetNInterfaces (); j++) |
155 for (uint32_t j = 0; j < m_ipv6->GetNInterfaces (); j++) |
156 { |
156 { |
157 for (uint32_t i = 0; i < m_ipv6->GetNAddresses (j); i++) |
157 for (uint32_t i = 0; i < m_ipv6->GetNAddresses (j); i++) |
158 { |
158 { |
159 Ipv6InterfaceAddress iaddr = m_ipv6->GetAddress (j, i); |
159 Ipv6InterfaceAddress iaddr = m_ipv6->GetAddress (j, i); |
181 ecb (p, header, Socket::ERROR_NOROUTETOHOST); |
181 ecb (p, header, Socket::ERROR_NOROUTETOHOST); |
182 return false; |
182 return false; |
183 } |
183 } |
184 // Next, try to find a route |
184 // Next, try to find a route |
185 for (Ipv6RoutingProtocolList::const_iterator rprotoIter = |
185 for (Ipv6RoutingProtocolList::const_iterator rprotoIter = |
186 m_routingProtocols.begin (); |
186 m_routingProtocols.begin (); |
187 rprotoIter != m_routingProtocols.end (); |
187 rprotoIter != m_routingProtocols.end (); |
188 rprotoIter++) |
188 rprotoIter++) |
189 { |
189 { |
190 if ((*rprotoIter).second->RouteInput (p, header, idev, ucb, mcb, lcb, ecb)) |
190 if ((*rprotoIter).second->RouteInput (p, header, idev, ucb, mcb, lcb, ecb)) |
191 { |
191 { |
199 void |
199 void |
200 Ipv6ListRouting::NotifyInterfaceUp (uint32_t interface) |
200 Ipv6ListRouting::NotifyInterfaceUp (uint32_t interface) |
201 { |
201 { |
202 NS_LOG_FUNCTION (this << interface); |
202 NS_LOG_FUNCTION (this << interface); |
203 for (Ipv6RoutingProtocolList::const_iterator rprotoIter = |
203 for (Ipv6RoutingProtocolList::const_iterator rprotoIter = |
204 m_routingProtocols.begin (); |
204 m_routingProtocols.begin (); |
205 rprotoIter != m_routingProtocols.end (); |
205 rprotoIter != m_routingProtocols.end (); |
206 rprotoIter++) |
206 rprotoIter++) |
207 { |
207 { |
208 (*rprotoIter).second->NotifyInterfaceUp (interface); |
208 (*rprotoIter).second->NotifyInterfaceUp (interface); |
209 } |
209 } |
211 void |
211 void |
212 Ipv6ListRouting::NotifyInterfaceDown (uint32_t interface) |
212 Ipv6ListRouting::NotifyInterfaceDown (uint32_t interface) |
213 { |
213 { |
214 NS_LOG_FUNCTION (this << interface); |
214 NS_LOG_FUNCTION (this << interface); |
215 for (Ipv6RoutingProtocolList::const_iterator rprotoIter = |
215 for (Ipv6RoutingProtocolList::const_iterator rprotoIter = |
216 m_routingProtocols.begin (); |
216 m_routingProtocols.begin (); |
217 rprotoIter != m_routingProtocols.end (); |
217 rprotoIter != m_routingProtocols.end (); |
218 rprotoIter++) |
218 rprotoIter++) |
219 { |
219 { |
220 (*rprotoIter).second->NotifyInterfaceDown (interface); |
220 (*rprotoIter).second->NotifyInterfaceDown (interface); |
221 } |
221 } |
223 void |
223 void |
224 Ipv6ListRouting::NotifyAddAddress (uint32_t interface, Ipv6InterfaceAddress address) |
224 Ipv6ListRouting::NotifyAddAddress (uint32_t interface, Ipv6InterfaceAddress address) |
225 { |
225 { |
226 NS_LOG_FUNCTION (this << interface << address); |
226 NS_LOG_FUNCTION (this << interface << address); |
227 for (Ipv6RoutingProtocolList::const_iterator rprotoIter = |
227 for (Ipv6RoutingProtocolList::const_iterator rprotoIter = |
228 m_routingProtocols.begin (); |
228 m_routingProtocols.begin (); |
229 rprotoIter != m_routingProtocols.end (); |
229 rprotoIter != m_routingProtocols.end (); |
230 rprotoIter++) |
230 rprotoIter++) |
231 { |
231 { |
232 (*rprotoIter).second->NotifyAddAddress (interface, address); |
232 (*rprotoIter).second->NotifyAddAddress (interface, address); |
233 } |
233 } |
235 void |
235 void |
236 Ipv6ListRouting::NotifyRemoveAddress (uint32_t interface, Ipv6InterfaceAddress address) |
236 Ipv6ListRouting::NotifyRemoveAddress (uint32_t interface, Ipv6InterfaceAddress address) |
237 { |
237 { |
238 NS_LOG_FUNCTION (this << interface << address); |
238 NS_LOG_FUNCTION (this << interface << address); |
239 for (Ipv6RoutingProtocolList::const_iterator rprotoIter = |
239 for (Ipv6RoutingProtocolList::const_iterator rprotoIter = |
240 m_routingProtocols.begin (); |
240 m_routingProtocols.begin (); |
241 rprotoIter != m_routingProtocols.end (); |
241 rprotoIter != m_routingProtocols.end (); |
242 rprotoIter++) |
242 rprotoIter++) |
243 { |
243 { |
244 (*rprotoIter).second->NotifyRemoveAddress (interface, address); |
244 (*rprotoIter).second->NotifyRemoveAddress (interface, address); |
245 } |
245 } |
247 |
247 |
248 void Ipv6ListRouting::NotifyAddRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse) |
248 void Ipv6ListRouting::NotifyAddRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse) |
249 { |
249 { |
250 NS_LOG_FUNCTION (this << dst << mask << nextHop << interface); |
250 NS_LOG_FUNCTION (this << dst << mask << nextHop << interface); |
251 for (Ipv6RoutingProtocolList::const_iterator rprotoIter = |
251 for (Ipv6RoutingProtocolList::const_iterator rprotoIter = |
252 m_routingProtocols.begin (); |
252 m_routingProtocols.begin (); |
253 rprotoIter != m_routingProtocols.end (); |
253 rprotoIter != m_routingProtocols.end (); |
254 rprotoIter++) |
254 rprotoIter++) |
255 { |
255 { |
256 (*rprotoIter).second->NotifyAddRoute (dst, mask, nextHop, interface, prefixToUse); |
256 (*rprotoIter).second->NotifyAddRoute (dst, mask, nextHop, interface, prefixToUse); |
257 } |
257 } |
259 |
259 |
260 void Ipv6ListRouting::NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse) |
260 void Ipv6ListRouting::NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse) |
261 { |
261 { |
262 NS_LOG_FUNCTION (this << dst << mask << nextHop << interface); |
262 NS_LOG_FUNCTION (this << dst << mask << nextHop << interface); |
263 for (Ipv6RoutingProtocolList::const_iterator rprotoIter = |
263 for (Ipv6RoutingProtocolList::const_iterator rprotoIter = |
264 m_routingProtocols.begin (); |
264 m_routingProtocols.begin (); |
265 rprotoIter != m_routingProtocols.end (); |
265 rprotoIter != m_routingProtocols.end (); |
266 rprotoIter++) |
266 rprotoIter++) |
267 { |
267 { |
268 (*rprotoIter).second->NotifyRemoveRoute (dst, mask, nextHop, interface, prefixToUse); |
268 (*rprotoIter).second->NotifyRemoveRoute (dst, mask, nextHop, interface, prefixToUse); |
269 } |
269 } |
273 Ipv6ListRouting::SetIpv6 (Ptr<Ipv6> ipv6) |
273 Ipv6ListRouting::SetIpv6 (Ptr<Ipv6> ipv6) |
274 { |
274 { |
275 NS_LOG_FUNCTION (this << ipv6); |
275 NS_LOG_FUNCTION (this << ipv6); |
276 NS_ASSERT (m_ipv6 == 0); |
276 NS_ASSERT (m_ipv6 == 0); |
277 for (Ipv6RoutingProtocolList::const_iterator rprotoIter = |
277 for (Ipv6RoutingProtocolList::const_iterator rprotoIter = |
278 m_routingProtocols.begin (); |
278 m_routingProtocols.begin (); |
279 rprotoIter != m_routingProtocols.end (); |
279 rprotoIter != m_routingProtocols.end (); |
280 rprotoIter++) |
280 rprotoIter++) |
281 { |
281 { |
282 (*rprotoIter).second->SetIpv6 (ipv6); |
282 (*rprotoIter).second->SetIpv6 (ipv6); |
283 } |
283 } |
338 #include "ipv6-list-routing.h" |
338 #include "ipv6-list-routing.h" |
339 #include "ns3/ipv6-routing-protocol.h" |
339 #include "ns3/ipv6-routing-protocol.h" |
340 |
340 |
341 namespace ns3 { |
341 namespace ns3 { |
342 |
342 |
343 class Ipv6ARouting : public Ipv6RoutingProtocol { |
343 class Ipv6ARouting : public Ipv6RoutingProtocol { |
344 public: |
344 public: |
345 Ptr<Ipv6Route> RouteOutput (Ptr<Packet> p, const Ipv6Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr) { return 0;} |
345 Ptr<Ipv6Route> RouteOutput (Ptr<Packet> p, const Ipv6Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr) { return 0;} |
346 bool RouteInput (Ptr<const Packet> p, const Ipv6Header &header, Ptr<const NetDevice> idev, |
346 bool RouteInput (Ptr<const Packet> p, const Ipv6Header &header, Ptr<const NetDevice> idev, |
347 UnicastForwardCallback ucb, MulticastForwardCallback mcb, |
347 UnicastForwardCallback ucb, MulticastForwardCallback mcb, |
348 LocalDeliverCallback lcb, ErrorCallback ecb) {return false;} |
348 LocalDeliverCallback lcb, ErrorCallback ecb) {return false;} |
349 void NotifyInterfaceUp (uint32_t interface) {} |
349 void NotifyInterfaceUp (uint32_t interface) {} |
350 void NotifyInterfaceDown (uint32_t interface) {} |
350 void NotifyInterfaceDown (uint32_t interface) {} |
351 void NotifyAddAddress (uint32_t interface, Ipv6InterfaceAddress address) {} |
351 void NotifyAddAddress (uint32_t interface, Ipv6InterfaceAddress address) {} |
352 void NotifyRemoveAddress (uint32_t interface, Ipv6InterfaceAddress address) {} |
352 void NotifyRemoveAddress (uint32_t interface, Ipv6InterfaceAddress address) {} |
353 void NotifyAddRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse = Ipv6Address:: |
353 void NotifyAddRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse = Ipv6Address:: |
354 GetZero ()) {} |
354 GetZero ()) {} |
355 void NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse) {} |
355 void NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse) {} |
356 void SetIpv6 (Ptr<Ipv6> ipv6) {} |
356 void SetIpv6 (Ptr<Ipv6> ipv6) {} |
357 }; |
357 }; |
358 |
358 |
359 class Ipv6BRouting : public Ipv6RoutingProtocol { |
359 class Ipv6BRouting : public Ipv6RoutingProtocol { |
360 public: |
360 public: |
361 Ptr<Ipv6Route> RouteOutput (Ptr<Packet> p, const Ipv6Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr) { return 0;} |
361 Ptr<Ipv6Route> RouteOutput (Ptr<Packet> p, const Ipv6Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr) { return 0;} |
362 bool RouteInput (Ptr<const Packet> p, const Ipv6Header &header, Ptr<const NetDevice> idev, |
362 bool RouteInput (Ptr<const Packet> p, const Ipv6Header &header, Ptr<const NetDevice> idev, |
363 UnicastForwardCallback ucb, MulticastForwardCallback mcb, |
363 UnicastForwardCallback ucb, MulticastForwardCallback mcb, |
364 LocalDeliverCallback lcb, ErrorCallback ecb) {return false;} |
364 LocalDeliverCallback lcb, ErrorCallback ecb) {return false;} |
365 void NotifyInterfaceUp (uint32_t interface) {} |
365 void NotifyInterfaceUp (uint32_t interface) {} |
366 void NotifyInterfaceDown (uint32_t interface) {} |
366 void NotifyInterfaceDown (uint32_t interface) {} |
367 void NotifyAddAddress (uint32_t interface, Ipv6InterfaceAddress address) {} |
367 void NotifyAddAddress (uint32_t interface, Ipv6InterfaceAddress address) {} |
368 void NotifyRemoveAddress (uint32_t interface, Ipv6InterfaceAddress address) {} |
368 void NotifyRemoveAddress (uint32_t interface, Ipv6InterfaceAddress address) {} |
369 void NotifyAddRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse = Ipv6Address:: |
369 void NotifyAddRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse = Ipv6Address:: |
370 GetZero ()) {} |
370 GetZero ()) {} |
371 void NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse) {} |
371 void NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse) {} |
372 void SetIpv6 (Ptr<Ipv6> ipv6) {} |
372 void SetIpv6 (Ptr<Ipv6> ipv6) {} |
373 }; |
373 }; |
374 |
374 |
375 class Ipv6ListRoutingNegativeTestCase : public TestCase |
375 class Ipv6ListRoutingNegativeTestCase : public TestCase |
376 { |
376 { |
377 public: |
377 public: |
378 Ipv6ListRoutingNegativeTestCase(); |
378 Ipv6ListRoutingNegativeTestCase(); |
379 virtual bool DoRun (void); |
379 virtual bool DoRun (void); |
380 }; |
380 }; |
381 |
381 |
382 Ipv6ListRoutingNegativeTestCase::Ipv6ListRoutingNegativeTestCase() |
382 Ipv6ListRoutingNegativeTestCase::Ipv6ListRoutingNegativeTestCase() |
383 : TestCase("Check negative priorities") |
383 : TestCase("Check negative priorities") |
384 {} |
384 {} |
385 bool |
385 bool |
386 Ipv6ListRoutingNegativeTestCase::DoRun (void) |
386 Ipv6ListRoutingNegativeTestCase::DoRun (void) |
387 { |
387 { |
388 Ptr<Ipv6ListRouting> lr = CreateObject<Ipv6ListRouting> (); |
388 Ptr<Ipv6ListRouting> lr = CreateObject<Ipv6ListRouting> (); |
389 Ptr<Ipv6RoutingProtocol> aRouting = CreateObject<Ipv6ARouting> (); |
389 Ptr<Ipv6RoutingProtocol> aRouting = CreateObject<Ipv6ARouting> (); |
390 Ptr<Ipv6RoutingProtocol> bRouting = CreateObject<Ipv6BRouting> (); |
390 Ptr<Ipv6RoutingProtocol> bRouting = CreateObject<Ipv6BRouting> (); |
391 // The Ipv6BRouting should be added with higher priority (larger integer value) |
391 // The Ipv6BRouting should be added with higher priority (larger integer value) |
392 lr->AddRoutingProtocol (aRouting, -10); |
392 lr->AddRoutingProtocol (aRouting, -10); |
393 lr->AddRoutingProtocol (bRouting, -5); |
393 lr->AddRoutingProtocol (bRouting, -5); |
394 int16_t first = 3; |
394 int16_t first = 3; |
395 uint32_t num = lr->GetNRoutingProtocols (); |
395 uint32_t num = lr->GetNRoutingProtocols (); |
396 NS_TEST_ASSERT_MSG_EQ (num, 2, "XXX"); |
396 NS_TEST_ASSERT_MSG_EQ (num, 2, "XXX"); |
397 Ptr<Ipv6RoutingProtocol> firstRp = lr->GetRoutingProtocol (0, first); |
397 Ptr<Ipv6RoutingProtocol> firstRp = lr->GetRoutingProtocol (0, first); |
398 NS_TEST_ASSERT_MSG_EQ (-5, first, "XXX"); |
398 NS_TEST_ASSERT_MSG_EQ (-5, first, "XXX"); |
399 NS_TEST_ASSERT_MSG_EQ (firstRp, bRouting, "XXX"); |
399 NS_TEST_ASSERT_MSG_EQ (firstRp, bRouting, "XXX"); |
400 |
400 |
401 // XXX |
401 // XXX |
402 return false; |
402 return false; |
403 } |
403 } |
404 |
404 |
405 class Ipv6ListRoutingPositiveTestCase : public TestCase |
405 class Ipv6ListRoutingPositiveTestCase : public TestCase |
406 { |
406 { |
407 public: |
407 public: |
408 Ipv6ListRoutingPositiveTestCase(); |
408 Ipv6ListRoutingPositiveTestCase(); |
409 virtual bool DoRun (void); |
409 virtual bool DoRun (void); |
410 }; |
410 }; |
411 |
411 |
412 Ipv6ListRoutingPositiveTestCase::Ipv6ListRoutingPositiveTestCase() |
412 Ipv6ListRoutingPositiveTestCase::Ipv6ListRoutingPositiveTestCase() |
413 : TestCase("Check positive priorities") |
413 : TestCase("Check positive priorities") |
414 {} |
414 {} |
415 bool |
415 bool |
416 Ipv6ListRoutingPositiveTestCase::DoRun (void) |
416 Ipv6ListRoutingPositiveTestCase::DoRun (void) |
417 { |
417 { |
418 Ptr<Ipv6ListRouting> lr = CreateObject<Ipv6ListRouting> (); |
418 Ptr<Ipv6ListRouting> lr = CreateObject<Ipv6ListRouting> (); |
419 Ptr<Ipv6RoutingProtocol> aRouting = CreateObject<Ipv6ARouting> (); |
419 Ptr<Ipv6RoutingProtocol> aRouting = CreateObject<Ipv6ARouting> (); |
420 Ptr<Ipv6RoutingProtocol> bRouting = CreateObject<Ipv6BRouting> (); |
420 Ptr<Ipv6RoutingProtocol> bRouting = CreateObject<Ipv6BRouting> (); |
421 // The Ipv6ARouting should be added with higher priority (larger integer |
421 // The Ipv6ARouting should be added with higher priority (larger integer |
422 // value) and will be fetched first below |
422 // value) and will be fetched first below |
423 lr->AddRoutingProtocol (aRouting, 10); |
423 lr->AddRoutingProtocol (aRouting, 10); |
424 lr->AddRoutingProtocol (bRouting, 5); |
424 lr->AddRoutingProtocol (bRouting, 5); |
425 int16_t first = 3; |
425 int16_t first = 3; |
426 int16_t second = 3; |
426 int16_t second = 3; |
427 uint32_t num = lr->GetNRoutingProtocols (); |
427 uint32_t num = lr->GetNRoutingProtocols (); |
428 NS_TEST_ASSERT_MSG_EQ (num, 2, "XXX"); |
428 NS_TEST_ASSERT_MSG_EQ (num, 2, "XXX"); |
429 Ptr<Ipv6RoutingProtocol> firstRp = lr->GetRoutingProtocol (0, first); |
429 Ptr<Ipv6RoutingProtocol> firstRp = lr->GetRoutingProtocol (0, first); |
430 NS_TEST_ASSERT_MSG_EQ (10, first, "XXX"); |
430 NS_TEST_ASSERT_MSG_EQ (10, first, "XXX"); |
431 NS_TEST_ASSERT_MSG_EQ (firstRp, aRouting, "XXX"); |
431 NS_TEST_ASSERT_MSG_EQ (firstRp, aRouting, "XXX"); |
432 Ptr<Ipv6RoutingProtocol> secondRp = lr->GetRoutingProtocol (1, second); |
432 Ptr<Ipv6RoutingProtocol> secondRp = lr->GetRoutingProtocol (1, second); |
433 NS_TEST_ASSERT_MSG_EQ (5, second, "XXX"); |
433 NS_TEST_ASSERT_MSG_EQ (5, second, "XXX"); |
434 NS_TEST_ASSERT_MSG_EQ (secondRp, bRouting, "XXX"); |
434 NS_TEST_ASSERT_MSG_EQ (secondRp, bRouting, "XXX"); |
435 |
435 |
436 // XXX |
436 // XXX |
437 return false; |
437 return false; |
438 } |
438 } |
439 |
439 |
440 static class Ipv6ListRoutingTestSuite : public TestSuite |
440 static class Ipv6ListRoutingTestSuite : public TestSuite |
441 { |
441 { |
442 public: |
442 public: |
443 Ipv6ListRoutingTestSuite() |
443 Ipv6ListRoutingTestSuite() |
444 : TestSuite("ipv6-list-routing", UNIT) |
444 : TestSuite("ipv6-list-routing", UNIT) |
445 { |
445 { |
446 AddTestCase(new Ipv6ListRoutingPositiveTestCase()); |
446 AddTestCase(new Ipv6ListRoutingPositiveTestCase()); |
447 AddTestCase(new Ipv6ListRoutingNegativeTestCase()); |
447 AddTestCase(new Ipv6ListRoutingNegativeTestCase()); |
448 } |
448 } |
449 |
449 |
450 } g_ipv6ListRoutingTestSuite; |
450 } g_ipv6ListRoutingTestSuite; |
451 |
451 |
452 } // namespace ns3 |
452 } // namespace ns3 |