OpenVPN
Data Structures | Macros | Functions | Variables
multi-auth.c File Reference
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.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 multi-auth.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 void plog (const struct plugin_context *ctx, int flags, char *fmt,...)
 
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 bool do_auth_user_pass (struct plugin_context *context, const char *username, const char *password)
 
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 char * MODULE = "multi-auth"
 
static plugin_vlog_t _plugin_vlog_func = NULL
 

Macro Definition Documentation

◆ OPENVPN_PLUGIN_STRUCTVER_MIN

#define OPENVPN_PLUGIN_STRUCTVER_MIN   5

Definition at line 108 of file multi-auth.c.

◆ OPENVPN_PLUGIN_VERSION_MIN

#define OPENVPN_PLUGIN_VERSION_MIN   3

Definition at line 107 of file multi-auth.c.

Function Documentation

◆ atoi_null0()

static int atoi_null0 ( const char *  str)
static

Definition at line 159 of file multi-auth.c.

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

◆ do_auth_user_pass()

static bool do_auth_user_pass ( struct plugin_context context,
const char *  username,
const char *  password 
)
static

◆ get_env()

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

Definition at line 123 of file multi-auth.c.

Referenced by auth_user_pass_verify().

◆ 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 393 of file multi-auth.c.

References plog(), and PLOG_NOTE.

◆ 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 401 of file multi-auth.c.

References plog(), and PLOG_NOTE.

◆ openvpn_plugin_close_v1()

OPENVPN_EXPORT void openvpn_plugin_close_v1 ( openvpn_plugin_handle_t  handle)

Definition at line 409 of file multi-auth.c.

References plog(), and PLOG_NOTE.

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

Definition at line 173 of file multi-auth.c.

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

◆ plog()

static void plog ( const struct plugin_context ctx,
int  flags,
char *  fmt,
  ... 
)
static

Variable Documentation

◆ _plugin_vlog_func

plugin_vlog_t _plugin_vlog_func = NULL
static

Definition at line 74 of file multi-auth.c.

Referenced by openvpn_plugin_open_v3(), and plog().

◆ MODULE

char* MODULE = "multi-auth"
static

Definition at line 60 of file multi-auth.c.

Referenced by openvpn_plugin_func_v3(), openvpn_plugin_open_v3(), and plog().