|
Lines 654-659
Ipv4L3Protocol::Send (Ptr<Packet> packet,
|
Link Here
|
|---|
|
| 654 |
} |
654 |
} |
| 655 |
} |
655 |
} |
| 656 |
|
656 |
|
|
|
657 |
uint128_t Ipv4L3Protocol::GetIpIdentificationKey(Ipv4Address source, |
| 658 |
Ipv4Address destination, |
| 659 |
uint8_t protocol) |
| 660 |
{ |
| 661 |
uint128_t src = (uint128_t)source.Get() & 0xffffffff; |
| 662 |
uint128_t dst = (uint128_t)destination.Get() & 0xffffffff; |
| 663 |
uint128_t key = protocol | (dst << 8) | (src << 40); |
| 664 |
return key; |
| 665 |
} |
| 666 |
|
| 657 |
// XXX when should we set ip_id? check whether we are incrementing |
667 |
// XXX when should we set ip_id? check whether we are incrementing |
| 658 |
// m_identification on packets that may later be dropped in this stack |
668 |
// m_identification on packets that may later be dropped in this stack |
| 659 |
// and whether that deviates from Linux |
669 |
// and whether that deviates from Linux |
|
Lines 676-683
Ipv4L3Protocol::BuildHeader (
|
Link Here
|
|---|
|
| 676 |
if (mayFragment == true) |
686 |
if (mayFragment == true) |
| 677 |
{ |
687 |
{ |
| 678 |
ipHeader.SetMayFragment (); |
688 |
ipHeader.SetMayFragment (); |
| 679 |
ipHeader.SetIdentification (m_identification[protocol]); |
689 |
uint128_t ipIdKey = GetIpIdentificationKey(source, destination, protocol); |
| 680 |
m_identification[protocol]++; |
690 |
ipHeader.SetIdentification (m_identification[ipIdKey]); |
|
|
691 |
m_identification[ipIdKey]++; |
| 681 |
} |
692 |
} |
| 682 |
else |
693 |
else |
| 683 |
{ |
694 |
{ |
|
Lines 686-693
Ipv4L3Protocol::BuildHeader (
|
Link Here
|
|---|
|
| 686 |
// identification requirement: |
697 |
// identification requirement: |
| 687 |
// >> Originating sources MAY set the IPv4 ID field of atomic datagrams |
698 |
// >> Originating sources MAY set the IPv4 ID field of atomic datagrams |
| 688 |
// to any value. |
699 |
// to any value. |
| 689 |
ipHeader.SetIdentification (m_identification[protocol]); |
700 |
uint128_t ipIdKey = GetIpIdentificationKey(source, destination, protocol); |
| 690 |
m_identification[protocol]++; |
701 |
ipHeader.SetIdentification (m_identification[ipIdKey]); |
|
|
702 |
m_identification[ipIdKey]++; |
| 691 |
} |
703 |
} |
| 692 |
if (Node::ChecksumEnabled ()) |
704 |
if (Node::ChecksumEnabled ()) |
| 693 |
{ |
705 |
{ |