60 #include <sys/types.h> 79 #define OPENVPN_PLUGIN_VERSION_MIN 3 80 #define OPENVPN_PLUGIN_STRUCTVER_MIN 5 97 static char *
MODULE =
"defer/simple";
110 const int namelen = strlen(name);
111 for (i = 0; envp[i]; ++i)
113 if (!strncmp(envp[i], name, namelen))
115 const char *cp = envp[i] + namelen;
166 const char **envp = args->
envp;
171 fprintf(stderr,
"%s: this plugin is incompatible with the running version of OpenVPN\n",
MODULE);
226 const char *
argv[],
const char *envp[])
238 const char *auth_control_file =
get_env(
"auth_control_file", envp);
243 np(auth_control_file));
246 if (!auth_control_file)
265 waitpid(p1, NULL, 0);
293 int fd = open(auth_control_file, O_WRONLY);
302 if (
write(fd,
"1", 1) != 1)
318 fprintf(stderr,
"%s: this plugin is incompatible with the running version of OpenVPN\n",
MODULE);
322 const char **envp = args->
envp;
384 free(per_client_context);
Arguments used to transport variables to the plug-in.
OPENVPN_EXPORT void openvpn_plugin_client_destructor_v1(openvpn_plugin_handle_t handle, void *per_client_context)
static const char * get_env(const char *name, const char *envp[])
static int auth_user_pass_verify(struct plugin_context *context, struct plugin_per_client_context *pcc, const char *argv[], const char *envp[])
Contains all state information for one tunnel.
#define OPENVPN_PLUGIN_VERSION_MIN
openvpn_plugin_handle_t * handle
#define OPENVPN_PLUGIN_DOWN
#define OPENVPN_PLUGIN_ROUTE_UP
#define OPENVPN_PLUGIN_FUNC_SUCCESS
OPENVPN_EXPORT int openvpn_plugin_min_version_required_v1()
#define OPENVPN_PLUGIN_LEARN_ADDRESS
#define OPENVPN_PLUGIN_IPCHANGE
OPENVPN_EXPORT int openvpn_plugin_open_v3(const int v3structver, struct openvpn_plugin_args_open_in const *args, struct openvpn_plugin_args_open_return *ret)
#define OPENVPN_PLUGIN_FUNC_DEFERRED
#define OPENVPN_PLUGIN_TLS_VERIFY
#define OPENVPN_PLUGIN_FUNC_ERROR
static const char * np(const char *str)
OPENVPN_EXPORT int openvpn_plugin_func_v3(const int v3structver, struct openvpn_plugin_args_func_in const *args, struct openvpn_plugin_args_func_return *ret)
Arguments used to transport variables to and from the plug-in.
static plugin_log_t plugin_log
#define OPENVPN_PLUGIN_TLS_FINAL
openvpn_plugin_handle_t handle
void(* plugin_log_t)(openvpn_plugin_log_flags_t flags, const char *plugin_name, const char *format,...) _ovpn_chk_fmt(3
#define OPENVPN_PLUGIN_CLIENT_DISCONNECT
void * openvpn_plugin_handle_t
OPENVPN_EXPORT void openvpn_plugin_close_v1(openvpn_plugin_handle_t handle)
static int atoi_null0(const char *str)
Arguments used to transport variables to and from the plug-in.
#define OPENVPN_PLUGIN_STRUCTVER_MIN
#define OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY
struct openvpn_plugin_callbacks * callbacks
OPENVPN_EXPORT void * openvpn_plugin_client_constructor_v1(openvpn_plugin_handle_t handle)
Arguments used to transport variables from the plug-in back to the OpenVPN process.
#define OPENVPN_PLUGIN_CLIENT_CONNECT_V2
void * per_client_context
#define OPENVPN_PLUGIN_UP
#define OPENVPN_PLUGIN_MASK(x)