Defines | Functions

eurephia-auth.c File Reference

Implements the API which the OpenVPN plug-in interface requires. More...

#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "openvpn-plugin.h"
#include <eurephiafw_struct.h>
#include <eurephia_context.h>
#include <eurephiadb.h>
#include <eurephia.h>
#include <eurephia_nullsafe.h>
#include <environment.h>
Include dependency graph for eurephia-auth.c:

Go to the source code of this file.

Functions

static const char * plugin_type_name (const int type)
static void dump_env (FILE *f, const char *prefix, const char *envp[])
static void daemonize (const char *envp[])
OPENVPN_EXPORT
openvpn_plugin_handle_t 
openvpn_plugin_open_v1 (unsigned int *type_mask, const char *argv[], const char *envp[])
OPENVPN_EXPORT int openvpn_plugin_func_v1 (openvpn_plugin_handle_t handle, const int type, const char *argv[], const char *envp[])
OPENVPN_EXPORT void openvpn_plugin_close_v1 (openvpn_plugin_handle_t handle)

Detailed Description

Implements the API which the OpenVPN plug-in interface requires.

Author:
David Sommerseth <dazo@users.sourceforge.net>
Date:
2008-08-06

Definition in file eurephia-auth.c.


Function Documentation

static void daemonize ( const char *  envp[]  )  [static]

daemonize if "daemon" environment variable is set. preserves stderr access after being daemonized, but only if "daemon_log_direct" environment variable is set.

Parameters:
envp openvpn environmental table

< Maximum allowed length of the daemon configuration value

< Maximum allowed length of daemon_log_redirect config value

Definition at line 112 of file eurephia-auth.c.

Here is the caller graph for this function:

static void dump_env ( FILE *  f,
const char *  prefix,
const char *  envp[] 
) [static]

Dumps the contents of the environmental table to the given FILE. This function is only available if DEBUG is defined during compilation. If SHOW_SECRETS is not defined, it will mask the contents of the password field, if found.

Parameters:
f FILE * where the contents will be dumped
prefix Adds a fixed prefix to each of the lines
envp openvpn environmental table

Definition at line 91 of file eurephia-auth.c.

Here is the caller graph for this function:

OPENVPN_EXPORT void openvpn_plugin_close_v1 ( openvpn_plugin_handle_t  handle  ) 

Called when openvpn is shutting down. This makes sure that eurephia disconnects, unloads drivers and frees the memory it has been using.

Parameters:
handle Contains a pointer to the eurephiaCTX

Definition at line 236 of file eurephia-auth.c.

Here is the call graph for this function:

OPENVPN_EXPORT int openvpn_plugin_func_v1 ( openvpn_plugin_handle_t  handle,
const int  type,
const char *  argv[],
const char *  envp[] 
)

On each hook defined in openvpn_plugin_open_v1(), this function will be called when openvpn reaches that phase.

Parameters:
handle Contains a pointer to the eurephiaCTX
type What kind of event is openvpn processing now
argv openvpn arguments for the current event
envp openvpn environmental table
Returns:
Returns OPENVPN_PLUGIN_FUNC_SUCCESS on success, otherwise OPENVPN_PLUGIN_FUNC_ERROR

< Messages intended when debugging. Only for log level > 10

< Alias for LOG_FATAL

< Operation failed and cannot continue. Log level always < 2

Definition at line 180 of file eurephia-auth.c.

Here is the call graph for this function:

OPENVPN_EXPORT openvpn_plugin_handle_t openvpn_plugin_open_v1 ( unsigned int *  type_mask,
const char *  argv[],
const char *  envp[] 
)

Prepares a eurephiaCTX (context) for the openvpn process and tells openvpn which hooks eurephia will make use of.

Parameters:
type_mask int pointer, containing the hooks eurephia will make use of
argv arguments from the openvpn --plugin configuration option.
envp openvpn environmental table
Returns:
Returns a pointer to the eurephiaCTX.

Definition at line 143 of file eurephia-auth.c.

Here is the call graph for this function:

static const char* plugin_type_name ( const int  type  )  [static]

Simple "converter" from OPENVPN_PLUGIN_* type IDs to string

Parameters:
type int value, corresponding to an OPENVPN_PLUGIN_* type
Returns:
String containing the string version of the type

Definition at line 54 of file eurephia-auth.c.

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines