|
|
| 368 |
Ipv4Address dst = header.GetDestination (); |
368 |
Ipv4Address dst = header.GetDestination (); |
| 369 |
Ipv4Address origin = header.GetSource (); |
369 |
Ipv4Address origin = header.GetSource (); |
| 370 |
|
370 |
|
|
|
371 |
// DSDV is not a multicast routing protocol |
| 372 |
if (dst.IsMulticast ()) |
| 373 |
{ |
| 374 |
return false; |
| 375 |
} |
| 376 |
|
| 371 |
// Deferred route request |
377 |
// Deferred route request |
| 372 |
if (EnableBuffering == true && idev == m_lo) |
378 |
if (EnableBuffering == true && idev == m_lo) |
| 373 |
{ |
379 |
{ |
|
|
| 396 |
{ |
402 |
{ |
| 397 |
if (dst == iface.GetBroadcast () || dst.IsBroadcast ()) |
403 |
if (dst == iface.GetBroadcast () || dst.IsBroadcast ()) |
| 398 |
{ |
404 |
{ |
| 399 |
NS_LOG_LOGIC ("Broadcast local delivery to " << iface.GetLocal ()); |
|
|
| 400 |
Ptr<Packet> packet = p->Copy (); |
405 |
Ptr<Packet> packet = p->Copy (); |
| 401 |
lcb (p,header,iif); |
406 |
if (lcb.IsNull () == false) |
|
|
407 |
{ |
| 408 |
NS_LOG_LOGIC ("Broadcast local delivery to " << iface.GetLocal ()); |
| 409 |
lcb (p, header, iif); |
| 410 |
// Fall through to additional processing |
| 411 |
} |
| 412 |
else |
| 413 |
{ |
| 414 |
NS_LOG_ERROR ("Unable to deliver packet locally due to null callback " << p->GetUid () << " from " << origin); |
| 415 |
ecb (p, header, Socket::ERROR_NOROUTETOHOST); |
| 416 |
} |
| 402 |
if (header.GetTtl () > 1) |
417 |
if (header.GetTtl () > 1) |
| 403 |
{ |
418 |
{ |
| 404 |
NS_LOG_LOGIC ("Forward broadcast. TTL " << (uint16_t) header.GetTtl ()); |
419 |
NS_LOG_LOGIC ("Forward broadcast. TTL " << (uint16_t) header.GetTtl ()); |
|
|
| 420 |
|
435 |
|
| 421 |
if (m_ipv4->IsDestinationAddress (dst, iif)) |
436 |
if (m_ipv4->IsDestinationAddress (dst, iif)) |
| 422 |
{ |
437 |
{ |
| 423 |
NS_LOG_LOGIC ("Unicast local delivery to " << dst); |
438 |
if (lcb.IsNull () == false) |
| 424 |
lcb (p, header, iif); |
439 |
{ |
|
|
440 |
NS_LOG_LOGIC ("Unicast local delivery to " << dst); |
| 441 |
lcb (p, header, iif); |
| 442 |
} |
| 443 |
else |
| 444 |
{ |
| 445 |
NS_LOG_ERROR ("Unable to deliver packet locally due to null callback " << p->GetUid () << " from " << origin); |
| 446 |
ecb (p, header, Socket::ERROR_NOROUTETOHOST); |
| 447 |
} |
| 425 |
return true; |
448 |
return true; |
| 426 |
} |
449 |
} |
| 427 |
RoutingTableEntry toDst; |
450 |
RoutingTableEntry toDst; |