1998-05-04 00:42:08 +08:00
|
|
|
/*
|
|
|
|
* BIRD Library -- Logging Functions
|
|
|
|
*
|
2000-06-05 20:49:04 +08:00
|
|
|
* (c) 1998--2000 Martin Mares <mj@ucw.cz>
|
1998-05-04 00:42:08 +08:00
|
|
|
*
|
|
|
|
* Can be freely distributed and used under the terms of the GNU GPL.
|
|
|
|
*/
|
|
|
|
|
2000-06-05 20:49:04 +08:00
|
|
|
/**
|
|
|
|
* DOC: Logging
|
|
|
|
*
|
|
|
|
* The Logging module offers a simple set of functions for writing
|
2000-06-08 20:37:21 +08:00
|
|
|
* messages to system logs and to the debug output. Message classes
|
|
|
|
* used by this module are described in |birdlib.h| and also in the
|
|
|
|
* user's manual.
|
2000-06-05 20:49:04 +08:00
|
|
|
*/
|
|
|
|
|
1998-05-04 00:42:08 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdarg.h>
|
2001-03-06 21:40:39 +08:00
|
|
|
#include <time.h>
|
2018-11-15 00:16:05 +08:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
2010-02-21 21:34:53 +08:00
|
|
|
#include <unistd.h>
|
2016-07-12 02:22:55 +08:00
|
|
|
#include <errno.h>
|
1998-05-04 00:42:08 +08:00
|
|
|
|
|
|
|
#include "nest/bird.h"
|
1999-12-06 20:34:45 +08:00
|
|
|
#include "nest/cli.h"
|
2010-01-03 19:17:52 +08:00
|
|
|
#include "nest/mrtdump.h"
|
1998-06-17 22:33:29 +08:00
|
|
|
#include "lib/string.h"
|
1999-12-06 21:45:56 +08:00
|
|
|
#include "lib/lists.h"
|
2016-04-12 17:14:54 +08:00
|
|
|
#include "sysdep/unix/unix.h"
|
1998-05-04 00:42:08 +08:00
|
|
|
|
2010-04-07 17:00:36 +08:00
|
|
|
static FILE *dbgf;
|
1999-12-06 21:45:56 +08:00
|
|
|
static list *current_log_list;
|
2010-04-07 17:00:36 +08:00
|
|
|
static char *current_syslog_name; /* NULL -> syslog closed */
|
1998-05-04 00:42:08 +08:00
|
|
|
|
2013-10-06 02:12:28 +08:00
|
|
|
|
2013-11-20 05:33:48 +08:00
|
|
|
#ifdef USE_PTHREADS
|
2013-10-06 02:12:28 +08:00
|
|
|
|
|
|
|
#include <pthread.h>
|
2014-02-07 20:09:55 +08:00
|
|
|
|
2013-10-06 02:12:28 +08:00
|
|
|
static pthread_mutex_t log_mutex;
|
|
|
|
static inline void log_lock(void) { pthread_mutex_lock(&log_mutex); }
|
|
|
|
static inline void log_unlock(void) { pthread_mutex_unlock(&log_mutex); }
|
|
|
|
|
2014-02-07 20:09:55 +08:00
|
|
|
static pthread_t main_thread;
|
|
|
|
void main_thread_init(void) { main_thread = pthread_self(); }
|
|
|
|
static int main_thread_self(void) { return pthread_equal(pthread_self(), main_thread); }
|
|
|
|
|
2013-11-20 05:33:48 +08:00
|
|
|
#else
|
|
|
|
|
|
|
|
static inline void log_lock(void) { }
|
|
|
|
static inline void log_unlock(void) { }
|
2014-02-07 20:09:55 +08:00
|
|
|
void main_thread_init(void) { }
|
|
|
|
static int main_thread_self(void) { return 1; }
|
2013-11-20 05:33:48 +08:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2009-02-26 21:23:54 +08:00
|
|
|
|
2017-05-09 19:44:02 +08:00
|
|
|
#ifdef HAVE_SYSLOG_H
|
1998-05-04 00:42:08 +08:00
|
|
|
#include <sys/syslog.h>
|
|
|
|
|
|
|
|
static int syslog_priorities[] = {
|
1999-12-06 21:45:56 +08:00
|
|
|
LOG_DEBUG,
|
|
|
|
LOG_DEBUG,
|
1998-05-04 00:42:08 +08:00
|
|
|
LOG_DEBUG,
|
|
|
|
LOG_INFO,
|
1999-12-06 21:45:56 +08:00
|
|
|
LOG_ERR,
|
1998-05-04 00:42:08 +08:00
|
|
|
LOG_WARNING,
|
|
|
|
LOG_ERR,
|
1999-12-06 21:45:56 +08:00
|
|
|
LOG_ERR,
|
|
|
|
LOG_CRIT,
|
1998-05-04 00:42:08 +08:00
|
|
|
LOG_CRIT
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static char *class_names[] = {
|
|
|
|
"???",
|
|
|
|
"DBG",
|
1999-12-06 21:45:56 +08:00
|
|
|
"TRACE",
|
1998-05-04 00:42:08 +08:00
|
|
|
"INFO",
|
1999-12-06 21:45:56 +08:00
|
|
|
"RMT",
|
1998-05-04 00:42:08 +08:00
|
|
|
"WARN",
|
|
|
|
"ERR",
|
|
|
|
"AUTH",
|
1999-12-06 21:45:56 +08:00
|
|
|
"FATAL",
|
|
|
|
"BUG"
|
1998-05-04 00:42:08 +08:00
|
|
|
};
|
|
|
|
|
2018-11-15 00:16:05 +08:00
|
|
|
static inline off_t
|
|
|
|
log_size(struct log_config *l)
|
|
|
|
{
|
|
|
|
struct stat st;
|
|
|
|
return (!fstat(rf_fileno(l->rf), &st) && S_ISREG(st.st_mode)) ? st.st_size : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
log_close(struct log_config *l)
|
|
|
|
{
|
|
|
|
rfree(l->rf);
|
|
|
|
l->rf = NULL;
|
|
|
|
l->fh = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
log_open(struct log_config *l)
|
|
|
|
{
|
|
|
|
l->rf = rf_open(config->pool, l->filename, "a");
|
|
|
|
if (!l->rf)
|
|
|
|
{
|
|
|
|
/* Well, we cannot do much in case of error as log is closed */
|
|
|
|
l->mask = 0;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
l->fh = rf_file(l->rf);
|
|
|
|
l->pos = log_size(l);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
log_rotate(struct log_config *l)
|
|
|
|
{
|
|
|
|
log_close(l);
|
|
|
|
|
|
|
|
/* If we cannot rename the logfile, we at least try to delete it
|
|
|
|
in order to continue logging and not exceeding logfile size */
|
|
|
|
if ((rename(l->filename, l->backup) < 0) &&
|
|
|
|
(unlink(l->filename) < 0))
|
|
|
|
{
|
|
|
|
l->mask = 0;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return log_open(l);
|
|
|
|
}
|
1998-06-17 22:33:29 +08:00
|
|
|
|
2010-09-20 19:01:01 +08:00
|
|
|
/**
|
|
|
|
* log_commit - commit a log message
|
|
|
|
* @class: message class information (%L_DEBUG to %L_BUG, see |lib/birdlib.h|)
|
2016-05-12 21:49:44 +08:00
|
|
|
* @buf: message to write
|
2010-09-20 19:01:01 +08:00
|
|
|
*
|
|
|
|
* This function writes a message prepared in the log buffer to the
|
|
|
|
* log file (as specified in the configuration). The log buffer is
|
|
|
|
* reset after that. The log message is a full line, log_commit()
|
|
|
|
* terminates it.
|
|
|
|
*
|
|
|
|
* The message class is an integer, not a first char of a string like
|
|
|
|
* in log(), so it should be written like *L_INFO.
|
|
|
|
*/
|
|
|
|
void
|
2013-10-06 02:12:28 +08:00
|
|
|
log_commit(int class, buffer *buf)
|
2010-09-20 19:01:01 +08:00
|
|
|
{
|
|
|
|
struct log_config *l;
|
1998-06-17 22:33:29 +08:00
|
|
|
|
2013-10-06 02:12:28 +08:00
|
|
|
if (buf->pos == buf->end)
|
|
|
|
strcpy(buf->end - 100, " ... <too long>");
|
|
|
|
|
|
|
|
log_lock();
|
1999-12-06 21:45:56 +08:00
|
|
|
WALK_LIST(l, *current_log_list)
|
1998-05-04 00:42:08 +08:00
|
|
|
{
|
1999-12-06 21:45:56 +08:00
|
|
|
if (!(l->mask & (1 << class)))
|
|
|
|
continue;
|
|
|
|
if (l->fh)
|
|
|
|
{
|
|
|
|
if (l->terminal_flag)
|
|
|
|
fputs("bird: ", l->fh);
|
|
|
|
else
|
|
|
|
{
|
2010-02-03 07:19:24 +08:00
|
|
|
byte tbuf[TM_DATETIME_BUFFER_SIZE];
|
2017-06-06 22:47:30 +08:00
|
|
|
tm_format_real_time(tbuf, config->tf_log.fmt1, current_real_time());
|
2018-11-15 00:16:05 +08:00
|
|
|
|
|
|
|
if (l->limit)
|
|
|
|
{
|
|
|
|
off_t msg_len = strlen(tbuf) + strlen(class_names[class]) +
|
|
|
|
(buf->pos - buf->start) + 5;
|
|
|
|
|
|
|
|
if (l->pos < 0)
|
|
|
|
l->pos = log_size(l);
|
|
|
|
|
|
|
|
if (l->pos + msg_len > l->limit)
|
|
|
|
if (log_rotate(l) < 0)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
l->pos += msg_len;
|
|
|
|
}
|
|
|
|
|
2010-02-03 07:19:24 +08:00
|
|
|
fprintf(l->fh, "%s <%s> ", tbuf, class_names[class]);
|
1999-12-06 21:45:56 +08:00
|
|
|
}
|
2013-10-06 02:12:28 +08:00
|
|
|
fputs(buf->start, l->fh);
|
1999-12-06 21:45:56 +08:00
|
|
|
fputc('\n', l->fh);
|
|
|
|
fflush(l->fh);
|
|
|
|
}
|
2017-05-09 19:44:02 +08:00
|
|
|
#ifdef HAVE_SYSLOG_H
|
1999-12-06 21:45:56 +08:00
|
|
|
else
|
2013-10-06 02:12:28 +08:00
|
|
|
syslog(syslog_priorities[class], "%s", buf->start);
|
1998-05-04 00:42:08 +08:00
|
|
|
#endif
|
|
|
|
}
|
2013-10-06 02:12:28 +08:00
|
|
|
log_unlock();
|
2010-09-20 19:01:01 +08:00
|
|
|
|
2014-02-07 20:09:55 +08:00
|
|
|
/* cli_echo is not thread-safe, so call it just from the main thread */
|
|
|
|
if (main_thread_self())
|
|
|
|
cli_echo(class, buf->start);
|
2013-11-23 04:58:43 +08:00
|
|
|
|
|
|
|
buf->pos = buf->start;
|
2010-09-20 19:01:01 +08:00
|
|
|
}
|
|
|
|
|
2013-10-06 02:12:28 +08:00
|
|
|
int buffer_vprint(buffer *buf, const char *fmt, va_list args);
|
2010-09-20 19:01:01 +08:00
|
|
|
|
|
|
|
static void
|
|
|
|
vlog(int class, const char *msg, va_list args)
|
|
|
|
{
|
2013-10-06 02:12:28 +08:00
|
|
|
buffer buf;
|
|
|
|
LOG_BUFFER_INIT(buf);
|
|
|
|
buffer_vprint(&buf, msg, args);
|
|
|
|
log_commit(class, &buf);
|
2010-09-20 19:01:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-06-05 20:49:04 +08:00
|
|
|
/**
|
|
|
|
* log - log a message
|
|
|
|
* @msg: printf-like formatting string with message class information
|
|
|
|
* prepended (%L_DEBUG to %L_BUG, see |lib/birdlib.h|)
|
|
|
|
*
|
|
|
|
* This function formats a message according to the format string @msg
|
2000-06-07 20:29:08 +08:00
|
|
|
* and writes it to the corresponding log file (as specified in the
|
2000-06-05 20:49:04 +08:00
|
|
|
* configuration). Please note that the message is automatically
|
|
|
|
* formatted as a full line, no need to include |\n| inside.
|
2010-09-20 19:01:01 +08:00
|
|
|
* It is essentially a sequence of log_reset(), logn() and log_commit().
|
2000-06-05 20:49:04 +08:00
|
|
|
*/
|
1998-05-04 00:42:08 +08:00
|
|
|
void
|
2014-12-03 17:57:31 +08:00
|
|
|
log_msg(const char *msg, ...)
|
1998-05-04 00:42:08 +08:00
|
|
|
{
|
|
|
|
int class = 1;
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
va_start(args, msg);
|
1998-12-20 22:24:35 +08:00
|
|
|
if (*msg >= 1 && *msg <= 8)
|
1998-05-04 00:42:08 +08:00
|
|
|
class = *msg++;
|
|
|
|
vlog(class, msg, args);
|
|
|
|
va_end(args);
|
|
|
|
}
|
|
|
|
|
2009-02-26 21:23:54 +08:00
|
|
|
void
|
2014-12-03 17:57:31 +08:00
|
|
|
log_rl(struct tbf *f, const char *msg, ...)
|
2009-02-26 21:23:54 +08:00
|
|
|
{
|
|
|
|
int class = 1;
|
|
|
|
va_list args;
|
|
|
|
|
2014-10-02 17:41:34 +08:00
|
|
|
/* Rate limiting is a bit tricky here as it also logs '...' during the first hit */
|
2017-11-29 00:06:10 +08:00
|
|
|
if (tbf_limit(f) && (f->drop > 1))
|
2009-02-26 21:23:54 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (*msg >= 1 && *msg <= 8)
|
|
|
|
class = *msg++;
|
2014-10-02 17:41:34 +08:00
|
|
|
|
|
|
|
va_start(args, msg);
|
2017-11-29 00:06:10 +08:00
|
|
|
vlog(class, (f->drop ? "..." : msg), args);
|
2009-02-26 21:23:54 +08:00
|
|
|
va_end(args);
|
|
|
|
}
|
|
|
|
|
2000-06-05 20:49:04 +08:00
|
|
|
/**
|
|
|
|
* bug - report an internal error
|
|
|
|
* @msg: a printf-like error message
|
|
|
|
*
|
|
|
|
* This function logs an internal error and aborts execution
|
|
|
|
* of the program.
|
|
|
|
*/
|
1998-12-20 22:24:35 +08:00
|
|
|
void
|
2014-12-03 17:57:31 +08:00
|
|
|
bug(const char *msg, ...)
|
1998-12-20 22:24:35 +08:00
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
va_start(args, msg);
|
|
|
|
vlog(L_BUG[0], msg, args);
|
2016-03-29 16:37:31 +08:00
|
|
|
va_end(args);
|
2000-05-08 20:38:00 +08:00
|
|
|
abort();
|
1998-12-20 22:24:35 +08:00
|
|
|
}
|
|
|
|
|
2000-06-05 20:49:04 +08:00
|
|
|
/**
|
|
|
|
* bug - report a fatal error
|
|
|
|
* @msg: a printf-like error message
|
|
|
|
*
|
|
|
|
* This function logs a fatal error and aborts execution
|
|
|
|
* of the program.
|
|
|
|
*/
|
1998-05-04 00:42:08 +08:00
|
|
|
void
|
2014-12-03 17:57:31 +08:00
|
|
|
die(const char *msg, ...)
|
1998-05-04 00:42:08 +08:00
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
va_start(args, msg);
|
1998-12-20 22:24:35 +08:00
|
|
|
vlog(L_FATAL[0], msg, args);
|
2016-03-29 16:37:31 +08:00
|
|
|
va_end(args);
|
1998-05-04 00:42:08 +08:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2000-06-05 20:49:04 +08:00
|
|
|
/**
|
|
|
|
* debug - write to debug output
|
|
|
|
* @msg: a printf-like message
|
|
|
|
*
|
|
|
|
* This function formats the message @msg and prints it out
|
|
|
|
* to the debugging output. No newline character is appended.
|
|
|
|
*/
|
1998-05-04 00:42:08 +08:00
|
|
|
void
|
2014-12-03 17:57:31 +08:00
|
|
|
debug(const char *msg, ...)
|
1998-05-04 00:42:08 +08:00
|
|
|
{
|
|
|
|
va_list args;
|
1999-12-06 20:34:45 +08:00
|
|
|
char buf[1024];
|
1998-05-04 00:42:08 +08:00
|
|
|
|
|
|
|
va_start(args, msg);
|
|
|
|
if (dbgf)
|
1999-12-06 21:45:56 +08:00
|
|
|
{
|
|
|
|
if (bvsnprintf(buf, sizeof(buf), msg, args) < 0)
|
|
|
|
bsprintf(buf + sizeof(buf) - 100, " ... <too long>\n");
|
|
|
|
fputs(buf, dbgf);
|
|
|
|
}
|
1998-05-04 00:42:08 +08:00
|
|
|
va_end(args);
|
|
|
|
}
|
|
|
|
|
2010-04-07 17:00:36 +08:00
|
|
|
static list *
|
|
|
|
default_log_list(int debug, int init, char **syslog_name)
|
1998-05-04 00:42:08 +08:00
|
|
|
{
|
2010-04-07 17:00:36 +08:00
|
|
|
static list init_log_list;
|
1999-12-06 21:45:56 +08:00
|
|
|
init_list(&init_log_list);
|
2010-04-07 17:00:36 +08:00
|
|
|
*syslog_name = NULL;
|
1998-05-04 00:42:08 +08:00
|
|
|
|
2017-05-09 19:44:02 +08:00
|
|
|
#ifdef HAVE_SYSLOG_H
|
1999-12-06 21:45:56 +08:00
|
|
|
if (!debug)
|
1998-05-04 00:42:08 +08:00
|
|
|
{
|
2014-12-03 17:10:34 +08:00
|
|
|
static struct log_config lc_syslog = { .mask = ~0 };
|
2010-04-07 17:00:36 +08:00
|
|
|
add_tail(&init_log_list, &lc_syslog.n);
|
|
|
|
*syslog_name = bird_name;
|
2000-06-09 15:32:57 +08:00
|
|
|
if (!init)
|
2010-04-07 17:00:36 +08:00
|
|
|
return &init_log_list;
|
1998-05-04 00:42:08 +08:00
|
|
|
}
|
1999-12-06 21:45:56 +08:00
|
|
|
#endif
|
|
|
|
|
2014-12-03 17:10:34 +08:00
|
|
|
static struct log_config lc_stderr = { .mask = ~0, .terminal_flag = 1 };
|
1999-12-06 21:45:56 +08:00
|
|
|
lc_stderr.fh = stderr;
|
2010-04-07 17:00:36 +08:00
|
|
|
add_tail(&init_log_list, &lc_stderr.n);
|
|
|
|
return &init_log_list;
|
1999-12-06 21:45:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2018-11-15 00:16:05 +08:00
|
|
|
log_switch(int debug, list *logs, char *new_syslog_name)
|
1999-12-06 21:45:56 +08:00
|
|
|
{
|
2018-11-15 00:16:05 +08:00
|
|
|
struct log_config *l;
|
|
|
|
|
|
|
|
if (!logs || EMPTY_LIST(*logs))
|
|
|
|
logs = default_log_list(debug, !logs, &new_syslog_name);
|
|
|
|
|
|
|
|
/* Close the logs to avoid pinning them on disk when deleted */
|
|
|
|
if (current_log_list)
|
|
|
|
WALK_LIST(l, *current_log_list)
|
|
|
|
if (l->rf)
|
|
|
|
log_close(l);
|
|
|
|
|
|
|
|
/* Reopen the logs, needed for 'configure undo' */
|
|
|
|
if (logs)
|
|
|
|
WALK_LIST(l, *logs)
|
|
|
|
if (l->filename && !l->rf)
|
|
|
|
log_open(l);
|
2010-04-07 17:00:36 +08:00
|
|
|
|
2018-11-15 00:16:05 +08:00
|
|
|
current_log_list = logs;
|
2010-04-07 17:00:36 +08:00
|
|
|
|
2017-05-09 19:44:02 +08:00
|
|
|
#ifdef HAVE_SYSLOG_H
|
2016-11-01 18:37:49 +08:00
|
|
|
if (current_syslog_name && new_syslog_name &&
|
|
|
|
!strcmp(current_syslog_name, new_syslog_name))
|
2010-04-07 17:00:36 +08:00
|
|
|
return;
|
|
|
|
|
2016-11-01 18:37:49 +08:00
|
|
|
if (current_syslog_name)
|
|
|
|
{
|
2010-04-07 17:00:36 +08:00
|
|
|
closelog();
|
2016-11-01 18:37:49 +08:00
|
|
|
xfree(current_syslog_name);
|
|
|
|
current_syslog_name = NULL;
|
|
|
|
}
|
2010-04-07 17:00:36 +08:00
|
|
|
|
|
|
|
if (new_syslog_name)
|
2016-11-01 18:37:49 +08:00
|
|
|
{
|
|
|
|
current_syslog_name = xstrdup(new_syslog_name);
|
|
|
|
openlog(current_syslog_name, LOG_CONS | LOG_NDELAY, LOG_DAEMON);
|
|
|
|
}
|
2010-04-07 17:00:36 +08:00
|
|
|
#endif
|
1998-05-04 00:42:08 +08:00
|
|
|
}
|
|
|
|
|
2010-04-07 17:00:36 +08:00
|
|
|
|
|
|
|
|
1998-05-04 00:42:08 +08:00
|
|
|
void
|
|
|
|
log_init_debug(char *f)
|
|
|
|
{
|
|
|
|
if (dbgf && dbgf != stderr)
|
|
|
|
fclose(dbgf);
|
|
|
|
if (!f)
|
|
|
|
dbgf = NULL;
|
1999-12-06 21:45:56 +08:00
|
|
|
else if (!*f)
|
|
|
|
dbgf = stderr;
|
1998-05-04 00:42:08 +08:00
|
|
|
else if (!(dbgf = fopen(f, "a")))
|
2016-07-12 02:22:55 +08:00
|
|
|
{
|
|
|
|
/* Cannot use die() nor log() here, logging is not yet initialized */
|
|
|
|
fprintf(stderr, "bird: Unable to open debug file %s: %s\n", f, strerror(errno));
|
|
|
|
exit(1);
|
|
|
|
}
|
2000-03-13 06:53:05 +08:00
|
|
|
if (dbgf)
|
|
|
|
setvbuf(dbgf, NULL, _IONBF, 0);
|
1998-05-04 00:42:08 +08:00
|
|
|
}
|
2010-01-03 19:17:52 +08:00
|
|
|
|
|
|
|
void
|
|
|
|
mrt_dump_message(struct proto *p, u16 type, u16 subtype, byte *buf, u32 len)
|
|
|
|
{
|
|
|
|
/* Prepare header */
|
2017-11-29 00:06:10 +08:00
|
|
|
put_u32(buf+0, current_real_time() TO_S);
|
2010-01-03 19:17:52 +08:00
|
|
|
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);
|
|
|
|
}
|