@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
@return NONE\r
\r
**/\r
-STATIC\r
VOID\r
Ip4FreeRouteEntry (\r
IN IP4_ROUTE_ENTRY *RtEntry\r
\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
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
**/\r
VOID\r
Ip4InitRouteCache (\r
- IN IP4_ROUTE_CACHE *RtCache\r
+ IN OUT IP4_ROUTE_CACHE *RtCache\r
)\r
{\r
UINT32 Index;\r
/**\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
@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
**/\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
**/\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
@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
\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
@return most specific route to the Dst.\r
\r
**/\r
-STATIC\r
IP4_ROUTE_ENTRY *\r
Ip4FindRouteEntry (\r
IN IP4_ROUTE_TABLE *RtTable,\r
\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
@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
\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