summaryrefslogtreecommitdiffstats
path: root/sample
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2015-07-10 15:22:28 +0200
committerGert Doering <gert@greenie.muc.de>2015-07-27 21:02:02 +0200
commit6a40276c7500c2d0a2fe44b1a450ffe9cb2f37cd (patch)
treed2878d2cafb14ebf379e6a7f575c337fae5e62ee /sample
parent9de35d4633ce3035b048957b2e20b81e31a40cd6 (diff)
downloadopenvpn-6a40276c7500c2d0a2fe44b1a450ffe9cb2f37cd.tar.gz
openvpn-6a40276c7500c2d0a2fe44b1a450ffe9cb2f37cd.tar.xz
openvpn-6a40276c7500c2d0a2fe44b1a450ffe9cb2f37cd.zip
Provide OpenVPN runtime version information to plug-ins
Also updated the log_v3 sample-plugin to demonstrate how this works. $ openvpn --plugin log_v3.so --dev tun Fri Jul 10 15:17:28 2015 OpenVPN 2.3_git [git:dev/plugin-version/f05d8623a29078bf+]..... ...more.openvpn.logging... log_v3: OpenVPN 2.3_git (Major: 2, Minor: 3, Patch: git:dev/plugin-version/f05d8623a29078bf+) ...more.openvpn.logging... $ Signed-off-by: David Sommerseth <davids@redhat.com> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <1436534548-21507-3-git-send-email-openvpn.list@topphemmelig.net> URL: http://article.gmane.org/gmane.network.openvpn.devel/9904 Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'sample')
-rw-r--r--sample/sample-plugins/log/log_v3.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sample/sample-plugins/log/log_v3.c b/sample/sample-plugins/log/log_v3.c
index bf1a15c..275b1e7 100644
--- a/sample/sample-plugins/log/log_v3.c
+++ b/sample/sample-plugins/log/log_v3.c
@@ -82,6 +82,7 @@ openvpn_plugin_open_v3 (const int v3structver,
/* Check that we are API compatible */
if( v3structver != OPENVPN_PLUGINv3_STRUCTVER ) {
+ printf("log_v3: ** ERROR ** Incompatible plug-in interface between this plug-in and OpenVPN\n");
return OPENVPN_PLUGIN_FUNC_ERROR;
}
@@ -90,6 +91,11 @@ openvpn_plugin_open_v3 (const int v3structver,
return OPENVPN_PLUGIN_FUNC_ERROR;
}
+ /* Print some version information about the OpenVPN process using this plug-in */
+ printf("log_v3: OpenVPN %s (Major: %i, Minor: %i, Patch: %s)\n",
+ args->ovpn_version, args->ovpn_version_major,
+ args->ovpn_version_minor, args->ovpn_version_patch);
+
/* Which callbacks to intercept. */
ret->type_mask =
OPENVPN_PLUGIN_MASK (OPENVPN_PLUGIN_UP) |