2 * OpenVPN -- An application to securely tunnel IP networks
3 * over a single TCP/UDP port, with support for SSL/TLS-based
4 * session authentication and key exchange,
5 * packet encryption, packet authentication, and
8 * Copyright (C) 2002-2005 OpenVPN Solutions LLC <info@openvpn.net>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2
12 * as published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program (see the file COPYING included with this
21 * distribution); if not, write to the Free Software Foundation, Inc.,
22 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 * plug-in support, using dynamically loaded libraries
29 #ifndef OPENVPN_PLUGIN_H
30 #define OPENVPN_PLUGIN_H
32 #include "openvpn-plugin.h"
38 #define MAX_PLUGINS 32
40 struct plugin_option
{
41 const char *so_pathname
;
45 struct plugin_option_list
{
47 struct plugin_option plugins
[MAX_PLUGINS
];
51 const char *so_pathname
;
52 unsigned int plugin_type_mask
;
53 #if defined(USE_LIBDL)
55 #elif defined(USE_LOAD_LIBRARY)
58 openvpn_plugin_open_v1 open
;
59 openvpn_plugin_func_v1 func
;
60 openvpn_plugin_close_v1 close
;
61 openvpn_plugin_abort_v1 abort
;
63 openvpn_plugin_handle_t plugin_handle
;
68 struct plugin plugins
[MAX_PLUGINS
];
71 struct plugin_option_list
*plugin_option_list_new (struct gc_arena
*gc
);
72 bool plugin_option_list_add (struct plugin_option_list
*list
, const char *so_pathname
, const char *args
);
75 void plugin_option_list_print (const struct plugin_option_list
*list
, int msglevel
);
78 struct plugin_list
*plugin_list_open (const struct plugin_option_list
*list
, const struct env_set
*es
);
79 int plugin_call (const struct plugin_list
*pl
, const int type
, const char *args
, struct env_set
*es
);
80 void plugin_list_close (struct plugin_list
*pl
);
81 bool plugin_defined (const struct plugin_list
*pl
, const int type
);
85 struct plugin_list
{ int dummy
; };
88 plugin_defined (const struct plugin_list
*pl
, const int type
)
94 plugin_call (const struct plugin_list
*pl
, const int type
, const char *args
, struct env_set
*es
)
99 #endif /* ENABLE_PLUGIN */
101 #endif /* OPENVPN_PLUGIN_H */