nhdp_address.h

Centralized address storage interface for NHDP.

struct nhdp_addr nhdp_addr_t

NHDP address representation.

struct nhdp_addr_entry nhdp_addr_entry_t

Container for NHDP address storage in a list.

NHDP_ADDR_TMP_NONE
1
(0x00)
NHDP_ADDR_TMP_ANY
1
(0x01)
NHDP_ADDR_TMP_SYM
1
(0x03)
NHDP_ADDR_TMP_REM_LIST
1
(0x04)
NHDP_ADDR_TMP_TH_REM_LIST
1
(0x08)
NHDP_ADDR_TMP_TH_SYM_LIST
1
(0x10)
NHDP_ADDR_TMP_NB_LIST
1
(0x20)
NHDP_ADDR_TMP_SEND_LIST
1
(0x60)
NHDP_ADDR_TMP_IN_ANY( addr)
1
((addr->in_tmp_table & 0x01))
NHDP_ADDR_TMP_IN_SYM( addr)
1
((addr->in_tmp_table & 0x02) >> 1)
NHDP_ADDR_TMP_IN_REM_LIST( addr)
1
((addr->in_tmp_table & 0x04) >> 2)
NHDP_ADDR_TMP_IN_TH_REM_LIST( addr)
1
((addr->in_tmp_table & 0x08) >> 3)
NHDP_ADDR_TMP_IN_TH_SYM_LIST( addr)
1
((addr->in_tmp_table & 0x10) >> 4)
NHDP_ADDR_TMP_IN_NB_LIST( addr)
1
((addr->in_tmp_table & 0x20) >> 5)
NHDP_ADDR_TMP_IN_SEND_LIST( addr)
1
((addr->in_tmp_table & 0x40) >> 6)
nhdp_address.h::nhdp_addr_t * nhdp_addr_db_get_address(uint8_t * addr, msp430_types.h::size_t addr_size, uint8_t addr_type)

Get or create a NHDP address for the given address.

Parameters

addr:Pointer to the given address
addr_size:Length in bytes of the given address
addr_type:AF type of the given address

Return values

  • Pointer to the NHDP address representation of the given address
  • NULL on error
void nhdp_decrement_addr_usage(nhdp_address.h::nhdp_addr_t * addr)

Decrement the usage counter of a given NHDP address.

The NHDP address is deleted if the usage counter reaches zero.

Parameters

addr:Pointer to the NHDP address

void nhdp_free_addr_list(nhdp_address.h::nhdp_addr_entry_t * list_head)

Free the given address list.

This function frees every address list entry of the given address list.

Parameters

list_head:Pointer to the head of the address list to free

void nhdp_free_addr_entry(nhdp_address.h::nhdp_addr_entry_t * addr_entry)

Free the given address list entry.

Additionally to freeing the address entry, this function takes care that the usage counter of the list entry’s address is decremented.

Parameters

addr_entry:Pointer to the address list entry to free

nhdp_address.h::nhdp_addr_entry_t * nhdp_generate_addr_list_from_tmp(uint8_t tmp_type)

Construct an addr list containing all addresses with the given tmp_type.

Return values

  • Pointer to the head of the newly created address list
  • NULL on error
void nhdp_reset_addresses_tmp_usg(uint8_t decr_usg)

Reset in_tmp_table flag of all NHDP addresses.

Note

Must not be called from outside the NHDP writer’s or reader’s message creation process.

Parameters

decr_usg:Flag whether the usage counter of a resetted addr has to be decremented

nhdp_address.h::nhdp_addr_t * nhdp_get_addr_db_head(void)

Get a pointer to the head of the address storage list.

Return values

  • Pointer to the head of the central storage address list
  • NULL if no addresses are registered
struct nhdp_addr

NHDP address representation.

uint8_t * addr

Pointer to the address data.

msp430_types.h::size_t addr_size

Size in bytes of the address.

uint8_t addr_type

AF type for the address.

uint8_t usg_count

Usage count in information bases.

uint8_t in_tmp_table

Signals usage in a writers temp table.

uint16_t tmp_metric_val

Encoded metric value used during HELLO processing.

struct nhdp_addr * next

Pointer to next address (used in central storage)

struct nhdp_addr_entry

Container for NHDP address storage in a list.

struct nhdp_addr * address

Pointer to NHDP address storage entry.

struct nhdp_addr_entry * next

Pointer to the next address list element.