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 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 (String config_text, String username, String password) throws ConfigError, CredsUnspecifiedError
 
void connect ()
 
void stop ()
 
void show_stats ()
 
void event (ClientAPI_Event event)
 
void external_pki_cert_request (ClientAPI_ExternalPKICertRequest req)
 
void external_pki_sign_request (ClientAPI_ExternalPKISignRequest req)
 
void log (ClientAPI_LogInfo loginfo)
 
void done (ClientAPI_Status status)
 
boolean socket_protect (int socket)
 
boolean pause_on_connection_timeout ()
 
OpenVPNClientThread.TunBuilder tun_builder_new ()
 
 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_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 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 560 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 237 of file ovpndcocli.hpp.

Here is the caller graph for this function:

◆ 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 663 of file ovpndcocli.hpp.

◆ del_peer()

void OvpnDcoClient::del_peer ( uint32_t  peer_id)
inline

Definition at line 225 of file ovpndcocli.hpp.

◆ disable_keepalive()

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

Definition at line 553 of file ovpndcocli.hpp.

◆ get_remote_sockaddr()

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

Definition at line 205 of file ovpndcocli.hpp.

Here is the caller graph for this function:

◆ handle_keepalive()

void OvpnDcoClient::handle_keepalive ( )
inlineprivate

Definition at line 596 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 548 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 517 of file ovpndcocli.hpp.

◆ queue_read_pipe()

void OvpnDcoClient::queue_read_pipe ( PacketFrom pkt)
inlineprivate

Definition at line 628 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 323 of file ovpndcocli.hpp.

◆ rekey_impl()

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

Definition at line 335 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 375 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 285 of file ovpndcocli.hpp.

◆ server_endpoint_addr()

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

Definition at line 142 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 150 of file ovpndcocli.hpp.

◆ stop_()

void OvpnDcoClient::stop_ ( )
inlineoverride

Definition at line 290 of file ovpndcocli.hpp.

Here is the caller graph for this function:

◆ transport_connecting()

void OvpnDcoClient::transport_connecting ( )
inlineoverride

Definition at line 543 of file ovpndcocli.hpp.

◆ transport_error()

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

Definition at line 511 of file ovpndcocli.hpp.

◆ transport_is_openvpn_protocol()

bool OvpnDcoClient::transport_is_openvpn_protocol ( )
inlineoverride

Definition at line 523 of file ovpndcocli.hpp.

◆ transport_needs_send()

void OvpnDcoClient::transport_needs_send ( )
inlineoverride

Definition at line 506 of file ovpndcocli.hpp.

◆ transport_pre_resolve()

void OvpnDcoClient::transport_pre_resolve ( )
inlineoverride

Definition at line 528 of file ovpndcocli.hpp.

◆ transport_protocol()

Protocol OvpnDcoClient::transport_protocol ( ) const
inlineoverride

Definition at line 158 of file ovpndcocli.hpp.

◆ transport_recv()

void OvpnDcoClient::transport_recv ( BufferAllocated &  buf)
inlineoverride

Definition at line 414 of file ovpndcocli.hpp.

◆ transport_send()

bool OvpnDcoClient::transport_send ( BufferAllocated &  buf)
inlineoverride

Definition at line 198 of file ovpndcocli.hpp.

◆ transport_send_const()

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

Definition at line 193 of file ovpndcocli.hpp.

◆ transport_start()

void OvpnDcoClient::transport_start ( )
inlineoverride

Definition at line 163 of file ovpndcocli.hpp.

◆ transport_wait()

void OvpnDcoClient::transport_wait ( )
inlineoverride

Definition at line 538 of file ovpndcocli.hpp.

◆ transport_wait_proxy()

void OvpnDcoClient::transport_wait_proxy ( )
inlineoverride

Definition at line 533 of file ovpndcocli.hpp.

◆ tun_name()

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

Definition at line 137 of file ovpndcocli.hpp.

◆ tun_read_handler()

bool OvpnDcoClient::tun_read_handler ( BufferAllocated &  buf)
inline

Definition at line 419 of file ovpndcocli.hpp.

◆ 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 264 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 680 of file ovpndcocli.hpp.

◆ last_delta

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

Definition at line 683 of file ovpndcocli.hpp.

◆ last_stats

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

Definition at line 682 of file ovpndcocli.hpp.

◆ pipe

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

Definition at line 678 of file ovpndcocli.hpp.

◆ transport

TransportClient::Ptr OvpnDcoClient::transport
private

Definition at line 681 of file ovpndcocli.hpp.


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