Ip6Route.h revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
1879N/A EFI IP6 route table and route cache table defintions. 0N/A Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> 0N/A This program and the accompanying materials 0N/A are licensed and made available under the terms and conditions of the BSD License 0N/A which accompanies this distribution. The full text of the license may be found at 0N/A THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 0N/A WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 0N/A/// Max NO. of cache entry per hash bucket 0N/A// Each IP6 instance has its own route table. Each ServiceBinding 0N/A// instance has a default route table and default address. 0N/A// All the route table entries with the same prefix length are linked 0N/A// together in one route area. For example, RouteArea[0] contains 0N/A// the default routes. A route table also contains a route cache. 0N/A This is the worker function for IP6_ROUTE_CACHE_HASH(). It calculates the value 0N/A as the index of the route cache bucket according to the prefix of two IPv6 addresses. 0N/A @param[in] Ip1 The IPv6 address. 0N/A @param[in] Ip2 The IPv6 address. 0N/A @return The hash value of the prefix of two IPv6 addresses. 0N/A Allocate and initialize an IP6 route cache entry. 0N/A @param[in] Dst The destination address. 0N/A @param[in] Src The source address. 1523N/A @param[in] GateWay The next hop address. 0N/A @param[in] Tag The tag from the caller. This marks all the cache entries 0N/A spawned from one route table entry. 0N/A @return NULL if it failed to allocate memory for the cache. Otherwise, point 0N/A to the created route cache entry. 0N/A Free the route cache entry. It is reference counted. 0N/A @param[in, out] RtCacheEntry The route cache entry to free. 0N/A Find a route cache with the destination and source address. This is 0N/A used by the ICMPv6 redirect messasge process. 0N/A @param[in] RtTable The route table to search the cache for. 0N/A @param[in] Dest The destination address. 0N/A @param[in] Src The source address. 0N/A @return NULL if no route entry to the (Dest, Src). Otherwise, point 0N/A to the correct route cache entry. 0N/A Build a array of EFI_IP6_ROUTE_TABLE to be returned to the caller. The number 0N/A of EFI_IP6_ROUTE_TABLE is also returned. 0N/A @param[in] RouteTable The pointer of IP6_ROUTE_TABLE internal used. 0N/A @param[out] EfiRouteCount The number of returned route entries. 0N/A @param[out] EfiRouteTable The pointer to the array of EFI_IP6_ROUTE_TABLE. 0N/A If NULL, only the route entry count is returned. 0N/A @retval EFI_SUCCESS The EFI_IP6_ROUTE_TABLE successfully built. 0N/A @retval EFI_OUT_OF_RESOURCES Failed to allocate the memory for the route table. 0N/A Create an empty route table, includes its internal route cache. 0N/A @return NULL if failed to allocate memory for the route table. Otherwise, 0N/A the point to newly created route table. 0N/A Free the route table and its associated route cache. Route 0N/A table is reference counted. 0N/A @param[in, out] RtTable The route table to free. 0N/A @param[in] Destination The IPv6 destination address. This is an optional 0N/A parameter that may be NULL. 0N/A @param[in] PrefixLength The destination network's prefix length. 0N/A @param[in] GatewayAddress The next hop address. This is optional parameter 0N/A @return NULL if it failed to allocate memeory. Otherwise, the newly created route entry. 0N/A Search the route table for a most specific match to the Dst. It searches 0N/A from the longest route area (prefix length == 128) to the shortest route area 0N/A (default routes). In each route area, it will first search the instance's 0N/A route table, then the default route table. This is required per the following 0N/A 1. IP search the route table for a most specific match. 0N/A 2. The local route entries have precedence over the default route entry. 0N/A @param[in] RtTable The route table to search from. 0N/A @param[in] Destination The destionation address to search. If NULL, search 0N/A the route table by NextHop. 0N/A @param[in] NextHop The next hop address. If NULL, search the route table 0N/A @return NULL if no route matches the Dst. Otherwise the point to the 0N/A most specific route to the Dst. 0N/A Free the route table entry. It is reference counted. 0N/A @param[in, out] RtEntry The route entry to free. 0N/A Add a route entry to the route table. It is the help function for EfiIp6Routes. 0N/A @param[in, out] RtTable Route table to add route to. 0N/A @param[in] Destination The destination of the network. 0N/A @param[in] PrefixLength The PrefixLength of the destination. 0N/A @param[in] GatewayAddress The next hop address. 0N/A @retval EFI_ACCESS_DENIED The same route already exists. 0N/A @retval EFI_OUT_OF_RESOURCES Failed to allocate memory for the entry. 0N/A @retval EFI_SUCCESS The route was added successfully. 0N/A Remove a route entry and all the route caches spawn from it. 0N/A It is the help function for EfiIp6Routes. 0N/A @param[in, out] RtTable The route table to remove the route from. 0N/A @param[in] Destination The destination network. 0N/A @param[in] PrefixLength The PrefixLength of the Destination. 0N/A @param[in] GatewayAddress The next hop address. 0N/A @retval EFI_SUCCESS Successfully removed the route entry. 0N/A @retval EFI_NOT_FOUND There is no route entry in the table with that 0N/A cache if there is a route to the destination. 0N/A @param[in] IpSb The IP6 service data. 0N/A @param[in] Dest The destination address to search for. 0N/A @param[in] Src The source address to search for. 0N/A @return NULL if failed to route packet. Otherwise, a route cache 0N/A entry that can be used to route packet.