OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::ClientOptions Class Reference

#include <cliopt.hpp>

Inheritance diagram for openvpn::ClientOptions:
[legend]
Collaboration diagram for openvpn::ClientOptions:
[legend]

Classes

struct  Config
 
class  OptionErrors
 

Public Types

typedef RCPtr< ClientOptionsPtr
 
typedef ClientProto::Session Client
 
- Public Types inherited from openvpn::RC< thread_unsafe_refcount >
typedef RCPtr< RCPtr
 

Public Member Functions

 ClientOptions (const OptionList &opt, const Config &config)
 
void check_for_incompatible_options (const OptionList &opt)
 
void handle_unused_options (const OptionList &opt)
 
void showUnusedOptionsByList (const OptionList &optlist, std::unordered_set< std::string > option_set, const std::string &message, bool fatal, OptionErrors &errors)
 
template<typename T >
void showOptionsByFunction (const OptionList &opt, T func, const std::string &message, bool fatal, OptionErrors &errors)
 
void next (RemoteList::Advance type)
 
void remote_reset_cache_item ()
 
bool pause_on_connection_timeout ()
 
bool retry_on_auth_failed () const
 
Client::Config::Ptr client_config (const bool relay_mode)
 
bool need_creds () const
 
void submit_creds (const ClientCreds::Ptr &creds_arg)
 
bool server_poll_timeout_enabled () const
 
Time::Duration server_poll_timeout () const
 
SessionStatsstats ()
 
const SessionStats::Ptrstats_ptr () const
 
ClientEvent::Queueevents ()
 
ClientLifeCyclelifecycle ()
 
int conn_timeout () const
 
bool asio_work_always_on () const
 
RemoteList::Ptr remote_list_precache () const
 
void update_now ()
 
void finalize (const bool disconnected)
 
- Public Member Functions inherited from openvpn::RC< thread_unsafe_refcount >
 RC () noexcept=default
 
 RC (const RC &)=delete
 
virtual ~RC ()=default
 
RCoperator= (const RC &)=delete
 
olong use_count () const noexcept
 Delegates call to RCImpl and returns the result.
 

Static Public Member Functions

static std::tuple< bool, std::string > check_dco_compatibility (const ClientAPI::ConfigCommon &config, const OptionList &opt)
 
static PeerInfo::Set::Ptr build_peer_info (const Config &config, const ParseClientConfig &pcc, const bool autologin_sessions)
 
- Static Public Member Functions inherited from openvpn::RC< thread_unsafe_refcount >
static constexpr bool is_thread_safe ()
 Delegates call to RCImpl and returns the result.
 

Public Attributes

std::unordered_set< std::string > settings_ignoreWithWarning
 
std::unordered_set< std::string > settings_serverOnlyOptions
 
std::unordered_set< std::string > settings_feature_not_implemented_fatal
 
std::unordered_set< std::string > settings_feature_not_implemented_warn
 
std::unordered_set< std::string > settings_pushonlyoptions
 
std::unordered_set< std::string > settings_script_plugin_feature
 
std::unordered_set< std::string > settings_standalone_options
 
std::unordered_set< std::string > settings_removedOptions
 
std::unordered_set< std::string > settings_ignoreSilently
 

Static Public Attributes

static std::unordered_set< std::string > dco_incompatible_opts
 

Private Member Functions

ProtoContext::ProtoConfigproto_config_cached (const bool relay_mode)
 
ProtoContext::ProtoConfig::Ptr proto_config (const OptionList &opt, const Config &config, const ParseClientConfig &pcc, const bool relay_mode)
 
std::string load_transport_config ()
 

Private Attributes

ClientConfigParsed clientconf
 
Time now_
 
StrongRandomAPI::Ptr rng
 
RandomAPI::Ptr prng
 
Frame::Ptr frame
 
Layer layer
 
ProtoContext::ProtoConfig::Ptr cp_main
 
ProtoContext::ProtoConfig::Ptr cp_relay
 
RemoteList::Ptr remote_list
 
bool server_addr_float
 
TransportClientFactory::Ptr transport_factory
 
TunClientFactory::Ptr tun_factory
 
SocketProtectsocket_protect
 
ReconnectNotifyreconnect_notify
 
SessionStats::Ptr cli_stats
 
ClientEvent::Queue::Ptr cli_events
 
ClientCreds::Ptr creds
 
unsigned int server_poll_timeout_
 
unsigned int tcp_queue_limit
 
ProtoContextCompressionOptions::Ptr proto_context_options
 
HTTPProxyTransport::Options::Ptr http_proxy_options
 
std::string userlocked_username
 
bool autologin
 
bool autologin_sessions
 
bool creds_locked
 
bool asio_work_always_on_
 
bool synchronous_dns_lookup
 
PushOptionsBase::Ptr push_base
 
OptionList::FilterBase::Ptr pushed_options_filter
 
ClientLifeCycle::Ptr client_lifecycle
 
AltProxy::Ptr alt_proxy
 
DCO::Ptr dco
 

Detailed Description

Definition at line 144 of file cliopt.hpp.

Member Typedef Documentation

◆ Client

◆ Ptr

Definition at line 147 of file cliopt.hpp.

Constructor & Destructor Documentation

◆ ClientOptions()

openvpn::ClientOptions::ClientOptions ( const OptionList opt,
const Config config 
)
inline

Definition at line 196 of file cliopt.hpp.

Member Function Documentation

◆ asio_work_always_on()

bool openvpn::ClientOptions::asio_work_always_on ( ) const
inline

Definition at line 1239 of file cliopt.hpp.

Here is the caller graph for this function:

◆ build_peer_info()

static PeerInfo::Set::Ptr openvpn::ClientOptions::build_peer_info ( const Config config,
const ParseClientConfig pcc,
const bool  autologin_sessions 
)
inlinestatic

Definition at line 1049 of file cliopt.hpp.

Here is the caller graph for this function:

◆ check_dco_compatibility()

static std::tuple< bool, std::string > openvpn::ClientOptions::check_dco_compatibility ( const ClientAPI::ConfigCommon config,
const OptionList opt 
)
inlinestatic

Checks if there are dco-incompatible options in options list or config has dco-incompatible settings. Return dcoCompatible flag and dcoIncompatibilityReason string property (if applicable)

Definition at line 599 of file cliopt.hpp.

Here is the caller graph for this function:

◆ check_for_incompatible_options()

void openvpn::ClientOptions::check_for_incompatible_options ( const OptionList opt)
inline

Definition at line 642 of file cliopt.hpp.

Here is the caller graph for this function:

◆ client_config()

Client::Config::Ptr openvpn::ClientOptions::client_config ( const bool  relay_mode)
inline

Return a client configuration to be used as configuration for the control layer.

Will basically copy a subset of this configuration object to a new smaller configuration object

Definition at line 1148 of file cliopt.hpp.

Here is the caller graph for this function:

◆ conn_timeout()

int openvpn::ClientOptions::conn_timeout ( ) const
inline

Definition at line 1234 of file cliopt.hpp.

◆ events()

ClientEvent::Queue & openvpn::ClientOptions::events ( )
inline

Definition at line 1225 of file cliopt.hpp.

Here is the caller graph for this function:

◆ finalize()

void openvpn::ClientOptions::finalize ( const bool  disconnected)
inline

Definition at line 1267 of file cliopt.hpp.

Here is the caller graph for this function:

◆ handle_unused_options()

void openvpn::ClientOptions::handle_unused_options ( const OptionList opt)
inline

This groups all the options that OpenVPN 2.x supports that the OpenVPN v3 client does not support into a number of different groups and warns or errors out if with a specific message for that group.

If any option that is not touched() after going through all groups the function will print them as unknown unsupported option(s) and error out

Definition at line 936 of file cliopt.hpp.

Here is the caller graph for this function:

◆ lifecycle()

ClientLifeCycle * openvpn::ClientOptions::lifecycle ( )
inline

Definition at line 1229 of file cliopt.hpp.

Here is the caller graph for this function:

◆ load_transport_config()

std::string openvpn::ClientOptions::load_transport_config ( )
inlineprivate

Definition at line 1335 of file cliopt.hpp.

Here is the caller graph for this function:

◆ need_creds()

bool openvpn::ClientOptions::need_creds ( ) const
inline

Definition at line 1178 of file cliopt.hpp.

◆ next()

void openvpn::ClientOptions::next ( RemoteList::Advance  type)
inline

Definition at line 1112 of file cliopt.hpp.

Here is the caller graph for this function:

◆ pause_on_connection_timeout()

bool openvpn::ClientOptions::pause_on_connection_timeout ( )
inline

Definition at line 1128 of file cliopt.hpp.

Here is the caller graph for this function:

◆ proto_config()

ProtoContext::ProtoConfig::Ptr openvpn::ClientOptions::proto_config ( const OptionList opt,
const Config config,
const ParseClientConfig pcc,
const bool  relay_mode 
)
inlineprivate

Definition at line 1282 of file cliopt.hpp.

Here is the caller graph for this function:

◆ proto_config_cached()

ProtoContext::ProtoConfig & openvpn::ClientOptions::proto_config_cached ( const bool  relay_mode)
inlineprivate

Definition at line 1274 of file cliopt.hpp.

Here is the caller graph for this function:

◆ remote_list_precache()

RemoteList::Ptr openvpn::ClientOptions::remote_list_precache ( ) const
inline

Definition at line 1244 of file cliopt.hpp.

Here is the caller graph for this function:

◆ remote_reset_cache_item()

void openvpn::ClientOptions::remote_reset_cache_item ( )
inline

Definition at line 1123 of file cliopt.hpp.

Here is the caller graph for this function:

◆ retry_on_auth_failed()

bool openvpn::ClientOptions::retry_on_auth_failed ( ) const
inline

Definition at line 1136 of file cliopt.hpp.

Here is the caller graph for this function:

◆ server_poll_timeout()

Time::Duration openvpn::ClientOptions::server_poll_timeout ( ) const
inline

Definition at line 1212 of file cliopt.hpp.

Here is the caller graph for this function:

◆ server_poll_timeout_enabled()

bool openvpn::ClientOptions::server_poll_timeout_enabled ( ) const
inline

Definition at line 1207 of file cliopt.hpp.

Here is the caller graph for this function:

◆ showOptionsByFunction()

template<typename T >
void openvpn::ClientOptions::showOptionsByFunction ( const OptionList opt,
func,
const std::string &  message,
bool  fatal,
OptionErrors errors 
)
inline

Definition at line 1035 of file cliopt.hpp.

Here is the caller graph for this function:

◆ showUnusedOptionsByList()

void openvpn::ClientOptions::showUnusedOptionsByList ( const OptionList optlist,
std::unordered_set< std::string >  option_set,
const std::string &  message,
bool  fatal,
OptionErrors errors 
)
inline

Definition at line 1025 of file cliopt.hpp.

Here is the caller graph for this function:

◆ stats()

SessionStats & openvpn::ClientOptions::stats ( )
inline

Definition at line 1217 of file cliopt.hpp.

Here is the caller graph for this function:

◆ stats_ptr()

const SessionStats::Ptr & openvpn::ClientOptions::stats_ptr ( ) const
inline

Definition at line 1221 of file cliopt.hpp.

Here is the caller graph for this function:

◆ submit_creds()

void openvpn::ClientOptions::submit_creds ( const ClientCreds::Ptr creds_arg)
inline

Definition at line 1183 of file cliopt.hpp.

Here is the caller graph for this function:

◆ update_now()

void openvpn::ClientOptions::update_now ( )
inline

Definition at line 1262 of file cliopt.hpp.

Member Data Documentation

◆ alt_proxy

AltProxy::Ptr openvpn::ClientOptions::alt_proxy
private

Definition at line 1482 of file cliopt.hpp.

◆ asio_work_always_on_

bool openvpn::ClientOptions::asio_work_always_on_
private

Definition at line 1477 of file cliopt.hpp.

◆ autologin

bool openvpn::ClientOptions::autologin
private

Definition at line 1474 of file cliopt.hpp.

◆ autologin_sessions

bool openvpn::ClientOptions::autologin_sessions
private

Definition at line 1475 of file cliopt.hpp.

◆ cli_events

ClientEvent::Queue::Ptr openvpn::ClientOptions::cli_events
private

Definition at line 1464 of file cliopt.hpp.

◆ cli_stats

SessionStats::Ptr openvpn::ClientOptions::cli_stats
private

Definition at line 1463 of file cliopt.hpp.

◆ client_lifecycle

ClientLifeCycle::Ptr openvpn::ClientOptions::client_lifecycle
private

Definition at line 1481 of file cliopt.hpp.

◆ clientconf

ClientConfigParsed openvpn::ClientOptions::clientconf
private

Definition at line 1448 of file cliopt.hpp.

◆ cp_main

ProtoContext::ProtoConfig::Ptr openvpn::ClientOptions::cp_main
private

Definition at line 1455 of file cliopt.hpp.

◆ cp_relay

ProtoContext::ProtoConfig::Ptr openvpn::ClientOptions::cp_relay
private

Definition at line 1456 of file cliopt.hpp.

◆ creds

ClientCreds::Ptr openvpn::ClientOptions::creds
private

Definition at line 1465 of file cliopt.hpp.

◆ creds_locked

bool openvpn::ClientOptions::creds_locked
private

Definition at line 1476 of file cliopt.hpp.

◆ dco

DCO::Ptr openvpn::ClientOptions::dco
private

Definition at line 1483 of file cliopt.hpp.

◆ dco_incompatible_opts

std::unordered_set<std::string> openvpn::ClientOptions::dco_incompatible_opts
inlinestatic
Initial value:
= {
"http-proxy",
"compress",
"comp-lzo"}

Definition at line 590 of file cliopt.hpp.

◆ frame

Frame::Ptr openvpn::ClientOptions::frame
private

Definition at line 1453 of file cliopt.hpp.

◆ http_proxy_options

HTTPProxyTransport::Options::Ptr openvpn::ClientOptions::http_proxy_options
private

Definition at line 1469 of file cliopt.hpp.

◆ layer

Layer openvpn::ClientOptions::layer
private

Definition at line 1454 of file cliopt.hpp.

◆ now_

Time openvpn::ClientOptions::now_
private

Definition at line 1450 of file cliopt.hpp.

◆ prng

RandomAPI::Ptr openvpn::ClientOptions::prng
private

Definition at line 1452 of file cliopt.hpp.

◆ proto_context_options

ProtoContextCompressionOptions::Ptr openvpn::ClientOptions::proto_context_options
private

Definition at line 1468 of file cliopt.hpp.

◆ push_base

PushOptionsBase::Ptr openvpn::ClientOptions::push_base
private

Definition at line 1479 of file cliopt.hpp.

◆ pushed_options_filter

OptionList::FilterBase::Ptr openvpn::ClientOptions::pushed_options_filter
private

Definition at line 1480 of file cliopt.hpp.

◆ reconnect_notify

ReconnectNotify* openvpn::ClientOptions::reconnect_notify
private

Definition at line 1462 of file cliopt.hpp.

◆ remote_list

RemoteList::Ptr openvpn::ClientOptions::remote_list
private

Definition at line 1457 of file cliopt.hpp.

◆ rng

StrongRandomAPI::Ptr openvpn::ClientOptions::rng
private

Definition at line 1451 of file cliopt.hpp.

◆ server_addr_float

bool openvpn::ClientOptions::server_addr_float
private

Definition at line 1458 of file cliopt.hpp.

◆ server_poll_timeout_

unsigned int openvpn::ClientOptions::server_poll_timeout_
private

Definition at line 1466 of file cliopt.hpp.

◆ settings_feature_not_implemented_fatal

std::unordered_set<std::string> openvpn::ClientOptions::settings_feature_not_implemented_fatal
Initial value:
= {
"askpass",
"capath",
"cd",
"chroot",
"client-nat",
"cryptoapicert",
"daemon",
"daemon",
"errors-to-stderr",
"gremlin",
"lladdr",
"log",
"log",
"log-append",
"management",
"memstats",
"msg-channel",
"ping-timer-rem",
"single-session",
"socks-proxy",
"status",
"status-version",
"syslog",
"tls-server",
"verify-hash",
"win-sys",
"writepid",
"x509-username-field",
}

Definition at line 764 of file cliopt.hpp.

◆ settings_feature_not_implemented_warn

std::unordered_set<std::string> openvpn::ClientOptions::settings_feature_not_implemented_warn
Initial value:
= {
"allow-pull-fqdn",
"bind",
"local",
"lport",
"mlock",
"mtu-disc",
"mtu-test",
"persist-local-ip",
"persist-remote-ip",
"shaper",
"tls-exit",
}

Definition at line 796 of file cliopt.hpp.

◆ settings_ignoreSilently

std::unordered_set<std::string> openvpn::ClientOptions::settings_ignoreSilently
Initial value:
= {
"ecdh-curve",
"fast-io",
"max-routes",
"mute-replay-warnings",
"nobind",
"prng",
"rcvbuf",
"replay-persist",
"script-security",
"sndbuf",
"tmp-dir",
"tun-ipv6",
"txqueuelen",
"verb"}

Definition at line 863 of file cliopt.hpp.

◆ settings_ignoreWithWarning

std::unordered_set<std::string> openvpn::ClientOptions::settings_ignoreWithWarning

Definition at line 676 of file cliopt.hpp.

◆ settings_pushonlyoptions

std::unordered_set<std::string> openvpn::ClientOptions::settings_pushonlyoptions
Initial value:
= {
"auth-token",
"auth-token-user",
"echo",
"parameter",
"ping",
"ping-exit",
"ping-restart",
"key-derivation",
"peer-id",
"protocol-flags",
"ifconfig",
"ifconfig-ipv6",
"topology",
"route-gateway"}

Definition at line 812 of file cliopt.hpp.

◆ settings_removedOptions

std::unordered_set<std::string> openvpn::ClientOptions::settings_removedOptions
Initial value:
= {
"mtu-dynamic", "no-replay", "no-name-remapping", "compat-names", "ncp-disable", "no-iv"}

Definition at line 860 of file cliopt.hpp.

◆ settings_script_plugin_feature

std::unordered_set<std::string> openvpn::ClientOptions::settings_script_plugin_feature
Initial value:
= {
"down",
"down-pre",
"ifconfig-noexec",
"ipchange",
"learn-address",
"plugin",
"route-noexec",
"route-pre-down",
"route-up",
"setenv-safe",
"tls-export-cert",
"tls-verify",
"up",
"up-delay",
"x509-track"}

Definition at line 829 of file cliopt.hpp.

◆ settings_serverOnlyOptions

std::unordered_set<std::string> openvpn::ClientOptions::settings_serverOnlyOptions

Definition at line 723 of file cliopt.hpp.

◆ settings_standalone_options

std::unordered_set<std::string> openvpn::ClientOptions::settings_standalone_options
Initial value:
= {
"genkey",
"mktun",
"rmtun",
"show-ciphers",
"show-curves",
"show-digests",
"show-engines",
"show-groups",
"show-tls",
"test-crypto"}

Definition at line 847 of file cliopt.hpp.

◆ socket_protect

SocketProtect* openvpn::ClientOptions::socket_protect
private

Definition at line 1461 of file cliopt.hpp.

◆ synchronous_dns_lookup

bool openvpn::ClientOptions::synchronous_dns_lookup
private

Definition at line 1478 of file cliopt.hpp.

◆ tcp_queue_limit

unsigned int openvpn::ClientOptions::tcp_queue_limit
private

Definition at line 1467 of file cliopt.hpp.

◆ transport_factory

TransportClientFactory::Ptr openvpn::ClientOptions::transport_factory
private

Definition at line 1459 of file cliopt.hpp.

◆ tun_factory

TunClientFactory::Ptr openvpn::ClientOptions::tun_factory
private

Definition at line 1460 of file cliopt.hpp.

◆ userlocked_username

std::string openvpn::ClientOptions::userlocked_username
private

Definition at line 1473 of file cliopt.hpp.


The documentation for this class was generated from the following file: