diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-03-23 01:40:35 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-03-23 01:40:35 +0100 |
commit | 0e8493ea17c1bba64ee0de588bdbad7fdb6fd9ba (patch) | |
tree | ff1474d41067c45e4d9b2190601e43a03f8aec74 /src/fastd.h | |
parent | 08e782b27d47c4b5e74d505aecfee661ff9df4e0 (diff) | |
download | fastd-0e8493ea17c1bba64ee0de588bdbad7fdb6fd9ba.tar fastd-0e8493ea17c1bba64ee0de588bdbad7fdb6fd9ba.zip |
Use peer-specific interface in TUN mode
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); +} |