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

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"
 

Macro Definition Documentation

◆ OPENVPN_PLUGIN_STRUCTVER_MIN

#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().

◆ OPENVPN_PLUGIN_VERSION_MIN

#define OPENVPN_PLUGIN_VERSION_MIN   3

Definition at line 79 of file simple.c.

Referenced by openvpn_plugin_min_version_required_v1().

Function Documentation

◆ atoi_null0()

static int atoi_null0 ( const char *  str)
static

Definition at line 141 of file simple.c.

References OPENVPN_EXPORT.

Referenced by openvpn_plugin_open_v3().

◆ auth_user_pass_verify()

static int auth_user_pass_verify ( struct plugin_context context,
struct plugin_per_client_context pcc,
const char *  argv[],
const char *  envp[] 
)
static

◆ get_env()

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

Definition at line 105 of file simple.c.

Referenced by auth_user_pass_verify(), and openvpn_plugin_open_v3().

◆ np()

static const char* np ( const char *  str)
static

◆ openvpn_plugin_client_constructor_v1()

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_plugin_client_destructor_v1()

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_plugin_close_v1()

OPENVPN_EXPORT void openvpn_plugin_close_v1 ( openvpn_plugin_handle_t  handle)

Definition at line 388 of file simple.c.

References free, MODULE, PLOG_NOTE, and plugin_log.

◆ openvpn_plugin_func_v3()

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_plugin_min_version_required_v1()

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_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 
)

Variable Documentation

◆ MODULE

char* MODULE = "defer/simple"
static

◆ plugin_log

plugin_log_t plugin_log = NULL
static