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 "sched.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 
fib_entry_t::global_flags
uint32_t global_flags
Unique identifier for the type of the global address.
Definition: table.h:47
fib_sr_meta_t
Container for one FIB source route table, combining source routes and an entry pool.
Definition: table.h:86
kernel_pid_t
int16_t kernel_pid_t
Unique process identifier.
Definition: sched.h:125
fib_sr_meta_t::entry_pool_size
size_t entry_pool_size
the maximum number of elements in the entry pool
Definition: table.h:92
fib_table_t::source_routes
fib_sr_meta_t * source_routes
array holding the FIB entries for source routes
Definition: table.h:114
fib_sr_entry::next
struct fib_sr_entry * next
Pointer to the next shared generic address on the source route.
Definition: table.h:63
FIB_MAX_REGISTERED_RP
#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
fib_table_t::entries
fib_entry_t * entries
array holding the FIB entries for single hops
Definition: table.h:112
fib_table_t
Meta information of a FIB table.
Definition: table.h:108
fib_sr_meta_t::entry_pool
fib_sr_entry_t * entry_pool
pointer to entry pool array holding all hop entries for this table
Definition: table.h:90
fib_entry_t::global
universal_address_container_t * global
Pointer to the shared generic address.
Definition: table.h:49
fib_sr_t::sr_flags
uint32_t sr_flags
Flags for this source route.
Definition: table.h:75
universal_address_container_t
The container descriptor used to identify a universal address entry.
Definition: universal_address.h:58
fib_sr_meta_t::headers
fib_sr_t * headers
pointer to source route header array
Definition: table.h:88
sched.h
Scheduler API definition.
fib_table_t::notify_rp_pos
size_t notify_rp_pos
current number of registered RPs.
Definition: table.h:125
fib_sr_entry_t
struct fib_sr_entry fib_sr_entry_t
Container descriptor for a FIB source route entry.
fib_entry_t::lifetime
uint64_t lifetime
Lifetime of this entry (an absolute time-point is stored by the FIB)
Definition: table.h:45
fib_table_t::mtx_access
mutex_t mtx_access
table access mutex to grant exclusive operations on calls
Definition: table.h:123
fib_table_t::size
size_t size
the maximum number of entries in this FIB table
Definition: table.h:121
fib_sr_t
Container descriptor for a FIB source route.
Definition: table.h:69
fib_sr_t::sr_iface_id
kernel_pid_t sr_iface_id
interface ID
Definition: table.h:71
fib_sr_t::sr_lifetime
uint64_t sr_lifetime
Lifetime of this entry (an absolute time-point is stored by the FIB)
Definition: table.h:73
fib_sr_entry::address
universal_address_container_t * address
Pointer to the shared generic address.
Definition: table.h:61
fib_table_t::table_type
uint8_t table_type
the kind of this FIB table, single hop or source route.
Definition: table.h:119
fib_sr_entry
Container descriptor for a FIB source route entry.
Definition: table.h:59
mutex.h
Mutex for thread synchronization.
fib_entry_t::next_hop_flags
uint32_t next_hop_flags
Unique identifier for the type of the next hop address.
Definition: table.h:51
fib_sr_t::sr_dest
fib_sr_entry_t * sr_dest
Pointer to the destination of the source route.
Definition: table.h:79
universal_address.h
Types and functions for operating universal addresses.
fib_entry_t
Container descriptor for a FIB entry.
Definition: table.h:41
fib_sr_t::sr_path
fib_sr_entry_t * sr_path
Pointer to the first hop on the source route.
Definition: table.h:77
fib_entry_t::next_hop
universal_address_container_t * next_hop
Pointer to the shared generic address.
Definition: table.h:53
fib_entry_t::iface_id
kernel_pid_t iface_id
interface ID
Definition: table.h:43
mutex_t
Mutex structure.
Definition: mutex.h:120