]> git.ipfire.org Git - thirdparty/openvpn.git/commit
openvpnserv: Add support for multi-instances
authorSimon Rozman <simon@rozman.si>
Sun, 3 Dec 2017 21:16:54 +0000 (22:16 +0100)
committerGert Doering <gert@greenie.muc.de>
Mon, 4 Dec 2017 17:51:20 +0000 (18:51 +0100)
commitf3fec49b1c916a701058ef2445b4c07005c30673
treefa83471a10fb4581932d54039065591c38191479
parent02fa8565498d701b5750ad19ee29be4fe657a7f5
openvpnserv: Add support for multi-instances

While openvpn.exe can run multiple concurrent processes, openvpnserv.exe
is usually only one single globally unique running process.

This patch extends openvpnserv.exe to support multiple service instances
in parallel allowing side-by-side OpenVPN installations.

Alternate instances must be installed as `SERVICE_WIN32_OWN_PROCESS`
(Type 0x10) and must use the newly introduced service command line
parameter:
-instance <name> <id>
<name> can be `automatic` or `interactive`.

- The service settings will be loaded from `HKLM\Software\OpenVPN<id>`
  registry key.

- The automatic service will use `openvpn<id>_exit_1` exit event.

- The interactive service will accept requests on
  `\\.\pipe\openvpn<id>\service` named pipe, and run IPC with
  openvpn.exe on `\\.\pipe\openvpn<id>\service_<pid>`.

This patch preserves backward compatibility, by defaulting to
`SERVICE_WIN32_SHARE_PROCESS` and `<empty string>` as service ID.

Acked-by: Selva Nair <selva.nair@gmail.com>
Message-Id: <20171203211654.1044-1-simon@rozman.si>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg16002.html

Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpnserv/automatic.c
src/openvpnserv/common.c
src/openvpnserv/interactive.c
src/openvpnserv/service.c
src/openvpnserv/service.h