ReactOS 0.4.16-dev-2491-g3dc6630
neighbor.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS TCP/IP protocol driver
4 * FILE: network/neighbor.c
5 * PURPOSE: Neighbor address cache
6 * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
7 * REVISIONS:
8 * CSH 01/08-2000 Created
9 */
10
11#include "precomp.h"
12
14
16 PNDIS_PACKET NdisPacket,
19 TI_DbgPrint(MID_TRACE, ("Called\n"));
21 ASSERT_KM_POINTER(Packet->Complete);
22 Packet->Complete( Packet->Context, Packet->Packet, Status );
23 TI_DbgPrint(MID_TRACE, ("Completed\n"));
25 TI_DbgPrint(MID_TRACE, ("Freed\n"));
26}
27
29 PLIST_ENTRY PacketEntry;
32
33 ASSERT(!(NCE->State & NUD_INCOMPLETE));
34
35 HashValue = *(PULONG)(&NCE->Address.Address);
36 HashValue ^= HashValue >> 16;
37 HashValue ^= HashValue >> 8;
38 HashValue ^= HashValue >> 4;
40
41 /* Send any waiting packets */
42 while ((PacketEntry = ExInterlockedRemoveHeadList(&NCE->PacketQueue,
44 {
46
48 (MID_TRACE,
49 ("PacketEntry: %x, NdisPacket %x\n",
50 PacketEntry, Packet->Packet));
51
52 PC(Packet->Packet)->DLComplete = NBCompleteSend;
53 PC(Packet->Packet)->Context = Packet;
54
56 ( NCE->Interface->Context,
57 Packet->Packet,
58 0,
59 NCE->LinkAddress,
61 }
62}
63
64/* Must be called with table lock acquired */
67 PLIST_ENTRY PacketEntry;
69
70 while( !IsListEmpty(&NCE->PacketQueue) ) {
71 PacketEntry = RemoveHeadList(&NCE->PacketQueue);
73 ( PacketEntry, NEIGHBOR_PACKET, Next );
74
76
78 (MID_TRACE,
79 ("PacketEntry: %x, NdisPacket %x\n",
80 PacketEntry, Packet->Packet));
81
82 ASSERT_KM_POINTER(Packet->Complete);
83 Packet->Complete( Packet->Context,
84 Packet->Packet,
85 ErrorCode );
86
88 }
89}
90
92/*
93 * FUNCTION: Neighbor address cache timeout handler
94 * NOTES:
95 * This routine is called by IPTimeout to remove outdated cache
96 * entries.
97 */
98{
99 UINT i;
100 PNEIGHBOR_CACHE_ENTRY *PrevNCE;
103
104 for (i = 0; i <= NB_HASHMASK; i++) {
106
107 for (PrevNCE = &NeighborCache[i].Cache;
108 (NCE = *PrevNCE) != NULL;) {
109 if (NCE->State & NUD_INCOMPLETE)
110 {
111 /* Solicit for an address */
112 NBSendSolicit(NCE);
113 if (NCE->EventTimer == 0)
114 {
115 NCE->EventCount++;
117 {
119 NCE->EventCount = 0;
120 }
121 }
122 }
123
124 /* Check if event timer is running */
125 if (NCE->EventTimer > 0) {
126 ASSERT(!(NCE->State & NUD_PERMANENT));
127 NCE->EventCount++;
128
129 if ((NCE->EventCount > ARP_RATE &&
131 (NCE->EventCount == ARP_RATE))
132 {
133 /* We haven't gotten a packet from them in
134 * EventCount seconds so we mark them as stale
135 * and solicit now */
136 NCE->State |= NUD_STALE;
137 NBSendSolicit(NCE);
138 }
139 if (NCE->EventTimer - NCE->EventCount == 0) {
140 /* Unlink and destroy the NCE */
141 *PrevNCE = NCE->Next;
142
143 /* Choose the proper failure status */
144 if (NCE->State & NUD_INCOMPLETE)
145 {
146 /* We couldn't get an address to this IP at all */
148 }
149 else
150 {
151 /* This guy was stale for way too long */
153 }
154
156
158
159 continue;
160 }
161 }
162 PrevNCE = &NCE->Next;
163 }
164
166 }
167}
168
170/*
171 * FUNCTION: Starts the neighbor cache
172 */
173{
174 UINT i;
175
176 TI_DbgPrint(DEBUG_NCACHE, ("Called.\n"));
177
178 for (i = 0; i <= NB_HASHMASK; i++) {
181 }
182}
183
185/*
186 * FUNCTION: Shuts down the neighbor cache
187 */
188{
189 PNEIGHBOR_CACHE_ENTRY NextNCE;
192 UINT i;
193
194 TI_DbgPrint(DEBUG_NCACHE, ("Called.\n"));
195
196 /* Remove possible entries from the cache */
197 for (i = 0; i <= NB_HASHMASK; i++)
198 {
200
201 CurNCE = NeighborCache[i].Cache;
202 while (CurNCE) {
203 NextNCE = CurNCE->Next;
204
205 /* Flush wait queue */
207
208 ExFreePoolWithTag(CurNCE, NCE_TAG);
209
210 CurNCE = NextNCE;
211 }
212
214
216 }
217
218 TI_DbgPrint(MAX_TRACE, ("Leaving.\n"));
219}
220
222/*
223 * FUNCTION: Sends a neighbor solicitation message
224 * ARGUMENTS:
225 * NCE = Pointer to NCE of neighbor to solicit
226 * NOTES:
227 * May be called with lock held on NCE's table
228 */
229{
230 TI_DbgPrint(DEBUG_NCACHE, ("Called. NCE (0x%X).\n", NCE));
231
232 ARPTransmit(&NCE->Address,
233 (NCE->State & NUD_INCOMPLETE) ? NULL : NCE->LinkAddress,
234 NCE->Interface);
235}
236
238{
240 PNEIGHBOR_CACHE_ENTRY *PrevNCE;
242 ULONG i;
243
245 for (i = 0; i <= NB_HASHMASK; i++)
246 {
248
249 for (PrevNCE = &NeighborCache[i].Cache;
250 (NCE = *PrevNCE) != NULL;)
251 {
252 if (NCE->Interface == Interface)
253 {
254 /* Unlink and destroy the NCE */
255 *PrevNCE = NCE->Next;
256
259
260 continue;
261 }
262 else
263 {
264 PrevNCE = &NCE->Next;
265 }
266 }
267
269 }
271}
272
276 PVOID LinkAddress,
277 UINT LinkAddressLength,
278 UCHAR State,
279 UINT EventTimer)
280/*
281 * FUNCTION: Adds a neighbor to the neighbor cache
282 * ARGUMENTS:
283 * Interface = Pointer to interface
284 * Address = Pointer to IP address
285 * LinkAddress = Pointer to link address (may be NULL)
286 * LinkAddressLength = Length of link address
287 * State = State of NCE
288 * RETURNS:
289 * Pointer to NCE, NULL there is not enough free resources
290 * NOTES:
291 * The NCE if referenced for the caller if created. The NCE retains
292 * a reference to the IP address if it is created, the caller is
293 * responsible for providing this reference
294 */
295{
299 IP_ADDRESS InternalAddress;
300
303 ("Called. Interface (0x%X) Address (0x%X) "
304 "LinkAddress (0x%X) LinkAddressLength (%d) State (0x%X)\n",
305 Interface, Address, LinkAddress, LinkAddressLength, State));
306
308 (NonPagedPool, sizeof(NEIGHBOR_CACHE_ENTRY) + LinkAddressLength,
309 NCE_TAG);
310 if (NCE == NULL)
311 {
312 TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
313 return NULL;
314 }
315
316 RtlCopyMemory(&InternalAddress, Address, sizeof(*Address));
317
318 /* Map 127.x.x.x adresses to the loopback address (127.0.0.1) */
320 InternalAddress.Address.IPv4Address = LOOPBACK_ADDRESS_IPv4;
321
322 NCE->Interface = Interface;
323 NCE->Address = InternalAddress;
324 NCE->LinkAddressLength = LinkAddressLength;
325 NCE->LinkAddress = (PVOID)&NCE[1];
326 if( LinkAddress )
327 RtlCopyMemory(NCE->LinkAddress, LinkAddress, LinkAddressLength);
328 else
329 memset(NCE->LinkAddress, 0xff, LinkAddressLength);
330 NCE->State = State;
331 NCE->EventTimer = EventTimer;
332 NCE->EventCount = 0;
334
335 TI_DbgPrint(MID_TRACE,("NCE: %x\n", NCE));
336
337 HashValue = *(PULONG)&InternalAddress.Address;
338 HashValue ^= HashValue >> 16;
339 HashValue ^= HashValue >> 8;
340 HashValue ^= HashValue >> 4;
342
344
347
349
350 return NCE;
351}
352
355 PVOID LinkAddress,
356 UCHAR State)
357/*
358 * FUNCTION: Update link address information in NCE
359 * ARGUMENTS:
360 * NCE = Pointer to NCE to update
361 * LinkAddress = Pointer to link address
362 * State = State of NCE
363 * NOTES:
364 * The link address and state is updated. Any waiting packets are sent
365 */
366{
369
370 TI_DbgPrint(DEBUG_NCACHE, ("Called. NCE (0x%X) LinkAddress (0x%X) State (0x%X).\n", NCE, LinkAddress, State));
371
372 HashValue = *(PULONG)(&NCE->Address.Address);
373 HashValue ^= HashValue >> 16;
374 HashValue ^= HashValue >> 8;
375 HashValue ^= HashValue >> 4;
377
379
380 RtlCopyMemory(NCE->LinkAddress, LinkAddress, NCE->LinkAddressLength);
381 NCE->State = State;
382 NCE->EventCount = 0;
383
385
386 if( !(NCE->State & NUD_INCOMPLETE) )
387 {
389 NBSendPackets( NCE );
390 }
391}
392
393VOID
395{
399
400 TI_DbgPrint(DEBUG_NCACHE, ("Resetting NCE timout for 0x%s\n", A2S(Address)));
401
402 HashValue = *(PULONG)(&Address->Address);
403 HashValue ^= HashValue >> 16;
404 HashValue ^= HashValue >> 8;
405 HashValue ^= HashValue >> 4;
407
409
410 for (NCE = NeighborCache[HashValue].Cache;
411 NCE != NULL;
412 NCE = NCE->Next)
413 {
414 if (AddrIsEqual(Address, &NCE->Address))
415 {
416 NCE->EventCount = 0;
417 break;
418 }
419 }
420
422}
423
427/*
428 * FUNCTION: Locates a neighbor in the neighbor cache
429 * ARGUMENTS:
430 * Address = Pointer to IP address
431 * Interface = Pointer to IP interface
432 * RETURNS:
433 * Pointer to NCE, NULL if not found
434 * NOTES:
435 * If the NCE is found, it is referenced. The caller is
436 * responsible for dereferencing it again after use
437 */
438{
442 PIP_INTERFACE FirstInterface;
443 IP_ADDRESS InternalAddress;
444
445 TI_DbgPrint(DEBUG_NCACHE, ("Called. Address (0x%X).\n", Address));
446
447 RtlCopyMemory(&InternalAddress, Address, sizeof(*Address));
448
449 /* Map 127.x.x.x adresses to the loopback address (127.0.0.1) */
451 InternalAddress.Address.IPv4Address = LOOPBACK_ADDRESS_IPv4;
452
453 HashValue = *(PULONG)&InternalAddress.Address;;
454 HashValue ^= HashValue >> 16;
455 HashValue ^= HashValue >> 8;
456 HashValue ^= HashValue >> 4;
458
460
461 /* If there's no adapter specified, we'll look for a match on
462 * each one. */
463 if (Interface == NULL)
464 {
465 FirstInterface = GetDefaultInterface();
466 Interface = FirstInterface;
467 }
468 else
469 {
470 FirstInterface = NULL;
471 }
472
473 do
474 {
476 while (NCE != NULL)
477 {
478 if (NCE->Interface == Interface &&
479 AddrIsEqual(&InternalAddress, &NCE->Address))
480 {
481 break;
482 }
483
484 NCE = NCE->Next;
485 }
486
487 if (NCE != NULL)
488 break;
489 }
490 while ((FirstInterface != NULL) &&
491 ((Interface = GetDefaultInterface()) != FirstInterface));
492
493 if ((NCE == NULL) && (FirstInterface != NULL))
494 {
495 /* This time we'll even match loopback NCEs */
497 while (NCE != NULL)
498 {
499 if (AddrIsEqual(&InternalAddress, &NCE->Address))
500 {
501 break;
502 }
503
504 NCE = NCE->Next;
505 }
506 }
507
509
510 TI_DbgPrint(MAX_TRACE, ("Leaving.\n"));
511
512 return NCE;
513}
514
518 BOOLEAN NoTimeout)
519/*
520 * FUNCTION: Tries to find a neighbor and if unsuccesful, creates a new NCE
521 * ARGUMENTS:
522 * Interface = Pointer to interface to use (in case NCE is not found)
523 * Address = Pointer to IP address
524 * RETURNS:
525 * Pointer to NCE, NULL if there is not enough free resources
526 * NOTES:
527 * The NCE is referenced if found or created. The caller is
528 * responsible for dereferencing it again after use
529 */
530{
532
533 TI_DbgPrint(DEBUG_NCACHE, ("Called. Interface (0x%X) Address (0x%X).\n", Interface, Address));
534
536 if (NCE == NULL)
537 {
538 TI_DbgPrint(MID_TRACE,("BCAST: %s\n", A2S(&Interface->Broadcast)));
539 if( AddrIsEqual(Address, &Interface->Broadcast) ||
541 TI_DbgPrint(MID_TRACE,("Packet targeted at broadcast addr\n"));
543 Interface->AddressLength, NUD_PERMANENT, 0);
544 } else {
546 Interface->AddressLength, NUD_INCOMPLETE, NoTimeout ? 0 : ARP_INCOMPLETE_TIMEOUT);
547 if (!NCE) return NULL;
548 NBSendSolicit(NCE);
549 }
550 }
551
552 return NCE;
553}
554
557 PNDIS_PACKET NdisPacket,
558 PNEIGHBOR_PACKET_COMPLETE PacketComplete,
559 PVOID PacketContext)
560/*
561 * FUNCTION: Queues a packet on an NCE for later transmission
562 * ARGUMENTS:
563 * NCE = Pointer to NCE to queue packet on
564 * NdisPacket = Pointer to NDIS packet to queue
565 * RETURNS:
566 * TRUE if the packet was successfully queued, FALSE if not
567 */
568{
572
575 ("Called. NCE (0x%X) NdisPacket (0x%X).\n", NCE, NdisPacket));
576
579 if( !Packet ) return FALSE;
580
581 /* FIXME: Should we limit the number of queued packets? */
582
583 HashValue = *(PULONG)(&NCE->Address.Address);
584 HashValue ^= HashValue >> 16;
585 HashValue ^= HashValue >> 8;
586 HashValue ^= HashValue >> 4;
588
590
591 Packet->Complete = PacketComplete;
592 Packet->Context = PacketContext;
593 Packet->Packet = NdisPacket;
594 InsertTailList( &NCE->PacketQueue, &Packet->Next );
595
597
598 if( !(NCE->State & NUD_INCOMPLETE) )
599 NBSendPackets( NCE );
600
601 return TRUE;
602}
603
606/*
607 * FUNCTION: Removes a neighbor from the neighbor cache
608 * ARGUMENTS:
609 * NCE = Pointer to NCE to remove from cache
610 * NOTES:
611 * The NCE must be in a safe state
612 */
613{
614 PNEIGHBOR_CACHE_ENTRY *PrevNCE;
618
619 TI_DbgPrint(DEBUG_NCACHE, ("Called. NCE (0x%X).\n", NCE));
620
621 HashValue = *(PULONG)(&NCE->Address.Address);
622 HashValue ^= HashValue >> 16;
623 HashValue ^= HashValue >> 8;
624 HashValue ^= HashValue >> 4;
626
628
629 /* Search the list and remove the NCE from the list if found */
630 for (PrevNCE = &NeighborCache[HashValue].Cache;
631 (CurNCE = *PrevNCE) != NULL;
632 PrevNCE = &CurNCE->Next)
633 {
634 if (CurNCE == NCE)
635 {
636 /* Found it, now unlink it from the list */
637 *PrevNCE = CurNCE->Next;
638
640 ExFreePoolWithTag(CurNCE, NCE_TAG);
641
642 break;
643 }
644 }
645
647}
648
651 PIPARP_ENTRY ArpTable)
652{
655 UINT Size = 0, i;
656
657 for (i = 0; i <= NB_HASHMASK; i++) {
659 for( CurNCE = NeighborCache[i].Cache;
660 CurNCE;
661 CurNCE = CurNCE->Next ) {
662 if( CurNCE->Interface == Interface &&
663 !AddrIsEqual( &CurNCE->Address, &CurNCE->Interface->Unicast ) ) {
664 if( ArpTable ) {
665 ArpTable[Size].Index = Interface->Index;
666 ArpTable[Size].AddrSize = CurNCE->LinkAddressLength;
668 (ArpTable[Size].PhysAddr,
669 CurNCE->LinkAddress,
670 CurNCE->LinkAddressLength);
671 ArpTable[Size].LogAddr = CurNCE->Address.Address.IPv4Address;
672 if( CurNCE->State & NUD_PERMANENT )
673 ArpTable[Size].Type = ARP_ENTRY_STATIC;
674 else if( CurNCE->State & NUD_INCOMPLETE )
675 ArpTable[Size].Type = ARP_ENTRY_INVALID;
676 else
677 ArpTable[Size].Type = ARP_ENTRY_DYNAMIC;
678 }
679 Size++;
680 }
681 }
683 }
684
685 return Size;
686}
unsigned char BOOLEAN
Definition: actypes.h:127
BOOLEAN AddrIsUnspecified(PIP_ADDRESS Address)
Definition: address.c:113
BOOLEAN AddrIsEqual(PIP_ADDRESS Address1, PIP_ADDRESS Address2)
Definition: address.c:221
BOOLEAN ARPTransmit(PIP_ADDRESS Address, PVOID LinkAddress, PIP_INTERFACE Interface)
Definition: arp.c:111
LONG NTSTATUS
Definition: precomp.h:26
#define MIN_TRACE
Definition: debug.h:14
#define MID_TRACE
Definition: debug.h:15
#define MAX_TRACE
Definition: debug.h:16
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define DEBUG_NCACHE
Definition: debug.h:32
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
#define ASSERT_KM_POINTER(_x)
Definition: debug.h:74
#define LOOPBACK_ADDRMASK_IPv4
Definition: ip.h:189
#define LOOPBACK_ADDRESS_IPv4
Definition: ip.h:187
#define PC(Packet)
Definition: ip.h:106
VOID TcpipAcquireSpinLockAtDpcLevel(PKSPIN_LOCK SpinLock)
Definition: lock.c:22
VOID TcpipReleaseSpinLockFromDpcLevel(PKSPIN_LOCK SpinLock)
Definition: lock.c:30
VOID TcpipReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL Irql)
Definition: lock.c:26
VOID TcpipInitializeSpinLock(PKSPIN_LOCK SpinLock)
Definition: lock.c:14
VOID TcpipAcquireSpinLock(PKSPIN_LOCK SpinLock, PKIRQL Irql)
Definition: lock.c:18
#define NEIGHBOR_PACKET_TAG
Definition: tags.h:24
#define NCE_TAG
Definition: tags.h:25
PCHAR A2S(PIP_ADDRESS Address)
Definition: address.c:17
#define InsertTailList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
#define RemoveHeadList(ListHead)
Definition: env_spec_w32.h:964
#define NonPagedPool
Definition: env_spec_w32.h:307
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
Status
Definition: gdiplustypes.h:25
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
Definition: glfuncs.h:248
#define ARP_ENTRY_STATIC
Definition: info.h:30
#define ARP_ENTRY_INVALID
Definition: info.h:32
#define ARP_ENTRY_DYNAMIC
Definition: info.h:31
PLIST_ENTRY NTAPI ExInterlockedRemoveHeadList(IN OUT PLIST_ENTRY ListHead, IN OUT PKSPIN_LOCK Lock)
Definition: interlocked.c:166
#define LAN_PROTO_IPv4
Definition: lan.h:126
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1549
#define NDIS_STATUS_NETWORK_UNREACHABLE
Definition: ndis.h:511
#define NDIS_STATUS_REQUEST_ABORTED
Definition: ndis.h:476
unsigned int UINT
Definition: ndis.h:50
#define NDIS_STATUS_HOST_UNREACHABLE
Definition: ndis.h:512
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define NDIS_STATUS_NOT_ACCEPTED
Definition: ndis.h:350
VOID NBSendPackets(PNEIGHBOR_CACHE_ENTRY NCE)
Definition: neighbor.c:28
NEIGHBOR_CACHE_TABLE NeighborCache[NB_HASHMASK+1]
Definition: neighbor.c:13
ULONG NBCopyNeighbors(PIP_INTERFACE Interface, PIPARP_ENTRY ArpTable)
Definition: neighbor.c:650
VOID NBDestroyNeighborsForInterface(PIP_INTERFACE Interface)
Definition: neighbor.c:237
VOID NBShutdown(VOID)
Definition: neighbor.c:184
PNEIGHBOR_CACHE_ENTRY NBFindOrCreateNeighbor(PIP_INTERFACE Interface, PIP_ADDRESS Address, BOOLEAN NoTimeout)
Definition: neighbor.c:515
BOOLEAN NBQueuePacket(PNEIGHBOR_CACHE_ENTRY NCE, PNDIS_PACKET NdisPacket, PNEIGHBOR_PACKET_COMPLETE PacketComplete, PVOID PacketContext)
Definition: neighbor.c:555
PNEIGHBOR_CACHE_ENTRY NBLocateNeighbor(PIP_ADDRESS Address, PIP_INTERFACE Interface)
Definition: neighbor.c:424
PNEIGHBOR_CACHE_ENTRY NBAddNeighbor(PIP_INTERFACE Interface, PIP_ADDRESS Address, PVOID LinkAddress, UINT LinkAddressLength, UCHAR State, UINT EventTimer)
Definition: neighbor.c:273
VOID NBTimeout(VOID)
Definition: neighbor.c:91
VOID NBStartup(VOID)
Definition: neighbor.c:169
VOID NBResetNeighborTimeout(PIP_ADDRESS Address)
Definition: neighbor.c:394
VOID NBRemoveNeighbor(PNEIGHBOR_CACHE_ENTRY NCE)
Definition: neighbor.c:604
VOID NBSendSolicit(PNEIGHBOR_CACHE_ENTRY NCE)
Definition: neighbor.c:221
VOID NBUpdateNeighbor(PNEIGHBOR_CACHE_ENTRY NCE, PVOID LinkAddress, UCHAR State)
Definition: neighbor.c:353
VOID NBCompleteSend(PVOID Context, PNDIS_PACKET NdisPacket, NDIS_STATUS Status)
Definition: neighbor.c:15
VOID NBFlushPacketQueue(PNEIGHBOR_CACHE_ENTRY NCE, NTSTATUS ErrorCode)
Definition: neighbor.c:65
VOID(* PNEIGHBOR_PACKET_COMPLETE)(PVOID Context, PNDIS_PACKET Packet, NDIS_STATUS Status)
Definition: neighbor.h:13
#define NB_HASHMASK
Definition: neighbor.h:10
#define NUD_INCOMPLETE
Definition: neighbor.h:41
#define ARP_RATE
Definition: neighbor.h:49
#define ARP_TIMEOUT_RETRANSMISSION
Definition: neighbor.h:55
#define ARP_COMPLETE_TIMEOUT
Definition: neighbor.h:52
#define NUD_STALE
Definition: neighbor.h:43
#define NUD_PERMANENT
Definition: neighbor.h:42
#define ARP_INCOMPLETE_TIMEOUT
Definition: neighbor.h:46
struct _NEIGHBOR_PACKET * PNEIGHBOR_PACKET
PIP_INTERFACE GetDefaultInterface(VOID)
Definition: interface.c:156
int NDIS_STATUS
Definition: ntddndis.h:496
static WCHAR Address[46]
Definition: ping.c:68
#define memset(x, y, z)
Definition: compat.h:39
STDMETHOD() Next(THIS_ ULONG celt, IAssociationElement *pElement, ULONG *pceltFetched) PURE
_In_ PVOID Context
Definition: storport.h:2269
Definition: fatfs.h:173
Definition: info.h:35
ULONG Index
Definition: info.h:36
ULONG Type
Definition: info.h:40
ULONG LogAddr
Definition: info.h:39
ULONG AddrSize
Definition: info.h:37
Definition: ip.h:23
union IP_ADDRESS::@1101 Address
IPv4_RAW_ADDRESS IPv4Address
Definition: ip.h:26
Definition: neighbor.h:28
PIP_INTERFACE Interface
Definition: neighbor.h:33
IP_ADDRESS Address
Definition: neighbor.h:36
PVOID LinkAddress
Definition: neighbor.h:35
struct NEIGHBOR_CACHE_ENTRY * Next
Definition: neighbor.h:29
UCHAR State
Definition: neighbor.h:30
UINT LinkAddressLength
Definition: neighbor.h:34
UINT EventTimer
Definition: neighbor.h:31
LIST_ENTRY PacketQueue
Definition: neighbor.h:37
UINT EventCount
Definition: neighbor.h:32
KSPIN_LOCK Lock
Definition: neighbor.h:24
struct NEIGHBOR_CACHE_ENTRY * Cache
Definition: neighbor.h:23
LL_TRANSMIT_ROUTINE Transmit
Definition: ip.h:169
IP_ADDRESS Unicast
Definition: ip.h:160
PVOID Context
Definition: ip.h:154
Definition: typedefs.h:120
uint32_t * PULONG
Definition: typedefs.h:59
void * PVOID
Definition: typedefs.h:50
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:778
_In_ BOOLEAN _In_ ULONG _Out_ PULONG HashValue
Definition: rtlfuncs.h:2056
unsigned char UCHAR
Definition: xmlstorage.h:181