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 
9 #pragma once
10 
21 #include <stdint.h>
22 
23 #include "sched.h"
24 #include "universal_address.h"
25 #include "mutex.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
35 #define FIB_MAX_REGISTERED_RP (5)
36 
40 typedef struct {
44  uint64_t lifetime;
46  uint32_t global_flags;
50  uint32_t next_hop_flags;
53 } fib_entry_t;
54 
58 typedef struct fib_sr_entry {
62  struct fib_sr_entry *next;
64 
68 typedef struct {
72  uint64_t sr_lifetime;
74  uint32_t sr_flags;
79 } fib_sr_t;
80 
85 typedef struct {
93 
97 #define FIB_TABLE_TYPE_SH (1)
98 
102 #define FIB_TABLE_TYPE_SR (FIB_TABLE_TYPE_SH + 1)
103 
107 typedef struct {
109  union{
114  }data;
118  uint8_t table_type;
120  size_t size;
135 } fib_table_t;
136 
137 #ifdef __cplusplus
138 }
139 #endif
140 
int16_t kernel_pid_t
Unique process identifier.
Definition: sched.h:138
Mutex for thread synchronization.
Scheduler API definition.
Container descriptor for a FIB entry.
Definition: table.h:40
kernel_pid_t iface_id
interface ID
Definition: table.h:42
universal_address_container_t * next_hop
Pointer to the shared generic address.
Definition: table.h:52
universal_address_container_t * global
Pointer to the shared generic address.
Definition: table.h:48
uint32_t next_hop_flags
Unique identifier for the type of the next hop address.
Definition: table.h:50
uint32_t global_flags
Unique identifier for the type of the global address.
Definition: table.h:46
uint64_t lifetime
Lifetime of this entry (an absolute time-point is stored by the FIB)
Definition: table.h:44
Container descriptor for a FIB source route entry.
Definition: table.h:58
universal_address_container_t * address
Pointer to the shared generic address.
Definition: table.h:60
struct fib_sr_entry * next
Pointer to the next shared generic address on the source route.
Definition: table.h:62
Container for one FIB source route table, combining source routes and an entry pool.
Definition: table.h:85
fib_sr_t * headers
pointer to source route header array
Definition: table.h:87
fib_sr_entry_t * entry_pool
pointer to entry pool array holding all hop entries for this table
Definition: table.h:89
size_t entry_pool_size
the maximum number of elements in the entry pool
Definition: table.h:91
Container descriptor for a FIB source route.
Definition: table.h:68
fib_sr_entry_t * sr_dest
Pointer to the destination of the source route.
Definition: table.h:78
kernel_pid_t sr_iface_id
interface ID
Definition: table.h:70
uint64_t sr_lifetime
Lifetime of this entry (an absolute time-point is stored by the FIB)
Definition: table.h:72
uint32_t sr_flags
Flags for this source route.
Definition: table.h:74
fib_sr_entry_t * sr_path
Pointer to the first hop on the source route.
Definition: table.h:76
Meta information of a FIB table.
Definition: table.h:107
mutex_t mtx_access
table access mutex to grant exclusive operations on calls
Definition: table.h:122
size_t size
the maximum number of entries in this FIB table
Definition: table.h:120
size_t notify_rp_pos
current number of registered RPs.
Definition: table.h:124
uint8_t table_type
the kind of this FIB table, single hop or source route.
Definition: table.h:118
fib_sr_meta_t * source_routes
array holding the FIB entries for source routes
Definition: table.h:113
fib_entry_t * entries
array holding the FIB entries for single hops
Definition: table.h:111
Mutex structure.
Definition: mutex.h:39
The container descriptor used to identify a universal address entry.
struct fib_sr_entry fib_sr_entry_t
Container descriptor for a FIB source route entry.
#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:35
Types and functions for operating universal addresses.