table.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Martin Landsmann <Martin.Landsmann@HAW-Hamburg.de>
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 NET_FIB_TABLE_H
20 #define NET_FIB_TABLE_H
21 
22 #include <stdint.h>
23 
24 #include "kernel_types.h"
25 #include "universal_address.h"
26 #include "mutex.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
36 #define FIB_MAX_REGISTERED_RP (5)
37 
41 typedef struct {
45  uint64_t lifetime;
47  uint32_t global_flags;
51  uint32_t next_hop_flags;
54 } fib_entry_t;
55 
59 typedef struct fib_sr_entry {
63  struct fib_sr_entry *next;
65 
69 typedef struct {
73  uint64_t sr_lifetime;
75  uint32_t sr_flags;
80 } fib_sr_t;
81 
86 typedef struct {
94 
98 #define FIB_TABLE_TYPE_SH (1)
99 
103 #define FIB_TABLE_TYPE_SR (FIB_TABLE_TYPE_SH + 1)
104 
108 typedef struct {
110  union{
115  }data;
119  uint8_t table_type;
121  size_t size;
136 } fib_table_t;
137 
138 #ifdef __cplusplus
139 }
140 #endif
141 
142 #endif /* NET_FIB_TABLE_H */
143 
Types used by the kernel.
fib_entry_t * entries
array holding the FIB entries for single hops
Definition: table.h:112
Meta information of a FIB table.
Definition: table.h:108
uint32_t sr_flags
Flags for this source route.
Definition: table.h:75
int16_t kernel_pid_t
Unique process identifier.
Definition: kernel_types.h:83
universal_address_container_t * address
Pointer to the shared generic address.
Definition: table.h:61
fib_sr_entry_t * entry_pool
pointer to entry pool array holding all hop entries for this table
Definition: table.h:90
size_t notify_rp_pos
current number of registered RPs.
Definition: table.h:125
The container descriptor used to identify a universal address entry.
uint64_t lifetime
Lifetime of this entry (an absolute time-point is stored by the FIB)
Definition: table.h:45
uint64_t sr_lifetime
Lifetime of this entry (an absolute time-point is stored by the FIB)
Definition: table.h:73
size_t size
the maximim number of entries in this FIB table
Definition: table.h:121
fib_sr_t * headers
pointer to source route header array
Definition: table.h:88
kernel_pid_t iface_id
interface ID
Definition: table.h:43
uint8_t table_type
the kind of this FIB table, single hop or source route.
Definition: table.h:119
#define FIB_MAX_REGISTERED_RP
maximum number of handled routing protocols (RP) used to notify the saved kernel_pid_t on unreachable...
Definition: table.h:36
struct fib_sr_entry * next
Pointer to the next shared generic address on the source route.
Definition: table.h:63
uint32_t global_flags
Unique identifier for the type of the global address.
Definition: table.h:47
Container descriptor for a FIB source route entry.
Definition: table.h:59
Container descriptor for a FIB source route.
Definition: table.h:69
Container for one FIB source route table, combining source routes and an entry pool.
Definition: table.h:86
kernel_pid_t sr_iface_id
interface ID
Definition: table.h:71
RIOT synchronization API.
Types and functions for operating universal addresses.
fib_sr_entry_t * sr_dest
Pointer to the destination of the source route.
Definition: table.h:79
universal_address_container_t * next_hop
Pointer to the shared generic address.
Definition: table.h:53
Mutex structure.
Definition: mutex.h:36
struct fib_sr_entry fib_sr_entry_t
Container descriptor for a FIB source route entry.
Container descriptor for a FIB entry.
Definition: table.h:41
fib_sr_meta_t * source_routes
array holding the FIB entries for source routes
Definition: table.h:114
uint32_t next_hop_flags
Unique identifier for the type of the next hop address.
Definition: table.h:51
fib_sr_entry_t * sr_path
Pointer to the first hop on the source route.
Definition: table.h:77
size_t entry_pool_size
the maximum number of elements in the entry pool
Definition: table.h:92
mutex_t mtx_access
table access mutex to grant exclusive operations on calls
Definition: table.h:123
universal_address_container_t * global
Pointer to the shared generic address.
Definition: table.h:49