summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2018-09-18 17:29:00 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2018-09-18 17:50:45 +0200
commitc0fc3e67185c1e0ff2d083572c6ad3983ba4ef25 (patch)
tree9fe17603f4fec18b7f9fbd8d8efc1f13a9bef8ee /nest
parentafa14f1868f2c753efdc81ce8e2c2d44e6bdd80e (diff)
The MRT protocol
The new MRT protocol is responsible for periodic RIB table dumps in the MRT format (RFC 6396). Also the existing code for BGP4MP MRT dumps is refactored and splitted between BGP to MRT protocols, will be more integrated into MRT in the future. Example: protocol mrt { table "*"; filename "%N_%F_%T.mrt"; period 60; } It is partially based on the old MRT code from Pavel Tvrdik.
Diffstat (limited to 'nest')
-rw-r--r--nest/mrtdump.h31
-rw-r--r--nest/proto.c3
-rw-r--r--nest/protocol.h2
-rw-r--r--nest/route.h1
-rw-r--r--nest/rt-table.c2
5 files changed, 6 insertions, 33 deletions
diff --git a/nest/mrtdump.h b/nest/mrtdump.h
deleted file mode 100644
index 73932553..00000000
--- a/nest/mrtdump.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * BIRD -- MRTdump handling
- *
- *
- * Can be freely distributed and used under the terms of the GNU GPL.
- */
-
-#ifndef MRTDUMP_H
-#define MRTDUMP_H
-#include "nest/protocol.h"
-
-/* MRTDump values */
-
-#define MRTDUMP_HDR_LENGTH 12
-
-/* MRTdump types */
-
-#define BGP4MP 16
-
-/* MRTdump subtypes */
-
-#define BGP4MP_MESSAGE 1
-#define BGP4MP_MESSAGE_AS4 4
-#define BGP4MP_STATE_CHANGE_AS4 5
-
-
-/* implemented in sysdep */
-void mrt_dump_message(struct proto *p, u16 type, u16 subtype, byte *buf, u32 len);
-
-#endif
-
diff --git a/nest/proto.c b/nest/proto.c
index 565b238f..162441b6 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -913,6 +913,9 @@ protos_build(void)
#ifdef CONFIG_STATIC
proto_build(&proto_static);
#endif
+#ifdef CONFIG_MRT
+ proto_build(&proto_mrt);
+#endif
#ifdef CONFIG_OSPF
proto_build(&proto_ospf);
#endif
diff --git a/nest/protocol.h b/nest/protocol.h
index af988c88..cc1dd5ca 100644
--- a/nest/protocol.h
+++ b/nest/protocol.h
@@ -76,7 +76,7 @@ void protos_dump_all(void);
*/
extern struct protocol
- proto_device, proto_radv, proto_rip, proto_static,
+ proto_device, proto_radv, proto_rip, proto_static, proto_mrt,
proto_ospf, proto_pipe, proto_bgp, proto_bfd, proto_babel;
/*
diff --git a/nest/route.h b/nest/route.h
index ab1ba50e..b9f8f795 100644
--- a/nest/route.h
+++ b/nest/route.h
@@ -263,6 +263,7 @@ static inline int rte_is_filtered(rte *r) { return !!(r->flags & REF_FILTERED);
#define RIC_REJECT -1 /* Rejected by protocol */
#define RIC_DROP -2 /* Silently dropped by protocol */
+extern list routing_tables;
struct config;
void rt_init(void);
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 93075c7b..cae6afaa 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -48,7 +48,7 @@ pool *rt_table_pool;
static slab *rte_slab;
static linpool *rte_update_pool;
-static list routing_tables;
+list routing_tables;
static byte *rt_format_via(rte *e);
static void rt_free_hostcache(rtable *tab);