|
|
| 22 |
#include "ns3/log.h" |
22 |
#include "ns3/log.h" |
| 23 |
#include "ns3/nstime.h" |
23 |
#include "ns3/nstime.h" |
| 24 |
#include "ns3/boolean.h" |
24 |
#include "ns3/boolean.h" |
|
|
25 |
#include "ns3/system-object.h" |
| 25 |
#include "ns3/object-vector.h" |
26 |
#include "ns3/object-vector.h" |
| 26 |
|
27 |
|
| 27 |
#include "ns3/packet.h" |
28 |
#include "ns3/packet.h" |
|
Lines 452-458
TcpL4Protocol::Receive (Ptr<Packet> pack
|
Link Here
|
|---|
|
| 452 |
NS_LOG_FUNCTION (this << packet << source << destination << incomingInterface); |
453 |
NS_LOG_FUNCTION (this << packet << source << destination << incomingInterface); |
| 453 |
|
454 |
|
| 454 |
TcpHeader tcpHeader; |
455 |
TcpHeader tcpHeader; |
| 455 |
if(m_calcChecksum) |
456 |
|
|
|
457 |
BooleanValue b; |
| 458 |
System ()->GetAttribute ("CalcChecksum", b); |
| 459 |
|
| 460 |
if(m_calcChecksum || b.Get ()) |
| 456 |
{ |
461 |
{ |
| 457 |
tcpHeader.EnableChecksums(); |
462 |
tcpHeader.EnableChecksums(); |
| 458 |
tcpHeader.InitializeChecksum (source, destination, PROT_NUMBER); |
463 |
tcpHeader.InitializeChecksum (source, destination, PROT_NUMBER); |
|
Lines 504-510
TcpL4Protocol::Send (Ptr<Packet> packet,
|
Link Here
|
|---|
|
| 504 |
TcpHeader tcpHeader; |
509 |
TcpHeader tcpHeader; |
| 505 |
tcpHeader.SetDestinationPort (dport); |
510 |
tcpHeader.SetDestinationPort (dport); |
| 506 |
tcpHeader.SetSourcePort (sport); |
511 |
tcpHeader.SetSourcePort (sport); |
| 507 |
if(m_calcChecksum) |
512 |
|
|
|
513 |
BooleanValue b; |
| 514 |
System ()->GetAttribute ("CalcChecksum", b); |
| 515 |
|
| 516 |
if(m_calcChecksum || b.Get ()) |
| 508 |
{ |
517 |
{ |
| 509 |
tcpHeader.EnableChecksums(); |
518 |
tcpHeader.EnableChecksums(); |
| 510 |
} |
519 |
} |
|
Lines 538-544
TcpL4Protocol::SendPacket (Ptr<Packet> p
|
Link Here
|
|---|
|
| 538 |
|
547 |
|
| 539 |
outgoingHeader.SetLength (5); //header length in units of 32bit words |
548 |
outgoingHeader.SetLength (5); //header length in units of 32bit words |
| 540 |
/* outgoingHeader.SetUrgentPointer (0); //XXX */ |
549 |
/* outgoingHeader.SetUrgentPointer (0); //XXX */ |
| 541 |
if(m_calcChecksum) |
550 |
|
|
|
551 |
BooleanValue b; |
| 552 |
System ()->GetAttribute ("CalcChecksum", b); |
| 553 |
|
| 554 |
if(m_calcChecksum || b.Get ()) |
| 542 |
{ |
555 |
{ |
| 543 |
outgoingHeader.EnableChecksums(); |
556 |
outgoingHeader.EnableChecksums(); |
| 544 |
} |
557 |
} |