|
|
| 75 |
UintegerValue (65535), |
75 |
UintegerValue (65535), |
| 76 |
MakeUintegerAccessor (&TcpSocketBase::m_maxWinSize), |
76 |
MakeUintegerAccessor (&TcpSocketBase::m_maxWinSize), |
| 77 |
MakeUintegerChecker<uint16_t> ()) |
77 |
MakeUintegerChecker<uint16_t> ()) |
|
|
78 |
.AddAttribute ("IcmpCallback", "Callback invoked whenever an icmp error is received on this socket.", |
| 79 |
CallbackValue (), |
| 80 |
MakeCallbackAccessor (&TcpSocketBase::m_icmpCallback), |
| 81 |
MakeCallbackChecker ()) |
| 82 |
.AddAttribute ("IcmpCallback6", "Callback invoked whenever an icmpv6 error is received on this socket.", |
| 83 |
CallbackValue (), |
| 84 |
MakeCallbackAccessor (&TcpSocketBase::m_icmpCallback6), |
| 85 |
MakeCallbackChecker ()) |
| 78 |
.AddTraceSource ("RTO", |
86 |
.AddTraceSource ("RTO", |
| 79 |
"Retransmission timeout", |
87 |
"Retransmission timeout", |
| 80 |
MakeTraceSourceAccessor (&TcpSocketBase::m_rto)) |
88 |
MakeTraceSourceAccessor (&TcpSocketBase::m_rto)) |
|
|
| 640 |
if (m_endPoint != 0) |
648 |
if (m_endPoint != 0) |
| 641 |
{ |
649 |
{ |
| 642 |
m_endPoint->SetRxCallback (MakeCallback (&TcpSocketBase::ForwardUp, Ptr<TcpSocketBase> (this))); |
650 |
m_endPoint->SetRxCallback (MakeCallback (&TcpSocketBase::ForwardUp, Ptr<TcpSocketBase> (this))); |
|
|
651 |
m_endPoint->SetIcmpCallback (MakeCallback (&TcpSocketBase::ForwardIcmp, Ptr<TcpSocketBase> (this))); |
| 643 |
m_endPoint->SetDestroyCallback (MakeCallback (&TcpSocketBase::Destroy, Ptr<TcpSocketBase> (this))); |
652 |
m_endPoint->SetDestroyCallback (MakeCallback (&TcpSocketBase::Destroy, Ptr<TcpSocketBase> (this))); |
| 644 |
} |
653 |
} |
| 645 |
if (m_endPoint6 != 0) |
654 |
if (m_endPoint6 != 0) |
| 646 |
{ |
655 |
{ |
| 647 |
m_endPoint6->SetRxCallback (MakeCallback (&TcpSocketBase::ForwardUp6, Ptr<TcpSocketBase> (this))); |
656 |
m_endPoint6->SetRxCallback (MakeCallback (&TcpSocketBase::ForwardUp6, Ptr<TcpSocketBase> (this))); |
|
|
657 |
m_endPoint6->SetIcmpCallback (MakeCallback (&TcpSocketBase::ForwardIcmp6, Ptr<TcpSocketBase> (this))); |
| 648 |
m_endPoint6->SetDestroyCallback (MakeCallback (&TcpSocketBase::Destroy6, Ptr<TcpSocketBase> (this))); |
658 |
m_endPoint6->SetDestroyCallback (MakeCallback (&TcpSocketBase::Destroy6, Ptr<TcpSocketBase> (this))); |
| 649 |
} |
659 |
} |
| 650 |
|
660 |
|
|
|
| 772 |
DoForwardUp (packet, saddr, daddr, port); |
782 |
DoForwardUp (packet, saddr, daddr, port); |
| 773 |
} |
783 |
} |
| 774 |
|
784 |
|
|
|
785 |
void |
| 786 |
TcpSocketBase::ForwardIcmp (Ipv4Address icmpSource, uint8_t icmpTtl, |
| 787 |
uint8_t icmpType, uint8_t icmpCode, |
| 788 |
uint32_t icmpInfo) |
| 789 |
{ |
| 790 |
NS_LOG_FUNCTION (this << icmpSource << (uint32_t)icmpTtl << (uint32_t)icmpType << |
| 791 |
(uint32_t)icmpCode << icmpInfo); |
| 792 |
if (!m_icmpCallback.IsNull ()) |
| 793 |
{ |
| 794 |
m_icmpCallback (icmpSource, icmpTtl, icmpType, icmpCode, icmpInfo); |
| 795 |
} |
| 796 |
} |
| 797 |
|
| 798 |
void |
| 799 |
TcpSocketBase::ForwardIcmp6 (Ipv6Address icmpSource, uint8_t icmpTtl, |
| 800 |
uint8_t icmpType, uint8_t icmpCode, |
| 801 |
uint32_t icmpInfo) |
| 802 |
{ |
| 803 |
NS_LOG_FUNCTION (this << icmpSource << (uint32_t)icmpTtl << (uint32_t)icmpType << |
| 804 |
(uint32_t)icmpCode << icmpInfo); |
| 805 |
if (!m_icmpCallback6.IsNull ()) |
| 806 |
{ |
| 807 |
m_icmpCallback6 (icmpSource, icmpTtl, icmpType, icmpCode, icmpInfo); |
| 808 |
} |
| 809 |
} |
| 810 |
|
| 811 |
|
| 775 |
/** The real function to handle the incoming packet from lower layers. This is |
812 |
/** The real function to handle the incoming packet from lower layers. This is |
| 776 |
wrapped by ForwardUp() so that this function can be overloaded by daughter |
813 |
wrapped by ForwardUp() so that this function can be overloaded by daughter |
| 777 |
classes. */ |
814 |
classes. */ |