Added networking code from Casper Hornstrup
[reactos.git] / reactos / drivers / net / tcpip / include / router.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS TCP/IP protocol driver
4 * FILE: include/router.h
5 * PURPOSE: IP routing definitions
6 */
7 #ifndef __ROUTER_H
8 #define __ROUTER_H
9
10 #include <neighbor.h>
11
12
13 /* Forward Information Base Entry */
14 typedef struct _FIB_ENTRY {
15 LIST_ENTRY ListEntry; /* Entry on list */
16 ULONG RefCount; /* Reference count */
17 PIP_ADDRESS NetworkAddress; /* Address of network */
18 PIP_ADDRESS Netmask; /* Netmask of network */
19 PNET_TABLE_ENTRY NTE; /* Pointer to NTE to use */
20 PNEIGHBOR_CACHE_ENTRY Router; /* Pointer to NCE of router to use */
21 UINT Metric; /* Cost of this route */
22 } FIB_ENTRY, *PFIB_ENTRY;
23
24
25 PNET_TABLE_ENTRY RouterFindBestNTE(
26 PIP_INTERFACE Interface,
27 PIP_ADDRESS Destination);
28
29 PIP_INTERFACE RouterFindOnLinkInterface(
30 PIP_ADDRESS Address,
31 PNET_TABLE_ENTRY NTE);
32
33 PFIB_ENTRY RouterAddRoute(
34 PIP_ADDRESS NetworkAddress,
35 PIP_ADDRESS Netmask,
36 PNET_TABLE_ENTRY NTE,
37 PNEIGHBOR_CACHE_ENTRY Router,
38 UINT Metric);
39
40 PNEIGHBOR_CACHE_ENTRY RouterGetRoute(
41 PIP_ADDRESS Destination,
42 PNET_TABLE_ENTRY NTE);
43
44 VOID RouterRemoveRoute(
45 PFIB_ENTRY FIBE);
46
47 PFIB_ENTRY RouterCreateRouteIPv4(
48 IPv4_RAW_ADDRESS NetworkAddress,
49 IPv4_RAW_ADDRESS Netmask,
50 IPv4_RAW_ADDRESS RouterAddress,
51 PNET_TABLE_ENTRY NTE,
52 UINT Metric);
53
54 NTSTATUS RouterStartup(
55 VOID);
56
57 NTSTATUS RouterShutdown(
58 VOID);
59
60 #endif /* __ROUTER_H */
61
62 /* EOF */