diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-04-11 15:50:43 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-04-11 15:50:43 +0200 |
commit | a45a313422efa33f261cb1b53a08646a6b3ab947 (patch) | |
tree | abe0d81b6dba97106b1016722e210f02a0168733 /src/fastd.h | |
parent | e5a8f900352b242860ac3dd4e3b39c7297169480 (diff) | |
download | fastd-a45a313422efa33f261cb1b53a08646a6b3ab947.tar fastd-a45a313422efa33f261cb1b53a08646a6b3ab947.zip |
Improve shell command config handling
Diffstat (limited to 'src/fastd.h')
-rw-r--r-- | src/fastd.h | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/src/fastd.h b/src/fastd.h index 9412116..c117cdc 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -26,11 +26,11 @@ #pragma once -#include "compat.h" #include "types.h" #include "dlist.h" #include "buffer.h" #include "log.h" +#include "shell.h" #include <errno.h> #include <stdarg.h> @@ -205,26 +205,13 @@ struct fastd_config { fastd_protocol_config_t *protocol_config; - char *on_pre_up; - char *on_pre_up_dir; - - char *on_up; - char *on_up_dir; - - char *on_down; - char *on_down_dir; - - char *on_post_down; - char *on_post_down_dir; - - char *on_establish; - char *on_establish_dir; - - char *on_disestablish; - char *on_disestablish_dir; - - char *on_verify; - char *on_verify_dir; + fastd_shell_command_t on_pre_up; + fastd_shell_command_t on_up; + fastd_shell_command_t on_down; + fastd_shell_command_t on_post_down; + fastd_shell_command_t on_establish; + fastd_shell_command_t on_disestablish; + fastd_shell_command_t on_verify; bool daemon; char *pid_file; @@ -317,8 +304,6 @@ void fastd_tuntap_close(fastd_context_t *ctx); void fastd_cap_init(fastd_context_t *ctx); void fastd_cap_drop(fastd_context_t *ctx); -bool fastd_shell_exec(fastd_context_t *ctx, const char *command, const char *dir, const fastd_peer_t *peer, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *peer_addr, int *ret); - void fastd_random_bytes(fastd_context_t *ctx, void *buffer, size_t len, bool secure); static inline int fastd_rand(fastd_context_t *ctx, int min, int max) { |