]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Add demo plugin that excercises "CLIENT_CONNECT" and "CLIENT_CONNECT_V2" paths
authorGert Doering <gert@greenie.muc.de>
Thu, 17 Sep 2020 16:19:09 +0000 (18:19 +0200)
committerGert Doering <gert@greenie.muc.de>
Fri, 18 Sep 2020 05:54:10 +0000 (07:54 +0200)
commit94cebf8261d20a55b0260cce61ad892a98bc24d8
tree39f747e4fa94b5552325aa0a4e5ced922b082dcd
parent4dff236811a1ec9c97a27ad93182ad4beb12377f
Add demo plugin that excercises "CLIENT_CONNECT" and "CLIENT_CONNECT_V2" paths

This is a new "samples" plugin which does not do many useful things,
besides
 - show how a plugin is programmed
 - how the various messages get dispatched
 - how to pass back information from a client-connect/v2 plugin
 - how to do async-cc plugins  [not yet implemented]

the operation of the plugin is controlled by UV_WANT_* environment
variables
controlled by the client ("--setenv UV_WANT_CC_FAIL 1 --push-peer-info"),
to "fail CLIENT_CONNECT" or "use async-cc for CLIENT_CONNECT_V2" or
"send 'disable' back from ...") - which is useful for automated testing
of server success/defer/fail code paths for the CLIENT_CONNECT_* functions.

See samples/sample-plugins/client-connect/README for details how to do
this.

v2:
  - implement async / deferred operation both for CLIENT_CONNECT and
    CLIENT_CONNECT_V2 plugin calls
  - implement returning openvpn-controlled (setenv) config snippets
    (so the client side can verify in automated testing that the plugin
    operated correctly, without hard-coding something in the plugin code)

v3:
  - remove -Wno-unused-variable from Makefile
  - remove unused "char ** argv" (commented out, but kept as reference)

v4:
  - upgrade to use the build infra brought by commit 0b5141d8f946
  - remove local Makefile
  - include "config.h" to get what is needed to get rid of the strdup()
    warning
Acked-by: David Sommerseth <davids@openvpn.net>
Message-Id: <20200917161909.11573-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21047.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
sample/sample-plugins/Makefile.plugins
sample/sample-plugins/README
sample/sample-plugins/client-connect/README [new file with mode: 0644]
sample/sample-plugins/client-connect/sample-client-connect.c [new file with mode: 0644]