]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h
MdeModulePkg: Remove trailing white space
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Common.h
index 0e221f7c625c2e010bdcaed63bad03f8056af07a..994a81f4dee4df5db8fe342914995391b17c21f2 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Common definition for IP4.\r
-  \r
-Copyright (c) 2005 - 2009, Intel Corporation.<BR>\r
-All rights reserved. This program and the accompanying materials\r
+\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
 http://opensource.org/licenses/bsd-license.php\r
@@ -55,7 +55,7 @@ typedef struct _IP4_SERVICE    IP4_SERVICE;
 /// Compose the fragment field to be used in the IP4 header.\r
 ///\r
 #define IP4_HEAD_FRAGMENT_FIELD(Df, Mf, Offset) \\r
-    ((UINT16)(((Df) ? 0x4000 : 0) | ((Mf) ? 0x2000 : 0) | (((Offset) >> 3) & 0x1fff)))\r
+    ((UINT16)(((Df) ? IP4_HEAD_DF_MASK : 0) | ((Mf) ? IP4_HEAD_MF_MASK : 0) | (((Offset) >> 3) & IP4_HEAD_OFFSET_MASK)))\r
 \r
 #define IP4_LAST_FRAGMENT(FragmentField)  \\r
           (((FragmentField) & IP4_HEAD_MF_MASK) == 0)\r
@@ -63,6 +63,9 @@ typedef struct _IP4_SERVICE    IP4_SERVICE;
 #define IP4_FIRST_FRAGMENT(FragmentField) \\r
           ((BOOLEAN)(((FragmentField) & IP4_HEAD_OFFSET_MASK) == 0))\r
 \r
+#define IP4_DO_NOT_FRAGMENT(FragmentField) \\r
+          ((BOOLEAN)(((FragmentField) & IP4_HEAD_DF_MASK) == IP4_HEAD_DF_MASK))\r
+\r
 #define IP4_IS_BROADCAST(CastType) ((CastType) >= IP4_LOCAL_BROADCAST)\r
 \r
 ///\r
@@ -198,33 +201,23 @@ Ip4NtohHead (
   IN IP4_HEAD           *Head\r
   );\r
 \r
-/**\r
-  Set the Ip4 variable data.\r
-  \r
-  Save the list of all of the IPv4 addresses and subnet masks that are currently\r
-  being used to volatile variable storage.\r
-\r
-  @param[in]  IpSb                  Ip4 service binding instance\r
-\r
-  @retval EFI_SUCCESS           Successfully set variable.\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
-Ip4SetVariableData (\r
-  IN IP4_SERVICE  *IpSb\r
-  );\r
 \r
 /**\r
-  Clear the variable and free the resource.\r
+  Validate that Ip/Netmask pair is OK to be used as station\r
+  address. Only continuous netmasks are supported. and check\r
+  that StationAddress is a unicast address on the newtwork.\r
 \r
-  @param[in]  IpSb                  Ip4 service binding instance\r
+  @param[in]  Ip                 The IP address to validate.\r
+  @param[in]  Netmask            The netmaks of the IP.\r
+\r
+  @retval TRUE                   The Ip/Netmask pair is valid.\r
+  @retval FALSE                  The Ip/Netmask pair is invalid.\r
 \r
 **/\r
-VOID\r
-Ip4ClearVariableData (\r
-  IN IP4_SERVICE  *IpSb\r
+BOOLEAN\r
+Ip4StationAddressValid (\r
+  IN IP4_ADDR               Ip,\r
+  IN IP4_ADDR               Netmask\r
   );\r
 \r
 #endif\r