diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-29 01:28:55 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-29 01:28:55 +0200 |
commit | aadf0a94b436990202cd2f13f1fe8528a9fd183c (patch) | |
tree | 87f5dd658b0503a4c33489e051b6a1b9dd0d85c1 /src/fastd.h | |
parent | 63e123738a9636618421d35ff97a278c06b69703 (diff) | |
download | fastd-aadf0a94b436990202cd2f13f1fe8528a9fd183c.tar fastd-aadf0a94b436990202cd2f13f1fe8528a9fd183c.zip |
Implement on-up commands; also fix log print conditions
Diffstat (limited to 'src/fastd.h')
-rw-r--r-- | src/fastd.h | 12 |
1 files changed, 10 insertions, 2 deletions
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) |