OpenVPN 3 Core Library
Loading...
Searching...
No Matches
clientconfig.hpp
Go to the documentation of this file.
1// OpenVPN -- An application to securely tunnel IP networks
2// over a single port, with support for SSL/TLS-based
3// session authentication and key exchange,
4// packet encryption, packet authentication, and
5// packet compression.
6//
7// Copyright (C) 2012- OpenVPN Inc.
8//
9// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10//
11//
12
13#pragma once
14
20
21namespace openvpn::TunWin {
22
23// These types manage the underlying TAP driver HANDLE
24typedef openvpn_io::windows::stream_handle TAPStream;
26
27template <typename ADAPTER_STATE>
29{
31 ADAPTER_STATE adapter_state;
32
33 void reset()
34 {
35 state.reset();
36 adapter_state.reset();
37 }
38};
41
43{
44 friend class Client; // accesses wfp
45
46 public:
48
50 int n_parallel = 8; // number of parallel async reads on tun socket
53
56
57 Stop *stop = nullptr;
58
60
62
63 TunWin::SetupBase::Ptr new_setup_obj(openvpn_io::io_context &io_context)
64 {
66 return tun_setup_factory->new_setup_obj(io_context, tun_type, allow_local_dns_resolvers);
67 else
68 return new TunWin::Setup(io_context, tun_type, allow_local_dns_resolvers);
69 }
70
71 static Ptr new_obj()
72 {
73 return new ClientConfig;
74 }
75
76 TunClient::Ptr new_tun_client_obj(openvpn_io::io_context &io_context,
77 TunClientParent &parent,
78 TransportClient *transcli) override;
79
80 bool supports_epoch_data() override
81 {
82 return tun_type != TunWin::OvpnDco;
83 }
84
85 void finalize(const bool disconnected) override
86 {
87 if (disconnected)
89 }
90
91 bool layer_2_supported() const override
92 {
93 return true;
94 }
95};
96} // namespace openvpn::TunWin
void reset() noexcept
Points this RCPtr<T> to nullptr safely.
Definition rc.hpp:290
TunWin::SetupFactory::Ptr tun_setup_factory
TunWin::SetupBase::Ptr new_setup_obj(openvpn_io::io_context &io_context)
TunClient::Ptr new_tun_client_obj(openvpn_io::io_context &io_context, TunClientParent &parent, TransportClient *transcli) override
Definition tuncli.hpp:433
RCPtr< ClientConfig > Ptr
bool layer_2_supported() const override
void finalize(const bool disconnected) override
bool supports_epoch_data() override
DNS utilities for Windows.
TunPersistTemplate< ScopedTAPStream, TunPersistState< Util::TapNameGuidPair > > DcoTunPersist
openvpn_io::windows::stream_handle TAPStream
TunPersistTemplate< ScopedTAPStream, TunPersistState< RingBuffer::Ptr > > TunPersist
ScopedAsioStream< TAPStream > ScopedTAPStream