]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.h
MdeModulePkg/Universal: Fix typos in comments
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Tcp4Dxe / SockImpl.h
index 69a1ac622296f946035083781ec7bf5d1fe6cef3..4a5a845b0e7d91ce64c854e1564dd6179428b03f 100644 (file)
-/** @file
-
-Copyright (c) 2005 - 2006, 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.
-
-Module Name:
-
-  SockImpl.h
-
-Abstract:
-
-
-**/
-
-#ifndef _SOCK_IMPL_H_
-#define _SOCK_IMPL_H_
-
-#include "Socket.h"
-
-#define SOCK_DEBUG_ERROR(PrintArg) NET_DEBUG_ERROR("Sock", PrintArg)
-#define SOCK_DEBUG_WARN(PrintArg)  NET_DEBUG_WARNING("Sock", PrintArg)
-#define SOCK_DEBUG_TRACE(PrintArg) NET_DEBUG_TRACE("Sock", PrintArg)
-
-#define SOCK_TRIM_RCV_BUFF(Sock, Len) \
-  (NetbufQueTrim ((Sock)->RcvBuffer.DataQueue, (Len)))
-
-#define SIGNAL_TOKEN(Token, TokenStatus) \
-  do { \
-    (Token)->Status = (TokenStatus); \
-    gBS->SignalEvent ((Token)->Event); \
-  } while (0)
-
-#define SOCK_HEADER_SPACE (60 + 60 + 72)
-
-//
-// Supporting function for both SockImpl and SockInterface
-//
-VOID
-SockFreeFoo (
-  IN EFI_EVENT Event
-  );
-
-EFI_STATUS
-SockProcessTcpSndData (
-  IN SOCKET *Sock,
-  IN VOID   *TcpTxData
-  );
-
-VOID
-SockSetTcpRxData (
-  IN SOCKET         *Sock,
-  IN VOID           *TcpRxData,
-  IN UINT32         RcvdBytes,
-  IN BOOLEAN        IsOOB
-  );
-
-UINT32
-SockProcessRcvToken (
-  IN SOCKET        *Sock,
-  IN SOCK_IO_TOKEN *RcvToken
-  );
-
-VOID
-SockConnFlush (
-  IN SOCKET *Sock
-  );
-
-SOCKET  *
-SockCreate (
-  IN SOCK_INIT_DATA *SockInitData
-  );
-
-VOID
-SockDestroy (
-  IN SOCKET *Sock
-  );
-
-#endif
+/** @file\r
+  Socket implementation header file.\r
+\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<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
+**/\r
+\r
+#ifndef _SOCK_IMPL_H_\r
+#define _SOCK_IMPL_H_\r
+\r
+#include "Socket.h"\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
+\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
+  );\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 TRUE 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
+  );\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 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 OUT SOCKET *Sock\r
+  );\r
+\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 OUT SOCKET *Sock\r
+  );\r
+\r
+#endif\r