]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Tcp4Dxe / Socket.h
index 9c2e6d0b65a9f7debaf106842cbd2a69f10b5458..7ff2fc565edd7a6bb4267f8f5ecd3111d3d2dc81 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Socket header file.\r
 \r
-Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2018, 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
@@ -85,31 +85,31 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 /**\r
   Set socket SO_NO_MORE_DATA flag.\r
-  \r
+\r
   @param Sock               Pointer to the socket\r
-  \r
+\r
 **/\r
 #define SOCK_NO_MORE_DATA(Sock)     ((Sock)->Flag |= SO_NO_MORE_DATA)\r
 \r
 /**\r
   Check whether the socket is unconfigured.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
-  \r
+\r
   @retval True               The socket is unconfigued\r
   @retval False              The socket is not unconfigued\r
-  \r
+\r
 **/\r
 #define SOCK_IS_UNCONFIGURED(Sock)  ((Sock)->ConfigureState == SO_UNCONFIGURED)\r
 \r
 /**\r
   Check whether the socket is configured.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
-  \r
+\r
   @retval True               The socket is configued\r
   @retval False              The socket is not configued\r
-  \r
+\r
 **/\r
 #define SOCK_IS_CONFIGURED(Sock) \\r
     (((Sock)->ConfigureState == SO_CONFIGURED_ACTIVE) || \\r
@@ -117,109 +117,109 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 /**\r
   Check whether the socket is configured to active mode.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
-  \r
+\r
   @retval True               The socket is configued to active mode\r
   @retval False              The socket is not configued to active mode\r
-  \r
+\r
 **/\r
 #define SOCK_IS_CONFIGURED_ACTIVE(Sock) \\r
   ((Sock)->ConfigureState == SO_CONFIGURED_ACTIVE)\r
 \r
 /**\r
   Check whether the socket is configured to passive mode.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
-  \r
+\r
   @retval True               The socket is configued to passive mode\r
   @retval False              The socket is not configued to passive mode\r
-  \r
+\r
 **/\r
 #define SOCK_IS_CONNECTED_PASSIVE(Sock) \\r
   ((Sock)->ConfigureState == SO_CONFIGURED_PASSIVE)\r
 \r
 /**\r
   Check whether the socket is mapped.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
-  \r
+\r
   @retval True               The socket is no mapping\r
   @retval False              The socket is mapped\r
-  \r
+\r
 **/\r
 #define SOCK_IS_NO_MAPPING(Sock) \\r
   ((Sock)->ConfigureState == SO_NO_MAPPING)\r
 \r
 /**\r
   Check whether the socket is closed.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
-  \r
+\r
   @retval True               The socket is closed\r
   @retval False              The socket is not closed\r
-  \r
+\r
 **/\r
 #define SOCK_IS_CLOSED(Sock)          ((Sock)->State == SO_CLOSED)\r
 \r
 /**\r
   Check whether the socket is listening.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
-  \r
+\r
   @retval True               The socket is listening\r
   @retval False              The socket is not listening\r
-  \r
+\r
 **/\r
 #define SOCK_IS_LISTENING(Sock)       ((Sock)->State == SO_LISTENING)\r
 \r
 /**\r
   Check whether the socket is connecting.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
-  \r
+\r
   @retval True               The socket is connecting\r
   @retval False              The socket is not connecting\r
-  \r
+\r
 **/\r
 #define SOCK_IS_CONNECTING(Sock)      ((Sock)->State == SO_CONNECTING)\r
 \r
 /**\r
   Check whether the socket has connected.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
-  \r
+\r
   @retval True               The socket has connected\r
   @retval False              The socket has not connected\r
-  \r
+\r
 **/\r
 #define SOCK_IS_CONNECTED(Sock)       ((Sock)->State == SO_CONNECTED)\r
 \r
 /**\r
   Check whether the socket is disconnecting.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
-  \r
+\r
   @retval True               The socket is disconnecting\r
   @retval False              The socket is not disconnecting\r
-  \r
+\r
 **/\r
 #define SOCK_IS_DISCONNECTING(Sock)   ((Sock)->State == SO_DISCONNECTING)\r
 \r
 /**\r
   Check whether the socket is no more data.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
-  \r
+\r
   @retval True               The socket is no more data\r
   @retval False              The socket still has data\r
-  \r
+\r
 **/\r
 #define SOCK_IS_NO_MORE_DATA(Sock)    (0 != ((Sock)->Flag & SO_NO_MORE_DATA))\r
 \r
 /**\r
   Set the size of the receive buffer.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
   @param  Size               The size to set\r
 \r
@@ -228,9 +228,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 /**\r
   Get the size of the receive buffer.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
-  \r
+\r
   @return The receive buffer size\r
 \r
 **/\r
@@ -238,9 +238,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 /**\r
   Get the size of the receive data.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
-  \r
+\r
   @return The received data size\r
 \r
 **/\r
@@ -248,7 +248,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 /**\r
   Set the size of the send buffer.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
   @param  Size               The size to set\r
 \r
@@ -257,9 +257,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 /**\r
   Get the size of the send buffer.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
-  \r
+\r
   @return The send buffer size\r
 \r
 **/\r
@@ -267,9 +267,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 /**\r
   Get the size of the send data.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
-  \r
+\r
   @return The send data size\r
 \r
 **/\r
@@ -277,7 +277,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 /**\r
   Set the backlog value of the socket.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
   @param  Value              The value to set\r
 \r
@@ -286,9 +286,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 /**\r
   Get the backlog value of the socket.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
-  \r
+\r
   @return The backlog value\r
 \r
 **/\r
@@ -296,7 +296,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 /**\r
   Set the socket with error state.\r
-  \r
+\r
   @param  Sock               Pointer to the socket\r
   @param  Error              The error state\r
 \r
@@ -342,7 +342,7 @@ typedef struct _SOCK_IO_TOKEN {
 } SOCK_IO_TOKEN;\r
 \r
 ///\r
-///  The request issued from socket layer to protocol layer.  \r
+///  The request issued from socket layer to protocol layer.\r
 ///\r
 #define SOCK_ATTACH     0    ///< Attach current socket to a new PCB\r
 #define SOCK_DETACH     1    ///< Detach current socket from the PCB\r
@@ -379,15 +379,15 @@ typedef struct _SOCK_BUFFER {
 \r
 /**\r
   The handler of protocol for request from socket.\r
-  \r
+\r
   @param Socket              The socket issuing the request to protocol\r
   @param Request             The request issued by socket\r
   @param RequestData         The request related data\r
-  \r
+\r
   @retval EFI_SUCCESS        The socket request is completed successfully.\r
   @retval other              The error status returned by the corresponding TCP\r
                              layer function.\r
-                             \r
+\r
 **/\r
 typedef\r
 EFI_STATUS\r
@@ -396,8 +396,8 @@ EFI_STATUS
   IN UINT8        Request,\r
   IN VOID         *RequestData\r
   );\r
-  \r
-  \r
+\r
+\r
 //\r
 // Socket provided oprerations for low layer protocol\r
 //\r
@@ -420,15 +420,15 @@ SockSetState (
   );\r
 \r
 /**\r
-  Called by the low layer protocol to indicate the socket a connection is \r
-  established. \r
-  \r
-  This function just changes the socket's state to SO_CONNECTED \r
+  Called by the low layer protocol to indicate the socket a connection is\r
+  established.\r
+\r
+  This function just changes the socket's state to SO_CONNECTED\r
   and signals the token used for connection establishment.\r
 \r
   @param  Sock                  Pointer to the socket associated with the\r
                                 established connection.\r
-                                \r
+\r
 **/\r
 VOID\r
 SockConnEstablished (\r
@@ -437,13 +437,13 @@ SockConnEstablished (
 \r
 /**\r
   Called by the low layer protocol to indicate the connection is closed.\r
-  \r
-  This function flushes the socket, sets the state to SO_CLOSED and signals \r
+\r
+  This function flushes the socket, sets the state to SO_CLOSED and signals\r
   the close token.\r
 \r
   @param  Sock                  Pointer to the socket associated with the closed\r
                                 connection.\r
-                                \r
+\r
 **/\r
 VOID\r
 SockConnClosed (\r
@@ -452,8 +452,8 @@ SockConnClosed (
 \r
 /**\r
   Called by low layer protocol to indicate that some data is sent or processed.\r
-   \r
-  This function trims the sent data in the socket send buffer, signals the data \r
+\r
+  This function trims the sent data in the socket send buffer, signals the data\r
   token if proper.\r
 \r
   @param  Sock                  Pointer to the socket.\r
@@ -490,7 +490,7 @@ SockGetDataToSend (
 /**\r
   Called by the low layer protocol to indicate that there\r
   will be no more data from the communication peer.\r
-  \r
+\r
   This function set the socket's state to SO_NO_MORE_DATA and\r
   signal all queued IO tokens with the error status EFI_CONNECTION_FIN.\r
 \r
@@ -504,8 +504,8 @@ SockNoMoreData (
 \r
 /**\r
   Called by the low layer protocol to deliver received data to socket layer.\r
-  \r
-  This function will append the data to the socket receive buffer, set ther \r
+\r
+  This function will append the data to the socket receive buffer, set ther\r
   urgent data length and then check if any receive token can be signaled.\r
 \r
   @param  Sock                  Pointer to the socket.\r
@@ -573,9 +573,9 @@ EFI_STATUS
   IN SOCKET  *This,\r
   IN VOID    *Context\r
   );\r
-  \r
+\r
 ///\r
-/// Proto type of the destroy callback \r
+/// Proto type of the destroy callback\r
 ///\r
 typedef\r
 VOID\r
@@ -618,7 +618,7 @@ typedef struct _SOCK_INIT_DATA {
 \r
 ///\r
 ///  The union type of TCP and UDP protocol.\r
-///  \r
+///\r
 typedef union _NET_PROTOCOL {\r
   EFI_TCP4_PROTOCOL TcpProtocol;   ///< Tcp protocol\r
   EFI_UDP4_PROTOCOL UdpProtocol;   ///< Udp protocol\r
@@ -637,7 +637,7 @@ struct _SOCKET {
   EFI_HANDLE            DriverBinding;  ///< Socket's driver binding protocol\r
   EFI_DEVICE_PATH_PROTOCOL  *ParentDevicePath;\r
   EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
-  LIST_ENTRY                Link;  \r
+  LIST_ENTRY                Link;\r
   UINT8                 ConfigureState;\r
   SOCK_TYPE             Type;\r
   UINT8                 State;\r
@@ -655,7 +655,7 @@ struct _SOCKET {
   UINT32          ConnCnt;        ///< the current count of connections to it\r
   SOCKET          *Parent;        ///< listening parent that accept the connection\r
   LIST_ENTRY      ConnectionList; ///< the connections maintained by this socket\r
-  \r
+\r
   //\r
   // The queue to buffer application's asynchronous token\r
   //\r
@@ -714,7 +714,7 @@ typedef struct _TCP_RSV_DATA {
   data ProtoData.\r
 \r
   @param  SockInitData         Inital data to setting the socket.\r
-  \r
+\r
   @return Pointer to the newly created socket. If NULL, error condition occured.\r
 \r
 **/\r
@@ -973,7 +973,7 @@ SockBufFirst (
   @param  SockEntry             Pointer to the buffer block prior to the required\r
                                 one.\r
 \r
-  @return Pointer to the buffer block next to SockEntry. NULL if SockEntry is \r
+  @return Pointer to the buffer block next to SockEntry. NULL if SockEntry is\r
           the tail or head entry.\r
 \r
 **/\r