diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-11-20 17:38:19 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-11-20 17:45:35 +0100 |
commit | 863ecfc78538657e51f1ec67441aec32261aa405 (patch) | |
tree | 73b8628fbca9e04a554c5d08fe18bae4c647a51e /nest | |
parent | 6712e77271fb3cb4a3c48cd7b027b39c5cea00a2 (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.h | 30 | ||||
-rw-r--r-- | nest/proto.c | 3 | ||||
-rw-r--r-- | nest/protocol.h | 3 | ||||
-rw-r--r-- | nest/route.h | 1 | ||||
-rw-r--r-- | nest/rt-table.c | 2 |
5 files changed, 7 insertions, 32 deletions
diff --git a/nest/mrtdump.h b/nest/mrtdump.h deleted file mode 100644 index 28b3bdfd..00000000 --- a/nest/mrtdump.h +++ /dev/null @@ -1,30 +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 7905c9f2..3dcb3429 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -1290,6 +1290,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 343ce523..61160c0a 100644 --- a/nest/protocol.h +++ b/nest/protocol.h @@ -46,6 +46,7 @@ enum protocol_class { PROTOCOL_DIRECT, PROTOCOL_KERNEL, PROTOCOL_OSPF, + PROTOCOL_MRT, PROTOCOL_PIPE, PROTOCOL_RADV, PROTOCOL_RIP, @@ -98,7 +99,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, proto_rpki; /* diff --git a/nest/route.h b/nest/route.h index e19e11ca..60650763 100644 --- a/nest/route.h +++ b/nest/route.h @@ -277,6 +277,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 4998e292..e47e03a9 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 void rt_free_hostcache(rtable *tab); static void rt_notify_hostcache(rtable *tab, net *net); |