2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS TCP/IP protocol driver
4 * FILE: include/route.h
5 * PURPOSE: Routing cache definitions
17 /* Route Cache Node structure.
18 * The primary purpose of the RCN is to cache selected source and
19 * next-hop addresses. The routing cache is implemented as a binary
20 * search tree to provide fast lookups when many RCNs are in the cache.
22 typedef struct ROUTE_CACHE_NODE
{
23 struct ROUTE_CACHE_NODE
*Parent
; /* Pointer to parent */
24 struct ROUTE_CACHE_NODE
*Left
; /* Pointer to left child */
25 struct ROUTE_CACHE_NODE
*Right
; /* Pointer to right child */
26 /* Memebers above this line must not be moved */
27 ULONG RefCount
; /* Reference count */
28 UCHAR State
; /* RCN state (RCN_STATE_*) */
29 IP_ADDRESS Destination
; /* Destination address */
30 PNET_TABLE_ENTRY NTE
; /* Preferred NTE */
31 PNEIGHBOR_CACHE_ENTRY NCE
; /* Pointer to NCE for first hop (NULL if none) */
32 UINT PathMTU
; /* Path MTU to destination */
33 } ROUTE_CACHE_NODE
, *PROUTE_CACHE_NODE
;
36 #define RCN_STATE_PERMANENT 0x00 /* RCN is permanent (properly local) */
37 #define RCN_STATE_COMPUTED 0x01 /* RCN is computed */
40 #define IsExternalRCN(RCN) \
43 #define IsInternalRCN(RCN) \
47 NTSTATUS
RouteStartup(
50 NTSTATUS
RouteShutdown(
53 UINT
RouteGetRouteToDestination(
54 PIP_ADDRESS Destination
,
56 PROUTE_CACHE_NODE
*RCN
);
58 PROUTE_CACHE_NODE
RouteAddRouteToDestination(
59 PIP_ADDRESS Destination
,
62 PNEIGHBOR_CACHE_ENTRY NCE
);
64 VOID
RouteRemoveRouteToDestination(
65 PROUTE_CACHE_NODE RCN
);
67 VOID
RouteInvalidateNTE(
68 PNET_TABLE_ENTRY NTE
);
70 VOID
RouteInvalidateNCE(
71 PNEIGHBOR_CACHE_ENTRY NCE
);
73 #endif /* __ROUTE_H */