Custom control messages & trigger (#10)
A message that is not in the archive (sent off-list or not yet received): OpenVPN/openvpn/pull/[email protected]...
Am 10.12.13 17:59, schrieb andreax79:
Quoted 15 lines
Hi,
I like to share with you this patch.
I was searching for a method to notify (e.g. executing a script) a client when something happen on the server.
The scenario is the following: then some configuration are changed on the server, the client has to update the
firewall rules.
In order to achieve the goal I added a new control message "CUSTOM". Then the this message is received, the script specified with "--custom" is executed. All the additional argument specified after CUSTOM are passed to the script as parameters.
I added a new command "control" to the management cli to send arbitrary control command to clients (by common name or by address/port).
Quoted 7 lines
As example, the following command:
control 192.168.18.164:45421 CUSTOM test
sends the "CUSTOM test" control message to the client at 192.168.18.164:45421.
On the client, the "--custom" script is executed with "test" as first parameter.
I have looked very briefly at the patch. But a few points:
* sending arbitrary control messages to the client is probably not a good idea. Some custom configuration might conflict with future or other real control messages.
* CUSTOM is a terrible name. something like CUSTOMSERVERMESSAGE, or async_custom_message or something which actually describes the what the control message
* We are trying to get away from IPv4 specific/only code as much as possible. for management command the CID (client id) is better suited to identify client connections than IP and port pair.
I have not looked at that in details but we already have 'push echo' for a very similar use case when a connection is initiated.
Arne
P.S.: Main place for discussing/submitting patches is our mailing list.