diff options
Diffstat (limited to 'plugin/environment.h')
| -rw-r--r-- | plugin/environment.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/plugin/environment.h b/plugin/environment.h index dbefe25..12b0d0b 100644 --- a/plugin/environment.h +++ b/plugin/environment.h @@ -49,6 +49,29 @@ */ char *get_env(eurephiaCTX *ctx, int logmasking, size_t len, const char *envp[], const char *fmt, ... ); +#define MAXLEN_DEVNAME 64 /**< Maximum allowed length of the device name of the tunnel device */ +/** + * Macro for retrieving the OpenVPN tunnel device name (openvpn --dev option) + * + * @param ctx eurephiaCTX + * @param env Char array pointer to the environment table where the value resides + * + * @return Returns a pointer to a new memory region with the value. This region must be freed after use. + * @see get_env() + */ +#define GETENV_DEVNAME(ctx, env) get_env(ctx, 0, MAXLEN_DEVNAME, env, "dev"); + +#define MAXLEN_DEVTYPE 8 /**< Maximum allowed length of the device type of the tunnel device */ +/** + * Macro for retrieving the OpenVPN tunnel device type (openvpn --dev-type option) + * + * @param ctx eurephiaCTX + * @param env Char array pointer to the environment table where the value resides + * + * @return Returns a pointer to a new memory region with the value. This region must be freed after use. + * @see get_env() + */ +#define GETENV_DEVTYPE(ctx, env) get_env(ctx, 0, MAXLEN_DEVTYPE, env, "dev_type"); #define MAXLEN_TLSID 2048 /**< Maximum allowed length of the TLS ID string*/ /** |
