|
Lines 593-602
void Icmpv6L4Protocol::HandleNA (Ptr<Pac
|
Link Here
|
|---|
|
| 593 |
Ipv6InterfaceAddress ifaddr; |
593 |
Ipv6InterfaceAddress ifaddr; |
| 594 |
bool found = false; |
594 |
bool found = false; |
| 595 |
uint32_t i = 0; |
595 |
uint32_t i = 0; |
| 596 |
uint32_t nb = 0; |
596 |
uint32_t nb = interface->GetNAddresses (); |
| 597 |
|
597 |
|
| 598 |
for (i = 0; i < nb; i++) |
598 |
for (i = 0; i < nb; i++) |
| 599 |
{ |
599 |
{ |
|
|
600 |
ifaddr = interface->GetAddress (i); |
| 600 |
if (ifaddr.GetAddress () == target) |
601 |
if (ifaddr.GetAddress () == target) |
| 601 |
{ |
602 |
{ |
| 602 |
found = true; |
603 |
found = true; |
|
Lines 1072-1078
void Icmpv6L4Protocol::SendErrorParamete
|
Link Here
|
|---|
|
| 1072 |
SendMessage (p, dst, header, 255); |
1073 |
SendMessage (p, dst, header, 255); |
| 1073 |
} |
1074 |
} |
| 1074 |
|
1075 |
|
| 1075 |
void Icmpv6L4Protocol::SendRedirection (Ptr<Packet> redirectedPacket, Ipv6Address dst, Ipv6Address redirTarget, Ipv6Address redirDestination, Address redirHardwareTarget) |
1076 |
void Icmpv6L4Protocol::SendRedirection (Ptr<Packet> redirectedPacket, Ipv6Address src, Ipv6Address dst, Ipv6Address redirTarget, Ipv6Address redirDestination, Address redirHardwareTarget) |
| 1076 |
{ |
1077 |
{ |
| 1077 |
NS_LOG_FUNCTION (this << redirectedPacket << dst << redirTarget << redirDestination << redirHardwareTarget); |
1078 |
NS_LOG_FUNCTION (this << redirectedPacket << dst << redirTarget << redirDestination << redirHardwareTarget); |
| 1078 |
uint32_t llaSize = 0; |
1079 |
uint32_t llaSize = 0; |
|
Lines 1117-1123
void Icmpv6L4Protocol::SendRedirection (
|
Link Here
|
|---|
|
| 1117 |
Icmpv6Redirection redirectionHeader; |
1118 |
Icmpv6Redirection redirectionHeader; |
| 1118 |
redirectionHeader.SetTarget (redirTarget); |
1119 |
redirectionHeader.SetTarget (redirTarget); |
| 1119 |
redirectionHeader.SetDestination (redirDestination); |
1120 |
redirectionHeader.SetDestination (redirDestination); |
| 1120 |
SendMessage (p, dst, redirectionHeader, 64); |
1121 |
redirectionHeader.CalculatePseudoHeaderChecksum (src, dst, p->GetSize () + redirectionHeader.GetSerializedSize (), PROT_NUMBER); |
|
|
1122 |
p->AddHeader (redirectionHeader); |
| 1123 |
SendMessage (p, src, dst, 64); |
| 1121 |
} |
1124 |
} |
| 1122 |
|
1125 |
|
| 1123 |
Ptr<Packet> Icmpv6L4Protocol::ForgeNA (Ipv6Address src, Ipv6Address dst, Address* hardwareAddress, uint8_t flags) |
1126 |
Ptr<Packet> Icmpv6L4Protocol::ForgeNA (Ipv6Address src, Ipv6Address dst, Address* hardwareAddress, uint8_t flags) |
|
Lines 1232-1238
bool Icmpv6L4Protocol::Lookup (Ipv6Addre
|
Link Here
|
|---|
|
| 1232 |
cache = FindCache (device); |
1235 |
cache = FindCache (device); |
| 1233 |
} |
1236 |
} |
| 1234 |
|
1237 |
|
| 1235 |
return cache->Lookup (dst); |
1238 |
NdiscCache::Entry* entry = cache->Lookup (dst); |
|
|
1239 |
if (entry) |
| 1240 |
{ |
| 1241 |
if (entry->IsReachable () || entry->IsDelay ()) |
| 1242 |
{ |
| 1243 |
*hardwareDestination = entry->GetMacAddress (); |
| 1244 |
return true; |
| 1245 |
} |
| 1246 |
else if (entry->IsStale ()) |
| 1247 |
{ |
| 1248 |
entry->StartDelayTimer (); |
| 1249 |
entry->MarkDelay (); |
| 1250 |
*hardwareDestination = entry->GetMacAddress (); |
| 1251 |
return true; |
| 1252 |
} |
| 1253 |
else |
| 1254 |
{ |
| 1255 |
return false; |
| 1256 |
} |
| 1257 |
} |
| 1258 |
return false; |
| 1236 |
} |
1259 |
} |
| 1237 |
|
1260 |
|
| 1238 |
bool Icmpv6L4Protocol::Lookup (Ptr<Packet> p, Ipv6Address dst, Ptr<NetDevice> device, Ptr<NdiscCache> cache, Address* hardwareDestination) |
1261 |
bool Icmpv6L4Protocol::Lookup (Ptr<Packet> p, Ipv6Address dst, Ptr<NetDevice> device, Ptr<NdiscCache> cache, Address* hardwareDestination) |