OpenVPN
Data Structures | Functions | Variables
sample-client-connect.c File Reference
#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"
Include dependency graph for sample-client-connect.c:

Go to the source code of this file.

Data Structures

struct  plugin_context
 
struct  plugin_per_client_context
 

Functions

static const char * get_env (const char *name, const char *envp[])
 
static int atoi_null0 (const char *str)
 
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)
 
int write_cc_options_file (const char *name, const char **envp)
 
int cc_handle_deferred_v1 (int seconds, const char *name, const char **envp)
 
int openvpn_plugin_client_connect (struct plugin_context *context, const char **argv, const char **envp)
 
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)
 
int openvpn_plugin_client_connect_defer_v2 (struct plugin_context *context, struct plugin_per_client_context *pcc, struct openvpn_plugin_string_list **return_list)
 
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)
 
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 plugin_secure_memzero_t plugin_secure_memzero = NULL
 
static plugin_base64_decode_t plugin_base64_decode = NULL
 
static char * MODULE = "sample-cc"
 

Function Documentation

◆ atoi_null0()

static int atoi_null0 ( const char *  str)
static

Definition at line 108 of file sample-client-connect.c.

References OPENVPN_EXPORT.

Referenced by openvpn_plugin_open_v3().

◆ cc_handle_deferred_v1()

int cc_handle_deferred_v1 ( int  seconds,
const char *  name,
const char **  envp 
)

◆ get_env()

static const char* get_env ( const char *  name,
const char *  envp[] 
)
static

◆ openvpn_plugin_client_connect()

int openvpn_plugin_client_connect ( struct plugin_context context,
const char **  argv,
const char **  envp 
)

◆ openvpn_plugin_client_connect_defer_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 
)

◆ openvpn_plugin_client_connect_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 
)

◆ openvpn_plugin_client_constructor_v1()

OPENVPN_EXPORT void* openvpn_plugin_client_constructor_v1 ( openvpn_plugin_handle_t  handle)

Definition at line 590 of file sample-client-connect.c.

References OPENVPN_EXPORT.

◆ openvpn_plugin_client_destructor_v1()

OPENVPN_EXPORT void openvpn_plugin_client_destructor_v1 ( openvpn_plugin_handle_t  handle,
void *  per_client_context 
)

Definition at line 597 of file sample-client-connect.c.

References free, and OPENVPN_EXPORT.

◆ openvpn_plugin_close_v1()

OPENVPN_EXPORT void openvpn_plugin_close_v1 ( openvpn_plugin_handle_t  handle)

Definition at line 604 of file sample-client-connect.c.

References free.

◆ openvpn_plugin_func_v2()

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 
)

◆ openvpn_plugin_open_v3()

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 
)

◆ write_cc_options_file()

int write_cc_options_file ( const char *  name,
const char **  envp 
)

Variable Documentation

◆ MODULE

char* MODULE = "sample-cc"
static

◆ plugin_base64_decode

plugin_base64_decode_t plugin_base64_decode = NULL
static

Definition at line 53 of file sample-client-connect.c.

Referenced by openvpn_plugin_open_v3().

◆ plugin_log

plugin_log_t plugin_log = NULL
static

◆ plugin_secure_memzero

plugin_secure_memzero_t plugin_secure_memzero = NULL
static

Definition at line 52 of file sample-client-connect.c.

Referenced by openvpn_plugin_open_v3().