From aadf0a94b436990202cd2f13f1fe8528a9fd183c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 29 Mar 2012 01:28:55 +0200 Subject: Implement on-up commands; also fix log print conditions --- src/fastd.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/fastd.h') diff --git a/src/fastd.h b/src/fastd.h index fd6fead..dbf9e61 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -99,11 +99,16 @@ struct _fastd_config { unsigned n_v6; fastd_protocol_config *protocol_config; + + char *on_up; + char *on_up_dir; }; struct _fastd_context { const fastd_config *conf; + char *ifname; + struct timespec now; fastd_peer *peers; @@ -126,8 +131,11 @@ void fastd_configure(fastd_context *ctx, fastd_config *conf, int argc, char *con void fastd_random_bytes(fastd_context *ctx, void *buffer, size_t len, bool secure); -#define pr_log(ctx, level, prefix, args...) if ((ctx)->conf == NULL || (level) <= (ctx)->conf->loglevel) \ - do { fputs(prefix, stderr); fastd_printf(ctx, args); fputs("\n", stderr); } while(0) +#define pr_log(ctx, level, prefix, args...) do { \ + if ((ctx)->conf == NULL || (level) <= (ctx)->conf->loglevel) { \ + fputs(prefix, stderr); fastd_printf(ctx, args); fputs("\n", stderr); \ + } \ + } while(0) #define is_error(ctx) ((ctx)->conf == NULL || LOG_ERROR <= (ctx)->conf->loglevel) #define is_warn(ctx) ((ctx)->conf == NULL || LOG_WARN <= (ctx)->conf->loglevel) -- cgit v1.2.3