diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-09-09 02:55:32 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-11-26 18:39:25 +0100 |
commit | 5ea39eaa96625ec8274703b1eb2c8f59042a8a32 (patch) | |
tree | 0ef3675d3818b86b2ee2c9edaf6663cdf153bbe9 /nest/route.h | |
parent | af02b83b888c693c292960072195f0e1caf1d2a1 (diff) |
Nest: Use bitmaps to keep track of exported routes
Use a hierarchical bitmap in a routing table to assign ids to routes, and
then use bitmaps (indexed by route id) in channels to keep track whether
routes were exported. This avoids unreliable and inefficient re-evaluation
of filters for old routes in order to determine whether they were exported.
Diffstat (limited to 'nest/route.h')
-rw-r--r-- | nest/route.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/nest/route.h b/nest/route.h index cd4b75db..434b9b34 100644 --- a/nest/route.h +++ b/nest/route.h @@ -10,6 +10,7 @@ #define _BIRD_ROUTE_H_ #include "lib/lists.h" +#include "lib/bitmap.h" #include "lib/resource.h" #include "lib/net.h" @@ -152,6 +153,7 @@ typedef struct rtable { int pipe_busy; /* Pipe loop detection */ int use_count; /* Number of protocols using this table */ u32 rt_count; /* Number of routes in the table */ + struct hmap id_map; struct hostcache *hostcache; struct rtable_config *config; /* Configuration of this table */ struct config *deleted; /* Table doesn't exist in current configuration, @@ -210,6 +212,7 @@ typedef struct rte { net *net; /* Network this RTE belongs to */ struct channel *sender; /* Channel used to send the route to the routing table */ struct rta *attrs; /* Attributes of this route */ + u32 id; /* Table specific route id */ byte flags; /* Flags (REF_...) */ byte pflags; /* Protocol-specific flags */ word pref; /* Route preference */ @@ -369,6 +372,7 @@ struct rt_show_data_rtable * rt_show_add_table(struct rt_show_data *d, rtable *t #define RSEM_PREEXPORT 1 /* Routes ready for export, before filtering */ #define RSEM_EXPORT 2 /* Routes accepted by export filter */ #define RSEM_NOEXPORT 3 /* Routes rejected by export filter */ +#define RSEM_EXPORTED 4 /* Routes marked in export map */ /* * Route Attributes |