TianoCore EDK2 master
Loading...
Searching...
No Matches
Ip4Route.h
Go to the documentation of this file.
1
9#ifndef __EFI_IP4_ROUTE_H__
10#define __EFI_IP4_ROUTE_H__
11
12#include "Ip4Common.h"
13
14#define IP4_DIRECT_ROUTE 0x00000001
15
16#define IP4_ROUTE_CACHE_HASH_VALUE 31
17#define IP4_ROUTE_CACHE_MAX 64 // Max NO. of cache entry per hash bucket
18
19#define IP4_ROUTE_CACHE_HASH(Dst, Src) (((Dst) ^ (Src)) % IP4_ROUTE_CACHE_HASH_VALUE)
20
28typedef struct {
29 LIST_ENTRY Link;
30 INTN RefCnt;
31 IP4_ADDR Dest;
32 IP4_ADDR Netmask;
33 IP4_ADDR NextHop;
34 UINT32 Flag;
36
47typedef struct {
48 LIST_ENTRY Link;
49 INTN RefCnt;
50 IP4_ADDR Dest;
51 IP4_ADDR Src;
52 IP4_ADDR NextHop;
53 UINTN Tag;
55
63typedef struct {
64 LIST_ENTRY CacheBucket[IP4_ROUTE_CACHE_HASH_VALUE];
66
76
78 INTN RefCnt;
79 UINT32 TotalNum;
80 LIST_ENTRY RouteArea[IP4_MASK_NUM];
81 IP4_ROUTE_TABLE *Next;
82 IP4_ROUTE_CACHE Cache;
83};
84
94 VOID
95 );
96
104VOID
106 IN IP4_ROUTE_TABLE *RtTable
107 );
108
125 IN OUT IP4_ROUTE_TABLE *RtTable,
126 IN IP4_ADDR Dest,
127 IN IP4_ADDR Netmask,
128 IN IP4_ADDR Gateway
129 );
130
146 IN OUT IP4_ROUTE_TABLE *RtTable,
147 IN IP4_ADDR Dest,
148 IN IP4_ADDR Netmask,
149 IN IP4_ADDR Gateway
150 );
151
168 IN IP4_ROUTE_TABLE *RtTable,
169 IN IP4_ADDR Dest,
170 IN IP4_ADDR Src
171 );
172
179VOID
181 IN IP4_ROUTE_CACHE_ENTRY *RtCacheEntry
182 );
183
202Ip4Route (
203 IN IP4_ROUTE_TABLE *RtTable,
204 IN IP4_ADDR Dest,
205 IN IP4_ADDR Src,
206 IN IP4_ADDR SubnetMask,
207 IN BOOLEAN AlwaysTryDestAddr
208 );
209
223 IN IP4_PROTOCOL *IpInstance
224 );
225
226#endif
UINT64 UINTN
INT64 INTN
EFI_STATUS Ip4BuildEfiRouteTable(IN IP4_PROTOCOL *IpInstance)
Definition: Ip4Route.c:593
IP4_ROUTE_CACHE_ENTRY * Ip4FindRouteCache(IN IP4_ROUTE_TABLE *RtTable, IN IP4_ADDR Dest, IN IP4_ADDR Src)
Definition: Ip4Route.c:397
EFI_STATUS Ip4DelRoute(IN OUT IP4_ROUTE_TABLE *RtTable, IN IP4_ADDR Dest, IN IP4_ADDR Netmask, IN IP4_ADDR Gateway)
Definition: Ip4Route.c:352
VOID Ip4FreeRouteCacheEntry(IN IP4_ROUTE_CACHE_ENTRY *RtCacheEntry)
Definition: Ip4Route.c:113
IP4_ROUTE_TABLE * Ip4CreateRouteTable(VOID)
Definition: Ip4Route.c:177
IP4_ROUTE_CACHE_ENTRY * Ip4Route(IN IP4_ROUTE_TABLE *RtTable, IN IP4_ADDR Dest, IN IP4_ADDR Src, IN IP4_ADDR SubnetMask, IN BOOLEAN AlwaysTryDestAddr)
Definition: Ip4Route.c:484
EFI_STATUS Ip4AddRoute(IN OUT IP4_ROUTE_TABLE *RtTable, IN IP4_ADDR Dest, IN IP4_ADDR Netmask, IN IP4_ADDR Gateway)
Definition: Ip4Route.c:291
VOID Ip4FreeRouteTable(IN IP4_ROUTE_TABLE *RtTable)
Definition: Ip4Route.c:211
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29