NetworkPkg/TcpDxe/TcpInput.c File Reference


Functions

INTN TcpSeqAcceptable (IN TCP_CB *Tcb, IN TCP_SEG *Seg)
VOID TcpFastRecover (IN OUT TCP_CB *Tcb, IN TCP_SEG *Seg)
VOID TcpFastLossRecover (IN OUT TCP_CB *Tcb, IN TCP_SEG *Seg)
VOID TcpComputeRtt (IN OUT TCP_CB *Tcb, IN UINT32 Measure)
VOID TcpTrimSegment (IN NET_BUF *Nbuf, IN TCP_SEQNO Left, IN TCP_SEQNO Right)
VOID TcpTrimInWnd (IN TCP_CB *Tcb, IN NET_BUF *Nbuf)
INTN TcpDeliverData (IN OUT TCP_CB *Tcb)
VOID TcpQueueData (IN OUT TCP_CB *Tcb, IN NET_BUF *Nbuf)
VOID TcpAdjustSndQue (IN TCP_CB *Tcb, IN TCP_SEQNO Ack)
INTN TcpInput (IN NET_BUF *Nbuf, IN EFI_IP_ADDRESS *Src, IN EFI_IP_ADDRESS *Dst, IN UINT8 Version)
VOID TcpIcmpInput (IN NET_BUF *Nbuf, IN UINT8 IcmpErr, IN EFI_IP_ADDRESS *Src, IN EFI_IP_ADDRESS *Dst, IN UINT8 Version)

Detailed Description

TCP input process routines.

Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Function Documentation

VOID TcpAdjustSndQue ( IN TCP_CB Tcb,
IN TCP_SEQNO  Ack 
)

Adjust the send queue or the retransmit queue.

Parameters:
[in] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Ack The acknowledge seuqence number of the received segment.

References _TCP_SEG::End, _TCP_SEG::Seq, TCP_SEQ_GEQ, TCP_SEQ_LEQ, TCPSEG_NETBUF, and TcpTrimSegment().

Referenced by TcpInput().

VOID TcpComputeRtt ( IN OUT TCP_CB Tcb,
IN UINT32  Measure 
)

Compute the RTT as specified in RFC2988.

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Measure Currently measured RTT in heartbeats.

References TCP_RTO_MAX, TCP_RTO_MIN, and TCP_RTT_SHIFT.

Referenced by TcpInput().

INTN TcpDeliverData ( IN OUT TCP_CB Tcb  ) 

Process the data and FIN flag, and check whether to deliver data to the socket layer.

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.
Return values:
0 No error occurred to deliver data.
-1 An error condition occurred. The proper response is to reset the connection.

References _TCP_SEG::End, _TCP_SEG::Flag, _TCP_SEG::Seq, SockDataRcvd(), SockNoMoreData(), TCP_CLOSE_WAIT, TCP_CLOSING, TCP_CONNECTED, TCP_CTRL_ACK_NOW, TCP_CTRL_FIN_ACKED, TCP_CTRL_RCVD_URG, TCP_ESTABLISHED, TCP_FIN_RCVD, TCP_FIN_WAIT_1, TCP_FIN_WAIT_2, TCP_FLG_FIN, TCP_FLG_ON, TCP_FLG_PSH, TCP_LAST_ACK, TCP_SEQ_GT, TCP_SEQ_LEQ, TCP_SET_FLG, TCP_SUB_SEQ, TCP_SYN_RCVD, TCP_TIME_WAIT, TCP_TIMER_2MSL, TcpClearAllTimer(), TcpClose(), TCPSEG_NETBUF, TcpSendAck(), TcpSetState(), TcpSetTimer(), and TcpVerifySegment().

Referenced by TcpInput().

VOID TcpFastLossRecover ( IN OUT TCP_CB Tcb,
IN TCP_SEG Seg 
)

NewReno fast loss recovery defined in RFC3792.

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Seg Segment that triggers the fast loss recovery.

References TCP_CONGEST_OPEN, TCP_SEQ_GEQ, TCP_SEQ_GT, and TcpRetransmit().

Referenced by TcpInput().

VOID TcpFastRecover ( IN OUT TCP_CB Tcb,
IN TCP_SEG Seg 
)

NewReno fast recovery defined in RFC3782.

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Seg Segment that triggers the fast recovery.

References TCP_CLEAR_FLG, TCP_CONGEST_OPEN, TCP_CONGEST_RECOVER, TCP_CTRL_RTT_ON, TCP_SEQ_GEQ, TCP_SUB_SEQ, and TcpRetransmit().

Referenced by TcpInput().

VOID TcpIcmpInput ( IN NET_BUF *  Nbuf,
IN UINT8  IcmpErr,
IN EFI_IP_ADDRESS *  Src,
IN EFI_IP_ADDRESS *  Dst,
IN UINT8  Version 
)

Process the received ICMP error messages for TCP.

Parameters:
[in] Nbuf The buffer that contains part of the TCP segment without an IP header truncated from the ICMP error packet.
[in] IcmpErr The ICMP error code interpreted from an ICMP error packet.
[in] Src Source address of the ICMP error message.
[in] Dst Destination address of the ICMP error message.
[in] Version IP_VERSION_4 indicates IP4 stack. IP_VERSION_6 indicates IP6 stack.

References _TCP_SOCKET::IpVersion, _TCP_CONTROL_BLOCK::Sk, _TCP_CONTROL_BLOCK::SndNxt, _TCP_CONTROL_BLOCK::SndUna, SOCK_ERROR, _TCP_CONTROL_BLOCK::State, TCP_CLOSED, TCP_SEQ_LEQ, TCP_SEQ_LT, TcpClose(), and TcpLocateTcb().

Referenced by TcpRxCallback().

INTN TcpInput ( IN NET_BUF *  Nbuf,
IN EFI_IP_ADDRESS *  Src,
IN EFI_IP_ADDRESS *  Dst,
IN UINT8  Version 
)

Process the received TCP segments.

Parameters:
[in] Nbuf Buffer that contains received a TCP segment without an IP header.
[in] Src Source address of the segment, or the peer's IP address.
[in] Dst Destination address of the segment, or the local end's IP address.
[in] Version IP_VERSION_4 indicates IP4 stack. IP_VERSION_6 indicates IP6 stack.
Return values:
0 Segment processed successfully. It is either accepted or discarded. However, no connection is reset by the segment.
-1 A connection is reset by the segment.

References _TCP_SEG::Ack, _TCP_CONTROL_BLOCK::CongestState, _TCP_CONTROL_BLOCK::ConnectTimeout, _TCP_CONTROL_BLOCK::CtrlFlag, _TCP_CONTROL_BLOCK::CWnd, _TCP_CONTROL_BLOCK::DupAck, _TCP_SEG::End, _TCP_CONTROL_BLOCK::FinWait2Timeout, _TCP_OPTION::Flag, _TCP_SEG::Flag, _TCP_CONTROL_BLOCK::Idle, _TCP_PEER::Ip, _TCP_CONTROL_BLOCK::IpInfo, _TCP_CONTROL_BLOCK::Iss, _TCP_CONTROL_BLOCK::LocalEnd, _TCP_CONTROL_BLOCK::LossRecover, mTcpTick, _TCP_CONTROL_BLOCK::Parent, _TCP_PEER::Port, _TCP_CONTROL_BLOCK::ProbeTimerOn, _TCP_CONTROL_BLOCK::RcvQue, _TCP_CONTROL_BLOCK::RcvUp, _TCP_CONTROL_BLOCK::RcvWl2, _TCP_CONTROL_BLOCK::Recover, _TCP_CONTROL_BLOCK::RemoteEnd, _TCP_CONTROL_BLOCK::Rto, _TCP_CONTROL_BLOCK::RttMeasure, _TCP_SEG::Seq, _TCP_CONTROL_BLOCK::Sk, _TCP_CONTROL_BLOCK::SndMss, _TCP_CONTROL_BLOCK::SndNxt, _TCP_CONTROL_BLOCK::SndUna, _TCP_CONTROL_BLOCK::SndUp, _TCP_CONTROL_BLOCK::SndWl1, _TCP_CONTROL_BLOCK::SndWl2, _TCP_CONTROL_BLOCK::SndWnd, _TCP_CONTROL_BLOCK::SndWndMax, _TCP_CONTROL_BLOCK::SndWndScale, SOCK_ERROR, _TCP_CONTROL_BLOCK::Ssthresh, _TCP_CONTROL_BLOCK::State, TCP6_KEEP_NEIGHBOR_TIME, TCP6_REFRESH_NEIGHBOR_TICK, Tcp6RefreshNeighbor(), TCP_CLEAR_FLG, TCP_CLOSE_WAIT, TCP_CLOSED, TCP_CLOSING, TCP_CONGEST_LOSS, TCP_CONGEST_OPEN, TCP_CONGEST_RECOVER, TCP_CTRL_ACK_NOW, TCP_CTRL_FIN_ACKED, TCP_CTRL_FIN_SENT, TCP_CTRL_RCVD_URG, TCP_CTRL_RTT_ON, TCP_CTRL_SND_URG, TCP_ESTABLISHED, TCP_FIN_RCVD, TCP_FIN_WAIT_1, TCP_FIN_WAIT_2, TCP_FLG_ACK, TCP_FLG_FIN, TCP_FLG_ON, TCP_FLG_RST, TCP_FLG_SYN, TCP_FLG_URG, TCP_LAST_ACK, TCP_LISTEN, TCP_LOCAL_CLOSED, TCP_MAX_WIN, TCP_OPTION_RCVD_TS, TCP_SEQ_GT, TCP_SEQ_LEQ, TCP_SEQ_LT, TCP_SET_FLG, TCP_SUB_TIME, TCP_SYN_RCVD, TCP_SYN_SENT, TCP_TIME_WAIT, TCP_TIMER_2MSL, TCP_TIMER_CONNECT, TCP_TIMER_FINWAIT2, TCP_TIMER_PROBE, TCP_TIMER_REXMIT, TcpAdjustSndQue(), TcpChecksum(), TcpClearAllTimer(), TcpClearTimer(), TcpCloneTcb(), TcpClose(), TcpComputeRtt(), TcpDeliverData(), TcpFastLossRecover(), TcpFastRecover(), TcpFormatNetbuf(), TcpInitTcbLocal(), TcpInitTcbPeer(), TcpInsertTcb(), TcpLocateTcb(), TcpParseOption(), TcpQueueData(), TcpSendAck(), TcpSendReset(), TcpSeqAcceptable(), TcpSetKeepaliveTimer(), TcpSetProbeTimer(), TcpSetState(), TcpSetTimer(), TcpToSendAck(), TcpToSendData(), TcpTrimInWnd(), _TCP_CONTROL_BLOCK::Tick, _TCP_CONTROL_BLOCK::TimeWaitTimeout, _TCP_OPTION::TSEcr, _TCP_CONTROL_BLOCK::TsRecent, _TCP_CONTROL_BLOCK::TsRecentAge, _TCP_OPTION::TSVal, _TCP_SEG::Urg, and _TCP_SEG::Wnd.

Referenced by TcpRxCallback().

VOID TcpQueueData ( IN OUT TCP_CB Tcb,
IN NET_BUF *  Nbuf 
)

Store the data into the reassemble queue.

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Nbuf Pointer to the buffer containing the data to be queued.

References _TCP_SEG::End, _TCP_SEG::Seq, TCP_CTRL_ACK_NOW, TCP_SEQ_LEQ, TCP_SEQ_LT, TCP_SET_FLG, TCPSEG_NETBUF, and TcpTrimSegment().

Referenced by TcpInput().

INTN TcpSeqAcceptable ( IN TCP_CB Tcb,
IN TCP_SEG Seg 
)

Check whether the sequence number of the incoming segment is acceptable.

Parameters:
[in] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Seg Pointer to the incoming segment.
Return values:
1 The sequence number is acceptable.
0 The sequence number is not acceptable.

References TCP_SEQ_LEQ, and TCP_SEQ_LT.

Referenced by TcpInput().

VOID TcpTrimInWnd ( IN TCP_CB Tcb,
IN NET_BUF *  Nbuf 
)

Trim off the data outside the tcb's receive window.

Parameters:
[in] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Nbuf Pointer to the NET_BUF containing the received tcp segment.

References TcpTrimSegment().

Referenced by TcpInput().

VOID TcpTrimSegment ( IN NET_BUF *  Nbuf,
IN TCP_SEQNO  Left,
IN TCP_SEQNO  Right 
)

Trim the data; SYN and FIN to fit into the window defined by Left and Right.

Parameters:
[in] Nbuf The buffer that contains a received TCP segment without an IP header.
[in] Left The sequence number of the window's left edge.
[in] Right The sequence number of the window's right edge.

References _TCP_SEG::End, _TCP_SEG::Flag, _TCP_SEG::Seq, TCP_CLEAR_FLG, TCP_FLG_FIN, TCP_FLG_ON, TCP_FLG_SYN, TCP_FLG_URG, TCP_SEQ_GT, TCP_SEQ_LEQ, TCP_SEQ_LT, TCP_SUB_SEQ, TCPSEG_NETBUF, TcpVerifySegment(), and _TCP_SEG::Urg.

Referenced by TcpAdjustSndQue(), TcpQueueData(), and TcpTrimInWnd().


Generated on Mon Sep 28 08:49:06 2015 for NetworkPkg[ALL] by  doxygen 1.5.7.1