]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h
BaseTools:Change the path of the file that Binary Cache
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Route.h
index ee1f6a907f9e263caa85918c15eba65dbece506e..4b0b5282ab5a470491190e157007c8ddc385da14 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
   EFI IP4 route table and route cache table defintions.\r
-  \r
-Copyright (c) 2005 - 2006, Intel Corporation.<BR>\r
-All rights reserved. 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
 \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
+Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -17,14 +11,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "Ip4Common.h"\r
 \r
-typedef enum {\r
-  IP4_DIRECT_ROUTE      = 0x00000001,\r
+#define IP4_DIRECT_ROUTE       0x00000001\r
 \r
-  IP4_ROUTE_CACHE_HASH  = 31,\r
-  IP4_ROUTE_CACHE_MAX   = 64  // Max NO. of cache entry per hash bucket\r
-} IP4_ROUTE_ENUM_TYPES;\r
+#define IP4_ROUTE_CACHE_HASH_VALUE 31\r
+#define IP4_ROUTE_CACHE_MAX        64  // Max NO. of cache entry per hash bucket\r
 \r
-#define IP4_ROUTE_CACHE_HASH(Dst, Src)  (((Dst) ^ (Src)) % IP4_ROUTE_CACHE_HASH)\r
+#define IP4_ROUTE_CACHE_HASH(Dst, Src)  (((Dst) ^ (Src)) % IP4_ROUTE_CACHE_HASH_VALUE)\r
 \r
 ///\r
 /// The route entry in the route table. Dest/Netmask is the destion\r
@@ -69,7 +61,7 @@ typedef struct {
 /// detach them later.\r
 ///\r
 typedef struct {\r
-  LIST_ENTRY                CacheBucket[IP4_ROUTE_CACHE_HASH];\r
+  LIST_ENTRY                CacheBucket[IP4_ROUTE_CACHE_HASH_VALUE];\r
 } IP4_ROUTE_CACHE;\r
 \r
 ///\r
@@ -196,6 +188,11 @@ Ip4FreeRouteCacheEntry (
   @param[in]  RtTable               The route table to search from\r
   @param[in]  Dest                  The destination address to search for\r
   @param[in]  Src                   The source address to search for\r
+  @param[in]  SubnetMask            The subnet mask of the Src address, this field is\r
+                                    used to check if the station is using /32 subnet.\r
+  @param[in]  AlwaysTryDestAddr     Always try to use the dest address as next hop even\r
+                                    though we can't find a matching route entry. This\r
+                                    field is only valid when using /32 subnet.\r
 \r
   @return NULL if failed to route packet, otherwise a route cache\r
           entry that can be used to route packet.\r
@@ -205,7 +202,9 @@ IP4_ROUTE_CACHE_ENTRY *
 Ip4Route (\r
   IN IP4_ROUTE_TABLE        *RtTable,\r
   IN IP4_ADDR               Dest,\r
-  IN IP4_ADDR               Src\r
+  IN IP4_ADDR               Src,\r
+  IN IP4_ADDR               SubnetMask,\r
+  IN BOOLEAN                AlwaysTryDestAddr\r
   );\r
 \r
 /**\r