OpenVPN
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdbool.h>
#include <fcntl.h>
#include <sys/types.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 |
Macros | |
#define | OPENVPN_PLUGIN_VERSION_MIN 3 |
#define | OPENVPN_PLUGIN_STRUCTVER_MIN 5 |
Functions | |
static const char * | get_env (const char *name, const char *envp[]) |
static const char * | np (const char *str) |
static int | atoi_null0 (const char *str) |
OPENVPN_EXPORT int | openvpn_plugin_min_version_required_v1 () |
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) |
static int | auth_user_pass_verify (struct plugin_context *context, struct plugin_per_client_context *pcc, const char *argv[], const char *envp[]) |
OPENVPN_EXPORT int | openvpn_plugin_func_v3 (const int v3structver, struct openvpn_plugin_args_func_in const *args, struct openvpn_plugin_args_func_return *ret) |
OPENVPN_EXPORT void * | openvpn_plugin_client_constructor_v1 (openvpn_plugin_handle_t handle) |
OPENVPN_EXPORT void | openvpn_plugin_client_destructor_v1 (openvpn_plugin_handle_t handle, void *per_client_context) |
OPENVPN_EXPORT void | openvpn_plugin_close_v1 (openvpn_plugin_handle_t handle) |
Variables | |
static plugin_log_t | plugin_log = NULL |
static char * | MODULE = "defer/simple" |
#define OPENVPN_PLUGIN_STRUCTVER_MIN 5 |
Definition at line 80 of file simple.c.
Referenced by openvpn_plugin_func_v3(), and openvpn_plugin_open_v3().
#define OPENVPN_PLUGIN_VERSION_MIN 3 |
Definition at line 79 of file simple.c.
Referenced by openvpn_plugin_min_version_required_v1().
|
static |
Definition at line 141 of file simple.c.
References OPENVPN_EXPORT.
Referenced by openvpn_plugin_open_v3().
|
static |
Definition at line 224 of file simple.c.
References get_env(), MODULE, np(), OPENVPN_EXPORT, OPENVPN_PLUGIN_FUNC_DEFERRED, OPENVPN_PLUGIN_FUNC_ERROR, OPENVPN_PLUGIN_FUNC_SUCCESS, plugin_context::password, PLOG_ERR, PLOG_ERRNO, PLOG_NOTE, plugin_log, sleep, plugin_context::test_deferred_auth, plugin_context::username, and write.
Referenced by openvpn_plugin_func_v3().
|
static |
Definition at line 105 of file simple.c.
Referenced by auth_user_pass_verify(), and openvpn_plugin_open_v3().
|
static |
Definition at line 128 of file simple.c.
Referenced by auth_user_pass_verify(), ce_management_query_proxy(), ce_management_query_remote(), management_client_auth(), print_key_filename(), and tls_lock_username().
OPENVPN_EXPORT void* openvpn_plugin_client_constructor_v1 | ( | openvpn_plugin_handle_t | handle | ) |
Definition at line 374 of file simple.c.
References MODULE, OPENVPN_EXPORT, PLOG_NOTE, and plugin_log.
OPENVPN_EXPORT void openvpn_plugin_client_destructor_v1 | ( | openvpn_plugin_handle_t | handle, |
void * | per_client_context | ||
) |
Definition at line 381 of file simple.c.
References free, MODULE, OPENVPN_EXPORT, PLOG_NOTE, and plugin_log.
OPENVPN_EXPORT void openvpn_plugin_close_v1 | ( | openvpn_plugin_handle_t | handle | ) |
OPENVPN_EXPORT int openvpn_plugin_func_v3 | ( | const int | v3structver, |
struct openvpn_plugin_args_func_in const * | args, | ||
struct openvpn_plugin_args_func_return * | ret | ||
) |
Definition at line 312 of file simple.c.
References openvpn_plugin_args_func_in::argv, auth_user_pass_verify(), openvpn_plugin_args_func_in::envp, openvpn_plugin_args_func_in::handle, MODULE, OPENVPN_EXPORT, OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY, 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_ROUTE_UP, OPENVPN_PLUGIN_STRUCTVER_MIN, OPENVPN_PLUGIN_TLS_FINAL, OPENVPN_PLUGIN_TLS_VERIFY, OPENVPN_PLUGIN_UP, openvpn_plugin_args_func_in::per_client_context, PLOG_NOTE, plugin_log, and openvpn_plugin_args_func_in::type.
OPENVPN_EXPORT int openvpn_plugin_min_version_required_v1 | ( | void | ) |
Definition at line 155 of file simple.c.
References OPENVPN_EXPORT, and OPENVPN_PLUGIN_VERSION_MIN.
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 162 of file simple.c.
References atoi_null0(), openvpn_plugin_args_open_in::callbacks, openvpn_plugin_args_open_in::envp, free, get_env(), openvpn_plugin_args_open_return::handle, MODULE, OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY, 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_STRUCTVER_MIN, OPENVPN_PLUGIN_TLS_FINAL, OPENVPN_PLUGIN_TLS_VERIFY, OPENVPN_PLUGIN_UP, PLOG_NOTE, plugin_log, openvpn_plugin_callbacks::plugin_log, plugin_context::test_deferred_auth, plugin_context::test_packet_filter, and openvpn_plugin_args_open_return::type_mask.
|
static |
Definition at line 97 of file simple.c.
Referenced by auth_user_pass_verify(), openvpn_plugin_client_constructor_v1(), openvpn_plugin_client_destructor_v1(), openvpn_plugin_close_v1(), openvpn_plugin_func_v3(), and openvpn_plugin_open_v3().
|
static |
Definition at line 66 of file simple.c.
Referenced by auth_user_pass_verify(), openvpn_plugin_client_constructor_v1(), openvpn_plugin_client_destructor_v1(), openvpn_plugin_close_v1(), openvpn_plugin_func_v3(), and openvpn_plugin_open_v3().