TianoCore EDK2 master
Loading...
Searching...
No Matches
Ip6Route.h
Go to the documentation of this file.
1
10#ifndef __EFI_IP6_ROUTE_H__
11#define __EFI_IP6_ROUTE_H__
12
13#define IP6_DIRECT_ROUTE 0x00000001
14#define IP6_PACKET_TOO_BIG 0x00000010
15
16#define IP6_ROUTE_CACHE_HASH_SIZE 31
20#define IP6_ROUTE_CACHE_MAX 32
21
22#define IP6_ROUTE_CACHE_HASH(Ip1, Ip2) Ip6RouteCacheHash ((Ip1), (Ip2))
23
24typedef struct {
25 LIST_ENTRY Link;
26 INTN RefCnt;
27 UINT32 Flag;
28 UINT8 PrefixLength;
29 EFI_IPv6_ADDRESS Destination;
30 EFI_IPv6_ADDRESS NextHop;
32
33typedef struct {
34 LIST_ENTRY Link;
35 INTN RefCnt;
36 UINTN Tag;
37 EFI_IPv6_ADDRESS Destination;
38 EFI_IPv6_ADDRESS Source;
39 EFI_IPv6_ADDRESS NextHop;
41
42typedef struct {
43 LIST_ENTRY CacheBucket[IP6_ROUTE_CACHE_HASH_SIZE];
44 UINT8 CacheNum[IP6_ROUTE_CACHE_HASH_SIZE];
46
47//
48// Each IP6 instance has its own route table. Each ServiceBinding
49// instance has a default route table and default address.
50//
51// All the route table entries with the same prefix length are linked
52// together in one route area. For example, RouteArea[0] contains
53// the default routes. A route table also contains a route cache.
54//
55
56typedef struct _IP6_ROUTE_TABLE {
57 INTN RefCnt;
58 UINT32 TotalNum;
59 LIST_ENTRY RouteArea[IP6_PREFIX_NUM];
60 IP6_ROUTE_CACHE Cache;
62
73UINT32
77 );
78
96 IN EFI_IPv6_ADDRESS *GateWay,
97 IN UINTN Tag
98 );
99
106VOID
108 IN OUT IP6_ROUTE_CACHE_ENTRY *RtCacheEntry
109 );
110
125 IN IP6_ROUTE_TABLE *RtTable,
126 IN EFI_IPv6_ADDRESS *Dest,
128 );
129
145 IN IP6_ROUTE_TABLE *RouteTable,
146 OUT UINT32 *EfiRouteCount,
147 OUT EFI_IP6_ROUTE_TABLE **EfiRouteTable OPTIONAL
148 );
149
159 VOID
160 );
161
169VOID
171 IN OUT IP6_ROUTE_TABLE *RtTable
172 );
173
189 IN EFI_IPv6_ADDRESS *Destination OPTIONAL,
190 IN UINT8 PrefixLength,
191 IN EFI_IPv6_ADDRESS *GatewayAddress OPTIONAL
192 );
193
215 IN IP6_ROUTE_TABLE *RtTable,
216 IN EFI_IPv6_ADDRESS *Destination OPTIONAL,
217 IN EFI_IPv6_ADDRESS *NextHop OPTIONAL
218 );
219
226VOID
228 IN OUT IP6_ROUTE_ENTRY *RtEntry
229 );
230
246 IN OUT IP6_ROUTE_TABLE *RtTable,
247 IN EFI_IPv6_ADDRESS *Destination,
248 IN UINT8 PrefixLength,
249 IN EFI_IPv6_ADDRESS *GatewayAddress
250 );
251
268 IN OUT IP6_ROUTE_TABLE *RtTable,
269 IN EFI_IPv6_ADDRESS *Destination,
270 IN UINT8 PrefixLength,
271 IN EFI_IPv6_ADDRESS *GatewayAddress
272 );
273
287Ip6Route (
288 IN IP6_SERVICE *IpSb,
289 IN EFI_IPv6_ADDRESS *Dest,
291 );
292
293#endif
UINT64 UINTN
INT64 INTN
EFI_STATUS Ip6BuildEfiRouteTable(IN IP6_ROUTE_TABLE *RouteTable, OUT UINT32 *EfiRouteCount, OUT EFI_IP6_ROUTE_TABLE **EfiRouteTable OPTIONAL)
Definition: Ip6Route.c:261
VOID Ip6FreeRouteCacheEntry(IN OUT IP6_ROUTE_CACHE_ENTRY *RtCacheEntry)
Definition: Ip6Route.c:199
VOID Ip6CleanRouteTable(IN OUT IP6_ROUTE_TABLE *RtTable)
Definition: Ip6Route.c:361
IP6_ROUTE_ENTRY * Ip6CreateRouteEntry(IN EFI_IPv6_ADDRESS *Destination OPTIONAL, IN UINT8 PrefixLength, IN EFI_IPv6_ADDRESS *GatewayAddress OPTIONAL)
Definition: Ip6Route.c:51
IP6_ROUTE_TABLE * Ip6CreateRouteTable(VOID)
Definition: Ip6Route.c:326
IP6_ROUTE_ENTRY * Ip6FindRouteEntry(IN IP6_ROUTE_TABLE *RtTable, IN EFI_IPv6_ADDRESS *Destination OPTIONAL, IN EFI_IPv6_ADDRESS *NextHop OPTIONAL)
Definition: Ip6Route.c:118
EFI_STATUS Ip6AddRoute(IN OUT IP6_ROUTE_TABLE *RtTable, IN EFI_IPv6_ADDRESS *Destination, IN UINT8 PrefixLength, IN EFI_IPv6_ADDRESS *GatewayAddress)
Definition: Ip6Route.c:446
IP6_ROUTE_CACHE_ENTRY * Ip6FindRouteCache(IN IP6_ROUTE_TABLE *RtTable, IN EFI_IPv6_ADDRESS *Dest, IN EFI_IPv6_ADDRESS *Src)
Definition: Ip6Route.c:223
EFI_STATUS Ip6DelRoute(IN OUT IP6_ROUTE_TABLE *RtTable, IN EFI_IPv6_ADDRESS *Destination, IN UINT8 PrefixLength, IN EFI_IPv6_ADDRESS *GatewayAddress)
Definition: Ip6Route.c:506
IP6_ROUTE_CACHE_ENTRY * Ip6CreateRouteCacheEntry(IN EFI_IPv6_ADDRESS *Dst, IN EFI_IPv6_ADDRESS *Src, IN EFI_IPv6_ADDRESS *GateWay, IN UINTN Tag)
Definition: Ip6Route.c:167
UINT32 Ip6RouteCacheHash(IN EFI_IPv6_ADDRESS *Ip1, IN EFI_IPv6_ADDRESS *Ip2)
Definition: Ip6Route.c:23
IP6_ROUTE_CACHE_ENTRY * Ip6Route(IN IP6_SERVICE *IpSb, IN EFI_IPv6_ADDRESS *Dest, IN EFI_IPv6_ADDRESS *Src)
Definition: Ip6Route.c:557
VOID Ip6FreeRouteEntry(IN OUT IP6_ROUTE_ENTRY *RtEntry)
Definition: Ip6Route.c:87
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29