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 242 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 85 of file sample-client-connect.c.
Referenced by cc_handle_deferred_v1(), openvpn_plugin_client_connect(), openvpn_plugin_client_connect_v2(), openvpn_plugin_func_v1(), 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 346 of file sample-client-connect.c.
References cc_handle_deferred_v1(), get_env(), 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 469 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 393 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 596 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 603 of file sample-client-connect.c.
OPENVPN_EXPORT void openvpn_plugin_close_v1 | ( | openvpn_plugin_handle_t | handle | ) |
Definition at line 610 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 527 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.
References atoi_null0(), openvpn_plugin_args_open_in::callbacks, openvpn_plugin_args_open_in::envp, get_env(), openvpn_plugin_args_open_return::handle, MODULE, OPENVPN_PLUGIN_CLIENT_CONNECT, OPENVPN_PLUGIN_CLIENT_CONNECT_DEFER_V2, OPENVPN_PLUGIN_CLIENT_CONNECT_V2, OPENVPN_PLUGIN_CLIENT_DISCONNECT, OPENVPN_PLUGIN_DOWN, OPENVPN_PLUGIN_FUNC_ERROR, OPENVPN_PLUGIN_FUNC_SUCCESS, OPENVPN_PLUGIN_IPCHANGE, OPENVPN_PLUGIN_LEARN_ADDRESS, OPENVPN_PLUGIN_MASK, OPENVPN_PLUGIN_ROUTE_UP, OPENVPN_PLUGIN_TLS_FINAL, OPENVPN_PLUGIN_TLS_VERIFY, OPENVPN_PLUGIN_UP, PLOG_NOTE, plugin_base64_decode, openvpn_plugin_callbacks::plugin_base64_decode, plugin_log, openvpn_plugin_callbacks::plugin_log, plugin_secure_memzero, openvpn_plugin_callbacks::plugin_secure_memzero, and openvpn_plugin_args_open_return::type_mask.
int write_cc_options_file | ( | const char * | name, |
const char ** | envp | ||
) |
Definition at line 206 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 56 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 53 of file sample-client-connect.c.
Referenced by openvpn_plugin_open_v3().
|
static |
Definition at line 51 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().