ReactOS  0.4.13-dev-563-g0561610
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 
15 typedef struct _NEIGHBOR_PACKET {
21 
22 typedef 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 */
28 typedef 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 */
Type
Definition: Type.h:6
PNDIS_PACKET Packet
Definition: neighbor.h:17
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1548
struct _NEIGHBOR_PACKET NEIGHBOR_PACKET
Definition: neighbor.h:28
struct NEIGHBOR_CACHE_TABLE NEIGHBOR_CACHE_TABLE
VOID NBDestroyNeighborsForInterface(PIP_INTERFACE Interface)
Definition: neighbor.c:237
PNEIGHBOR_CACHE_ENTRY NBLocateNeighbor(PIP_ADDRESS Address, PIP_INTERFACE Interface)
Definition: neighbor.c:417
struct _NEIGHBOR_PACKET * PNEIGHBOR_PACKET
VOID NBResetNeighborTimeout(PIP_ADDRESS Address)
Definition: neighbor.c:387
UINT LinkAddressLength
Definition: neighbor.h:34
int NDIS_STATUS
Definition: ntddndis.h:445
Definition: ip.h:23
LIST_ENTRY PacketQueue
Definition: neighbor.h:37
PNEIGHBOR_CACHE_ENTRY NBFindOrCreateNeighbor(PIP_INTERFACE Interface, PIP_ADDRESS Address, BOOLEAN NoTimeout)
Definition: neighbor.c:501
KSPIN_LOCK Lock
Definition: neighbor.h:24
unsigned char BOOLEAN
static WCHAR Address[46]
Definition: ping.c:68
struct NEIGHBOR_CACHE_TABLE * PNEIGHBOR_CACHE_TABLE
UCHAR State
Definition: neighbor.h:30
PVOID LinkAddress
Definition: neighbor.h:35
VOID(* PNEIGHBOR_PACKET_COMPLETE)(PVOID Context, PNDIS_PACKET Packet, NDIS_STATUS Status)
Definition: neighbor.h:13
VOID NBUpdateNeighbor(PNEIGHBOR_CACHE_ENTRY NCE, PVOID LinkAddress, UCHAR State)
Definition: neighbor.c:346
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:359
VOID NBRemoveNeighbor(PNEIGHBOR_CACHE_ENTRY NCE)
Definition: neighbor.c:590
LIST_ENTRY Next
Definition: neighbor.h:16
struct NEIGHBOR_CACHE_ENTRY * Next
Definition: neighbor.h:29
unsigned char UCHAR
Definition: xmlstorage.h:181
NEIGHBOR_CACHE_TABLE NeighborCache[NB_HASHMASK+1]
Definition: neighbor.c:13
#define VOID
Definition: acefi.h:82
Definition: typedefs.h:117
PNEIGHBOR_PACKET_COMPLETE Complete
Definition: neighbor.h:18
UINT EventCount
Definition: neighbor.h:32
PNEIGHBOR_CACHE_ENTRY NBAddNeighbor(PIP_INTERFACE Interface, PIP_ADDRESS Address, PVOID LinkAddress, UINT LinkAddressLength, UCHAR Type, UINT EventTimer)
Definition: neighbor.c:273
#define NB_HASHMASK
Definition: neighbor.h:10
VOID NBShutdown(VOID)
Definition: neighbor.c:184
Status
Definition: gdiplustypes.h:24
PIP_INTERFACE Interface
Definition: neighbor.h:33
Definition: info.h:35
UINT EventTimer
Definition: neighbor.h:31
VOID NBSendSolicit(PNEIGHBOR_CACHE_ENTRY NCE)
Definition: neighbor.c:221
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
unsigned int UINT
Definition: ndis.h:50
ULONG NBCopyNeighbors(PIP_INTERFACE Interface, PIPARP_ENTRY ArpTable)
Definition: neighbor.c:636
IP_ADDRESS Address
Definition: neighbor.h:36
BOOLEAN NBQueuePacket(PNEIGHBOR_CACHE_ENTRY NCE, PNDIS_PACKET NdisPacket, PNEIGHBOR_PACKET_COMPLETE PacketComplete, PVOID PacketContext)
Definition: neighbor.c:541
struct tagContext Context
Definition: acpixf.h:1012
unsigned int ULONG
Definition: retypes.h:1
struct NEIGHBOR_CACHE_ENTRY * PNEIGHBOR_CACHE_ENTRY
VOID NBStartup(VOID)
Definition: neighbor.c:169
struct NEIGHBOR_CACHE_ENTRY NEIGHBOR_CACHE_ENTRY
VOID NBTimeout(VOID)
Definition: neighbor.c:91
struct NEIGHBOR_CACHE_ENTRY * Cache
Definition: neighbor.h:23