diff options
author | Bernhard Schmidt <berni@debian.org> | 2019-02-20 14:11:46 +0100 |
---|---|---|
committer | Bernhard Schmidt <berni@debian.org> | 2019-02-20 14:11:46 +0100 |
commit | 87356242baf10c8b2a94d9013e436ed2a0dada53 (patch) | |
tree | dd8c5f9774af74c20cdae579ac0f2d352a835e9e /include | |
parent | 2c8e4bc4f9ab94e4d0b63341820d471af7c28c6c (diff) |
New upstream version 2.4.7upstream/2.4.7
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile.in | 14 | ||||
-rw-r--r-- | include/openvpn-msg.h | 8 | ||||
-rw-r--r-- | include/openvpn-plugin.h | 44 | ||||
-rw-r--r-- | include/openvpn-plugin.h.in | 42 |
4 files changed, 90 insertions, 18 deletions
diff --git a/include/Makefile.in b/include/Makefile.in index 34b7efd..28dff09 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -354,7 +354,6 @@ plugindir = @plugindir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ -runstatedir = @runstatedir@ sampledir = @sampledir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ @@ -395,8 +394,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -498,7 +497,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ diff --git a/include/openvpn-msg.h b/include/openvpn-msg.h index 82ecfe8..66177a2 100644 --- a/include/openvpn-msg.h +++ b/include/openvpn-msg.h @@ -37,7 +37,8 @@ typedef enum { msg_flush_neighbors, msg_add_block_dns, msg_del_block_dns, - msg_register_dns + msg_register_dns, + msg_enable_dhcp, } message_type_t; typedef struct { @@ -111,4 +112,9 @@ typedef struct { interface_t iface; } block_dns_message_t; +typedef struct { + message_header_t header; + interface_t iface; +} enable_dhcp_message_t; + #endif /* ifndef OPENVPN_MSG_H_ */ diff --git a/include/openvpn-plugin.h b/include/openvpn-plugin.h index 20526b1..de9aa9f 100644 --- a/include/openvpn-plugin.h +++ b/include/openvpn-plugin.h @@ -55,7 +55,7 @@ extern "C" { */ #define OPENVPN_VERSION_MAJOR 2 #define OPENVPN_VERSION_MINOR 4 -#define OPENVPN_VERSION_PATCH ".6" +#define OPENVPN_VERSION_PATCH ".7" /* * Plug-in types. These types correspond to the set of script callbacks @@ -222,8 +222,11 @@ struct openvpn_plugin_string_list * OpenVPN to plug-ins. * * 4 Exported secure_memzero() as plugin_secure_memzero() + * + * 5 Exported openvpn_base64_encode() as plugin_base64_encode() + * Exported openvpn_base64_decode() as plugin_base64_decode() */ -#define OPENVPN_PLUGINv3_STRUCTVER 4 +#define OPENVPN_PLUGINv3_STRUCTVER 5 /** * Definitions needed for the plug-in callback functions. @@ -270,6 +273,33 @@ typedef void (*plugin_vlog_t)(openvpn_plugin_log_flags_t flags, */ typedef void (*plugin_secure_memzero_t)(void *data, size_t len); +/** + * Export of openvpn_base64_encode() to be used inside plug-ins + * + * @param data Pointer to data to BASE64 encode + * @param size Length of data, in bytes + * @param *str Pointer to the return buffer. This needed memory is + * allocated by openvpn_base64_encode() and needs to be free()d + * after use. + * + * @return int Returns the length of the buffer created, or -1 on error. + * + */ +typedef int (*plugin_base64_encode_t)(const void *data, int size, char **str); + +/** + * Export of openvpn_base64_decode() to be used inside plug-ins + * + * @param str Pointer to the BASE64 encoded data + * @param data Pointer to the buffer where save the decoded data + * @param size Size of the destination buffer + * + * @return int Returns the length of the decoded data, or -1 on error or + * if the destination buffer is too small. + * + */ +typedef int (*plugin_base64_decode_t)(const char *str, void *data, int size); + /** * Used by the openvpn_plugin_open_v3() function to pass callback @@ -292,6 +322,8 @@ struct openvpn_plugin_callbacks plugin_log_t plugin_log; plugin_vlog_t plugin_vlog; plugin_secure_memzero_t plugin_secure_memzero; + plugin_base64_encode_t plugin_base64_encode; + plugin_base64_decode_t plugin_base64_decode; }; /** @@ -356,7 +388,7 @@ struct openvpn_plugin_args_open_in * type_mask = OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_CONNECT) * | OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_DISCONNECT) * - * *handle : Pointer to a global plug-in context, created by the plug-in. This pointer + * handle : Pointer to a global plug-in context, created by the plug-in. This pointer * is passed on to the other plug-in calls. * * return_list : used to return data back to OpenVPN. @@ -365,7 +397,7 @@ struct openvpn_plugin_args_open_in struct openvpn_plugin_args_open_return { int type_mask; - openvpn_plugin_handle_t *handle; + openvpn_plugin_handle_t handle; struct openvpn_plugin_string_list **return_list; }; @@ -387,9 +419,9 @@ struct openvpn_plugin_args_open_return * these variables are not actually written to the "official" * environmental variable store of the process. * - * *handle : Pointer to a global plug-in context, created by the plug-in's openvpn_plugin_open_v3(). + * handle : Pointer to a global plug-in context, created by the plug-in's openvpn_plugin_open_v3(). * - * *per_client_context : the per-client context pointer which was returned by + * per_client_context : the per-client context pointer which was returned by * openvpn_plugin_client_constructor_v1, if defined. * * current_cert_depth : Certificate depth of the certificate being passed over (only if compiled with ENABLE_CRYPTO defined) diff --git a/include/openvpn-plugin.h.in b/include/openvpn-plugin.h.in index 8614b61..a604f1c 100644 --- a/include/openvpn-plugin.h.in +++ b/include/openvpn-plugin.h.in @@ -221,8 +221,11 @@ struct openvpn_plugin_string_list * OpenVPN to plug-ins. * * 4 Exported secure_memzero() as plugin_secure_memzero() + * + * 5 Exported openvpn_base64_encode() as plugin_base64_encode() + * Exported openvpn_base64_decode() as plugin_base64_decode() */ -#define OPENVPN_PLUGINv3_STRUCTVER 4 +#define OPENVPN_PLUGINv3_STRUCTVER 5 /** * Definitions needed for the plug-in callback functions. @@ -269,6 +272,33 @@ typedef void (*plugin_vlog_t)(openvpn_plugin_log_flags_t flags, */ typedef void (*plugin_secure_memzero_t)(void *data, size_t len); +/** + * Export of openvpn_base64_encode() to be used inside plug-ins + * + * @param data Pointer to data to BASE64 encode + * @param size Length of data, in bytes + * @param *str Pointer to the return buffer. This needed memory is + * allocated by openvpn_base64_encode() and needs to be free()d + * after use. + * + * @return int Returns the length of the buffer created, or -1 on error. + * + */ +typedef int (*plugin_base64_encode_t)(const void *data, int size, char **str); + +/** + * Export of openvpn_base64_decode() to be used inside plug-ins + * + * @param str Pointer to the BASE64 encoded data + * @param data Pointer to the buffer where save the decoded data + * @param size Size of the destination buffer + * + * @return int Returns the length of the decoded data, or -1 on error or + * if the destination buffer is too small. + * + */ +typedef int (*plugin_base64_decode_t)(const char *str, void *data, int size); + /** * Used by the openvpn_plugin_open_v3() function to pass callback @@ -291,6 +321,8 @@ struct openvpn_plugin_callbacks plugin_log_t plugin_log; plugin_vlog_t plugin_vlog; plugin_secure_memzero_t plugin_secure_memzero; + plugin_base64_encode_t plugin_base64_encode; + plugin_base64_decode_t plugin_base64_decode; }; /** @@ -355,7 +387,7 @@ struct openvpn_plugin_args_open_in * type_mask = OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_CONNECT) * | OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_DISCONNECT) * - * *handle : Pointer to a global plug-in context, created by the plug-in. This pointer + * handle : Pointer to a global plug-in context, created by the plug-in. This pointer * is passed on to the other plug-in calls. * * return_list : used to return data back to OpenVPN. @@ -364,7 +396,7 @@ struct openvpn_plugin_args_open_in struct openvpn_plugin_args_open_return { int type_mask; - openvpn_plugin_handle_t *handle; + openvpn_plugin_handle_t handle; struct openvpn_plugin_string_list **return_list; }; @@ -386,9 +418,9 @@ struct openvpn_plugin_args_open_return * these variables are not actually written to the "official" * environmental variable store of the process. * - * *handle : Pointer to a global plug-in context, created by the plug-in's openvpn_plugin_open_v3(). + * handle : Pointer to a global plug-in context, created by the plug-in's openvpn_plugin_open_v3(). * - * *per_client_context : the per-client context pointer which was returned by + * per_client_context : the per-client context pointer which was returned by * openvpn_plugin_client_constructor_v1, if defined. * * current_cert_depth : Certificate depth of the certificate being passed over (only if compiled with ENABLE_CRYPTO defined) |