table.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2014 Martin Landsmann <Martin.Landsmann@HAW-Hamburg.de>
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
18 #include <stdint.h>
19 
20 #include "sched.h"
21 #include "universal_address.h"
22 #include "mutex.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
32 #define FIB_MAX_REGISTERED_RP (5)
33 
37 typedef struct {
41  uint64_t lifetime;
43  uint32_t global_flags;
47  uint32_t next_hop_flags;
50 } fib_entry_t;
51 
55 typedef struct fib_sr_entry {
59  struct fib_sr_entry *next;
61 
65 typedef struct {
69  uint64_t sr_lifetime;
71  uint32_t sr_flags;
76 } fib_sr_t;
77 
82 typedef struct {
90 
94 #define FIB_TABLE_TYPE_SH (1)
95 
99 #define FIB_TABLE_TYPE_SR (FIB_TABLE_TYPE_SH + 1)
100 
104 typedef struct {
106  union{
111  }data;
115  uint8_t table_type;
117  size_t size;
132 } fib_table_t;
133 
134 #ifdef __cplusplus
135 }
136 #endif
137 
int16_t kernel_pid_t
Unique process identifier.
Definition: sched.h:135
Mutex for thread synchronization.
Scheduler API definition.
Container descriptor for a FIB entry.
Definition: table.h:37
kernel_pid_t iface_id
interface ID
Definition: table.h:39
universal_address_container_t * next_hop
Pointer to the shared generic address.
Definition: table.h:49
universal_address_container_t * global
Pointer to the shared generic address.
Definition: table.h:45
uint32_t next_hop_flags
Unique identifier for the type of the next hop address.
Definition: table.h:47
uint32_t global_flags
Unique identifier for the type of the global address.
Definition: table.h:43
uint64_t lifetime
Lifetime of this entry (an absolute time-point is stored by the FIB)
Definition: table.h:41
Container descriptor for a FIB source route entry.
Definition: table.h:55
universal_address_container_t * address
Pointer to the shared generic address.
Definition: table.h:57
struct fib_sr_entry * next
Pointer to the next shared generic address on the source route.
Definition: table.h:59
Container for one FIB source route table, combining source routes and an entry pool.
Definition: table.h:82
fib_sr_t * headers
pointer to source route header array
Definition: table.h:84
fib_sr_entry_t * entry_pool
pointer to entry pool array holding all hop entries for this table
Definition: table.h:86
size_t entry_pool_size
the maximum number of elements in the entry pool
Definition: table.h:88
Container descriptor for a FIB source route.
Definition: table.h:65
fib_sr_entry_t * sr_dest
Pointer to the destination of the source route.
Definition: table.h:75
kernel_pid_t sr_iface_id
interface ID
Definition: table.h:67
uint64_t sr_lifetime
Lifetime of this entry (an absolute time-point is stored by the FIB)
Definition: table.h:69
uint32_t sr_flags
Flags for this source route.
Definition: table.h:71
fib_sr_entry_t * sr_path
Pointer to the first hop on the source route.
Definition: table.h:73
Meta information of a FIB table.
Definition: table.h:104
mutex_t mtx_access
table access mutex to grant exclusive operations on calls
Definition: table.h:119
size_t size
the maximum number of entries in this FIB table
Definition: table.h:117
size_t notify_rp_pos
current number of registered RPs.
Definition: table.h:121
uint8_t table_type
the kind of this FIB table, single hop or source route.
Definition: table.h:115
fib_sr_meta_t * source_routes
array holding the FIB entries for source routes
Definition: table.h:110
fib_entry_t * entries
array holding the FIB entries for single hops
Definition: table.h:108
Mutex structure.
Definition: mutex.h:36
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:32
Types and functions for operating universal addresses.