diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-04-05 05:21:58 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-04-05 05:21:58 +0200 |
commit | 329d15d50c54a69ce8e2be0865124744c0bf3428 (patch) | |
tree | 34734e0ed120a83069738a0a51df9bdd1a664640 /src/fastd.h | |
parent | cbf0166a7f12f71747c495b5ea68ff676c1a7868 (diff) | |
download | fastd-329d15d50c54a69ce8e2be0865124744c0bf3428.tar fastd-329d15d50c54a69ce8e2be0865124744c0bf3428.zip |
Implement reconfiguration on SIGHUP
Diffstat (limited to 'src/fastd.h')
-rw-r--r-- | src/fastd.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/fastd.h b/src/fastd.h index 4a4bd49..f07f108 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -59,7 +59,9 @@ struct _fastd_eth_addr { struct _fastd_protocol { const char *name; - void (*init)(fastd_context *ctx, fastd_config *conf); + fastd_protocol_config* (*init)(fastd_context *ctx); + void (*peer_configure)(fastd_context *ctx, fastd_peer_config *peer_conf); + void (*peer_config_purged)(fastd_context *ctx, fastd_peer_config *peer_conf); size_t (*max_packet_size)(fastd_context *ctx); size_t (*min_encrypt_head_space)(fastd_context *ctx); @@ -140,9 +142,10 @@ struct _fastd_string_stack { void fastd_printf(const fastd_context *ctx, const char *format, ...); -void fastd_read_config_dir(fastd_context *ctx, fastd_config *conf, const char *dir, int depth); +void fastd_read_peer_dir(fastd_context *ctx, fastd_config *conf, const char *dir); bool fastd_read_config(fastd_context *ctx, fastd_config *conf, const char *filename, bool peer_config, int depth); void fastd_configure(fastd_context *ctx, fastd_config *conf, int argc, char *const argv[]); +void fastd_reconfigure(fastd_context *ctx, fastd_config *conf); void fastd_random_bytes(fastd_context *ctx, void *buffer, size_t len, bool secure); @@ -265,4 +268,11 @@ static inline int timespec_diff(const struct timespec *tp1, const struct timespe return ((tp1->tv_sec - tp2->tv_sec))*1000 + (tp1->tv_nsec - tp2->tv_nsec)/1e6; } +static inline bool strequal(const char *str1, const char *str2) { + if (str1 && str2) + return (!strcmp(str1, str2)); + else + return (str1 == str2); +} + #endif /* _FASTD_FASTD_H_ */ |