nhdp.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
25 #ifndef NHDP_H
26 #define NHDP_H
27 
28 #include "timex.h"
29 #include "xtimer.h"
30 #include "kernel_types.h"
31 
32 #include "nhdp_metric.h"
33 #include "rfc5444/rfc5444_writer.h"
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
40 #define ENABLE_DEBUG (0)
41 #include "debug.h"
42 
48 #ifndef MANET_PORT
49 
50 #define MANET_PORT (269)
51 #endif
52 
54 #if ENABLE_DEBUG
55 #define NHDP_STACK_SIZE (THREAD_STACKSIZE_DEFAULT + THREAD_EXTRA_STACKSIZE_PRINTF)
56 #else
57 #define NHDP_STACK_SIZE (THREAD_STACKSIZE_DEFAULT)
58 #endif
59 
61 #define NHDP_WR_MSG_BUF_SIZE (256)
62 
63 #define NHDP_WR_TLV_BUF_SIZE (512)
64 
65 /* TODO: Determine a good value */
67 #define NHDP_MSG_QUEUE_SIZE (16)
68 
70 #define NHDP_MAX_RFC5444_PACKET_SZ (128)
71 
73 #define NHDP_DEFAULT_HELLO_INT_MS (2000)
74 
75 #define NHDP_DEFAULT_HOLD_TIME_MS (3 * NHDP_DEFAULT_HELLO_INT_MS)
76 
82 #define NHDP_INITIAL_PENDING (0)
83 
85 #define NHDP_HP_MAXJITTER_MS (200)
86 
87 #define NHDP_L_HOLD_TIME_MS (NHDP_DEFAULT_HOLD_TIME_MS)
88 #define NHDP_N_HOLD_TIME_MS (NHDP_DEFAULT_HOLD_TIME_MS)
89 #define NHDP_I_HOLD_TIME_MS (NHDP_DEFAULT_HOLD_TIME_MS)
90 
95 typedef struct {
100  uint16_t seq_no;
101  struct rfc5444_writer_target wr_target;
103 
108  AF_CC110X = AF_MAX + 3,
109 };
110 
117 void nhdp_init(void) __attribute__
118  ((deprecated("The nhdp module will be removed after 2020.04")));
119 
127 
149 int nhdp_register_if_default(kernel_pid_t if_pid, uint8_t *addr, size_t addr_size,
150  uint8_t addr_type, uint16_t max_pl_size);
151 
171 int nhdp_register_if(kernel_pid_t if_pid, uint8_t *addr, size_t addr_size, uint8_t addr_type,
172  uint16_t max_pl_size, uint16_t hello_int_ms, uint16_t val_time_ms);
173 
189 int nhdp_register_non_manet_if(kernel_pid_t if_pid, uint8_t *addr, size_t addr_size,
190  uint8_t addr_type);
191 
206 int nhdp_add_address(kernel_pid_t if_pid, uint8_t *addr, size_t addr_size, uint8_t addr_type);
207 
208 #ifdef __cplusplus
209 }
210 #endif
211 
212 #endif /* NHDP_H */
213 
Types used by the kernel.
kernel_pid_t if_pid
PID of the interface's handling thread.
Definition: nhdp.h:96
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.
A timex timestamp.
Definition: timex.h:79
xtimer_t if_timer
xtimer used for the periodic signaling
Definition: nhdp.h:97
Debug-header.
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.
kernel_pid_t if_pid
PID of the interface's handling thread.
Definition: lib_table.h:36
timex_t hello_interval
Interval time for periodic HELLOs.
Definition: nhdp.h:98
int16_t kernel_pid_t
Unique process identifier.
Definition: kernel_types.h:83
kernel_pid_t nhdp_start(void)
Start NHDP's operational thread.
Utility library for comparing and computing timestamps.
uint16_t seq_no
Sequence number of last send RFC5444 packet.
Definition: nhdp.h:100
void nhdp_init(void)
Initialize NHDP for operation.
xtimer interface definitions
#define AF_MAX
alias for AF_NUMOF
Definition: af.h:44
nhdp_address_type_t
Additional address types for link layer operation.
Definition: nhdp.h:107
xtimer timer structure
Definition: xtimer.h:70
Macros for NHDP metric computation.
MANET interface representation.
Definition: nhdp.h:95
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.
timex_t validity_time
Validity time for propagated information.
Definition: nhdp.h:99
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.