|
OpenVPN
|
#include "config.h"#include <stdio.h>#include <string.h>#include <stdlib.h>#include <stdbool.h>#include <unistd.h>#include <fcntl.h>#include <sys/wait.h>#include "openvpn-plugin.h"
Go to the source code of this file.
Data Structures | |
| struct | plugin_context |
| struct | plugin_per_client_context |
Variables | |
| static plugin_log_t | plugin_log = NULL |
| static plugin_secure_memzero_t | plugin_secure_memzero = NULL |
| static plugin_base64_decode_t | plugin_base64_decode = NULL |
| static char * | MODULE = "sample-cc" |
|
static |
Definition at line 108 of file sample-client-connect.c.
Referenced by openvpn_plugin_open_v3().
| int cc_handle_deferred_v1 | ( | int | seconds, |
| const char * | name, | ||
| const char ** | envp | ||
| ) |
Definition at line 241 of file sample-client-connect.c.
References get_env(), MODULE, OPENVPN_PLUGIN_FUNC_DEFERRED, OPENVPN_PLUGIN_FUNC_ERROR, OPENVPN_PLUGIN_FUNC_SUCCESS, PLOG_ERR, PLOG_ERRNO, PLOG_NOTE, plugin_log, sleep, write, and write_cc_options_file().
Referenced by openvpn_plugin_client_connect().
|
static |
Definition at line 86 of file sample-client-connect.c.
References i.
Referenced by cc_handle_deferred_v1(), openvpn_plugin_client_connect(), openvpn_plugin_client_connect_v2(), openvpn_plugin_func_v1(), openvpn_plugin_open_v3(), openvpn_plugin_open_v3(), and write_cc_options_file().
| int openvpn_plugin_client_connect | ( | struct plugin_context * | context, |
| const char ** | argv, | ||
| const char ** | envp | ||
| ) |
Definition at line 347 of file sample-client-connect.c.
References cc_handle_deferred_v1(), get_env(), i, MODULE, OPENVPN_PLUGIN_FUNC_ERROR, PLOG_NOTE, plugin_log, and write_cc_options_file().
Referenced by openvpn_plugin_func_v2().
| int openvpn_plugin_client_connect_defer_v2 | ( | struct plugin_context * | context, |
| struct plugin_per_client_context * | pcc, | ||
| struct openvpn_plugin_string_list ** | return_list | ||
| ) |
Definition at line 467 of file sample-client-connect.c.
References plugin_per_client_context::client_config, MODULE, openvpn_plugin_string_list::name, OPENVPN_PLUGIN_FUNC_DEFERRED, OPENVPN_PLUGIN_FUNC_ERROR, OPENVPN_PLUGIN_FUNC_SUCCESS, PLOG_ERR, PLOG_NOTE, plugin_log, plugin_per_client_context::sleep_until, openvpn_plugin_string_list::value, plugin_per_client_context::want_disable, and plugin_per_client_context::want_fail.
Referenced by openvpn_plugin_func_v2().
| int openvpn_plugin_client_connect_v2 | ( | struct plugin_context * | context, |
| struct plugin_per_client_context * | pcc, | ||
| const char ** | envp, | ||
| struct openvpn_plugin_string_list ** | return_list | ||
| ) |
Definition at line 392 of file sample-client-connect.c.
References plugin_per_client_context::client_config, get_env(), MODULE, openvpn_plugin_string_list::name, OPENVPN_PLUGIN_FUNC_DEFERRED, OPENVPN_PLUGIN_FUNC_ERROR, OPENVPN_PLUGIN_FUNC_SUCCESS, PLOG_ERR, PLOG_NOTE, plugin_log, plugin_per_client_context::sleep_until, openvpn_plugin_string_list::value, plugin_per_client_context::want_disable, and plugin_per_client_context::want_fail.
Referenced by openvpn_plugin_func_v2().
| OPENVPN_EXPORT void * openvpn_plugin_client_constructor_v1 | ( | openvpn_plugin_handle_t | handle | ) |
Definition at line 586 of file sample-client-connect.c.
| OPENVPN_EXPORT void openvpn_plugin_client_destructor_v1 | ( | openvpn_plugin_handle_t | handle, |
| void * | per_client_context | ||
| ) |
Definition at line 593 of file sample-client-connect.c.
| OPENVPN_EXPORT void openvpn_plugin_close_v1 | ( | openvpn_plugin_handle_t | handle | ) |
Definition at line 600 of file sample-client-connect.c.
| OPENVPN_EXPORT int openvpn_plugin_func_v2 | ( | openvpn_plugin_handle_t | handle, |
| const int | type, | ||
| const char * | argv[], | ||
| const char * | envp[], | ||
| void * | per_client_context, | ||
| struct openvpn_plugin_string_list ** | return_list | ||
| ) |
Definition at line 522 of file sample-client-connect.c.
References MODULE, OPENVPN_PLUGIN_CLIENT_CONNECT, openvpn_plugin_client_connect(), OPENVPN_PLUGIN_CLIENT_CONNECT_DEFER_V2, openvpn_plugin_client_connect_defer_v2(), OPENVPN_PLUGIN_CLIENT_CONNECT_V2, openvpn_plugin_client_connect_v2(), OPENVPN_PLUGIN_CLIENT_DISCONNECT, OPENVPN_PLUGIN_DOWN, OPENVPN_PLUGIN_FUNC_SUCCESS, OPENVPN_PLUGIN_IPCHANGE, OPENVPN_PLUGIN_LEARN_ADDRESS, OPENVPN_PLUGIN_ROUTE_UP, OPENVPN_PLUGIN_TLS_FINAL, OPENVPN_PLUGIN_TLS_VERIFY, OPENVPN_PLUGIN_UP, PLOG_NOTE, and plugin_log.
| 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 | ||
| ) |
Definition at line 122 of file sample-client-connect.c.
| int write_cc_options_file | ( | const char * | name, |
| const char ** | envp | ||
| ) |
Definition at line 205 of file sample-client-connect.c.
References get_env(), MODULE, OPENVPN_PLUGIN_FUNC_ERROR, OPENVPN_PLUGIN_FUNC_SUCCESS, PLOG_ERR, PLOG_NOTE, and plugin_log.
Referenced by cc_handle_deferred_v1(), and openvpn_plugin_client_connect().
|
static |
Definition at line 55 of file sample-client-connect.c.
Referenced by cc_handle_deferred_v1(), openvpn_plugin_client_connect(), openvpn_plugin_client_connect_defer_v2(), openvpn_plugin_client_connect_v2(), openvpn_plugin_func_v2(), openvpn_plugin_open_v3(), and write_cc_options_file().
|
static |
Definition at line 52 of file sample-client-connect.c.
Referenced by openvpn_plugin_open_v3().
|
static |
Definition at line 50 of file sample-client-connect.c.
Referenced by cc_handle_deferred_v1(), openvpn_plugin_client_connect(), openvpn_plugin_client_connect_defer_v2(), openvpn_plugin_client_connect_v2(), openvpn_plugin_func_v2(), openvpn_plugin_open_v3(), and write_cc_options_file().
|
static |
Definition at line 51 of file sample-client-connect.c.
Referenced by openvpn_plugin_open_v3().