TianoCore EDK2 master
Loading...
Searching...
No Matches
TcpInput.c File Reference
#include "TcpMain.h"

Go to the source code of this file.

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)
 
INTN TcpTrimSegment (IN NET_BUF *Nbuf, IN TCP_SEQNO Left, IN TCP_SEQNO Right)
 
INTN TcpTrimInWnd (IN TCP_CB *Tcb, IN NET_BUF *Nbuf)
 
INTN TcpDeliverData (IN OUT TCP_CB *Tcb)
 
INTN TcpQueueData (IN OUT TCP_CB *Tcb, IN NET_BUF *Nbuf)
 
INTN 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 - 2018, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file TcpInput.c.

Function Documentation

◆ TcpAdjustSndQue()

INTN TcpAdjustSndQue ( IN TCP_CB Tcb,
IN TCP_SEQNO  Ack 
)

Adjust the send queue or the retransmit queue.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
[in]AckThe acknowledge sequence number of the received segment.
Return values
0An error condition occurred.
1No error occurred.

Definition at line 656 of file TcpInput.c.

◆ TcpComputeRtt()

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

Compute the RTT as specified in RFC2988.

Parameters
[in,out]TcbPointer to the TCP_CB of this TCP instance.
[in]MeasureCurrently measured RTT in heartbeats.

Definition at line 203 of file TcpInput.c.

◆ TcpDeliverData()

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]TcbPointer to the TCP_CB of this TCP instance.
Return values
0No error occurred to deliver data.
-1An error condition occurred. The proper response is to reset the connection.

Definition at line 370 of file TcpInput.c.

◆ TcpFastLossRecover()

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

NewReno fast loss recovery defined in RFC3792.

Parameters
[in,out]TcbPointer to the TCP_CB of this TCP instance.
[in]SegSegment that triggers the fast loss recovery.

Definition at line 156 of file TcpInput.c.

◆ TcpFastRecover()

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

NewReno fast recovery defined in RFC3782.

Parameters
[in,out]TcbPointer to the TCP_CB of this TCP instance.
[in]SegSegment that triggers the fast recovery.

Definition at line 40 of file TcpInput.c.

◆ TcpIcmpInput()

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]NbufThe buffer that contains part of the TCP segment without an IP header truncated from the ICMP error packet.
[in]IcmpErrThe ICMP error code interpreted from an ICMP error packet.
[in]SrcSource address of the ICMP error message.
[in]DstDestination address of the ICMP error message.
[in]VersionIP_VERSION_4 indicates IP4 stack. IP_VERSION_6 indicates IP6 stack.

Definition at line 1569 of file TcpInput.c.

◆ TcpInput()

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]NbufBuffer that contains received a TCP segment without an IP header.
[in]SrcSource address of the segment, or the peer's IP address.
[in]DstDestination address of the segment, or the local end's IP address.
[in]VersionIP_VERSION_4 indicates IP4 stack. IP_VERSION_6 indicates IP6 stack.
Return values
0Segment processed successfully. It is either accepted or discarded. However, no connection is reset by the segment.
-1A connection is reset by the segment.

Definition at line 710 of file TcpInput.c.

◆ TcpQueueData()

INTN TcpQueueData ( IN OUT TCP_CB Tcb,
IN NET_BUF Nbuf 
)

Store the data into the reassemble queue.

Parameters
[in,out]TcbPointer to the TCP_CB of this TCP instance.
[in]NbufPointer to the buffer containing the data to be queued.
Return values
0An error condition occurred.
1No error occurred to queue data.

Definition at line 548 of file TcpInput.c.

◆ TcpSeqAcceptable()

INTN TcpSeqAcceptable ( IN TCP_CB Tcb,
IN TCP_SEG Seg 
)

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

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

Definition at line 23 of file TcpInput.c.

◆ TcpTrimInWnd()

INTN TcpTrimInWnd ( IN TCP_CB Tcb,
IN NET_BUF Nbuf 
)

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

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
[in]NbufPointer to the NET_BUF containing the received tcp segment.
Return values
0The segment is broken.
1The segment is in good shape.

Definition at line 350 of file TcpInput.c.

◆ TcpTrimSegment()

INTN 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]NbufThe buffer that contains a received TCP segment without an IP header.
[in]LeftThe sequence number of the window's left edge.
[in]RightThe sequence number of the window's right edge.
Return values
0The segment is broken.
1The segment is in good shape.

Definition at line 265 of file TcpInput.c.