0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 20:13:05 +02:00

ovpnagent: Enable pipe name build-time customization

We need to support customization of pipe name in case when few
clients based on ovpnagent running at the same time. Name of
pipe is defined by build-time variable “OVPNAGENT_NAME” (we
already use it as name of Windows service).

Signed-off-by: Yuriy Barnovych <yuriy@openvpn.net>
Jira: UCONNECT-1151
This commit is contained in:
Yuriy Barnovych 2019-02-11 14:07:01 +02:00 committed by Lev Stipakov
parent a2962be74e
commit 586e8cc8a8
No known key found for this signature in database
GPG Key ID: 88670BE258B9C258

View File

@ -2,13 +2,22 @@
// agentconfig.hpp
// OpenVPN
//
// Copyright (C) 2012-2017 OpenVPN Technologies, Inc.
// Copyright (C) 2012-2019 OpenVPN Technologies, Inc.
// All rights reserved.
//
#ifndef OPENVPN_CLIENT_WIN_AGENTCONFIG_H
#define OPENVPN_CLIENT_WIN_AGENTCONFIG_H
// OVPNAGENT_NAME can be passed on build command line.
// Customized agent name is needed with purpose to install
// few app with agents on one OS (e.g OC 3.0 and PT)
#ifdef OVPNAGENT_NAME
#define OVPNAGENT_NAME_STRING OPENVPN_STRINGIZE(OVPNAGENT_NAME)
#else
#define OVPNAGENT_NAME_STRING "ovpnagent"
#endif
#include <openvpn/common/string.hpp>
#include <openvpn/common/path.hpp>
@ -18,7 +27,7 @@ namespace openvpn {
public:
static std::string named_pipe_path()
{
return "\\\\.\\pipe\\ovpnagent";
return "\\\\.\\pipe\\" OVPNAGENT_NAME_STRING;
}
static bool valid_pipe(const std::string& client_exe,