OpenVPN 3 Core Library
Loading...
Searching...
No Matches
OMI Class Reference
Inheritance diagram for OMI:
[legend]
Collaboration diagram for OMI:
[legend]

Public Types

typedef RCPtr< OMIPtr
 
- Public Types inherited from openvpn::Acceptor::ListenerBase
typedef RCPtr< ListenerBasePtr
 

Public Member Functions

 OMI (openvpn_io::io_context &io_context, OptionList opt_arg)
 
void start ()
 
void log (const ClientAPI::LogInfo &msg) override
 
void event (const ClientAPI::Event &ev)
 
void event (const ClientAPI::Event &ev, const ClientAPI::ConnectionInfo &ci)
 
void external_pki_cert_request (ClientAPI::ExternalPKICertRequest &certreq)
 
virtual void acc_event (const openvpn::ClientAPI::AppCustomControlMessageEvent &event)
 
void external_pki_sign_request (ClientAPI::ExternalPKISignRequest &signreq)
 
void epki_sign_request ()
 
void epki_sign_reply (const Command &cmd)
 
bool omi_command_is_multiline (const std::string &arg0, const Option &o) override
 
- Public Member Functions inherited from openvpn::OMICore
 OPENVPN_EXCEPTION (omi_error)
 
void stop ()
 
- Public Member Functions inherited from openvpn::ClientAPI::LogReceiver
virtual ~LogReceiver ()=default
 

Private Types

typedef openvpn_io::windows::object_handle AsioEvent
 

Private Member Functions

bool omi_command_in (const std::string &arg0, const Command &cmd) override
 
void omi_done (const bool eof) override
 
std::vector< ClientAPI::KeyValueget_peer_info () const
 
void omi_start_connection () override
 
void query_username_password (const std::string &type, const bool password_only, const std::string &static_challenge, const bool static_challenge_echo)
 
bool is_auth_cmd (const std::string &arg0) const
 
void process_auth_cmd (const Option &o)
 
void reset_auth_cmd ()
 
void provide_username_password (const std::string &type, const std::string &username, const std::string &password)
 
void query_remote (const std::string &host, const std::string &port, const std::string &proto)
 
void process_remote_cmd (const Option &o)
 
void schedule_bytecount_timer ()
 
void report_bytecount ()
 
void start_connection_thread ()
 
void connection_thread ()
 
void join_thread ()
 
bool omi_stop () override
 
void retry ()
 
void deferred_reconnect (const unsigned int seconds, const std::string &reason)
 
void omi_sigterm () override
 
bool omi_is_sighup_implemented () override
 
void omi_sighup () override
 
void log_msg (const ClientAPI::LogInfo &msg)
 
void event_msg (const ClientAPI::Event &ev, const ClientAPI::ConnectionInfo *ci)
 
void emit_up_down (const std::string &state)
 
void set_final_error (const std::string &err)
 
std::string get_final_error ()
 
void signal (const openvpn_io::error_code &error, int signum)
 
void signal_rearm ()
 

Static Private Member Functions

static std::string event_format (const ClientAPI::Event &ev, const ClientAPI::ConnectionInfo *ci)
 
static std::string gen_state_msg (const bool prefix, std::string name, std::string info)
 

Private Attributes

OptionList opt
 
std::unique_ptr< Clientclient
 
std::unique_ptr< ClientAPI::Configconfig
 
std::unique_ptr< ClientAPI::ProvideCredscreds
 
std::unique_ptr< std::thread > thread
 
std::string final_error
 
Stop async_stop
 
int connection_timeout = 0
 
bool management_query_passwords = false
 
bool auth_nocache = false
 
std::string auth_type
 
bool auth_password_only = false
 
std::string auth_username
 
std::string auth_password
 
std::string dc_cookie
 
bool management_query_remote = false
 
bool did_query_remote = false
 
bool remote_pending = false
 
std::string remote_override
 
std::string proto_override
 
std::string http_proxy_host
 
std::string http_proxy_port
 
bool proxy_need_creds = false
 
std::string reconnect_reason
 
AsioTimerSafe reconnect_timer
 
AsioTimerSafe bytecount_timer
 
bool management_external_key = false
 
std::mutex epki_mutex
 
std::condition_variable epki_cv
 
ClientAPI::ExternalPKISignRequestepki_signreq = nullptr
 
bool management_up_down = false
 
bool autologin = false
 
ASIOSignals::Ptr signals
 
AsioEvent exit_event
 
std::string exit_event_name
 
Log::Context log_context
 

Additional Inherited Members

- Protected Member Functions inherited from openvpn::OMICore
 OMICore (openvpn_io::io_context &io_context_arg)
 
void log_setup (const LogFn &log)
 
void start (const OptionList &opt)
 
void start_connection_if_not_hold ()
 
void send (BufferPtr buf)
 
void send (const std::string &str)
 
bool send_ready () const
 
void async_done ()
 
void log_full (const std::string &text)
 
void log_timestamp (const time_t timestamp, const std::string &text)
 
void log_line (const std::string &line)
 
void state_line (const std::string &line)
 
void echo_line (const std::string &line)
 
bool is_errors_to_stderr () const
 
bool is_stopping () const
 
unsigned int get_bytecount () const
 
- Static Protected Member Functions inherited from openvpn::OMICore
static std::string get_config (const OptionList &opt)
 
- Protected Attributes inherited from openvpn::OMICore
openvpn_io::io_context & io_context
 

Detailed Description

Definition at line 81 of file openvpn.cpp.

Member Typedef Documentation

◆ AsioEvent

typedef openvpn_io::windows::object_handle OMI::AsioEvent
private

Definition at line 1004 of file openvpn.cpp.

◆ Ptr

typedef RCPtr<OMI> OMI::Ptr

Definition at line 84 of file openvpn.cpp.

Constructor & Destructor Documentation

◆ OMI()

OMI::OMI ( openvpn_io::io_context &  io_context,
OptionList  opt_arg 
)
inline

Definition at line 86 of file openvpn.cpp.

Member Function Documentation

◆ acc_event()

virtual void OMI::acc_event ( const openvpn::ClientAPI::AppCustomControlMessageEvent event)
inlinevirtual

Definition at line 163 of file openvpn.cpp.

Here is the caller graph for this function:

◆ connection_thread()

void OMI::connection_thread ( )
inlineprivate

Definition at line 600 of file openvpn.cpp.

Here is the caller graph for this function:

◆ deferred_reconnect()

void OMI::deferred_reconnect ( const unsigned int  seconds,
const std::string &  reason 
)
inlineprivate

Definition at line 697 of file openvpn.cpp.

Here is the caller graph for this function:

◆ emit_up_down()

void OMI::emit_up_down ( const std::string &  state)
inlineprivate

Definition at line 898 of file openvpn.cpp.

Here is the caller graph for this function:

◆ epki_sign_reply()

void OMI::epki_sign_reply ( const Command cmd)
inline

Definition at line 220 of file openvpn.cpp.

Here is the caller graph for this function:

◆ epki_sign_request()

void OMI::epki_sign_request ( )
inline

Definition at line 209 of file openvpn.cpp.

Here is the caller graph for this function:

◆ event() [1/2]

void OMI::event ( const ClientAPI::Event ev)
inline

Definition at line 146 of file openvpn.cpp.

Here is the caller graph for this function:

◆ event() [2/2]

void OMI::event ( const ClientAPI::Event ev,
const ClientAPI::ConnectionInfo ci 
)
inline

Definition at line 152 of file openvpn.cpp.

◆ event_format()

static std::string OMI::event_format ( const ClientAPI::Event ev,
const ClientAPI::ConnectionInfo ci 
)
inlinestaticprivate

Definition at line 732 of file openvpn.cpp.

Here is the caller graph for this function:

◆ event_msg()

void OMI::event_msg ( const ClientAPI::Event ev,
const ClientAPI::ConnectionInfo ci 
)
inlineprivate

Definition at line 756 of file openvpn.cpp.

Here is the caller graph for this function:

◆ external_pki_cert_request()

void OMI::external_pki_cert_request ( ClientAPI::ExternalPKICertRequest certreq)
inline

Definition at line 158 of file openvpn.cpp.

Here is the caller graph for this function:

◆ external_pki_sign_request()

void OMI::external_pki_sign_request ( ClientAPI::ExternalPKISignRequest signreq)
inline

Definition at line 168 of file openvpn.cpp.

Here is the caller graph for this function:

◆ gen_state_msg()

static std::string OMI::gen_state_msg ( const bool  prefix,
std::string  name,
std::string  info 
)
inlinestaticprivate

Definition at line 744 of file openvpn.cpp.

Here is the caller graph for this function:

◆ get_final_error()

std::string OMI::get_final_error ( )
inlineprivate

Definition at line 911 of file openvpn.cpp.

Here is the caller graph for this function:

◆ get_peer_info()

std::vector< ClientAPI::KeyValue > OMI::get_peer_info ( ) const
inlineprivate

Definition at line 304 of file openvpn.cpp.

Here is the caller graph for this function:

◆ is_auth_cmd()

bool OMI::is_auth_cmd ( const std::string &  arg0) const
inlineprivate

Definition at line 416 of file openvpn.cpp.

Here is the caller graph for this function:

◆ join_thread()

void OMI::join_thread ( )
inlineprivate

Definition at line 636 of file openvpn.cpp.

Here is the caller graph for this function:

◆ log()

void OMI::log ( const ClientAPI::LogInfo msg)
inlineoverridevirtual

Implements openvpn::ClientAPI::LogReceiver.

Definition at line 140 of file openvpn.cpp.

Here is the caller graph for this function:

◆ log_msg()

void OMI::log_msg ( const ClientAPI::LogInfo msg)
inlineprivate

Definition at line 727 of file openvpn.cpp.

Here is the caller graph for this function:

◆ omi_command_in()

bool OMI::omi_command_in ( const std::string &  arg0,
const Command cmd 
)
inlineoverrideprivatevirtual

Implements openvpn::OMICore.

Definition at line 258 of file openvpn.cpp.

◆ omi_command_is_multiline()

bool OMI::omi_command_is_multiline ( const std::string &  arg0,
const Option o 
)
inlineoverridevirtual

Implements openvpn::OMICore.

Definition at line 250 of file openvpn.cpp.

◆ omi_done()

void OMI::omi_done ( const bool  eof)
inlineoverrideprivatevirtual

Implements openvpn::OMICore.

Definition at line 299 of file openvpn.cpp.

◆ omi_is_sighup_implemented()

bool OMI::omi_is_sighup_implemented ( )
inlineoverrideprivatevirtual

Reimplemented from openvpn::OMICore.

Definition at line 716 of file openvpn.cpp.

◆ omi_sighup()

void OMI::omi_sighup ( )
inlineoverrideprivatevirtual

Reimplemented from openvpn::OMICore.

Definition at line 721 of file openvpn.cpp.

Here is the caller graph for this function:

◆ omi_sigterm()

void OMI::omi_sigterm ( )
inlineoverrideprivatevirtual

Implements openvpn::OMICore.

Definition at line 709 of file openvpn.cpp.

Here is the caller graph for this function:

◆ omi_start_connection()

void OMI::omi_start_connection ( )
inlineoverrideprivatevirtual

Implements openvpn::OMICore.

Definition at line 325 of file openvpn.cpp.

Here is the caller graph for this function:

◆ omi_stop()

bool OMI::omi_stop ( )
inlineoverrideprivatevirtual

Implements openvpn::OMICore.

Definition at line 648 of file openvpn.cpp.

◆ process_auth_cmd()

void OMI::process_auth_cmd ( const Option o)
inlineprivate

Definition at line 421 of file openvpn.cpp.

Here is the caller graph for this function:

◆ process_remote_cmd()

void OMI::process_remote_cmd ( const Option o)
inlineprivate

Definition at line 501 of file openvpn.cpp.

Here is the caller graph for this function:

◆ provide_username_password()

void OMI::provide_username_password ( const std::string &  type,
const std::string &  username,
const std::string &  password 
)
inlineprivate

Definition at line 459 of file openvpn.cpp.

Here is the caller graph for this function:

◆ query_remote()

void OMI::query_remote ( const std::string &  host,
const std::string &  port,
const std::string &  proto 
)
inlineprivate

Definition at line 495 of file openvpn.cpp.

Here is the caller graph for this function:

◆ query_username_password()

void OMI::query_username_password ( const std::string &  type,
const bool  password_only,
const std::string &  static_challenge,
const bool  static_challenge_echo 
)
inlineprivate

Definition at line 385 of file openvpn.cpp.

Here is the caller graph for this function:

◆ report_bytecount()

void OMI::report_bytecount ( )
inlineprivate

Definition at line 556 of file openvpn.cpp.

◆ reset_auth_cmd()

void OMI::reset_auth_cmd ( )
inlineprivate

Definition at line 451 of file openvpn.cpp.

Here is the caller graph for this function:

◆ retry()

void OMI::retry ( )
inlineprivate

Definition at line 688 of file openvpn.cpp.

Here is the caller graph for this function:

◆ schedule_bytecount_timer()

void OMI::schedule_bytecount_timer ( )
inlineprivate

Definition at line 542 of file openvpn.cpp.

Here is the caller graph for this function:

◆ set_final_error()

void OMI::set_final_error ( const std::string &  err)
inlineprivate

Definition at line 905 of file openvpn.cpp.

Here is the caller graph for this function:

◆ signal()

void OMI::signal ( const openvpn_io::error_code &  error,
int  signum 
)
inlineprivate

Definition at line 916 of file openvpn.cpp.

◆ signal_rearm()

void OMI::signal_rearm ( )
inlineprivate

Definition at line 937 of file openvpn.cpp.

Here is the caller graph for this function:

◆ start()

void OMI::start ( )
inline

Definition at line 98 of file openvpn.cpp.

◆ start_connection_thread()

void OMI::start_connection_thread ( )
inlineprivate

Definition at line 566 of file openvpn.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ async_stop

Stop OMI::async_stop
private

Definition at line 952 of file openvpn.cpp.

◆ auth_nocache

bool OMI::auth_nocache = false
private

Definition at line 959 of file openvpn.cpp.

◆ auth_password

std::string OMI::auth_password
private

Definition at line 963 of file openvpn.cpp.

◆ auth_password_only

bool OMI::auth_password_only = false
private

Definition at line 961 of file openvpn.cpp.

◆ auth_type

std::string OMI::auth_type
private

Definition at line 960 of file openvpn.cpp.

◆ auth_username

std::string OMI::auth_username
private

Definition at line 962 of file openvpn.cpp.

◆ autologin

bool OMI::autologin = false
private

Definition at line 999 of file openvpn.cpp.

◆ bytecount_timer

AsioTimerSafe OMI::bytecount_timer
private

Definition at line 987 of file openvpn.cpp.

◆ client

std::unique_ptr<Client> OMI::client
private

Definition at line 947 of file openvpn.cpp.

◆ config

std::unique_ptr<ClientAPI::Config> OMI::config
private

Definition at line 948 of file openvpn.cpp.

◆ connection_timeout

int OMI::connection_timeout = 0
private

Definition at line 955 of file openvpn.cpp.

◆ creds

std::unique_ptr<ClientAPI::ProvideCreds> OMI::creds
private

Definition at line 949 of file openvpn.cpp.

◆ dc_cookie

std::string OMI::dc_cookie
private

Definition at line 964 of file openvpn.cpp.

◆ did_query_remote

bool OMI::did_query_remote = false
private

Definition at line 968 of file openvpn.cpp.

◆ epki_cv

std::condition_variable OMI::epki_cv
private

Definition at line 992 of file openvpn.cpp.

◆ epki_mutex

std::mutex OMI::epki_mutex
private

Definition at line 991 of file openvpn.cpp.

◆ epki_signreq

ClientAPI::ExternalPKISignRequest* OMI::epki_signreq = nullptr
private

Definition at line 993 of file openvpn.cpp.

◆ exit_event

AsioEvent OMI::exit_event
private

Definition at line 1005 of file openvpn.cpp.

◆ exit_event_name

std::string OMI::exit_event_name
private

Definition at line 1006 of file openvpn.cpp.

◆ final_error

std::string OMI::final_error
private

Definition at line 951 of file openvpn.cpp.

◆ http_proxy_host

std::string OMI::http_proxy_host
private

Definition at line 976 of file openvpn.cpp.

◆ http_proxy_port

std::string OMI::http_proxy_port
private

Definition at line 977 of file openvpn.cpp.

◆ log_context

Log::Context OMI::log_context
private

Definition at line 1008 of file openvpn.cpp.

◆ management_external_key

bool OMI::management_external_key = false
private

Definition at line 990 of file openvpn.cpp.

◆ management_query_passwords

bool OMI::management_query_passwords = false
private

Definition at line 958 of file openvpn.cpp.

◆ management_query_remote

bool OMI::management_query_remote = false
private

Definition at line 967 of file openvpn.cpp.

◆ management_up_down

bool OMI::management_up_down = false
private

Definition at line 996 of file openvpn.cpp.

◆ opt

OptionList OMI::opt
private

Definition at line 944 of file openvpn.cpp.

◆ proto_override

std::string OMI::proto_override
private

Definition at line 973 of file openvpn.cpp.

◆ proxy_need_creds

bool OMI::proxy_need_creds = false
private

Definition at line 978 of file openvpn.cpp.

◆ reconnect_reason

std::string OMI::reconnect_reason
private

Definition at line 981 of file openvpn.cpp.

◆ reconnect_timer

AsioTimerSafe OMI::reconnect_timer
private

Definition at line 984 of file openvpn.cpp.

◆ remote_override

std::string OMI::remote_override
private

Definition at line 970 of file openvpn.cpp.

◆ remote_pending

bool OMI::remote_pending = false
private

Definition at line 969 of file openvpn.cpp.

◆ signals

ASIOSignals::Ptr OMI::signals
private

Definition at line 1002 of file openvpn.cpp.

◆ thread

std::unique_ptr<std::thread> OMI::thread
private

Definition at line 950 of file openvpn.cpp.


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