El vie, 19-09-2008 a las 10:12 -0300, Giancarlo Razzolini escribió: > Jose Sanchez escreveu: > > Hello, I am new at openvpn, I am trying to do a very simple plugin to > > see connections/disconnections and to be able to notify to another > > system in "real" time. > > > > The problem is that I haven't found any documentation about the code or > > about how to make plugins except on the code (I have been reading the > > comments and I have some code of my plugin). > > > > The main problem is that there are two functions: OPENVPN_PLUGIN_DEF int > > OPENVPN_PLUGIN_FUNC(openvpn_plugin_func_v1) > > (openvpn_plugin_handle_t handle, const int type, const char > > *argv[], const char *envp[]); > > and > > OPENVPN_PLUGIN_DEF int OPENVPN_PLUGIN_FUNC(openvpn_plugin_func_v2) > > (openvpn_plugin_handle_t handle, > > const int type, > > const char *argv[], > > const char *envp[], > > void *per_client_context, > > struct openvpn_plugin_string_list **return_list); > > > > What I need is to obtain the public (inet IP) and the private (vpn ip) > > when a client connects/disconnect to notify it to another program (I > > know I can make a ping or similar things but it seems to be too slow > > when there are a lot of clients connected (> 100)). > > > > What I need is to know in which variable is that data and which function > > I need to implement (v1 or v2) and how these functions works (Is any > > documentation on any site?). > > > > In openvpn_plugin_open_v1 I have registered the events: *type_mask = > > OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_CONNECT) | > > OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_DISCONNECT); and even on > > openvpn_plugin_func_v1 I can know if there is if (type == > > OPENVPN_PLUGIN_CLIENT_CONNECT) or OPENVPN_PLUGIN_CLIENT_DISCONNECT but I > > don't know how to recover IP information. > > > > If somebody could help me or saying me where the documentation is would > > be great. > > > > Thanks in advance and excuse my english (I have written this too > > quickly) and excuse me if what i am asking is answered on another place > > that I haven't found. > > > > > You don't need a plugin for that. That's just why there is a > openvpn-status file. It won't show you things in real time but, it > didn't seemed as a requirement, based on what you are saying. Take a > look at the openvpn-status option. > > My regards, >
Unfortunately, yes, it is a requirement, I know openvpn-status, but thanks anyway for your answer. -- Jose Sánchez <jose dot informatica at centrolamilagrosa dot org>