summaryrefslogtreecommitdiffstats
path: root/plugin.h
diff options
context:
space:
mode:
authorAdriaan de Jong <dejong@fox-it.com>2011-07-07 09:21:03 +0200
committerDavid Sommerseth <davids@redhat.com>2011-10-22 17:22:51 +0200
commit1876ccd012e9e2ca6f8e1cd9e7e9bb4bf24ccecb (patch)
tree4ccb3c4e2c142dce66a95fef769af1196ba734e5 /plugin.h
parent557624e0a7282cf31cd3b58f8155f11f0517f254 (diff)
downloadopenvpn-1876ccd012e9e2ca6f8e1cd9e7e9bb4bf24ccecb.tar.gz
openvpn-1876ccd012e9e2ca6f8e1cd9e7e9bb4bf24ccecb.tar.xz
openvpn-1876ccd012e9e2ca6f8e1cd9e7e9bb4bf24ccecb.zip
Fixes for the plugin system:
- Removed the dependency on an SSL library for USE_SSL when creating non-SSL plugins - Fixed example plugin code to include USE_SSL when needed Signed-off-by: Adriaan de Jong <dejong@fox-it.com> Acked-by: James Yonan <james@openvpn.net> Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'plugin.h')
-rw-r--r--plugin.h35
1 files changed, 28 insertions, 7 deletions
diff --git a/plugin.h b/plugin.h
index 5518147..8fa4168 100644
--- a/plugin.h
+++ b/plugin.h
@@ -116,13 +116,31 @@ void plugin_list_open (struct plugin_list *pl,
struct plugin_list *plugin_list_inherit (const struct plugin_list *src);
-int plugin_call (const struct plugin_list *pl,
+
+static inline int
+plugin_call(const struct plugin_list *pl,
+ const int type,
+ const struct argv *av,
+ struct plugin_return *pr,
+ struct env_set *es)
+{
+ return plugin_call_ssl(pl, type, av, pr, es
+#ifdef USE_SSL
+ -1, NULL
+#endif
+ );
+}
+
+int plugin_call_ssl (const struct plugin_list *pl,
const int type,
const struct argv *av,
struct plugin_return *pr,
- struct env_set *es,
- int current_cert_depth,
- x509_cert_t *current_cert);
+ struct env_set *es
+#ifdef USE_SSL
+ , int current_cert_depth,
+ x509_cert_t *current_cert
+#endif
+ );
void plugin_list_close (struct plugin_list *pl);
bool plugin_defined (const struct plugin_list *pl, const int type);
@@ -174,9 +192,12 @@ plugin_call (const struct plugin_list *pl,
const int type,
const struct argv *av,
struct plugin_return *pr,
- struct env_set *es,
- int current_cert_depth,
- x509_cert_t *current_cert)
+ struct env_set *es
+#ifdef USE_SSL
+ , int current_cert_depth,
+ x509_cert_t *current_cert
+#endif
+ )
{
return 0;
}