/*++ Copyright(c) 2001 Microsoft Corporation Module Name: NLB Driver File Name: diplist.h Abstract: Code to lookup if a DIP is in a list of DIPs, without holding any locks. History: 04/24/2002 JosephJ Created --*/ #include #define NULL_VALUE 0 // Illegal value; may be used to clear an item. #define MAX_ITEMS CVY_MAX_HOSTS // maximum number of DIPs in our list #define HASH1_SIZE 257 // size (in bits) of bit-vector (make it a prime) #define HASH2_SIZE 59 // size of hashtable (make it a prime) // // I've tested with the following "boundary case" // // #define MAX_ITEMS 1 // #define HASH1_SIZE 1 // #define HASH2_SIZE 1 // #pragma pack(4) typedef struct { // // NOTE: All fields in this structure should be treated as // OPAQUE (private members) to callers of the DipList APIs. // // // The "master copy" of values, indexed by the "Index" field in // DipListSetItem. // ULONG Items[MAX_ITEMS]; // // A bit vector used for a quick check to see if the value MAY exist // in the dip list. // // To lookup a bit based on value "Value", do the following: // // Hash1 = Value % HASH1_SIZE; // u = Hash1/32 // 32 is the number of bits in a ULONG // bit = BitVector[u] & ( (1<