/* openvpn_plugin_{open,func}_v3() related structs */
+/* Defines version of the v3 plugin argument structs
+ *
+ * Whenever one or more of these structs are modified, this constant
+ * must be updated. A changelog should be appended in this comment
+ * as well, to make it easier to see what information is available
+ * in the different versions.
+ *
+ * Version Comment
+ * 1 Initial plugin v3 structures providing the same API as
+ * the v2 plugin interface + X509 certificate information.
+ *
+ */
+#define OPENVPN_PLUGINv3_STRUCTVER 1
+
/**
* Arguments used to transport variables to the plug-in.
* The struct openvpn_plugin_args_open_in is only used
struct openvpn_plugin_args_open_return retargs;
CLEAR(retargs);
- if ((*p->open3)(OPENVPN_PLUGIN_VERSION, &args, &retargs) == OPENVPN_PLUGIN_FUNC_SUCCESS) {
+ if ((*p->open3)(OPENVPN_PLUGINv3_STRUCTVER, &args, &retargs) == OPENVPN_PLUGIN_FUNC_SUCCESS) {
p->plugin_type_mask = retargs.type_mask;
p->plugin_handle = retargs.handle;
retlist = retargs.return_list;
struct openvpn_plugin_args_func_return retargs;
CLEAR(retargs);
- status = (*p->func3)(OPENVPN_PLUGIN_VERSION, &args, &retargs);
+ status = (*p->func3)(OPENVPN_PLUGINv3_STRUCTVER, &args, &retargs);
retlist = retargs.return_list;
} else if (p->func2)
status = (*p->func2)(p->plugin_handle, type, (const char **)a.argv, envp, per_client_context, retlist);
}
OPENVPN_EXPORT int
-openvpn_plugin_open_v3 (const int apiver,
+openvpn_plugin_open_v3 (const int v3structver,
struct openvpn_plugin_args_open_in const *args,
struct openvpn_plugin_args_open_return *ret)
{
struct plugin_context *context = NULL;
/* Check that we are API compatible */
- if( apiver != OPENVPN_PLUGIN_VERSION ) {
+ if( v3structver != OPENVPN_PLUGINv3_STRUCTVER ) {
return OPENVPN_PLUGIN_FUNC_ERROR;
}