]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Func.h
Add comments for functions.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Tcp4Dxe / Tcp4Func.h
index dbb1008b40617879162392067e7b66cda25ecf63..21922c7a023853999259966c6efdf6c014eec8a7 100644 (file)
@@ -1,21 +1,14 @@
 /** @file\r
 \r
-Copyright (c) 2005 - 2006, Intel Corporation\r
+Copyright (c) 2005 - 2006, Intel Corporation<BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
+http://opensource.org/licenses/bsd-license.php<BR>\r
 \r
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-Module Name:\r
-\r
-  Tcp4Func.h\r
-\r
-Abstract:\r
-\r
-\r
 **/\r
 \r
 #ifndef _TCP4_FUNC_H_\r
@@ -30,13 +23,36 @@ Abstract:
 //\r
 // Functions in tcp.c\r
 //\r
+\r
+/**\r
+  Try to find one Tcb whose <Ip, Port> equals to <IN Addr, IN Port>.\r
+\r
+  @param  Addr                  Pointer to the IP address needs to match.\r
+  @param  Port                  The port number needs to match.\r
+\r
+  @return  The Tcb which matches the <Addr Port> paire exists or not.\r
+\r
+**/\r
 BOOLEAN\r
 TcpFindTcbByPeer (\r
   IN EFI_IPv4_ADDRESS  *Addr,\r
   IN TCP_PORTNO        Port\r
   );\r
 \r
-TCP_CB  *\r
+/**\r
+  Locate the TCP_CB related to the socket pair.\r
+\r
+  @param  LocalPort             The local port number.\r
+  @param  LocalIp               The local IP address.\r
+  @param  RemotePort            The remote port number.\r
+  @param  RemoteIp              The remote IP address.\r
+  @param  Syn                   Whether to search the listen sockets, if TRUE, the\r
+                                listen sockets are searched.\r
+\r
+  @return  Pointer to the related TCP_CB, if NULL no match is found.\r
+\r
+**/\r
+TCP_CB *\r
 TcpLocateTcb (\r
   IN TCP_PORTNO  LocalPort,\r
   IN UINT32      LocalIp,\r
@@ -45,26 +61,64 @@ TcpLocateTcb (
   IN BOOLEAN     Syn\r
   );\r
 \r
+/**\r
+  Insert a Tcb into the proper queue.\r
+\r
+  @param  Tcb                   Pointer to the TCP_CB to be inserted.\r
+\r
+  @retval 0                     The Tcb is inserted successfully.\r
+  @retval -1                    Error condition occurred.\r
+\r
+**/\r
 INTN\r
 TcpInsertTcb (\r
   IN TCP_CB *Tcb\r
   );\r
 \r
-TCP_CB  *\r
+/**\r
+  Clone a TCP_CB from Tcb.\r
+\r
+  @param  Tcb                   Pointer to the TCP_CB to be cloned.\r
+\r
+  @return  Pointer to the new cloned TCP_CB, if NULL error condition occurred.\r
+\r
+**/\r
+TCP_CB *\r
 TcpCloneTcb (\r
   IN TCP_CB *Tcb\r
   );\r
 \r
+/**\r
+  Compute an ISS to be used by a new connection.\r
+\r
+  @return  The result ISS.\r
+\r
+**/\r
 TCP_SEQNO\r
 TcpGetIss (\r
   VOID\r
   );\r
 \r
+/**\r
+  Initialize the Tcb local related members.\r
+\r
+  @param  Tcb                   Pointer to the TCP_CB of this TCP instance.\r
+\r
+**/\r
 VOID\r
 TcpInitTcbLocal (\r
   IN TCP_CB *Tcb\r
   );\r
 \r
+/**\r
+  Initialize the peer related members.\r
+\r
+  @param  Tcb                   Pointer to the TCP_CB of this TCP instance.\r
+  @param  Seg                   Pointer to the segment that contains the peer's\r
+                                intial info.\r
+  @param  Opt                   Pointer to the options announced by the peer.\r
+\r
+**/\r
 VOID\r
 TcpInitTcbPeer (\r
   IN TCP_CB     *Tcb,\r
@@ -72,95 +126,241 @@ TcpInitTcbPeer (
   IN TCP_OPTION *Opt\r
   );\r
 \r
+/**\r
+  Get the local mss.\r
+\r
+  @param  Sock        Pointer to the socket to get mss\r
+\r
+  @return  The mss size.\r
+\r
+**/\r
 UINT16\r
 TcpGetRcvMss (\r
-  IN SOCKET *Sock\r
+  IN SOCKET  *Sock\r
   );\r
 \r
+/**\r
+  Set the Tcb's state.\r
+\r
+  @param  Tcb                   Pointer to the TCP_CB of this TCP instance.\r
+  @param  State                 The state to be set.\r
+\r
+**/\r
 VOID\r
 TcpSetState (\r
-  IN TCP_CB *Tcb,\r
-  IN UINT8  State\r
+  IN TCP_CB      *Tcb,\r
+  IN TCP_STATES  State\r
   );\r
 \r
 //\r
 // Functions in Tcp4Output.c\r
 //\r
+/**\r
+  Send the segment to IP via IpIo function.\r
+\r
+  @param  Tcb         Pointer to the TCP_CB of this TCP instance.\r
+  @param  Nbuf        Pointer to the TCP segment to be sent.\r
+  @param  Src         Source address of the TCP segment.\r
+  @param  Dest        Destination address of the TCP segment.\r
+\r
+  @retval 0           The segment was sent out successfully.\r
+  @retval -1          The segment was failed to send.\r
+\r
+**/\r
 INTN\r
 TcpSendIpPacket (\r
-  IN TCP_CB  *Tcb,\r
-  IN NET_BUF *Nbuf,\r
-  IN UINT32  Src,\r
-  IN UINT32  Dst\r
+  IN TCP_CB    *Tcb,\r
+  IN NET_BUF   *Nbuf,\r
+  IN UINT32    Src,\r
+  IN UINT32    Dest\r
   );\r
 \r
+/**\r
+  Check whether to send data/SYN/FIN and piggy back an ACK.\r
+\r
+  @param  Tcb     Pointer to the TCP_CB of this TCP instance.\r
+  @param  Force   Whether to ignore the sender's SWS avoidance algorithm and send\r
+                  out data by force.\r
+\r
+  @return The number of bytes sent.\r
+\r
+**/\r
 INTN\r
 TcpToSendData (\r
   IN TCP_CB *Tcb,\r
-  IN INTN    Force\r
+  IN INTN Force\r
   );\r
 \r
+/**\r
+  Check whether to send an ACK or delayed ACK.\r
+\r
+  @param  Tcb     Pointer to the TCP_CB of this TCP instance.\r
+\r
+**/\r
 VOID\r
 TcpToSendAck (\r
   IN TCP_CB *Tcb\r
   );\r
 \r
+/**\r
+  Send an ACK immediately.\r
+\r
+  @param  Tcb     Pointer to the TCP_CB of this TCP instance.\r
+\r
+**/\r
 VOID\r
 TcpSendAck (\r
   IN TCP_CB *Tcb\r
   );\r
 \r
+/**\r
+  Send a zero probe segment. It can be used by keepalive and zero window probe.\r
+\r
+  @param  Tcb     Pointer to the TCP_CB of this TCP instance.\r
+\r
+  @retval 0       The zero probe segment was sent out successfully.\r
+  @retval other   Error condition occurred.\r
+\r
+**/\r
 INTN\r
 TcpSendZeroProbe (\r
   IN TCP_CB *Tcb\r
   );\r
 \r
+/**\r
+  Process the data and FIN flag, check whether to deliver\r
+  data to the socket layer.\r
+\r
+  @param  Tcb      Pointer to the TCP_CB of this TCP instance.\r
+\r
+  @retval 0        No error occurred to deliver data.\r
+  @retval -1       Error condition occurred. Proper response is to reset the\r
+                   connection.\r
+\r
+**/\r
 INTN\r
 TcpDeliverData (\r
   IN TCP_CB *Tcb\r
   );\r
 \r
+/**\r
+  Send a RESET segment in response to the segment received.\r
+\r
+  @param  Tcb     Pointer to the TCP_CB of this TCP instance, may be NULL.\r
+  @param  Head    TCP header of the segment that triggers the reset.\r
+  @param  Len     Length of the segment that triggers the reset.\r
+  @param  Local   Local IP address.\r
+  @param  Remote  Remote peer's IP address.\r
+\r
+  @retval 0       A reset is sent or no need to send it.\r
+  @retval -1      No reset is sent.\r
+\r
+**/\r
 INTN\r
 TcpSendReset (\r
-  IN TCP_CB   *Tcb,\r
-  IN TCP_HEAD *Head,\r
-  IN INT32    Len,\r
-  IN UINT32   Local,\r
-  IN UINT32   Remote\r
+  IN TCP_CB    *Tcb,\r
+  IN TCP_HEAD  *Head,\r
+  IN INT32     Len,\r
+  IN UINT32    Local,\r
+  IN UINT32    Remote\r
   );\r
 \r
+/**\r
+  Compute the sequence space left in the old receive window.\r
+\r
+  @param  Tcb     Pointer to the TCP_CB of this TCP instance.\r
+\r
+  @return The sequence space left in the old receive window.\r
+\r
+**/\r
 UINT32\r
 TcpRcvWinOld (\r
   IN TCP_CB *Tcb\r
   );\r
 \r
+/**\r
+  Compute the current receive window.\r
+\r
+  @param  Tcb     Pointer to the TCP_CB of this TCP instance.\r
+\r
+  @return The size of the current receive window, in bytes.\r
+\r
+**/\r
 UINT32\r
 TcpRcvWinNow (\r
   IN TCP_CB *Tcb\r
   );\r
 \r
+/**\r
+  Retransmit the segment from sequence Seq.\r
+\r
+  @param  Tcb     Pointer to the TCP_CB of this TCP instance.\r
+  @param  Seq     The sequence number of the segment to be retransmitted.\r
+\r
+  @retval 0       Retransmission succeeded.\r
+  @retval -1      Error condition occurred.\r
+\r
+**/\r
 INTN\r
 TcpRetransmit (\r
   IN TCP_CB    *Tcb,\r
   IN TCP_SEQNO Seq\r
   );\r
 \r
+/**\r
+  Compute how much data to send.\r
+\r
+  @param  Tcb     Pointer to the TCP_CB of this TCP instance.\r
+  @param  Force   Whether to ignore the sender's SWS avoidance algorithm and send\r
+                  out data by force.\r
+\r
+  @return The length of the data can be sent, if 0, no data can be sent.\r
+\r
+**/\r
 UINT32\r
 TcpDataToSend (\r
   IN TCP_CB *Tcb,\r
   IN INTN   Force\r
   );\r
 \r
+/**\r
+  Verify that the segment is in good shape.\r
+\r
+  @param  Nbuf    Buffer that contains the segment to be checked.\r
+\r
+  @retval 0       The segment is broken.\r
+  @retval 1       The segment is in good shape.\r
+\r
+**/\r
 INTN\r
 TcpVerifySegment (\r
   IN NET_BUF *Nbuf\r
   );\r
 \r
+/**\r
+  Verify that all the segments in SndQue are in good shape.\r
+\r
+  @param  Head    Pointer to the head node of the SndQue.\r
+\r
+  @retval 0       At least one segment is broken.\r
+  @retval 1       All segments in the specific queue are in good shape.\r
+\r
+**/\r
 INTN\r
 TcpCheckSndQue (\r
   IN LIST_ENTRY     *Head\r
   );\r
 \r
+/**\r
+  Get a segment from the Tcb's SndQue.\r
+\r
+  @param  Tcb     Pointer to the TCP_CB of this TCP instance.\r
+  @param  Seq     The sequence number of the segment.\r
+  @param  Len     The maximum length of the segment.\r
+\r
+  @return Pointer to the segment, if NULL some error occurred.\r
+\r
+**/\r
 NET_BUF *\r
 TcpGetSegmentSndQue (\r
   IN TCP_CB    *Tcb,\r
@@ -168,6 +368,16 @@ TcpGetSegmentSndQue (
   IN UINT32    Len\r
   );\r
 \r
+/**\r
+  Get a segment from the Tcb's socket buffer.\r
+\r
+  @param  Tcb     Pointer to the TCP_CB of this TCP instance.\r
+  @param  Seq     The sequence number of the segment.\r
+  @param  Len     The maximum length of the segment.\r
+\r
+  @return Pointer to the segment, if NULL some error occurred.\r
+\r
+**/\r
 NET_BUF *\r
 TcpGetSegmentSock (\r
   IN TCP_CB    *Tcb,\r
@@ -175,6 +385,17 @@ TcpGetSegmentSock (
   IN UINT32    Len\r
   );\r
 \r
+/**\r
+  Get a segment starting from sequence Seq of a maximum\r
+  length of Len.\r
+\r
+  @param  Tcb     Pointer to the TCP_CB of this TCP instance.\r
+  @param  Seq     The sequence number of the segment.\r
+  @param  Len     The maximum length of the segment.\r
+\r
+  @return Pointer to the segment, if NULL some error occurred.\r
+\r
+**/\r
 NET_BUF *\r
 TcpGetSegment (\r
   IN TCP_CB    *Tcb,\r
@@ -182,6 +403,14 @@ TcpGetSegment (
   IN UINT32    Len\r
   );\r
 \r
+/**\r
+  Get the maximum SndNxt.\r
+\r
+  @param  Tcb     Pointer to the TCP_CB of this TCP instance.\r
+\r
+  @return The sequence number of the maximum SndNxt.\r
+\r
+**/\r
 TCP_SEQNO\r
 TcpGetMaxSndNxt (\r
   IN TCP_CB *Tcb\r
@@ -190,6 +419,16 @@ TcpGetMaxSndNxt (
 //\r
 // Functions from Tcp4Input.c\r
 //\r
+/**\r
+  Process the received ICMP error messages for TCP.\r
+\r
+  @param  Nbuf     Buffer that contains part of the TCP segment without IP header\r
+                   truncated from the ICMP error packet.\r
+  @param  IcmpErr  The ICMP error code interpreted from ICMP error packet.\r
+  @param  Src      Source address of the ICMP error message.\r
+  @param  Dst      Destination address of the ICMP error message.\r
+\r
+**/\r
 VOID\r
 TcpIcmpInput (\r
   IN NET_BUF     *Nbuf,\r
@@ -198,6 +437,19 @@ TcpIcmpInput (
   IN UINT32      Dst\r
   );\r
 \r
+/**\r
+  Process the received TCP segments.\r
+\r
+  @param  Nbuf     Buffer that contains received TCP segment without IP header.\r
+  @param  Src      Source address of the segment, or the peer's IP address.\r
+  @param  Dst      Destination address of the segment, or the local end's IP\r
+                   address.\r
+\r
+  @retval 0        Segment is processed successfully. It is either accepted or\r
+                   discarded. But no connection is reset by the segment.\r
+  @retval -1       A connection is reset by the segment.\r
+\r
+**/\r
 INTN\r
 TcpInput (\r
   IN NET_BUF *Nbuf,\r
@@ -205,42 +457,96 @@ TcpInput (
   IN UINT32  Dst\r
   );\r
 \r
+/**\r
+  Check whether the sequence number of the incoming segment is acceptable.\r
+\r
+  @param  Tcb      Pointer to the TCP_CB of this TCP instance.\r
+  @param  Seg      Pointer to the incoming segment.\r
+\r
+  @retval 1       The sequence number is acceptable.\r
+  @retval 0       The sequence number is not acceptable.\r
+\r
+**/\r
 INTN\r
 TcpSeqAcceptable (\r
   IN TCP_CB  *Tcb,\r
   IN TCP_SEG *Seg\r
   );\r
 \r
+/**\r
+  NewReno fast recovery, RFC3782.\r
+\r
+  @param  Tcb      Pointer to the TCP_CB of this TCP instance.\r
+  @param  Seg      Segment that triggers the fast recovery.\r
+\r
+**/\r
 VOID\r
 TcpFastRecover (\r
   IN TCP_CB  *Tcb,\r
   IN TCP_SEG *Seg\r
   );\r
 \r
+/**\r
+  NewReno fast loss recovery, RFC3792.\r
+\r
+  @param  Tcb      Pointer to the TCP_CB of this TCP instance.\r
+  @param  Seg      Segment that triggers the fast loss recovery.\r
+\r
+**/\r
 VOID\r
 TcpFastLossRecover (\r
   IN TCP_CB  *Tcb,\r
   IN TCP_SEG *Seg\r
   );\r
 \r
+/**\r
+  Compute the RTT as specified in RFC2988.\r
+\r
+  @param  Tcb      Pointer to the TCP_CB of this TCP instance.\r
+  @param  Measure  Currently measured RTT in heart beats.\r
+\r
+**/\r
 VOID\r
 TcpComputeRtt (\r
   IN TCP_CB *Tcb,\r
   IN UINT32 Measure\r
   );\r
 \r
+/**\r
+  Trim off the data outside the tcb's receive window.\r
+\r
+  @param  Tcb      Pointer to the TCP_CB of this TCP instance.\r
+  @param  Nbuf     Pointer to the NET_BUF containing the received tcp segment.\r
+\r
+  @return 0        The data is trimmed.\r
+\r
+**/\r
 INTN\r
 TcpTrimInWnd (\r
   IN TCP_CB  *Tcb,\r
-  IN NET_BUF *Buf\r
+  IN NET_BUF *Nbuf\r
   );\r
 \r
+/**\r
+  Store the data into the reassemble queue.\r
+\r
+  @param  Tcb      Pointer to the TCP_CB of this TCP instance.\r
+  @param  Nbuf     Pointer to the buffer containing the data to be queued.\r
+\r
+**/\r
 VOID\r
 TcpQueueData (\r
   IN TCP_CB  *Tcb,\r
   IN NET_BUF *Nbuf\r
   );\r
 \r
+/**\r
+  Ajust the send queue or the retransmit queue.\r
+\r
+  @param  Tcb      Pointer to the TCP_CB of this TCP instance.\r
+  @param  Ack      The acknowledge seuqence number of the received segment.\r
+\r
+**/\r
 VOID\r
 TcpAdjustSndQue (\r
   IN TCP_CB    *Tcb,\r
@@ -250,43 +556,110 @@ TcpAdjustSndQue (
 //\r
 // Functions from Tcp4Misc.c\r
 //\r
+/**\r
+  Compute the TCP segment's checksum.\r
+\r
+  @param  Nbuf                  Pointer to the buffer that contains the TCP\r
+                                segment.\r
+  @param  HeadSum               The checksum value of the fixed part of pseudo\r
+                                header.\r
+\r
+  @return  The checksum value.\r
+\r
+**/\r
 UINT16\r
 TcpChecksum (\r
-  IN NET_BUF *Buf,\r
-  IN UINT16  HeadChecksum\r
+  IN NET_BUF *Nbuf,\r
+  IN UINT16  HeadSum\r
   );\r
 \r
+/**\r
+  Translate the information from the head of the received TCP\r
+  segment Nbuf contains and fill it into a TCP_SEG structure.\r
+\r
+  @param  Tcb                   Pointer to the TCP_CB of this TCP instance.\r
+  @param  Nbuf                  Pointer to the buffer contains the TCP segment.\r
+\r
+  @return  Pointer to the TCP_SEG that contains the translated TCP head information.\r
+\r
+**/\r
 TCP_SEG *\r
 TcpFormatNetbuf (\r
   IN TCP_CB  *Tcb,\r
   IN NET_BUF *Nbuf\r
   );\r
 \r
+/**\r
+  Initialize an active connection.\r
+\r
+  @param  Tcb                   Pointer to the TCP_CB that wants to initiate a\r
+                                connection.\r
+\r
+**/\r
 VOID\r
 TcpOnAppConnect (\r
   IN TCP_CB  *Tcb\r
   );\r
 \r
+/**\r
+  Application has consumed some data, check whether\r
+  to send a window updata ack or a delayed ack.\r
+\r
+  @param  Tcb                   Pointer to the TCP_CB of this TCP instance.\r
+\r
+**/\r
 INTN\r
 TcpOnAppConsume (\r
   IN TCP_CB *Tcb\r
   );\r
 \r
+/**\r
+  Initiate the connection close procedure, called when\r
+  applications want to close the connection.\r
+\r
+  @param  Tcb                   Pointer to the TCP_CB of this TCP instance.\r
+\r
+**/\r
 VOID\r
 TcpOnAppClose (\r
   IN TCP_CB *Tcb\r
   );\r
 \r
+/**\r
+  Check whether the application's newly delivered data can be sent out.\r
+\r
+  @param  Tcb                   Pointer to the TCP_CB of this TCP instance.\r
+\r
+  @retval 0                     Whether the data is sent out or is buffered for\r
+                                further sending.\r
+  @retval -1                    The Tcb is not in a state that data is permitted to\r
+                                be sent out.\r
+\r
+**/\r
 INTN\r
 TcpOnAppSend (\r
   IN TCP_CB *Tcb\r
   );\r
 \r
+/**\r
+  Abort the connection by sending a reset segment, called\r
+  when the application wants to abort the connection.\r
+\r
+  @param  Tcb                   Pointer to the TCP_CB of the TCP instance.\r
+\r
+**/\r
 VOID\r
 TcpOnAppAbort (\r
   IN TCP_CB *Tcb\r
   );\r
 \r
+/**\r
+  Reset the connection related with Tcb.\r
+\r
+  @param  Tcb                   Pointer to the TCP_CB of the connection to be\r
+                                reset.\r
+\r
+**/\r
 VOID\r
 TcpResetConnection (\r
   IN TCP_CB *Tcb\r
@@ -295,11 +668,24 @@ TcpResetConnection (
 //\r
 // Functions in Tcp4Timer.c\r
 //\r
+/**\r
+  Close the TCP connection.\r
+\r
+  @param  Tcb      Pointer to the TCP_CB of this TCP instance.\r
+\r
+**/\r
 VOID\r
 TcpClose (\r
   IN TCP_CB *Tcb\r
   );\r
 \r
+/**\r
+  Heart beat timer handler, queues the DPC at TPL_CALLBACK.\r
+\r
+  @param  Event    Timer event signaled, ignored.\r
+  @param  Context  Context of the timer event, ignored.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 TcpTicking (\r
@@ -307,6 +693,14 @@ TcpTicking (
   IN VOID      *Context\r
   );\r
 \r
+/**\r
+  Enable a TCP timer.\r
+\r
+  @param  Tcb      Pointer to the TCP_CB of this TCP instance.\r
+  @param  Timer    The index of the timer to be enabled.\r
+  @param  TimeOut  The timeout value of this timer.\r
+\r
+**/\r
 VOID\r
 TcpSetTimer (\r
   IN TCP_CB *Tcb,\r
@@ -314,45 +708,100 @@ TcpSetTimer (
   IN UINT32 TimeOut\r
   );\r
 \r
+/**\r
+  Clear one TCP timer.\r
+\r
+  @param  Tcb      Pointer to the TCP_CB of this TCP instance.\r
+  @param  Timer    The index of the timer to be cleared.\r
+\r
+**/\r
 VOID\r
 TcpClearTimer (\r
   IN TCP_CB *Tcb,\r
   IN UINT16 Timer\r
   );\r
 \r
+/**\r
+  Clear all TCP timers.\r
+\r
+  @param  Tcb      Pointer to the TCP_CB of this TCP instance.\r
+\r
+**/\r
 VOID\r
 TcpClearAllTimer (\r
   IN TCP_CB *Tcb\r
   );\r
 \r
+/**\r
+  Enable the window prober timer and set the timeout value.\r
+\r
+  @param  Tcb      Pointer to the TCP_CB of this TCP instance.\r
+\r
+**/\r
 VOID\r
 TcpSetProbeTimer (\r
   IN TCP_CB *Tcb\r
   );\r
 \r
+/**\r
+  Enable the keepalive timer and set the timeout value.\r
+\r
+  @param  Tcb      Pointer to the TCP_CB of this TCP instance.\r
+\r
+**/\r
 VOID\r
 TcpSetKeepaliveTimer (\r
   IN TCP_CB *Tcb\r
   );\r
 \r
+/**\r
+  Backoff the RTO.\r
+\r
+  @param  Tcb      Pointer to the TCP_CB of this TCP instance.\r
+\r
+**/\r
 VOID\r
 TcpBackoffRto (\r
   IN TCP_CB *Tcb\r
   );\r
 \r
+/**\r
+  Set the Tdp4 variable data.\r
+\r
+  @param  Tcp4Service           Pointer to Tcp4 service data.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources to set the variable.\r
+  @retval other                 Set variable failed.\r
+\r
+**/\r
 EFI_STATUS\r
 TcpSetVariableData (\r
   IN TCP4_SERVICE_DATA  *Tcp4Service\r
   );\r
 \r
+/**\r
+  Clear the variable and free the resource.\r
+\r
+  @param  Tcp4Service           Pointer to Tcp4 service data.\r
+\r
+**/\r
 VOID\r
 TcpClearVariableData (\r
   IN TCP4_SERVICE_DATA  *Tcp4Service\r
   );\r
 \r
+/**\r
+  Install the device path protocol on the TCP instance.\r
+\r
+  @param  Sock             Pointer to the socket representing the TCP instance.\r
+\r
+  @retval  EFI_SUCCESS     The device path protocol is installed.\r
+  @retval  other           Failed to install the device path protocol.\r
+\r
+**/\r
 EFI_STATUS\r
 TcpInstallDevicePath (\r
-  IN SOCKET  *Sock\r
+  IN SOCKET *Sock\r
   );\r
 \r
 #endif\r