]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Include/Library/UdpIoLib.h
refine the code and add more security check.
[mirror_edk2.git] / MdeModulePkg / Include / Library / UdpIoLib.h
index c93fb1208590754855ed1384a337c5af7f68c103..a680cc6179afae4e03f6d4899938bba9004c5bf7 100644 (file)
@@ -51,7 +51,7 @@ typedef struct {
   UdpIoRecvDatagram() or UdpIoSendDatagram(). When receiving, Netbuf is allocated by the\r
   UDP access point and released by the user. When sending, the user allocates the the NetBuf, which is then\r
   provided to the callback as a reference.\r
-  \r
+\r
   @param[in] Packet       Packet received or sent\r
   @param[in] EndPoint     The UDP address pair corresponds to the UDP IO\r
   @param[in] IoStatus     Packet receiving or sending status\r
@@ -127,7 +127,7 @@ typedef struct {
 ///\r
 /// Type defined as UDP_IO.\r
 ///\r
-/// This data structure wraps the UDP instance and configuration. \r
+/// This data structure wraps the UDP instance and configuration.\r
 /// UdpIo Library uses this structure for all Udp4 or Udp6 operations.\r
 ///\r
 struct _UDP_IO {\r
@@ -151,7 +151,7 @@ struct _UDP_IO {
   union {\r
     EFI_UDP4_PROTOCOL       *Udp4;\r
     EFI_UDP6_PROTOCOL       *Udp6;\r
-  } Protocol;  \r
+  } Protocol;\r
 \r
   union {\r
     EFI_UDP4_CONFIG_DATA    Udp4;\r
@@ -161,12 +161,12 @@ struct _UDP_IO {
 \r
 /**\r
   Prototype called when UdpIo Library configures a UDP instance.\r
-  \r
+\r
   The prototype is set and called when creating a UDP_IO in UdpIoCreatePort().\r
-  \r
+\r
   @param[in] UdpIo         The UDP_IO to configure\r
   @param[in] Context       User-defined data when calling UdpIoCreatePort()\r
-  \r
+\r
   @retval EFI_SUCCESS  The configuration succeeded\r
   @retval Others       The UDP_IO fails to configure indicating\r
                        UdpIoCreatePort() should fail\r
@@ -179,11 +179,11 @@ EFI_STATUS
   );\r
 \r
 /**\r
-  The select function to decide whether to cancel the UDP_TX_TOKEN. \r
-  \r
+  The select function to decide whether to cancel the UDP_TX_TOKEN.\r
+\r
   @param[in] Token        The UDP_TX_TOKEN to decide whether to cancel\r
   @param[in] Context      User-defined data in UdpIoCancelDgrams()\r
-  \r
+\r
   @retval TRUE        Cancel the UDP_TX_TOKEN\r
   @retval FALSE       Do not cancel this UDP_TX_TOKEN\r
 \r
@@ -196,12 +196,13 @@ BOOLEAN
   );\r
 \r
 /**\r
-  Cancel all sent datagrams selected by the parameter ToCancel.\r
+  Cancel all the sent datagram that pass the selection criteria of ToCancel.\r
   If ToCancel is NULL, all the datagrams are cancelled.\r
 \r
   @param[in]  UdpIo                 The UDP_IO to cancel packet.\r
   @param[in]  IoStatus              The IoStatus to return to the packet owners.\r
-  @param[in]  ToCancel              Sets the criteria for canceling a packet. \r
+  @param[in]  ToCancel              The select funtion to test whether to cancel this\r
+                                    packet or not.\r
   @param[in]  Context               The opaque parameter to the ToCancel.\r
 \r
 **/\r
@@ -210,19 +211,18 @@ EFIAPI
 UdpIoCancelDgrams (\r
   IN UDP_IO                 *UdpIo,\r
   IN EFI_STATUS             IoStatus,\r
-  IN UDP_IO_TO_CANCEL       ToCancel OPTIONAL,\r
+  IN UDP_IO_TO_CANCEL       ToCancel,        OPTIONAL\r
   IN VOID                   *Context\r
   );\r
 \r
 /**\r
   Creates a UDP_IO to access the UDP service. It creates and configures\r
   a UDP child.\r
-  \r
-  This function:\r
-  # locates the UDP service binding prototype on the Controller parameter\r
-  # uses the UDP service binding prototype to create a UDP child (also known as a UDP instance)\r
-  # configures the UDP child by calling Configure function prototype. \r
-  Any failures in creating or configuring the UDP child return NULL for failure. \r
+\r
+  It locates the UDP service binding prototype on the Controller parameter\r
+  uses the UDP service binding prototype to create a UDP child (also known as\r
+  a UDP instance) configures the UDP child by calling Configure function prototype.\r
+  Any failures in creating or configuring the UDP child return NULL for failure.\r
 \r
   @param[in]  Controller            The controller that has the UDP service binding.\r
                                     protocol installed.\r
@@ -246,7 +246,7 @@ UdpIoCreateIo (
 \r
 /**\r
   Free the UDP_IO and all its related resources.\r
-  \r
+\r
   The function cancels all sent datagrams and receive requests.\r
 \r
   @param[in]  UdpIo             The UDP_IO to free.\r
@@ -261,9 +261,9 @@ UdpIoFreeIo (
   );\r
 \r
 /**\r
-  Cleans up the UDP_IO without freeing it. Call this function \r
+  Cleans up the UDP_IO without freeing it. Call this function\r
   if you intend to later re-use the UDP_IO.\r
-  \r
+\r
   This function releases all transmitted datagrams and receive requests and configures NULL for the UDP instance.\r
 \r
   @param[in]  UdpIo                 The UDP_IO to clean up.\r
@@ -277,7 +277,7 @@ UdpIoCleanIo (
 \r
 /**\r
   Send a packet through the UDP_IO.\r
-  \r
+\r
   The packet will be wrapped in UDP_TX_TOKEN. Function Callback will be called\r
   when the packet is sent. The optional parameter EndPoint overrides the default\r
   address pair if specified.\r
@@ -286,7 +286,7 @@ UdpIoCleanIo (
   @param[in]  Packet                The packet to send.\r
   @param[in]  EndPoint              The local and remote access point. Override the\r
                                     default address pair set during configuration.\r
-  @param[in]  Gateway               The gateway to use.  \r
+  @param[in]  Gateway               The gateway to use.\r
   @param[in]  CallBack              The function being called when packet is\r
                                     transmitted or failed.\r
   @param[in]  Context               The opaque parameter passed to CallBack.\r
@@ -310,7 +310,7 @@ UdpIoSendDatagram (
 /**\r
   Cancel a single sent datagram.\r
 \r
-  @param[in]  UdpIo                 The UDP_IO from which to cancel the packet \r
+  @param[in]  UdpIo                 The UDP_IO from which to cancel the packet\r
   @param[in]  Packet                The packet to cancel\r
 \r
 **/\r
@@ -323,7 +323,7 @@ UdpIoCancelSentDatagram (
 \r
 /**\r
   Issue a receive request to the UDP_IO.\r
-  \r
+\r
   This function is called when upper-layer needs packet from UDP for processing.\r
   Only one receive request is acceptable at a time. Therefore, one common usage model is\r
   to invoke this function inside its Callback function when the former packet\r