]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.h
Fix some grammar and converge formatting of the two versions of TcpInput.c
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Tcp4Dxe / SockImpl.h
index 13feea18fae4a6b89a09ede7b9dd5584a04d4716..52472d4440cc004679734440bd18d61dc8cc7721 100644 (file)
@@ -1,21 +1,15 @@
 /** @file\r
+  Socket implementation header file.\r
 \r
-Copyright (c) 2005 - 2006, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2005 - 2006, Intel Corporation. All rights reserved.<BR>\r
+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
-  SockImpl.h\r
-\r
-Abstract:\r
-\r
-\r
 **/\r
 \r
 #ifndef _SOCK_IMPL_H_\r
@@ -23,62 +17,114 @@ Abstract:
 \r
 #include "Socket.h"\r
 \r
-#define SOCK_DEBUG_ERROR(PrintArg) NET_DEBUG_ERROR("Sock", PrintArg)\r
-#define SOCK_DEBUG_WARN(PrintArg)  NET_DEBUG_WARNING("Sock", PrintArg)\r
-#define SOCK_DEBUG_TRACE(PrintArg) NET_DEBUG_TRACE("Sock", PrintArg)\r
-\r
-#define SOCK_TRIM_RCV_BUFF(Sock, Len) \\r
-  (NetbufQueTrim ((Sock)->RcvBuffer.DataQueue, (Len)))\r
-\r
+/**\r
+  Signal a event with the given status.\r
+  \r
+  @param Token        The token's event is to be signaled.\r
+  @param TokenStatus  The status to be sent with the event.\r
+  \r
+**/\r
 #define SIGNAL_TOKEN(Token, TokenStatus) \\r
   do { \\r
     (Token)->Status = (TokenStatus); \\r
     gBS->SignalEvent ((Token)->Event); \\r
   } while (0)\r
 \r
-#define SOCK_HEADER_SPACE (60 + 60 + 72)\r
 \r
-//\r
-// Supporting function for both SockImpl and SockInterface\r
-//\r
+/**\r
+  Supporting function for both SockImpl and SockInterface.\r
+\r
+  @param Event  The Event this notify function registered to, ignored.\r
+  \r
+**/\r
 VOID\r
+EFIAPI\r
 SockFreeFoo (\r
   IN EFI_EVENT Event\r
   );\r
 \r
+/**\r
+  Process the TCP send data, buffer the tcp txdata and append\r
+  the buffer to socket send buffer,then try to send it.\r
+\r
+  @param  Sock                  Pointer to the socket.\r
+  @param  TcpTxData             Pointer to the tcp txdata.\r
+\r
+  @retval EFI_SUCCESS           The operation is completed successfully.\r
+  @retval EFI_OUT_OF_RESOURCES  Failed due to resource limit.\r
+\r
+**/\r
 EFI_STATUS\r
 SockProcessTcpSndData (\r
-  IN SOCKET *Sock,\r
-  IN VOID   *TcpTxData\r
+  IN SOCKET   *Sock,\r
+  IN VOID     *TcpTxData\r
   );\r
 \r
+/**\r
+  Copy data from socket buffer to application provided receive buffer.\r
+\r
+  @param  Sock                  Pointer to the socket.\r
+  @param  TcpRxData             Pointer to the application provided receive buffer.\r
+  @param  RcvdBytes             The maximum length of the data can be copied.\r
+  @param  IsOOB                 If TURE the data is OOB, else the data is normal.\r
+\r
+**/\r
 VOID\r
 SockSetTcpRxData (\r
-  IN SOCKET         *Sock,\r
-  IN VOID           *TcpRxData,\r
-  IN UINT32         RcvdBytes,\r
-  IN BOOLEAN        IsOOB\r
+  IN SOCKET     *Sock,\r
+  IN VOID       *TcpRxData,\r
+  IN UINT32     RcvdBytes,\r
+  IN BOOLEAN    IsOOB\r
   );\r
 \r
+/**\r
+  Get received data from the socket layer to the receive token.\r
+\r
+  @param  Sock                  Pointer to the socket.\r
+  @param  RcvToken              Pointer to the application provided receive token.\r
+\r
+  @return The length of data received in this token.\r
+\r
+**/\r
 UINT32\r
 SockProcessRcvToken (\r
-  IN SOCKET        *Sock,\r
-  IN SOCK_IO_TOKEN *RcvToken\r
+  IN     SOCKET        *Sock,\r
+  IN OUT SOCK_IO_TOKEN *RcvToken\r
   );\r
 \r
+/**\r
+  Flush the socket.\r
+\r
+  @param  Sock                  Pointer to the socket.\r
+\r
+**/\r
 VOID\r
 SockConnFlush (\r
-  IN SOCKET *Sock\r
+  IN OUT SOCKET *Sock\r
   );\r
 \r
-SOCKET  *\r
+/**\r
+  Create a socket with initial data SockInitData.\r
+\r
+  @param  SockInitData          Pointer to the initial data of the socket.\r
+\r
+  @return Pointer to the newly created socket.\r
+\r
+**/\r
+SOCKET *\r
 SockCreate (\r
   IN SOCK_INIT_DATA *SockInitData\r
   );\r
 \r
+/**\r
+  Destroy a socket.\r
+\r
+  @param  Sock                  Pointer to the socket.\r
+\r
+**/\r
 VOID\r
 SockDestroy (\r
-  IN SOCKET *Sock\r
+  IN OUT SOCKET *Sock\r
   );\r
 \r
 #endif\r