summaryrefslogtreecommitdiff
path: root/sysdep/unix/log.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-01-03 12:17:52 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2010-01-03 12:17:52 +0100
commitcf31112f0d7618464097f71228f84bd534f1bc0f (patch)
tree68f7fa93bd2154a16169b4db3dc9c16e51c2e84f /sysdep/unix/log.c
parent610bb3cff05f6d5b09c77724bc97295b809d15e2 (diff)
Implements MRTdump feature.
Diffstat (limited to 'sysdep/unix/log.c')
-rw-r--r--sysdep/unix/log.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sysdep/unix/log.c b/sysdep/unix/log.c
index eb083099..dad0c5db 100644
--- a/sysdep/unix/log.c
+++ b/sysdep/unix/log.c
@@ -22,6 +22,7 @@
#include "nest/bird.h"
#include "nest/cli.h"
+#include "nest/mrtdump.h"
#include "lib/string.h"
#include "lib/lists.h"
#include "lib/unix.h"
@@ -261,3 +262,16 @@ 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, now_real);
+ 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);
+}