]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c
Scrubbed more.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Route.c
index fed1983515188affe0bc57f836f2c130c22c1580..5bec33e5987a7658258b3a767d9c066b186d26e3 100644 (file)
@@ -31,10 +31,9 @@ Abstract:
   @param  GateWay               The nexthop address\r
 \r
   @return NULL if failed to allocate memeory, otherwise the newly created\r
-  @return route entry.\r
+          route entry.\r
 \r
 **/\r
-STATIC\r
 IP4_ROUTE_ENTRY *\r
 Ip4CreateRouteEntry (\r
   IN IP4_ADDR               Dest,\r
@@ -70,7 +69,6 @@ Ip4CreateRouteEntry (
   @return NONE\r
 \r
 **/\r
-STATIC\r
 VOID\r
 Ip4FreeRouteEntry (\r
   IN IP4_ROUTE_ENTRY    *RtEntry\r
@@ -85,7 +83,7 @@ Ip4FreeRouteEntry (
 \r
 \r
 /**\r
-  Allocate and initialize a IP4 route cache entry.\r
+  Allocate and initialize an IP4 route cache entry.\r
 \r
   @param  Dst                   The destination address\r
   @param  Src                   The source address\r
@@ -94,10 +92,9 @@ Ip4FreeRouteEntry (
                                 entries spawned from one route table entry.\r
 \r
   @return NULL if failed to allocate memory for the cache, other point\r
-  @return to the created route cache entry.\r
+          to the created route cache entry.\r
 \r
 **/\r
-STATIC\r
 IP4_ROUTE_CACHE_ENTRY *\r
 Ip4CreateRouteCacheEntry (\r
   IN IP4_ADDR               Dst,\r
@@ -157,7 +154,7 @@ Ip4FreeRouteCacheEntry (
 **/\r
 VOID\r
 Ip4InitRouteCache (\r
-  IN IP4_ROUTE_CACHE        *RtCache\r
+  IN OUT IP4_ROUTE_CACHE        *RtCache\r
   )\r
 {\r
   UINT32                    Index;\r
@@ -202,10 +199,8 @@ Ip4CleanRouteCache (
 /**\r
   Create an empty route table, includes its internal route cache\r
 \r
-  None\r
-\r
   @return NULL if failed to allocate memory for the route table, otherwise\r
-  @return the point to newly created route table.\r
+          the point to newly created route table.\r
 \r
 **/\r
 IP4_ROUTE_TABLE *\r
@@ -292,11 +287,10 @@ Ip4FreeRouteTable (
   @return None\r
 \r
 **/\r
-STATIC\r
 VOID\r
 Ip4PurgeRouteCache (\r
-  IN IP4_ROUTE_CACHE        *RtCache,\r
-  IN UINTN                  Tag\r
+  IN OUT IP4_ROUTE_CACHE        *RtCache,\r
+  IN     UINTN                  Tag\r
   )\r
 {\r
   LIST_ENTRY                *Entry;\r
@@ -334,10 +328,10 @@ Ip4PurgeRouteCache (
 **/\r
 EFI_STATUS\r
 Ip4AddRoute (\r
-  IN IP4_ROUTE_TABLE        *RtTable,\r
-  IN IP4_ADDR               Dest,\r
-  IN IP4_ADDR               Netmask,\r
-  IN IP4_ADDR               Gateway\r
+  IN OUT IP4_ROUTE_TABLE        *RtTable,\r
+  IN     IP4_ADDR               Dest,\r
+  IN     IP4_ADDR               Netmask,\r
+  IN     IP4_ADDR               Gateway\r
   )\r
 {\r
   LIST_ENTRY                *Head;\r
@@ -396,10 +390,10 @@ Ip4AddRoute (
 **/\r
 EFI_STATUS\r
 Ip4DelRoute (\r
-  IN IP4_ROUTE_TABLE      *RtTable,\r
-  IN IP4_ADDR             Dest,\r
-  IN IP4_ADDR             Netmask,\r
-  IN IP4_ADDR             Gateway\r
+  IN OUT IP4_ROUTE_TABLE      *RtTable,\r
+  IN     IP4_ADDR             Dest,\r
+  IN     IP4_ADDR             Netmask,\r
+  IN     IP4_ADDR             Gateway\r
   )\r
 {\r
   LIST_ENTRY                *Head;\r
@@ -437,7 +431,7 @@ Ip4DelRoute (
   @param  Src                   The source address\r
 \r
   @return NULL if no route entry to the (Dest, Src). Otherwise the point\r
-  @return to the correct route cache entry.\r
+          to the correct route cache entry.\r
 \r
 **/\r
 IP4_ROUTE_CACHE_ENTRY *\r
@@ -468,8 +462,8 @@ Ip4FindRouteCache (
 \r
 /**\r
   Search the route table for a most specific match to the Dst. It searches\r
-  from the longest route area (mask length == 32) to the shortest route area (\r
-  default routes). In each route area, it will first search the instance's\r
+  from the longest route area (mask length == 32) to the shortest route area\r
+  (default routes). In each route area, it will first search the instance's\r
   route table, then the default route table. This is required by the following\r
   requirements:\r
   1. IP search the route table for a most specific match\r
@@ -482,7 +476,6 @@ Ip4FindRouteCache (
   @return most specific route to the Dst.\r
 \r
 **/\r
-STATIC\r
 IP4_ROUTE_ENTRY *\r
 Ip4FindRouteEntry (\r
   IN IP4_ROUTE_TABLE        *RtTable,\r
@@ -515,7 +508,7 @@ Ip4FindRouteEntry (
 \r
 \r
 /**\r
-  Search the route table to route the packet. Return/creat a route\r
+  Search the route table to route the packet. Return/create a route\r
   cache if there is a route to the destination.\r
 \r
   @param  RtTable               The route table to search from\r
@@ -523,7 +516,7 @@ Ip4FindRouteEntry (
   @param  Src                   The source address to search for\r
 \r
   @return NULL if failed to route packet, otherwise a route cache\r
-  @return entry that can be used to route packet.\r
+          entry that can be used to route packet.\r
 \r
 **/\r
 IP4_ROUTE_CACHE_ENTRY *\r
@@ -567,11 +560,11 @@ Ip4Route (
 \r
   //\r
   // Found a route to the Dest, if it is a direct route, the packet\r
-  // will be send directly to the destination, such as for connected\r
+  // will be sent directly to the destination, such as for connected\r
   // network. Otherwise, it is an indirect route, the packet will be\r
-  // send the next hop router.\r
+  // sent to the next hop router.\r
   //\r
-  if (RtEntry->Flag & IP4_DIRECT_ROUTE) {\r
+  if ((RtEntry->Flag & IP4_DIRECT_ROUTE) != 0) {\r
     NextHop = Dest;\r
   } else {\r
     NextHop = RtEntry->NextHop;\r