ETHERNET COMMUNICATION MODULE
Sample hash table code
336 Hardware Reference NS9215
/*
*
* Function: void set_hash_bit (BYTE *table, int bit)
*
* Description:
*
* This routine sets the appropriate bit in the hash table.
*
* Parameters:
*
* table pointer to hash table
* bit position of bit to set
*
* Return Values:
*
* none
*
*/
static void set_hash_bit (BYTE *table, int bit)
{
int byte_index, bit_index;
byte-index = bit >> 3;
bit_index = bit & 7;
table [byte_index] |= (1 << bit_index);
}
/*
*
* Function: int calculate_hash_bit (BYTE *mca)
*
* Description:
* This routine calculates which bit in the CRC hash table needs
* to be set for the MERCURY to recognize incoming packets with
* the MCA passed to us.
*
* Parameters:
*
* mca pointer to multi-cast address