lib_table.h

Local Information Base interface for NHDP.

struct lib_entry lib_entry_t

Local Interface Set entry (local interface tuple)

int lib_add_if_addr(kernel_types.h::kernel_pid_t if_pid, nhdp_address.h::nhdp_addr_t * addr)

Add an interface to the Local Information Base.

This function can also be used to add an additional address to an existing LIB tuple.

Parameters

if_pid:PID of the interface
addr:The (additional) NHDP address to register for the interface

Return values

  • 0 on success
  • -1 on error
void lib_rem_if(kernel_types.h::kernel_pid_t if_pid)

Remove a given interface’s Local Information Base entry.

Parameters

if_pid:PID of the interface that should be removed

void lib_fill_wr_addresses(kernel_types.h::kernel_pid_t if_pid, struct rfc5444_writer * wr)

Add addresses to the currently constructed HELLO message.

Note

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

Parameters

if_pid:PID of the interface the message is constructed for
wr:The NHDP writer used for message construction

uint8_t lib_is_reg_addr(kernel_types.h::kernel_pid_t if_pid, nhdp_address.h::nhdp_addr_t * addr)

Check whether a given NHDP address is used as a local address.

Parameters

if_pid:PID of the interface to check for
addr:Pointer to the NHDP address that has to be checked

Return values

  • 1 if the given address is assigned to the given interface
  • 2 if the given address is assigned to any other local interface
  • 0 otherwise
struct lib_entry

Local Interface Set entry (local interface tuple)

kernel_types.h::kernel_pid_t if_pid

PID of the interface’s handling thread.

nhdp_address.h::nhdp_addr_entry_t * if_addr_list_head

Pointer to head of this interface’s addr list.

struct lib_entry * next

Pointer to next list entry.