iib_table.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 
19 #ifndef IIB_TABLE_H
20 #define IIB_TABLE_H
21 
22 #include "timex.h"
23 #include "kernel_types.h"
24 
25 #include "nib_table.h"
26 #include "nhdp_address.h"
27 #include "nhdp_metric.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
36 typedef enum {
37  IIB_LT_STATUS_PENDING,
38  IIB_LT_STATUS_LOST,
39  IIB_LT_STATUS_HEARD,
40  IIB_LT_STATUS_SYM,
41  IIB_LT_STATUS_UNKNOWN
43 
47 typedef struct iib_link_set_entry {
51  uint8_t pending;
52  uint8_t lost;
56  uint32_t metric_in;
57  uint32_t metric_out;
58 #if (NHDP_METRIC == NHDP_LMT_DAT)
59  uint8_t dat_received[NHDP_Q_MEM_LENGTH];
60  uint8_t dat_total[NHDP_Q_MEM_LENGTH];
61  timex_t dat_time;
62  uint8_t hello_interval;
63  uint8_t lost_hellos;
64  uint32_t rx_bitrate;
65  uint16_t last_seq_no;
66 #endif
69 
73 typedef struct iib_two_hop_set_entry {
77  uint32_t metric_in;
78  uint32_t metric_out;
81 
85 typedef struct iib_base_entry {
89  struct iib_base_entry *next;
91 
104 
121  uint64_t validity_time, uint8_t is_sym_nb,
122  uint8_t is_lost);
123 
133 void iib_fill_wr_addresses(kernel_pid_t if_pid, struct rfc5444_writer *wr);
134 
143 void iib_update_lt_status(timex_t *now);
144 
154 void iib_propagate_nb_entry_change(nib_entry_t *old_entry, nib_entry_t *new_entry);
155 
165 void iib_process_metric_msg(iib_link_set_entry_t *ls_entry, uint64_t int_time);
166 
177 void iib_process_metric_pckt(iib_link_set_entry_t *ls_entry, uint32_t metric_out, uint16_t seq_no);
178 
182 void iib_process_metric_refresh(void);
183 
184 #ifdef __cplusplus
185 }
186 #endif
187 
188 #endif /* IIB_TABLE_H */
189 
Types used by the kernel.
#define NHDP_Q_MEM_LENGTH
Default queue size for metrics using a queue to determine link loss.
Definition: nhdp_metric.h:56
A timex timestamp.
Definition: timex.h:79
iib_link_set_entry_t * ls_elt
Pointer to corresponding link tuple.
Definition: iib_table.h:74
int16_t kernel_pid_t
Unique process identifier.
Definition: kernel_types.h:83
iib_two_hop_set_entry_t * two_hop_set_head
Pointer to this if's 2-hop tuples.
Definition: iib_table.h:88
void iib_propagate_nb_entry_change(nib_entry_t *old_entry, nib_entry_t *new_entry)
Exchange the corresponding Neighbor Tuple of existing Link Tuples.
void iib_process_metric_msg(iib_link_set_entry_t *ls_entry, uint64_t int_time)
Process steps for the chosen NHDP metric for a message.
NHDP address representation.
Definition: nhdp_address.h:29
timex_t exp_time
Time at which entry expires.
Definition: iib_table.h:53
Container for NHDP address storage in a list.
Definition: nhdp_address.h:42
nib_entry_t * nb_elt
Pointer to corresponding nb tuple.
Definition: iib_table.h:54
struct iib_two_hop_set_entry * next
Pointer to next list entry.
Definition: iib_table.h:79
void iib_process_metric_pckt(iib_link_set_entry_t *ls_entry, uint32_t metric_out, uint16_t seq_no)
Process steps for the chosen NHDP metric for a packet.
void iib_update_lt_status(timex_t *now)
Update L_STATUS of all existing Link Tuples.
Utility library for comparing and computing timestamps.
uint8_t pending
Flag whether link is pending.
Definition: iib_table.h:51
uint8_t lost
Flag whether link is lost.
Definition: iib_table.h:52
Centralized address storage interface for NHDP.
Neighbor Information Base interface for NHDP.
timex_t heard_time
Time at which entry leaves heard status.
Definition: iib_table.h:49
timex_t exp_time
Time at which entry expires.
Definition: iib_table.h:76
timex_t sym_time
Time at which entry leaves symmetry status.
Definition: iib_table.h:50
nhdp_addr_entry_t * address_list_head
Pointer to head of this tuple's addresses.
Definition: iib_table.h:48
uint32_t metric_out
Metric value for outgoing link.
Definition: iib_table.h:78
void iib_fill_wr_addresses(kernel_pid_t if_pid, struct rfc5444_writer *wr)
Add addresses to the currently constructed HELLO message.
iib_link_tuple_status_t
Possible L_STATUS values of a link tuple.
Definition: iib_table.h:36
uint32_t metric_in
Metric value for incoming link.
Definition: iib_table.h:77
int iib_register_if(kernel_pid_t pid)
Register a new interface in the IIB.
void iib_process_metric_refresh(void)
Update metric values for the chosen NHDP metric for all Link Tuples.
struct iib_base_entry * next
Pointer to next list entry.
Definition: iib_table.h:89
iib_link_set_entry_t * iib_process_hello(kernel_pid_t if_pid, nib_entry_t *nb_elt, uint64_t validity_time, uint8_t is_sym_nb, uint8_t is_lost)
Process a received HELLO message in the IIB.
Link Set entry (link tuple)
Definition: iib_table.h:47
struct iib_link_set_entry * next
Pointer to next list entry.
Definition: iib_table.h:67
struct iib_link_set_entry iib_link_set_entry_t
Link Set entry (link tuple)
nhdp_addr_t * th_nb_addr
Address of symmetric 2-hop neighbor.
Definition: iib_table.h:75
Link set for a registered interface.
Definition: iib_table.h:85
Macros for NHDP metric computation.
struct iib_two_hop_set_entry iib_two_hop_set_entry_t
2-Hop Set entry (2-Hop tuple)
uint32_t metric_in
Metric value for incoming link.
Definition: iib_table.h:56
kernel_pid_t if_pid
PID of the interface.
Definition: iib_table.h:86
struct iib_base_entry iib_base_entry_t
Link set for a registered interface.
iib_link_tuple_status_t last_status
Last processed status of link tuple.
Definition: iib_table.h:55
uint32_t metric_out
Metric value for outgoing link.
Definition: iib_table.h:57
Neighbor Set entry (neighbor tuple)
Definition: nib_table.h:35
2-Hop Set entry (2-Hop tuple)
Definition: iib_table.h:73
iib_link_set_entry_t * link_set_head
Pointer to this if's link tuples.
Definition: iib_table.h:87