Digi NS7520 DJ Equipment User Manual


 
www.digi.com
      205
Ethernet Module
*
* This routine creates a hash table based on the CRC values of
* the MAC addresses set up by eth_add_mca(). The CRC value of
* each MAC address is calculated and the lower six bits are used
* to generate a value between 0 and 64. The corresponding bit in
* the 64-bit hash table is then set.
*
* Parameters:
*
* hash_table pointer to buffer to store hash table in
*
* Return Values:
*
* none
*
*/
static void eth_make_has_table (WORD16 *hash_table)
{
int index:
memset (hash_table, 0, 8); /* clear hash table*/
for (index = 0; index < mca_count; index++)/* for each mca
address*/
{
set_has_bit ((BYTE *) hash_table, calculate_hash_bit
mca_address [index]));
}
}
/*
*
* 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: