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 /sysdep | |
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 'sysdep')
-rw-r--r-- | sysdep/unix/log.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/sysdep/unix/log.c b/sysdep/unix/log.c index 960b4c1c..9a0fa550 100644 --- a/sysdep/unix/log.c +++ b/sysdep/unix/log.c @@ -26,7 +26,7 @@ #include "nest/bird.h" #include "nest/cli.h" -#include "nest/mrtdump.h" +#include "conf/conf.h" #include "lib/string.h" #include "lib/lists.h" #include "sysdep/unix/unix.h" @@ -170,7 +170,8 @@ log_commit(int class, buffer *buf) else { byte tbuf[TM_DATETIME_BUFFER_SIZE]; - tm_format_real_time(tbuf, config->tf_log.fmt1, current_real_time()); + if (!tm_format_real_time(tbuf, sizeof(tbuf), config->tf_log.fmt1, current_real_time())) + strcpy(tbuf, "<error>"); if (l->limit) { @@ -386,8 +387,6 @@ log_switch(int debug, list *logs, char *new_syslog_name) #endif } - - void log_init_debug(char *f) { @@ -406,16 +405,3 @@ log_init_debug(char *f) if (dbgf) setvbuf(dbgf, NULL, _IONBF, 0); } - -void -mrt_dump_message(struct proto *p, u16 type, u16 subtype, byte *buf, u32 len) -{ - /* Prepare header */ - put_u32(buf+0, current_real_time() TO_S); - put_u16(buf+4, type); - put_u16(buf+6, subtype); - put_u32(buf+8, len - MRTDUMP_HDR_LENGTH); - - if (p->cf->global->mrtdump_file != -1) - write(p->cf->global->mrtdump_file, buf, len); -} |