#include "precomp.h"
Go to the source code of this file.
|
void | RouterDumpRoutes () |
|
VOID | FreeFIB (PVOID Object) |
|
VOID | DestroyFIBE (PFIB_ENTRY FIBE) |
|
VOID | DestroyFIBEs (VOID) |
|
UINT | CountFIBs (PIP_INTERFACE IF) |
|
UINT | CopyFIBs (PIP_INTERFACE IF, PFIB_ENTRY Target) |
|
UINT | CommonPrefixLength (PIP_ADDRESS Address1, PIP_ADDRESS Address2) |
|
PFIB_ENTRY | RouterAddRoute (PIP_ADDRESS NetworkAddress, PIP_ADDRESS Netmask, PNEIGHBOR_CACHE_ENTRY Router, UINT Metric) |
|
PNEIGHBOR_CACHE_ENTRY | RouterGetRoute (PIP_ADDRESS Destination) |
|
PNEIGHBOR_CACHE_ENTRY | RouteGetRouteToDestination (PIP_ADDRESS Destination) |
|
VOID | RouterRemoveRoutesForInterface (PIP_INTERFACE Interface) |
|
NTSTATUS | RouterRemoveRoute (PIP_ADDRESS Target, PIP_ADDRESS Router) |
|
PFIB_ENTRY | RouterCreateRoute (PIP_ADDRESS NetworkAddress, PIP_ADDRESS Netmask, PIP_ADDRESS RouterAddress, PIP_INTERFACE Interface, UINT Metric) |
|
NTSTATUS | RouterStartup (VOID) |
|
NTSTATUS | RouterShutdown (VOID) |
|
◆ CommonPrefixLength()
Definition at line 142 of file router.c.
155{
160
162
163
164
165
168 else
170
173
174
175 for (
i = 0;
i <
Size && Addr1[
i] == Addr2[
i];
i++);
176 if(
i ==
Size )
return 8 *
i;
177
178
179 Bitmask = 0x80;
180 for (
j = 0; (Addr1[
i] & Bitmask) == (Addr2[
i] & Bitmask);
j++)
181 Bitmask >>= 1;
182
184
186}
#define TI_DbgPrint(_t_, _x_)
USHORT IPv6_RAW_ADDRESS[8]
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
union IP_ADDRESS::@1014 Address
IPv4_RAW_ADDRESS IPv4Address
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Referenced by RouterGetRoute().
◆ CopyFIBs()
Definition at line 120 of file router.c.
120 {
125
128 NextEntry = CurrentEntry->
Flink;
131 {
132 Target[FibCount] = *Current;
133 FibCount++;
134 }
135 CurrentEntry = NextEntry;
136 }
137
138 return FibCount;
139}
PNEIGHBOR_CACHE_ENTRY Router
struct _LIST_ENTRY * Flink
#define CONTAINING_RECORD(address, type, field)
Referenced by InfoTdiQueryGetRouteTable().
◆ CountFIBs()
◆ DestroyFIBE()
◆ DestroyFIBEs()
Definition at line 77 of file router.c.
84{
88
89
92 NextEntry = CurrentEntry->
Flink;
94
96 CurrentEntry = NextEntry;
97 }
98}
VOID DestroyFIBE(PFIB_ENTRY FIBE)
Referenced by RouterShutdown().
◆ FreeFIB()
Definition at line 45 of file router.c.
52{
54}
#define ExFreePoolWithTag(_P, _T)
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
Referenced by DestroyFIBE().
◆ RouteGetRouteToDestination()
Definition at line 300 of file router.c.
312{
315
317
319
320#if 0
322 PrintTree(RouteCache);
323#endif
324
325
328
330 } else {
331
333 }
334
335 if( NCE )
337
338 return NCE;
339}
PCHAR A2S(PIP_ADDRESS Address)
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
PNEIGHBOR_CACHE_ENTRY NBFindOrCreateNeighbor(PIP_INTERFACE Interface, PIP_ADDRESS Address, BOOLEAN NoTimeout)
PIP_INTERFACE FindOnLinkInterface(PIP_ADDRESS Address)
PNEIGHBOR_CACHE_ENTRY RouterGetRoute(PIP_ADDRESS Destination)
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Referenced by DispTdiQueryIpHwAddress(), ICMPReply(), RawIPSendDatagram(), TCPConnect(), TCPSendDataCallback(), and UDPSendDatagram().
◆ RouterAddRoute()
Definition at line 189 of file router.c.
208{
210
212 "Router (0x%X) Metric (%d).\n",
NetworkAddress, Netmask, Router, Metric));
213
218
220 if (!FIBE) {
223 }
224
231
232
234
235 return FIBE;
236}
VOID TcpipInterlockedInsertTailList(PLIST_ENTRY ListHead, PLIST_ENTRY Item, PKSPIN_LOCK Lock)
#define ExAllocatePoolWithTag(hernya, size, tag)
_Must_inspect_result_ _Out_ PNDIS_STATUS _Outptr_result_bytebuffer_to_ NetworkAddressLength PVOID * NetworkAddress
IP_ADDRESS NetworkAddress
#define RtlCopyMemory(Destination, Source, Length)
Referenced by IPAddInterfaceRoute(), and RouterCreateRoute().
◆ RouterCreateRoute()
Definition at line 421 of file router.c.
440{
446
448
451 NextEntry = CurrentEntry->
Flink;
453
455
459 {
463 }
464
465 CurrentEntry = NextEntry;
466 }
467
469
470
472
473 if (!NCE) {
474
476 }
477
479}
BOOLEAN AddrIsEqual(PIP_ADDRESS Address1, PIP_ADDRESS Address2)
VOID TcpipReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL Irql)
VOID TcpipAcquireSpinLock(PKSPIN_LOCK SpinLock, PKIRQL Irql)
PFIB_ENTRY RouterAddRoute(PIP_ADDRESS NetworkAddress, PIP_ADDRESS Netmask, PNEIGHBOR_CACHE_ENTRY Router, UINT Metric)
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Referenced by InfoTdiSetRoute(), and ReadIpConfiguration().
◆ RouterDumpRoutes()
void RouterDumpRoutes |
( |
| ) |
|
Definition at line 20 of file router.c.
20 {
25
27
30 NextEntry = CurrentEntry->
Flink;
32
34
38
39 CurrentEntry = NextEntry;
40 }
41
43}
Referenced by RouterRemoveRoute().
◆ RouterGetRoute()
Definition at line 239 of file router.c.
249{
257
259
261
263
266 NextEntry = CurrentEntry->
Flink;
268
271
274
277
278 if(
Length >= MaskLength && (
Length > BestLength || !BestNCE) &&
280
281 BestNCE = NCE;
284 }
285
286 CurrentEntry = NextEntry;
287 }
288
290
291 if( BestNCE ) {
293 } else {
295 }
296
297 return BestNCE;
298}
UINT AddrCountPrefixBits(PIP_ADDRESS Netmask)
_In_ ULONG _In_ ULONG _In_ ULONG Length
UINT CommonPrefixLength(PIP_ADDRESS Address1, PIP_ADDRESS Address2)
Referenced by RouteGetRouteToDestination().
◆ RouterRemoveRoute()
Definition at line 364 of file router.c.
373{
380
384
386
388
391 NextEntry = CurrentEntry->
Flink;
393
395
399 break;
400 }
401
403 CurrentEntry = NextEntry;
404 }
405
409 }
410
412
414
416
418}
#define STATUS_UNSUCCESSFUL
Referenced by InfoTdiSetRoute(), and IPRemoveInterfaceRoute().
◆ RouterRemoveRoutesForInterface()
◆ RouterShutdown()
◆ RouterStartup()
Definition at line 482 of file router.c.
489{
491
492
495
497}
VOID TcpipInitializeSpinLock(PKSPIN_LOCK SpinLock)
#define InitializeListHead(ListHead)
Referenced by IPStartup().
◆ FIBListHead
◆ FIBLock