ReactOS 0.4.15-dev-7897-g78dc504
neighbor.h
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: include/neighbor.h
5 * PURPOSE: Neighbor definitions
6 */
7
8#pragma once
9
10#define NB_HASHMASK 0xF /* Hash mask for neighbor cache */
11
14
15typedef struct _NEIGHBOR_PACKET {
21
22typedef struct NEIGHBOR_CACHE_TABLE {
23 struct NEIGHBOR_CACHE_ENTRY *Cache; /* Pointer to cache */
24 KSPIN_LOCK Lock; /* Protecting lock */
26
27/* Information about a neighbor */
28typedef struct NEIGHBOR_CACHE_ENTRY {
29 struct NEIGHBOR_CACHE_ENTRY *Next; /* Pointer to next entry */
30 UCHAR State; /* State of NCE */
31 UINT EventTimer; /* Ticks since last event */
32 UINT EventCount; /* Number of events */
33 PIP_INTERFACE Interface; /* Pointer to interface */
34 UINT LinkAddressLength; /* Length of link address */
35 PVOID LinkAddress; /* Pointer to link address */
36 IP_ADDRESS Address; /* IP address of neighbor */
37 LIST_ENTRY PacketQueue; /* Packet queue */
39
40/* NCE states */
41#define NUD_INCOMPLETE 0x01
42#define NUD_PERMANENT 0x02
43#define NUD_STALE 0x04
44
45/* Timeout for incomplete NCE ARP requests */
46#define ARP_INCOMPLETE_TIMEOUT 3
47
48/* Number of seconds between ARP transmissions */
49#define ARP_RATE 900
50
51/* Number of seconds before the NCE times out */
52#define ARP_COMPLETE_TIMEOUT (ARP_RATE + 9)
53
54/* Number of seconds before retransmission */
55#define ARP_TIMEOUT_RETRANSMISSION 3
56
58
59
61 VOID);
62
64 VOID);
65
67 VOID);
68
71
77 UCHAR Type,
79
83 UCHAR State);
84
88
92 BOOLEAN NoTimeout);
93
96 PNDIS_PACKET NdisPacket,
97 PNEIGHBOR_PACKET_COMPLETE PacketComplete,
98 PVOID PacketContext);
99
102
105 PIPARP_ENTRY ArpTable);
106
109
111
112/* EOF */
unsigned char BOOLEAN
Type
Definition: Type.h:7
#define VOID
Definition: acefi.h:82
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
Status
Definition: gdiplustypes.h:25
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1549
unsigned int UINT
Definition: ndis.h:50
NEIGHBOR_CACHE_TABLE NeighborCache[NB_HASHMASK+1]
Definition: neighbor.c:13
ULONG NBCopyNeighbors(PIP_INTERFACE Interface, PIPARP_ENTRY ArpTable)
Definition: neighbor.c:636
VOID NBDestroyNeighborsForInterface(PIP_INTERFACE Interface)
Definition: neighbor.c:237
VOID(* PNEIGHBOR_PACKET_COMPLETE)(PVOID Context, PNDIS_PACKET Packet, NDIS_STATUS Status)
Definition: neighbor.h:13
#define NB_HASHMASK
Definition: neighbor.h:10
VOID NBShutdown(VOID)
Definition: neighbor.c:184
PNEIGHBOR_CACHE_ENTRY NBFindOrCreateNeighbor(PIP_INTERFACE Interface, PIP_ADDRESS Address, BOOLEAN NoTimeout)
Definition: neighbor.c:501
BOOLEAN NBQueuePacket(PNEIGHBOR_CACHE_ENTRY NCE, PNDIS_PACKET NdisPacket, PNEIGHBOR_PACKET_COMPLETE PacketComplete, PVOID PacketContext)
Definition: neighbor.c:541
PNEIGHBOR_CACHE_ENTRY NBLocateNeighbor(PIP_ADDRESS Address, PIP_INTERFACE Interface)
Definition: neighbor.c:417
PNEIGHBOR_CACHE_ENTRY NBAddNeighbor(PIP_INTERFACE Interface, PIP_ADDRESS Address, PVOID LinkAddress, UINT LinkAddressLength, UCHAR Type, 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:387
VOID NBRemoveNeighbor(PNEIGHBOR_CACHE_ENTRY NCE)
Definition: neighbor.c:590
struct _NEIGHBOR_PACKET NEIGHBOR_PACKET
VOID NBSendSolicit(PNEIGHBOR_CACHE_ENTRY NCE)
Definition: neighbor.c:221
struct _NEIGHBOR_PACKET * PNEIGHBOR_PACKET
struct NEIGHBOR_CACHE_TABLE * PNEIGHBOR_CACHE_TABLE
struct NEIGHBOR_CACHE_ENTRY * PNEIGHBOR_CACHE_ENTRY
VOID NBUpdateNeighbor(PNEIGHBOR_CACHE_ENTRY NCE, PVOID LinkAddress, UCHAR State)
Definition: neighbor.c:346
int NDIS_STATUS
Definition: ntddndis.h:475
static WCHAR Address[46]
Definition: ping.c:68
Definition: info.h:35
Definition: ip.h:23
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
Definition: typedefs.h:120
LIST_ENTRY Next
Definition: neighbor.h:16
PNDIS_PACKET Packet
Definition: neighbor.h:17
PNEIGHBOR_PACKET_COMPLETE Complete
Definition: neighbor.h:18
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
unsigned char UCHAR
Definition: xmlstorage.h:181