The friendly Operating System for the Internet of Things

The MANET Neighborhood Discovery Protocol (RFC 6130) More...

Detailed Description

Files

file  iib_table.h
 Interface Information Base interface for NHDP.
 
file  lib_table.h
 Local Information Base interface for NHDP.
 
file  nhdp.h
 Interface for core functionality of NHDP.
 
file  nhdp_address.h
 Centralized address storage interface for NHDP.
 
file  nhdp_metric.h
 Macros for NHDP metric computation.
 
file  nhdp_reader.h
 Reader interface for message processing in NHDP.
 
file  nhdp_writer.h
 Writer interface for message generation in NHDP.
 
file  nib_table.h
 Neighbor Information Base interface for NHDP.
 

Data Structures

struct  nhdp_if_entry_t
 MANET interface representation. More...
 

Macros

#define ENABLE_DEBUG   (0)
 Definition for RIOTs debugging option.
 

Enumerations

enum  nhdp_address_type_t { AF_CC110X = AF_MAX + 3 }
 Additional address types for link layer operation.
 

Functions

void nhdp_init (void)
 Initialize NHDP for operation. More...
 
kernel_pid_t nhdp_start (void)
 Start NHDP's operational thread. More...
 
int nhdp_register_if_default (kernel_pid_t if_pid, uint8_t *addr, size_t addr_size, uint8_t addr_type, uint16_t max_pl_size)
 Register an interface for NHDP operation with default values. More...
 
int nhdp_register_if (kernel_pid_t if_pid, uint8_t *addr, size_t addr_size, uint8_t addr_type, uint16_t max_pl_size, uint16_t hello_int_ms, uint16_t val_time_ms)
 Register an interface for NHDP operation. More...
 
int nhdp_register_non_manet_if (kernel_pid_t if_pid, uint8_t *addr, size_t addr_size, uint8_t addr_type)
 Register a non MANET interface in NHDP. More...
 
int nhdp_add_address (kernel_pid_t if_pid, uint8_t *addr, size_t addr_size, uint8_t addr_type)
 Register an additional address for an interface in NHDP. More...
 

NHDP protocol macros

#define MANET_PORT   (269)
 Well-known MANET port from RFC 5498.
 
#define NHDP_STACK_SIZE   (THREAD_STACKSIZE_DEFAULT + THREAD_EXTRA_STACKSIZE_PRINTF)
 Stack size for NHDP thread.
 
#define NHDP_WR_MSG_BUF_SIZE   (256)
 Buffer size in bytes for NHDP writer's msg buffer.
 
#define NHDP_WR_TLV_BUF_SIZE   (512)
 Buffer size in bytes for NHDP writer's tlv buffer.
 
#define NHDP_MSG_QUEUE_SIZE   (16)
 Queue size for msg queue of NHDP.
 
#define NHDP_MAX_RFC5444_PACKET_SZ   (128)
 Maximum size of handled RFC5444 packets.
 
#define NHDP_DEFAULT_HELLO_INT_MS   (2000)
 Default hello interval in milliseconds.
 
#define NHDP_DEFAULT_HOLD_TIME_MS   (3 * NHDP_DEFAULT_HELLO_INT_MS)
 Default hold time in milliseconds.
 
#define NHDP_INITIAL_PENDING   (0)
 Initial pending flag value for new link tuples. More...
 
#define NHDP_HP_MAXJITTER_MS   (200)
 Maximum jitter for nhdp messages in milliseconds.
 
#define NHDP_L_HOLD_TIME_MS   (NHDP_DEFAULT_HOLD_TIME_MS)
 
#define NHDP_N_HOLD_TIME_MS   (NHDP_DEFAULT_HOLD_TIME_MS)
 
#define NHDP_I_HOLD_TIME_MS   (NHDP_DEFAULT_HOLD_TIME_MS)
 

Macro Definition Documentation

#define NHDP_INITIAL_PENDING   (0)

Do not change (link quality currently not considered)

Definition at line 78 of file nhdp.h.

Function Documentation

int nhdp_add_address ( kernel_pid_t  if_pid,
uint8_t *  addr,
size_t  addr_size,
uint8_t  addr_type 
)

The address is added to the Local Information Base entry of this interface and will afterwards be propagated as a local address in newly created HELLO messages.

Parameters
[in]if_pidPID of the interface
[in]addrAdditional local address of this interface represented in bytes
[in]addr_sizeLength of the local address (number of bytes)
[in]addr_typeAF type of the given address
Returns
0 on success
-1 on error
void nhdp_init ( void  )

Sets up NHDP's reader and writer. Call first before starting NHDP's thread and registering interfaces.

int nhdp_register_if ( kernel_pid_t  if_pid,
uint8_t *  addr,
size_t  addr_size,
uint8_t  addr_type,
uint16_t  max_pl_size,
uint16_t  hello_int_ms,
uint16_t  val_time_ms 
)

Registers the interface completely for NHDP operation. Registration includes a new Local Information Base entry, a new Interface Information Base and starting the periodical HELLO messaging.

Parameters
[in]if_pidPID of the interface
[in]addrA local address of this interface represented in bytes
[in]addr_sizeLength of the local address (number of bytes)
[in]addr_typeAF type of the given address
[in]max_pl_sizeMaximum payload size for packets send over this interface
[in]hello_int_msHello interval in ms for periodic message generation
[in]val_time_msValidity time in ms for propagated information
Returns
0 on success
-1 on error
-2 on maximum number of interfaces registered
int nhdp_register_if_default ( kernel_pid_t  if_pid,
uint8_t *  addr,
size_t  addr_size,
uint8_t  addr_type,
uint16_t  max_pl_size 
)

Registers the interface completely for NHDP operation. Registration includes a new Local Information Base entry, a new Interface Information Base and starting the periodical HELLO messaging.

Note
Default values are a hello interval of 2 seconds and a validity time of 6 seconds for propagated information.
Parameters
[in]if_pidPID of the interface
[in]addrA local address of this interface represented in bytes
[in]addr_sizeLength in bytes of the local address
[in]addr_typeAF type of the local address
[in]max_pl_sizeMaximum payload size for packets send over this interface
Returns
0 on success
-1 on error
-2 on maximum number of interfaces registered
int nhdp_register_non_manet_if ( kernel_pid_t  if_pid,
uint8_t *  addr,
size_t  addr_size,
uint8_t  addr_type 
)

The registered interface does not take part in NHDP operation. Its addresses will be represented only in other interfaces' messages. No periodical messages are created for this interface and no message processing is done.

Parameters
[in]if_pidPID of the interface
[in]addrA local address of this interface represented in bytes
[in]addr_sizeLength of the local address (number of bytes)
[in]addr_typeAF type of the given address
Returns
0 on success
-1 on error
kernel_pid_t nhdp_start ( void  )
Returns
PID of NHDP's operational thread
KERNEL_PID_UNDEF on error