OpenVPN embedded Python plugin.
This plugin implements V1 OpenVPN plugin interface, thus in other words getting many info from OpenVPN and returning only TRUE/FALSE values.
It is loaded as other plugins. Plugin parameters are:
Module. Module should contain anything, but at least two callback functions must be declared:
Next callbacks which are optional: route_up() ipchange() tls_verify() auth_user_pass_verify() client_connect() client_disconnect() learn_address() tls_final() enable_pf()
During initialization of plugin those optional callbacks are searched for presence and if they are Python callable. If so, OpenVPN type mask is set for particular callbacks, so only those, which are declared, are advertised to OpenVPN. Every callback has at least one parameter, environment which is Python dictionary. It is not system env., but OpenVPN environment. Callbacks are expected to return only True/False values. Look at sample module in sources.
Import and use what you wish, but threading is not anyhow handled. In fact may be it is not a problem for this plugin cause of its behavior, but keep it on mind.