diff options
author | David Sommerseth | 2016-12-14 22:33:21 +0100 |
---|---|---|
committer | David Sommerseth | 2016-12-14 22:33:49 +0100 |
commit | 81d882d5302b8b647202a6893b57dfdc61fd6df2 (patch) | |
tree | a77464fe53e45fd843fcee2ff008bcf4f6482d56 /include | |
parent | 2417d55c4945d491e528dd0e4cf24047da5ceae9 (diff) | |
download | openvpn-81d882d5302b8b647202a6893b57dfdc61fd6df2.zip openvpn-81d882d5302b8b647202a6893b57dfdc61fd6df2.tar.gz |
The Great Reformatting - first phase
This is the first commit of the big reformatting task. This
is performed by running the ./dev-tools/reformat-all.sh script.
This is based upon the v3 reformat-all.sh/uncrustify.conf version
which is now applied to git master.
Signed-off-by: David Sommerseth <davids@openvpn.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/openvpn-msg.h | 108 | ||||
-rw-r--r-- | include/openvpn-plugin.h.in | 182 |
2 files changed, 145 insertions, 145 deletions
diff --git a/include/openvpn-msg.h b/include/openvpn-msg.h index f7fbdd2..4c9e63c 100644 --- a/include/openvpn-msg.h +++ b/include/openvpn-msg.h @@ -26,90 +26,90 @@ #define OPENVPN_MSG_H_ typedef enum { - msg_acknowledgement, - msg_add_address, - msg_del_address, - msg_add_route, - msg_del_route, - msg_add_dns_cfg, - msg_del_dns_cfg, - msg_add_nbt_cfg, - msg_del_nbt_cfg, - msg_flush_neighbors, - msg_add_block_dns, - msg_del_block_dns, - msg_register_dns + msg_acknowledgement, + msg_add_address, + msg_del_address, + msg_add_route, + msg_del_route, + msg_add_dns_cfg, + msg_del_dns_cfg, + msg_add_nbt_cfg, + msg_del_nbt_cfg, + msg_flush_neighbors, + msg_add_block_dns, + msg_del_block_dns, + msg_register_dns } message_type_t; typedef struct { - message_type_t type; - size_t size; - int message_id; + message_type_t type; + size_t size; + int message_id; } message_header_t; typedef union { - struct in_addr ipv4; - struct in6_addr ipv6; + struct in_addr ipv4; + struct in6_addr ipv6; } inet_address_t; typedef struct { - int index; - char name[256]; + int index; + char name[256]; } interface_t; typedef struct { - message_header_t header; - short family; - inet_address_t address; - int prefix_len; - interface_t iface; + message_header_t header; + short family; + inet_address_t address; + int prefix_len; + interface_t iface; } address_message_t; typedef struct { - message_header_t header; - short family; - inet_address_t prefix; - int prefix_len; - inet_address_t gateway; - interface_t iface; - int metric; + message_header_t header; + short family; + inet_address_t prefix; + int prefix_len; + inet_address_t gateway; + interface_t iface; + int metric; } route_message_t; typedef struct { - message_header_t header; - interface_t iface; - char domains[512]; - short family; - int addr_len; - inet_address_t addr[4]; /* support up to 4 dns addresses */ + message_header_t header; + interface_t iface; + char domains[512]; + short family; + int addr_len; + inet_address_t addr[4]; /* support up to 4 dns addresses */ } dns_cfg_message_t; typedef struct { - message_header_t header; - interface_t iface; - int disable_nbt; - int nbt_type; - char scope_id[256]; - struct in_addr primary_nbns; - struct in_addr secondary_nbns; + message_header_t header; + interface_t iface; + int disable_nbt; + int nbt_type; + char scope_id[256]; + struct in_addr primary_nbns; + struct in_addr secondary_nbns; } nbt_cfg_message_t; -// TODO: NTP +/* TODO: NTP */ typedef struct { - message_header_t header; - short family; - interface_t iface; + message_header_t header; + short family; + interface_t iface; } flush_neighbors_message_t; typedef struct { - message_header_t header; - int error_number; + message_header_t header; + int error_number; } ack_message_t; typedef struct { - message_header_t header; - interface_t iface; + message_header_t header; + interface_t iface; } block_dns_message_t; -#endif +#endif /* ifndef OPENVPN_MSG_H_ */ diff --git a/include/openvpn-plugin.h.in b/include/openvpn-plugin.h.in index 34ad18b..f17b753 100644 --- a/include/openvpn-plugin.h.in +++ b/include/openvpn-plugin.h.in @@ -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 } |