|
|
| 619 |
|
619 |
|
| 620 |
CheckCacheStateAndFlush (); |
620 |
CheckCacheStateAndFlush (); |
| 621 |
|
621 |
|
|
|
622 |
NS_ASSERT (m_ipv4 != 0); |
| 623 |
// Check if input device supports IP |
| 624 |
NS_ASSERT (m_ipv4->GetInterfaceForDevice (idev) >= 0); |
| 625 |
uint32_t iif = m_ipv4->GetInterfaceForDevice (idev); |
| 626 |
|
| 627 |
NS_LOG_LOGIC ("Unicast destination"); |
| 628 |
/// \todo Configurable option to enable \RFC{1222} Strong End System Model |
| 629 |
// Right now, we will be permissive and allow a source to send us |
| 630 |
// a packet to one of our other interface addresses; that is, the |
| 631 |
// destination unicast address does not match one of the iif addresses, |
| 632 |
// but we check our other interfaces. This could be an option |
| 633 |
// (to remove the outer loop immediately below and just check iif). |
| 634 |
for (uint32_t j = 0; j < m_ipv4->GetNInterfaces (); j++) |
| 635 |
{ |
| 636 |
for (uint32_t i = 0; i < m_ipv4->GetNAddresses (j); i++) |
| 637 |
{ |
| 638 |
Ipv4InterfaceAddress iaddr = m_ipv4->GetAddress (j, i); |
| 639 |
Ipv4Address addr = iaddr.GetLocal (); |
| 640 |
if (addr.IsEqual (header.GetDestination ())) |
| 641 |
{ |
| 642 |
if (j == iif) |
| 643 |
{ |
| 644 |
NS_LOG_LOGIC ("For me (destination " << addr << " match)"); |
| 645 |
} |
| 646 |
else |
| 647 |
{ |
| 648 |
NS_LOG_LOGIC ("For me (destination " << addr << " match) on another interface " << header.GetDestination ()); |
| 649 |
} |
| 650 |
lcb (p, header, iif); |
| 651 |
return true; |
| 652 |
} |
| 653 |
if (header.GetDestination ().IsEqual (iaddr.GetBroadcast ())) |
| 654 |
{ |
| 655 |
NS_LOG_LOGIC ("For me (interface broadcast address)"); |
| 656 |
lcb (p, header, iif); |
| 657 |
return true; |
| 658 |
} |
| 659 |
NS_LOG_LOGIC ("Address "<< addr << " not a match"); |
| 660 |
} |
| 661 |
} |
| 662 |
|
| 622 |
Ptr<Ipv4Route> rtentry; |
663 |
Ptr<Ipv4Route> rtentry; |
| 623 |
|
664 |
|
| 624 |
// Get the nix-vector from the packet |
665 |
// Get the nix-vector from the packet |