diff options
Diffstat (limited to 'src/fastd.h')
-rw-r--r-- | src/fastd.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/fastd.h b/src/fastd.h index d901554..039d0c6 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -538,3 +538,30 @@ static inline bool fastd_allow_verify(void) { return false; #endif } + + +/** Calls the on-pre-up command */ +static inline void fastd_on_pre_up(void) { + fastd_shell_command_exec(&conf.on_pre_up, NULL); +} + +/** Calls the on-up command */ +static inline void fastd_on_up(fastd_iface_t *iface) { + fastd_shell_env_t *env = fastd_shell_env_alloc(); + fastd_shell_env_set_iface(env, iface); + fastd_shell_command_exec(&conf.on_up, env); + fastd_shell_env_free(env); +} + +/** Calls the on-down command */ +static inline void fastd_on_down(fastd_iface_t *iface) { + fastd_shell_env_t *env = fastd_shell_env_alloc(); + fastd_shell_env_set_iface(env, iface); + fastd_shell_command_exec(&conf.on_down, env); + fastd_shell_env_free(env); +} + +/** Calls the on-post-down command */ +static inline void fastd_on_post_down(void) { + fastd_shell_command_exec(&conf.on_post_down, NULL); +} |