Digi NS9215 User Manual

Page 336

Advertising
background image

E T H E R N E T C O M M U N I C A T I O N M O D U L E

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

Advertising