summaryrefslogtreecommitdiff
path: root/include/openvpn-plugin.h.in
diff options
context:
space:
mode:
authorAlberto Gonzalez Iniesta <agi@inittab.org>2016-12-27 18:25:47 +0100
committerAlberto Gonzalez Iniesta <agi@inittab.org>2016-12-27 18:25:47 +0100
commit79f3537f69e125f19f59c36aa090120a63186a54 (patch)
tree2089a3b7dac990841dbc2e4d9b2f535b82dbb0af /include/openvpn-plugin.h.in
parentf2137fedb30cb87448eb03b2f288920df6187571 (diff)
parent3a2bbdb05ca6a6996e424c9fb225cb0d53804125 (diff)
Merge tag 'upstream/2.4.0'
Upstream version 2.4.0
Diffstat (limited to 'include/openvpn-plugin.h.in')
-rw-r--r--include/openvpn-plugin.h.in184
1 files changed, 92 insertions, 92 deletions
diff --git a/include/openvpn-plugin.h.in b/include/openvpn-plugin.h.in
index 34ad18b..0b30352 100644
--- a/include/openvpn-plugin.h.in
+++ b/include/openvpn-plugin.h.in
@@ -5,7 +5,7 @@
* packet encryption, packet authentication, and
* packet compression.
*
- * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2002-2017 OpenVPN Technologies, Inc. <sales@openvpn.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
@@ -34,7 +34,7 @@
#define __OPENVPN_X509_CERT_T_DECLARED
typedef mbedtls_x509_crt openvpn_x509_cert_t;
#endif
-#else
+#else /* ifdef ENABLE_CRYPTO_MBEDTLS */
#include <openssl/x509.h>
#ifndef __OPENVPN_X509_CERT_T_DECLARED
#define __OPENVPN_X509_CERT_T_DECLARED
@@ -85,7 +85,7 @@ extern "C" {
*
* FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_CLIENT_CONNECT_V2
* FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_LEARN_ADDRESS
- *
+ *
* [Client session ensues]
*
* For each "TLS soft reset", according to reneg-sec option (or similar):
@@ -96,7 +96,7 @@ extern "C" {
* in the server chain)
* FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY
* FUNC: openvpn_plugin_func_v1 OPENVPN_PLUGIN_TLS_FINAL
- *
+ *
* [If OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY returned OPENVPN_PLUGIN_FUNC_DEFERRED,
* we expect that authentication is verified via auth_control_file within
* the number of seconds defined by the "hand-window" option. Data channel traffic
@@ -155,9 +155,9 @@ typedef void *openvpn_plugin_handle_t;
* For Windows (needs to be modified for MSVC)
*/
#if defined(_WIN32) && !defined(OPENVPN_PLUGIN_H)
-# define OPENVPN_EXPORT __declspec(dllexport)
+#define OPENVPN_EXPORT __declspec(dllexport)
#else
-# define OPENVPN_EXPORT
+#define OPENVPN_EXPORT
#endif
/*
@@ -172,7 +172,7 @@ typedef void *openvpn_plugin_handle_t;
#define OPENVPN_PLUGIN_DEF typedef
#define OPENVPN_PLUGIN_FUNC(name) (*name)
-#else
+#else /* ifdef OPENVPN_PLUGIN_H */
/*
* We are compiling plugin.
@@ -191,9 +191,9 @@ typedef void *openvpn_plugin_handle_t;
*/
struct openvpn_plugin_string_list
{
- struct openvpn_plugin_string_list *next;
- char *name;
- char *value;
+ struct openvpn_plugin_string_list *next;
+ char *name;
+ char *value;
};
@@ -226,35 +226,35 @@ struct openvpn_plugin_string_list
*/
typedef enum
{
- PLOG_ERR = (1 << 0), /* Error condition message */
- PLOG_WARN = (1 << 1), /* General warning message */
- PLOG_NOTE = (1 << 2), /* Informational message */
- PLOG_DEBUG = (1 << 3), /* Debug message, displayed if verb >= 7 */
+ PLOG_ERR = (1 << 0),/* Error condition message */
+ PLOG_WARN = (1 << 1),/* General warning message */
+ PLOG_NOTE = (1 << 2),/* Informational message */
+ PLOG_DEBUG = (1 << 3),/* Debug message, displayed if verb >= 7 */
- PLOG_ERRNO = (1 << 8), /* Add error description to message */
- PLOG_NOMUTE = (1 << 9), /* Mute setting does not apply for message */
+ PLOG_ERRNO = (1 << 8),/* Add error description to message */
+ PLOG_NOMUTE = (1 << 9), /* Mute setting does not apply for message */
} openvpn_plugin_log_flags_t;
#ifdef __GNUC__
#if __USE_MINGW_ANSI_STDIO
-# define _ovpn_chk_fmt(a, b) __attribute__ ((format(gnu_printf, (a), (b))))
+#define _ovpn_chk_fmt(a, b) __attribute__ ((format(gnu_printf, (a), (b))))
#else
-# define _ovpn_chk_fmt(a, b) __attribute__ ((format(__printf__, (a), (b))))
+#define _ovpn_chk_fmt(a, b) __attribute__ ((format(__printf__, (a), (b))))
#endif
-#else
-# define _ovpn_chk_fmt(a, b)
+#else /* ifdef __GNUC__ */
+#define _ovpn_chk_fmt(a, b)
#endif
-typedef void (*plugin_log_t) (openvpn_plugin_log_flags_t flags,
- const char *plugin_name,
- const char *format, ...) _ovpn_chk_fmt(3, 4);
+typedef void (*plugin_log_t)(openvpn_plugin_log_flags_t flags,
+ const char *plugin_name,
+ const char *format, ...) _ovpn_chk_fmt (3, 4);
-typedef void (*plugin_vlog_t) (openvpn_plugin_log_flags_t flags,
- const char *plugin_name,
- const char *format,
- va_list arglist) _ovpn_chk_fmt(3, 0);
+typedef void (*plugin_vlog_t)(openvpn_plugin_log_flags_t flags,
+ const char *plugin_name,
+ const char *format,
+ va_list arglist) _ovpn_chk_fmt (3, 0);
#undef _ovpn_chk_fmt
@@ -270,8 +270,8 @@ typedef void (*plugin_vlog_t) (openvpn_plugin_log_flags_t flags,
*/
struct openvpn_plugin_callbacks
{
- plugin_log_t plugin_log;
- plugin_vlog_t plugin_vlog;
+ plugin_log_t plugin_log;
+ plugin_vlog_t plugin_vlog;
};
/**
@@ -281,9 +281,9 @@ struct openvpn_plugin_callbacks
* and the plug-in against OpenSSL.
*/
typedef enum {
- SSLAPI_NONE,
- SSLAPI_OPENSSL,
- SSLAPI_MBEDTLS
+ SSLAPI_NONE,
+ SSLAPI_OPENSSL,
+ SSLAPI_MBEDTLS
} ovpnSSLAPI;
/**
@@ -309,15 +309,15 @@ typedef enum {
*/
struct openvpn_plugin_args_open_in
{
- const int type_mask;
- const char ** const argv;
- const char ** const envp;
- struct openvpn_plugin_callbacks *callbacks;
- const ovpnSSLAPI ssl_api;
- const char *ovpn_version;
- const unsigned int ovpn_version_major;
- const unsigned int ovpn_version_minor;
- const char * const ovpn_version_patch;
+ const int type_mask;
+ const char **const argv;
+ const char **const envp;
+ struct openvpn_plugin_callbacks *callbacks;
+ const ovpnSSLAPI ssl_api;
+ const char *ovpn_version;
+ const unsigned int ovpn_version_major;
+ const unsigned int ovpn_version_minor;
+ const char *const ovpn_version_patch;
};
@@ -344,9 +344,9 @@ struct openvpn_plugin_args_open_in
*/
struct openvpn_plugin_args_open_return
{
- int type_mask;
- openvpn_plugin_handle_t *handle;
- struct openvpn_plugin_string_list **return_list;
+ int type_mask;
+ openvpn_plugin_handle_t *handle;
+ struct openvpn_plugin_string_list **return_list;
};
/**
@@ -379,17 +379,17 @@ struct openvpn_plugin_args_open_return
*/
struct openvpn_plugin_args_func_in
{
- const int type;
- const char ** const argv;
- const char ** const envp;
- openvpn_plugin_handle_t handle;
- void *per_client_context;
+ const int type;
+ const char **const argv;
+ const char **const envp;
+ openvpn_plugin_handle_t handle;
+ void *per_client_context;
#ifdef ENABLE_CRYPTO
- int current_cert_depth;
- openvpn_x509_cert_t *current_cert;
+ int current_cert_depth;
+ openvpn_x509_cert_t *current_cert;
#else
- int __current_cert_depth_disabled; /* Unused, for compatibility purposes only */
- void *__current_cert_disabled; /* Unused, for compatibility purposes only */
+ int __current_cert_depth_disabled; /* Unused, for compatibility purposes only */
+ void *__current_cert_disabled; /* Unused, for compatibility purposes only */
#endif
};
@@ -407,7 +407,7 @@ struct openvpn_plugin_args_func_in
*/
struct openvpn_plugin_args_func_return
{
- struct openvpn_plugin_string_list **return_list;
+ struct openvpn_plugin_string_list **return_list;
};
/*
@@ -441,7 +441,7 @@ struct openvpn_plugin_args_func_return
* FUNCTION: openvpn_plugin_open_v2
*
* REQUIRED: YES
- *
+ *
* Called on initial plug-in load. OpenVPN will preserve plug-in state
* across SIGUSR1 restarts but not across SIGHUP restarts. A SIGHUP reset
* will cause the plugin to be closed and reopened.
@@ -473,10 +473,10 @@ struct openvpn_plugin_args_func_return
* An openvpn_plugin_handle_t value on success, NULL on failure
*/
OPENVPN_PLUGIN_DEF openvpn_plugin_handle_t OPENVPN_PLUGIN_FUNC(openvpn_plugin_open_v2)
- (unsigned int *type_mask,
- const char *argv[],
- const char *envp[],
- struct openvpn_plugin_string_list **return_list);
+ (unsigned int *type_mask,
+ const char *argv[],
+ const char *envp[],
+ struct openvpn_plugin_string_list **return_list);
/*
* FUNCTION: openvpn_plugin_func_v2
@@ -484,7 +484,7 @@ OPENVPN_PLUGIN_DEF openvpn_plugin_handle_t OPENVPN_PLUGIN_FUNC(openvpn_plugin_op
* Called to perform the work of a given script type.
*
* REQUIRED: YES
- *
+ *
* ARGUMENTS
*
* handle : the openvpn_plugin_handle_t value which was returned by
@@ -569,12 +569,12 @@ OPENVPN_PLUGIN_DEF openvpn_plugin_handle_t OPENVPN_PLUGIN_FUNC(openvpn_plugin_op
* authentication and client-specific packet filtering.
*/
OPENVPN_PLUGIN_DEF int OPENVPN_PLUGIN_FUNC(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_handle_t handle,
+ const int type,
+ const char *argv[],
+ const char *envp[],
+ void *per_client_context,
+ struct openvpn_plugin_string_list **return_list);
/*
@@ -589,8 +589,8 @@ OPENVPN_PLUGIN_DEF int OPENVPN_PLUGIN_FUNC(openvpn_plugin_func_v2)
* ARGUMENTS
*
* version : fixed value, defines the API version of the OpenVPN plug-in API. The plug-in
- * should validate that this value is matching the OPENVPN_PLUGINv3_STRUCTVER
- * value.
+ * should validate that this value is matching the OPENVPN_PLUGINv3_STRUCTVER
+ * value.
*
* arguments : Structure with all arguments available to the plug-in.
*
@@ -601,9 +601,9 @@ OPENVPN_PLUGIN_DEF int OPENVPN_PLUGIN_FUNC(openvpn_plugin_func_v2)
* OPENVPN_PLUGIN_FUNC_SUCCESS on success, OPENVPN_PLUGIN_FUNC_ERROR on failure
*/
OPENVPN_PLUGIN_DEF int OPENVPN_PLUGIN_FUNC(openvpn_plugin_open_v3)
- (const int version,
- struct openvpn_plugin_args_open_in const *arguments,
- struct openvpn_plugin_args_open_return *retptr);
+ (const int version,
+ struct openvpn_plugin_args_open_in const *arguments,
+ struct openvpn_plugin_args_open_return *retptr);
/*
* FUNCTION: openvpn_plugin_func_v3
@@ -685,15 +685,15 @@ OPENVPN_PLUGIN_DEF int OPENVPN_PLUGIN_FUNC(openvpn_plugin_open_v3)
* authentication and client-specific packet filtering.
*/
OPENVPN_PLUGIN_DEF int OPENVPN_PLUGIN_FUNC(openvpn_plugin_func_v3)
- (const int version,
- struct openvpn_plugin_args_func_in const *arguments,
- struct openvpn_plugin_args_func_return *retptr);
+ (const int version,
+ struct openvpn_plugin_args_func_in const *arguments,
+ struct openvpn_plugin_args_func_return *retptr);
/*
* FUNCTION: openvpn_plugin_close_v1
*
* REQUIRED: YES
- *
+ *
* ARGUMENTS
*
* handle : the openvpn_plugin_handle_t value which was returned by
@@ -702,13 +702,13 @@ OPENVPN_PLUGIN_DEF int OPENVPN_PLUGIN_FUNC(openvpn_plugin_func_v3)
* Called immediately prior to plug-in unload.
*/
OPENVPN_PLUGIN_DEF void OPENVPN_PLUGIN_FUNC(openvpn_plugin_close_v1)
- (openvpn_plugin_handle_t handle);
+ (openvpn_plugin_handle_t handle);
/*
* FUNCTION: openvpn_plugin_abort_v1
*
* REQUIRED: NO
- *
+ *
* ARGUMENTS
*
* handle : the openvpn_plugin_handle_t value which was returned by
@@ -719,7 +719,7 @@ OPENVPN_PLUGIN_DEF void OPENVPN_PLUGIN_FUNC(openvpn_plugin_close_v1)
* openvpn_plugin_open callback.
*/
OPENVPN_PLUGIN_DEF void OPENVPN_PLUGIN_FUNC(openvpn_plugin_abort_v1)
- (openvpn_plugin_handle_t handle);
+ (openvpn_plugin_handle_t handle);
/*
* FUNCTION: openvpn_plugin_client_constructor_v1
@@ -736,7 +736,7 @@ OPENVPN_PLUGIN_DEF void OPENVPN_PLUGIN_FUNC(openvpn_plugin_abort_v1)
* return a void * to this memory region.
*
* REQUIRED: NO
- *
+ *
* ARGUMENTS
*
* handle : the openvpn_plugin_handle_t value which was returned by
@@ -747,8 +747,8 @@ OPENVPN_PLUGIN_DEF void OPENVPN_PLUGIN_FUNC(openvpn_plugin_abort_v1)
* void * pointer to plugin's private per-client memory region, or NULL
* if no memory region is required.
*/
-OPENVPN_PLUGIN_DEF void * OPENVPN_PLUGIN_FUNC(openvpn_plugin_client_constructor_v1)
- (openvpn_plugin_handle_t handle);
+OPENVPN_PLUGIN_DEF void *OPENVPN_PLUGIN_FUNC(openvpn_plugin_client_constructor_v1)
+ (openvpn_plugin_handle_t handle);
/*
* FUNCTION: openvpn_plugin_client_destructor_v1
@@ -756,7 +756,7 @@ OPENVPN_PLUGIN_DEF void * OPENVPN_PLUGIN_FUNC(openvpn_plugin_client_constructor_
* This function is called on client instance object destruction.
*
* REQUIRED: NO
- *
+ *
* ARGUMENTS
*
* handle : the openvpn_plugin_handle_t value which was returned by
@@ -766,7 +766,7 @@ OPENVPN_PLUGIN_DEF void * OPENVPN_PLUGIN_FUNC(openvpn_plugin_client_constructor_
* openvpn_plugin_client_constructor_v1, if defined.
*/
OPENVPN_PLUGIN_DEF void OPENVPN_PLUGIN_FUNC(openvpn_plugin_client_destructor_v1)
- (openvpn_plugin_handle_t handle, void *per_client_context);
+ (openvpn_plugin_handle_t handle, void *per_client_context);
/*
* FUNCTION: openvpn_plugin_select_initialization_point_v1
@@ -779,7 +779,7 @@ OPENVPN_PLUGIN_DEF void OPENVPN_PLUGIN_FUNC(openvpn_plugin_client_destructor_v1)
* OPENVPN_PLUGIN_INIT_PRE_CONFIG_PARSE.
*
* REQUIRED: NO
- *
+ *
* RETURN VALUE:
*
* An OPENVPN_PLUGIN_INIT_x value.
@@ -790,35 +790,35 @@ OPENVPN_PLUGIN_DEF void OPENVPN_PLUGIN_FUNC(openvpn_plugin_client_destructor_v1)
#define OPENVPN_PLUGIN_INIT_POST_UID_CHANGE 4
OPENVPN_PLUGIN_DEF int OPENVPN_PLUGIN_FUNC(openvpn_plugin_select_initialization_point_v1)
- (void);
+ (void);
/*
* FUNCTION: openvpn_plugin_min_version_required_v1
*
* This function is called by OpenVPN to query the minimum
- plugin interface version number required by the plugin.
+ * plugin interface version number required by the plugin.
*
* REQUIRED: NO
- *
+ *
* RETURN VALUE
*
* The minimum OpenVPN plugin interface version number necessary to support
* this plugin.
*/
OPENVPN_PLUGIN_DEF int OPENVPN_PLUGIN_FUNC(openvpn_plugin_min_version_required_v1)
- (void);
+ (void);
/*
* Deprecated functions which are still supported for backward compatibility.
*/
OPENVPN_PLUGIN_DEF openvpn_plugin_handle_t OPENVPN_PLUGIN_FUNC(openvpn_plugin_open_v1)
- (unsigned int *type_mask,
- const char *argv[],
- const char *envp[]);
+ (unsigned int *type_mask,
+ const char *argv[],
+ const char *envp[]);
OPENVPN_PLUGIN_DEF int OPENVPN_PLUGIN_FUNC(openvpn_plugin_func_v1)
- (openvpn_plugin_handle_t handle, const int type, const char *argv[], const char *envp[]);
+ (openvpn_plugin_handle_t handle, const int type, const char *argv[], const char *envp[]);
#ifdef __cplusplus
}