// OpenVPN -- An application to securely tunnel IP networks
// over a single port, with support for SSL/TLS-based
// session authentication and key exchange,
// packet encryption, packet authentication, and
// packet compression.
//
// Copyright (C) 2012-2017 OpenVPN Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License Version 3
// as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program in the COPYING file.
// If not, see .
//
// Client tun setup base class for Windows
#ifndef OPENVPN_TUN_WIN_CLIENT_SETUPBASE_H
#define OPENVPN_TUN_WIN_CLIENT_SETUPBASE_H
#include // for HANDLE
#include
#include
#include
#include
#include
#include
namespace openvpn {
namespace TunWin {
struct SetupBase : public DestructorBase
{
typedef RCPtr Ptr;
OPENVPN_EXCEPTION(tun_win_setup);
virtual HANDLE establish(const TunBuilderCapture& pull,
const std::wstring& openvpn_app_path,
Stop* stop,
std::ostream& os,
RingBuffer::Ptr rings) = 0;
virtual bool l2_ready(const TunBuilderCapture& pull) = 0;
virtual void l2_finish(const TunBuilderCapture& pull,
Stop* stop,
std::ostream& os) = 0;
virtual void confirm()
{
}
virtual void set_service_fail_handler(std::function&& handler)
{
}
};
struct SetupFactory : public RC
{
typedef RCPtr Ptr;
virtual SetupBase::Ptr new_setup_obj(openvpn_io::io_context& io_context, bool wintun) = 0;
};
}
}
#endif