OpenVPN
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "openvpn-plugin.h"
Go to the source code of this file.
Macros | |
#define | PLUGIN_NAME "base64.c" |
Functions | |
static const char * | get_env (const char *name, const char *envp[]) |
Search the environment pointer for a specific env var name. | |
OPENVPN_EXPORT int | openvpn_plugin_open_v3 (const int v3structver, struct openvpn_plugin_args_open_in const *args, struct openvpn_plugin_args_open_return *ret) |
This function is called when OpenVPN loads the plug-in. | |
OPENVPN_EXPORT int | openvpn_plugin_func_v1 (openvpn_plugin_handle_t handle, const int type, const char *argv[], const char *envp[]) |
This function is called by OpenVPN each time the OpenVPN reaches a point where plug-in calls should happen. | |
OPENVPN_EXPORT void | openvpn_plugin_close_v1 (openvpn_plugin_handle_t handle) |
This cleans up the last part of the plug-in, allows it to shut down cleanly and release the plug-in global context buffer. | |
Variables | |
plugin_log_t | ovpn_log = NULL |
Pointer to the OpenVPN log function. | |
plugin_vlog_t | ovpn_vlog = NULL |
Pointer to the OpenVPN vlog function. | |
plugin_base64_encode_t | ovpn_base64_encode = NULL |
Pointer to the openvpn_base64_encode () function. | |
plugin_base64_decode_t | ovpn_base64_decode = NULL |
Pointer to the openvpn_base64_decode () function. | |
|
static |
Search the environment pointer for a specific env var name.
PLEASE NOTE! The result is not valid outside the local scope of the calling function. Once the calling function returns, any returned pointers are invalid.
name | String containing the env.var name to search for |
envp | String array pointer to the environment variables |
Definition at line 54 of file base64.c.
Referenced by openvpn_plugin_func_v1().
OPENVPN_EXPORT void openvpn_plugin_close_v1 | ( | openvpn_plugin_handle_t | handle | ) |
OPENVPN_EXPORT int openvpn_plugin_func_v1 | ( | openvpn_plugin_handle_t | handle, |
const int | type, | ||
const char * | argv[], | ||
const char * | envp[] | ||
) |
This function is called by OpenVPN each time the OpenVPN reaches a point where plug-in calls should happen.
It only happens for those plug-in hooks enabled in openvpn_plugin_open_v3().
For the arguments, see the include/openvpn-plugin.h file for details on the function parameters
handle | Pointer to the plug-in global context buffer, which need to be released by this function |
type | Type of the hook |
argv | String array pointer to arguments for the hook |
envp | String array pointer to current environment variables |
Definition at line 155 of file base64.c.
References get_env(), ovpn_base64_decode, ovpn_base64_encode, ovpn_log, and PLUGIN_NAME.
OPENVPN_EXPORT int openvpn_plugin_open_v3 | ( | const int | v3structver, |
struct openvpn_plugin_args_open_in const * | args, | ||
struct openvpn_plugin_args_open_return * | ret | ||
) |
This function is called when OpenVPN loads the plug-in.
The purpose is to initialize the plug-in and tell OpenVPN which plug-in hooks this plug-in wants to be involved in
For the arguments, see the include/openvpn-plugin.h file for details on the function parameters
v3structver | An integer containing the API version of the plug-in structs OpenVPN uses |
args | A pointer to the argument struct for information and features provided by OpenVPN to the plug-in |
ret | A pointer to the struct OpenVPN uses to receive information back from the plug-in |
Definition at line 99 of file base64.c.
References ovpn_base64_decode, ovpn_base64_encode, ovpn_log, ovpn_vlog, and PLUGIN_NAME.
plugin_base64_decode_t ovpn_base64_decode = NULL |
Pointer to the openvpn_base64_decode () function.
Definition at line 37 of file base64.c.
Referenced by openvpn_plugin_func_v1(), and openvpn_plugin_open_v3().
plugin_base64_encode_t ovpn_base64_encode = NULL |
Pointer to the openvpn_base64_encode () function.
Definition at line 36 of file base64.c.
Referenced by openvpn_plugin_func_v1(), and openvpn_plugin_open_v3().
plugin_log_t ovpn_log = NULL |
Pointer to the OpenVPN log function.
See plugin_log()
Definition at line 34 of file base64.c.
Referenced by openvpn_plugin_func_v1(), and openvpn_plugin_open_v3().
plugin_vlog_t ovpn_vlog = NULL |
Pointer to the OpenVPN vlog function.
See plugin_vlog()
Definition at line 35 of file base64.c.
Referenced by openvpn_plugin_open_v3().