OpenVPN 3 Core Library
Loading...
Searching...
No Matches
OvpnDcoClient Class Reference

#include <ovpndcocli.hpp>

Inheritance diagram for OvpnDcoClient:
[legend]
Collaboration diagram for OvpnDcoClient:
[legend]

Classes

struct  PacketFrom
 

Public Member Functions

void tun_start (const OptionList &opt, TransportClient &transcli, CryptoDCSettings &dc_settings) override
 
std::string tun_name () const override
 
IP::Addr server_endpoint_addr () const override
 
unsigned short server_endpoint_port () const override
 
Protocol transport_protocol () const override
 
void transport_start () override
 
bool transport_send_const (const Buffer &buf) override
 
bool transport_send (BufferAllocated &buf) override
 
void get_remote_sockaddr (struct sockaddr_storage &sa, socklen_t &salen)
 
void del_peer (uint32_t peer_id)
 
void add_peer (uint32_t peer_id, IPv4::Addr ipv4, IPv6::Addr ipv6)
 
void update_peer_stats (uint32_t peer_id, bool sync)
 
void resolve_callback (const openvpn_io::error_code &error, results_type results) override
 
void stop_ () override
 
void apply_push_update (const OptionList &opt, TransportClient &) override
 
void rekey (const CryptoDCInstance::RekeyType rktype, const KoRekey::Info &rkinfo) override
 
void rekey_impl (const CryptoDCInstance::RekeyType rktype, const KoRekey::Info &rkinfo)
 
void rekey_impl_tb (const CryptoDCInstance::RekeyType rktype, const KoRekey::Info &rkinfo)
 
void transport_recv (BufferAllocated &buf) override
 
bool tun_read_handler (BufferAllocated &buf)
 
void transport_needs_send () override
 
void transport_error (const Error::Type fatal_err, const std::string &err_text) override
 
void proxy_error (const Error::Type fatal_err, const std::string &err_text) override
 
bool transport_is_openvpn_protocol () override
 
void transport_pre_resolve () override
 
void transport_wait_proxy () override
 
void transport_wait () override
 
void transport_connecting () override
 
bool is_keepalive_enabled () const override
 
void disable_keepalive (unsigned int &keepalive_ping, unsigned int &keepalive_timeout) override
 
- Public Member Functions inherited from Client
 Client (OMI *omi)
 
bool is_dynamic_challenge () const
 
std::string dynamic_challenge_cookie ()
 
void set_clock_tick_action (const ClockTickAction action)
 
void print_stats ()
 
void set_write_url_fn (const std::string &fn)
 
- Public Member Functions inherited from openvpn::ClientAPI::OpenVPNClient
 OpenVPNClient ()
 
virtual ~OpenVPNClient ()
 
EvalConfig eval_config (const Config &)
 
Status provide_creds (const ProvideCreds &)
 
Status connect ()
 
ConnectionInfo connection_info ()
 
bool session_token (SessionToken &tok)
 
void stop ()
 
void pause (const std::string &reason)
 
void resume ()
 
void reconnect (int seconds)
 
long long stats_value (int index) const
 
std::vector< long long > stats_bundle () const
 
InterfaceStats tun_stats () const
 
TransportStats transport_stats () const
 
void post_cc_msg (const std::string &msg)
 
void send_app_control_channel_msg (const std::string &protocol, const std::string &msg)
 
void start_cert_check (const std::string &client_cert, const std::string &clientkey, const std::optional< const std::string > &ca=std::nullopt)
 Start up the cert check handshake using the given certs and key.
 
void start_cert_check_epki (const std::string &alias, const std::optional< const std::string > &ca)
 Start up the cert check handshake using the given epki_alias string.
 
virtual bool remote_override_enabled ()
 
virtual void remote_override (RemoteOverride &)
 
- Public Member Functions inherited from openvpn::TunBuilderBase
virtual bool tun_builder_new ()
 Callback to construct a new TunBuilder. This function should be called first.
 
virtual bool tun_builder_set_layer (int layer)
 Optional callback that indicates OSI layer to be used.
 
virtual bool tun_builder_set_remote_address (const std::string &address, bool ipv6)
 Callback to set the address of the remote server.
 
virtual bool tun_builder_add_address (const std::string &address, int prefix_length, const std::string &gateway, bool ipv6, bool net30)
 Callback to add a network address to the VPN interface.
 
virtual bool tun_builder_set_route_metric_default (int metric)
 Optional callback to set default value for route metric.
 
virtual bool tun_builder_reroute_gw (bool ipv4, bool ipv6, unsigned int flags)
 Callback to reroute the default gateway to the VPN interface.
 
virtual bool tun_builder_add_route (const std::string &address, int prefix_length, int metric, bool ipv6)
 Callback to add a route to the VPN interface.
 
virtual bool tun_builder_exclude_route (const std::string &address, int prefix_length, int metric, bool ipv6)
 Callback to exclude route from VPN interface.
 
virtual bool tun_builder_set_dns_options (const DnsOptions &dns)
 Callback to set DNS related options to VPN interface.
 
virtual bool tun_builder_set_mtu (int mtu)
 Callback to set the MTU of the VPN interface.
 
virtual bool tun_builder_set_session_name (const std::string &name)
 Sets the session name for the TunBuilder.
 
virtual bool tun_builder_add_proxy_bypass (const std::string &bypass_host)
 Callback to add a host which should bypass the proxy.
 
virtual bool tun_builder_set_proxy_auto_config_url (const std::string &url)
 Callback to set the proxy "Auto Config URL".
 
virtual bool tun_builder_set_proxy_http (const std::string &host, int port)
 Callback to set the HTTP proxy.
 
virtual bool tun_builder_set_proxy_https (const std::string &host, int port)
 Set the HTTPS proxy for the TunBuilder session.
 
virtual bool tun_builder_add_wins_server (const std::string &address)
 Callback to add a Windows WINS server to the VPN interface.
 
virtual bool tun_builder_set_allow_family (int af, bool allow)
 Indicates whether traffic of a certain address family (AF_INET or AF_INET6) should be blocked or allowed.
 
virtual bool tun_builder_set_allow_local_dns (bool allow)
 Optional callback that indicates whether local DNS traffic should be blocked or allowed to prevent DNS queries from leaking while the tunnel is connected.
 
virtual int tun_builder_establish ()
 Callback to establish the VPN tunnel.
 
virtual bool tun_builder_persist ()
 Determines if the TUN interface can be persisted.
 
virtual std::vector< std::string > tun_builder_get_local_networks (bool ipv6)
 Retrieves a list of local networks to exclude from the VPN network.
 
virtual void tun_builder_establish_lite ()
 Indicates a reconnection with persisted TUN state.
 
virtual void tun_builder_teardown (bool disconnect)
 Indicates that tunnel is being torn down.
 
virtual ~TunBuilderBase ()=default
 Virtual destructor for the TunBuilderBase class.
 
- Public Member Functions inherited from openvpn::ClientAPI::LogReceiver
virtual ~LogReceiver ()=default
 
- Public Member Functions inherited from ClientBase
bool socket_protect (openvpn_io::detail::socket_type socket, std::string remote, bool ipv6) override
 

Static Public Member Functions

static bool available (TunBuilderBase *tb)
 
- Static Public Member Functions inherited from openvpn::ClientAPI::OpenVPNClient
static int stats_n ()
 
static std::string stats_name (int index)
 

Private Types

typedef RCPtr< OvpnDcoClientPtr
 
typedef GeNL< OvpnDcoClient * > GeNLImpl
 

Private Member Functions

 OPENVPN_EXCEPTION (dcocli_error)
 
 OvpnDcoClient (openvpn_io::io_context &io_context_arg, ClientConfig *config_arg, TransportClientParent *parent_arg)
 
void tun_setup (const OptionList &opt)
 
void handle_keepalive ()
 
void queue_read_pipe (PacketFrom *pkt)
 
SessionStats::DCOTransportSource::Data dco_transport_stats_delta () override
 

Private Attributes

std::unique_ptr< openvpn_io::posix::stream_descriptor > pipe
 
GeNLImpl::Ptr genl
 
TransportClient::Ptr transport
 
SessionStats::DCOTransportSource::Data last_stats
 
SessionStats::DCOTransportSource::Data last_delta
 

Friends

class ClientConfig
 
class GeNL
 

Additional Inherited Members

- Public Types inherited from Client
enum  ClockTickAction {
  CT_UNDEF , CT_STOP , CT_RECONNECT , CT_PAUSE ,
  CT_RESUME , CT_STATS
}
 
- Public Attributes inherited from Client
std::string epki_ca
 
std::string epki_cert
 
std::string certcheck_cert
 file name of properly encoded server cert
 
std::string certcheck_clientca_fn
 file name of properly encoded client ca
 
- Protected Member Functions inherited from openvpn::ClientAPI::OpenVPNClient
Status do_connect ()
 
virtual void connect_attach ()
 
virtual void connect_pre_run ()
 
virtual void connect_run ()
 
virtual void connect_session_stop ()
 
virtual Stopget_async_stop ()
 
- Protected Attributes inherited from openvpn::ClientAPI::OpenVPNClient
Private::ClientStatestate
 

Detailed Description

Definition at line 19 of file ovpndcocli.hpp.

Member Typedef Documentation

◆ GeNLImpl

Definition at line 30 of file ovpndcocli.hpp.

◆ Ptr

typedef RCPtr<OvpnDcoClient> OvpnDcoClient::Ptr
private

Definition at line 29 of file ovpndcocli.hpp.

Constructor & Destructor Documentation

◆ OvpnDcoClient()

OvpnDcoClient::OvpnDcoClient ( openvpn_io::io_context &  io_context_arg,
ClientConfig config_arg,
TransportClientParent *  parent_arg 
)
inlineprivate

Definition at line 527 of file ovpndcocli.hpp.

Member Function Documentation

◆ add_peer()

void OvpnDcoClient::add_peer ( uint32_t  peer_id,
IPv4::Addr  ipv4,
IPv6::Addr  ipv6 
)
inline

Definition at line 190 of file ovpndcocli.hpp.

Here is the caller graph for this function:

◆ apply_push_update()

void OvpnDcoClient::apply_push_update ( const OptionList &  opt,
TransportClient &   
)
inlineoverride

Definition at line 282 of file ovpndcocli.hpp.

◆ available()

static bool OvpnDcoClient::available ( TunBuilderBase *  tb)
inlinestatic

Definition at line 39 of file ovpndcocli.hpp.

◆ dco_transport_stats_delta()

SessionStats::DCOTransportSource::Data OvpnDcoClient::dco_transport_stats_delta ( )
inlineoverrideprivate

Definition at line 690 of file ovpndcocli.hpp.

◆ del_peer()

void OvpnDcoClient::del_peer ( uint32_t  peer_id)
inline

Definition at line 176 of file ovpndcocli.hpp.

◆ disable_keepalive()

void OvpnDcoClient::disable_keepalive ( unsigned int &  keepalive_ping,
unsigned int &  keepalive_timeout 
)
inlineoverride

Definition at line 520 of file ovpndcocli.hpp.

◆ get_remote_sockaddr()

void OvpnDcoClient::get_remote_sockaddr ( struct sockaddr_storage &  sa,
socklen_t &  salen 
)
inline

Definition at line 156 of file ovpndcocli.hpp.

Here is the caller graph for this function:

◆ handle_keepalive()

void OvpnDcoClient::handle_keepalive ( )
inlineprivate

Definition at line 621 of file ovpndcocli.hpp.

Here is the caller graph for this function:

◆ is_keepalive_enabled()

bool OvpnDcoClient::is_keepalive_enabled ( ) const
inlineoverride

Definition at line 515 of file ovpndcocli.hpp.

◆ OPENVPN_EXCEPTION()

OvpnDcoClient::OPENVPN_EXCEPTION ( dcocli_error  )
private

◆ proxy_error()

void OvpnDcoClient::proxy_error ( const Error::Type  fatal_err,
const std::string &  err_text 
)
inlineoverride

Definition at line 484 of file ovpndcocli.hpp.

◆ queue_read_pipe()

void OvpnDcoClient::queue_read_pipe ( PacketFrom pkt)
inlineprivate

Definition at line 655 of file ovpndcocli.hpp.

Here is the caller graph for this function:

◆ rekey()

void OvpnDcoClient::rekey ( const CryptoDCInstance::RekeyType  rktype,
const KoRekey::Info &  rkinfo 
)
inlineoverride

Definition at line 288 of file ovpndcocli.hpp.

◆ rekey_impl()

void OvpnDcoClient::rekey_impl ( const CryptoDCInstance::RekeyType  rktype,
const KoRekey::Info &  rkinfo 
)
inline

Definition at line 300 of file ovpndcocli.hpp.

Here is the caller graph for this function:

◆ rekey_impl_tb()

void OvpnDcoClient::rekey_impl_tb ( const CryptoDCInstance::RekeyType  rktype,
const KoRekey::Info &  rkinfo 
)
inline

Definition at line 342 of file ovpndcocli.hpp.

Here is the caller graph for this function:

◆ resolve_callback()

void OvpnDcoClient::resolve_callback ( const openvpn_io::error_code &  error,
results_type  results 
)
inlineoverride

Definition at line 244 of file ovpndcocli.hpp.

◆ server_endpoint_addr()

IP::Addr OvpnDcoClient::server_endpoint_addr ( ) const
inlineoverride

Definition at line 92 of file ovpndcocli.hpp.

Here is the caller graph for this function:

◆ server_endpoint_port()

unsigned short OvpnDcoClient::server_endpoint_port ( ) const
inlineoverride

Definition at line 100 of file ovpndcocli.hpp.

◆ stop_()

void OvpnDcoClient::stop_ ( )
inlineoverride

Definition at line 249 of file ovpndcocli.hpp.

Here is the caller graph for this function:

◆ transport_connecting()

void OvpnDcoClient::transport_connecting ( )
inlineoverride

Definition at line 510 of file ovpndcocli.hpp.

◆ transport_error()

void OvpnDcoClient::transport_error ( const Error::Type  fatal_err,
const std::string &  err_text 
)
inlineoverride

Definition at line 478 of file ovpndcocli.hpp.

◆ transport_is_openvpn_protocol()

bool OvpnDcoClient::transport_is_openvpn_protocol ( )
inlineoverride

Definition at line 490 of file ovpndcocli.hpp.

◆ transport_needs_send()

void OvpnDcoClient::transport_needs_send ( )
inlineoverride

Definition at line 473 of file ovpndcocli.hpp.

◆ transport_pre_resolve()

void OvpnDcoClient::transport_pre_resolve ( )
inlineoverride

Definition at line 495 of file ovpndcocli.hpp.

◆ transport_protocol()

Protocol OvpnDcoClient::transport_protocol ( ) const
inlineoverride

Definition at line 108 of file ovpndcocli.hpp.

◆ transport_recv()

void OvpnDcoClient::transport_recv ( BufferAllocated &  buf)
inlineoverride

Definition at line 381 of file ovpndcocli.hpp.

◆ transport_send()

bool OvpnDcoClient::transport_send ( BufferAllocated &  buf)
inlineoverride

Definition at line 148 of file ovpndcocli.hpp.

◆ transport_send_const()

bool OvpnDcoClient::transport_send_const ( const Buffer &  buf)
inlineoverride

Definition at line 143 of file ovpndcocli.hpp.

◆ transport_start()

void OvpnDcoClient::transport_start ( )
inlineoverride

Definition at line 113 of file ovpndcocli.hpp.

◆ transport_wait()

void OvpnDcoClient::transport_wait ( )
inlineoverride

Definition at line 505 of file ovpndcocli.hpp.

◆ transport_wait_proxy()

void OvpnDcoClient::transport_wait_proxy ( )
inlineoverride

Definition at line 500 of file ovpndcocli.hpp.

◆ tun_name()

std::string OvpnDcoClient::tun_name ( ) const
inlineoverride

Definition at line 87 of file ovpndcocli.hpp.

◆ tun_read_handler()

bool OvpnDcoClient::tun_read_handler ( BufferAllocated &  buf)
inline

Definition at line 386 of file ovpndcocli.hpp.

◆ tun_setup()

void OvpnDcoClient::tun_setup ( const OptionList &  opt)
inlineprivate

Definition at line 563 of file ovpndcocli.hpp.

Here is the caller graph for this function:

◆ tun_start()

void OvpnDcoClient::tun_start ( const OptionList &  opt,
TransportClient &  transcli,
CryptoDCSettings &  dc_settings 
)
inlineoverride

Definition at line 47 of file ovpndcocli.hpp.

◆ update_peer_stats()

void OvpnDcoClient::update_peer_stats ( uint32_t  peer_id,
bool  sync 
)
inline

Definition at line 221 of file ovpndcocli.hpp.

Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ ClientConfig

friend class ClientConfig
friend

Definition at line 24 of file ovpndcocli.hpp.

◆ GeNL

friend class GeNL
friend

Definition at line 25 of file ovpndcocli.hpp.

Member Data Documentation

◆ genl

GeNLImpl::Ptr OvpnDcoClient::genl
private

Definition at line 707 of file ovpndcocli.hpp.

◆ last_delta

SessionStats::DCOTransportSource::Data OvpnDcoClient::last_delta
private

Definition at line 710 of file ovpndcocli.hpp.

◆ last_stats

SessionStats::DCOTransportSource::Data OvpnDcoClient::last_stats
private

Definition at line 709 of file ovpndcocli.hpp.

◆ pipe

std::unique_ptr<openvpn_io::posix::stream_descriptor> OvpnDcoClient::pipe
private

Definition at line 705 of file ovpndcocli.hpp.

◆ transport

TransportClient::Ptr OvpnDcoClient::transport
private

Definition at line 708 of file ovpndcocli.hpp.


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