ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

neighbor.h
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT:   See COPYING in the top level directory
00003  * PROJECT:     ReactOS TCP/IP protocol driver
00004  * FILE:        include/neighbor.h
00005  * PURPOSE:     Neighbor definitions
00006  */
00007 
00008 #pragma once
00009 
00010 #define NB_HASHMASK 0xF /* Hash mask for neighbor cache */
00011 
00012 typedef VOID (*PNEIGHBOR_PACKET_COMPLETE)
00013     ( PVOID Context, PNDIS_PACKET Packet, NDIS_STATUS Status );
00014 
00015 typedef struct _NEIGHBOR_PACKET {
00016     LIST_ENTRY Next;
00017     PNDIS_PACKET Packet;
00018     PNEIGHBOR_PACKET_COMPLETE Complete;
00019     PVOID Context;
00020 } NEIGHBOR_PACKET, *PNEIGHBOR_PACKET;
00021 
00022 typedef struct NEIGHBOR_CACHE_TABLE {
00023     struct NEIGHBOR_CACHE_ENTRY *Cache; /* Pointer to cache */
00024     KSPIN_LOCK Lock;                    /* Protecting lock */
00025 } NEIGHBOR_CACHE_TABLE, *PNEIGHBOR_CACHE_TABLE;
00026 
00027 /* Information about a neighbor */
00028 typedef struct NEIGHBOR_CACHE_ENTRY {
00029     struct NEIGHBOR_CACHE_ENTRY *Next;  /* Pointer to next entry */
00030     UCHAR State;                        /* State of NCE */
00031     UINT EventTimer;                    /* Ticks since last event */
00032     UINT EventCount;                    /* Number of events */
00033     PIP_INTERFACE Interface;            /* Pointer to interface */
00034     UINT LinkAddressLength;             /* Length of link address */
00035     PVOID LinkAddress;                  /* Pointer to link address */
00036     IP_ADDRESS Address;                 /* IP address of neighbor */
00037     LIST_ENTRY PacketQueue;             /* Packet queue */
00038 } NEIGHBOR_CACHE_ENTRY, *PNEIGHBOR_CACHE_ENTRY;
00039 
00040 /* NCE states */
00041 #define NUD_INCOMPLETE 0x01
00042 #define NUD_PERMANENT  0x02
00043 #define NUD_STALE      0x04
00044 
00045 /* Timeout for incomplete NCE ARP requests */
00046 #define ARP_INCOMPLETE_TIMEOUT 3
00047 
00048 /* Number of seconds between ARP transmissions */
00049 #define ARP_RATE 900
00050 
00051 /* Number of seconds before the NCE times out */
00052 #define ARP_COMPLETE_TIMEOUT (ARP_RATE + 9)
00053 
00054 /* Number of seconds before retransmission */
00055 #define ARP_TIMEOUT_RETRANSMISSION 3
00056 
00057 extern NEIGHBOR_CACHE_TABLE NeighborCache[NB_HASHMASK + 1];
00058 
00059 
00060 VOID NBTimeout(
00061     VOID);
00062 
00063 VOID NBStartup(
00064     VOID);
00065 
00066 VOID NBShutdown(
00067     VOID);
00068 
00069 VOID NBSendSolicit(
00070     PNEIGHBOR_CACHE_ENTRY NCE);
00071 
00072 PNEIGHBOR_CACHE_ENTRY NBAddNeighbor(
00073     PIP_INTERFACE Interface,
00074     PIP_ADDRESS Address,
00075     PVOID LinkAddress,
00076     UINT LinkAddressLength,
00077     UCHAR Type,
00078     UINT EventTimer);
00079 
00080 VOID NBUpdateNeighbor(
00081     PNEIGHBOR_CACHE_ENTRY NCE,
00082     PVOID LinkAddress,
00083     UCHAR State);
00084 
00085 PNEIGHBOR_CACHE_ENTRY NBLocateNeighbor(
00086     PIP_ADDRESS Address);
00087 
00088 PNEIGHBOR_CACHE_ENTRY NBFindOrCreateNeighbor(
00089     PIP_INTERFACE Interface,
00090     PIP_ADDRESS Address,
00091     BOOLEAN NoTimeout);
00092 
00093 BOOLEAN NBQueuePacket(
00094     PNEIGHBOR_CACHE_ENTRY NCE,
00095     PNDIS_PACKET NdisPacket,
00096     PNEIGHBOR_PACKET_COMPLETE PacketComplete,
00097     PVOID PacketContext);
00098 
00099 VOID NBRemoveNeighbor(
00100     PNEIGHBOR_CACHE_ENTRY NCE);
00101 
00102 ULONG NBCopyNeighbors(
00103     PIP_INTERFACE Interface,
00104     PIPARP_ENTRY ArpTable);
00105 
00106 VOID NBResetNeighborTimeout(
00107     PIP_ADDRESS Address);
00108 
00109 VOID NBDestroyNeighborsForInterface(PIP_INTERFACE Interface);
00110 
00111 /* EOF */

Generated on Sun May 27 2012 04:28:06 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.