|
OpenVPN 3 Core Library
|
#include <cliproto.hpp>
Classes | |
| struct | Config |
Public Types | |
| using | Ptr = RCPtr< Session > |
Public Types inherited from openvpn::RC< thread_unsafe_refcount > | |
| using | Ptr = RCPtr< RC > |
Public Member Functions | |
| OPENVPN_EXCEPTION (client_exception) | |
| OPENVPN_EXCEPTION (client_halt_restart) | |
| OPENVPN_EXCEPTION (tun_exception) | |
| OPENVPN_EXCEPTION (transport_exception) | |
| OPENVPN_EXCEPTION (max_pushed_options_exceeded) | |
| OPENVPN_SIMPLE_EXCEPTION (session_invalidated) | |
| OPENVPN_SIMPLE_EXCEPTION (authentication_failed) | |
| OPENVPN_SIMPLE_EXCEPTION (inactive_timer_expired) | |
| OPENVPN_SIMPLE_EXCEPTION (relay_event) | |
| OPENVPN_EXCEPTION (proxy_exception) | |
| Session (openvpn_io::io_context &io_context_arg, const Config &config, NotifyCallback *notify_callback_arg) | |
| bool | first_packet_received () const |
| void | start () |
| TransportClientFactory::Ptr | transport_factory_relay () |
| void | transport_factory_override (TransportClientFactory::Ptr factory) |
| void | send_explicit_exit_notify () |
| void | tun_set_disconnect () |
| void | validate_and_post_cc_msg (const std::string &msg) |
| void | post_cc_msg (const std::string &msg) |
| void | post_app_control_message (const std::string &proto, const std::string &message) |
| void | stop (const bool call_terminate_callback) |
| void | stop_on_signal (const openvpn_io::error_code &error, int signal_number) |
| bool | reached_connected_state () const |
| Error::Type | fatal () const |
| const std::string & | fatal_reason () const |
| RemoteList::Advance | advance_type () const |
| std::chrono::milliseconds | reconnect_delay () const |
| void | start_acc_certcheck (SSLLib::SSLAPI::Config::Ptr config) |
| Start up the cert check handshake using the given certs and key. | |
| virtual | ~Session () |
Public Member Functions inherited from openvpn::RC< thread_unsafe_refcount > | |
| RC () noexcept=default | |
| RC (const RC &)=delete | |
| virtual | ~RC ()=default |
| RC & | operator= (const RC &)=delete |
| olong | use_count () const noexcept |
| Delegates call to RCImpl and returns the result. | |
Private Member Functions | |
| bool | transport_is_openvpn_protocol () override |
| void | transport_recv (BufferAllocated &buf) override |
| void | transport_needs_send () override |
| void | tun_recv (BufferAllocated &buf) override |
| bool | is_keepalive_enabled () const override |
| void | disable_keepalive (unsigned int &keepalive_ping, unsigned int &keepalive_timeout) override |
| void | transport_pre_resolve () override |
| std::string | server_endpoint_render () |
| void | transport_wait_proxy () override |
| void | transport_wait () override |
| void | transport_connecting () 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 |
| void | extract_auth_token (const OptionList &opt) |
| std::string | parse_auth_failed_temp (const std::string &msg) |
| void | control_net_send (const Buffer &net_buf) override |
| void | recv_auth_failed (const std::string &msg) |
| void | recv_auth_pending (const std::string &msg) |
| void | recv_relay () |
| void | recv_info (const std::string &msg, bool info_pre) |
| void | recv_push_update (const std::string &msg) |
| Handles incoming PUSH_UPDATE message. | |
| void | control_recv (BufferPtr &&app_bp) override |
| void | recv_custom_control_message (const std::string &msg) |
| receive, validate, and dispatch ACC messages | |
| void | do_acc_certcheck (const std::string &msg_str) |
| Handles the ACC certcheck TLS handshake data exchange. | |
| void | notify_client_acc_protocols () |
| void | recv_push_reply (const std::string &msg) |
| void | tun_pre_tun_config () override |
| void | tun_pre_route_config () override |
| void | tun_event (ClientEvent::Base::Ptr ev) override |
| void | tun_connected () override |
| void | tun_error (const Error::Type fatal_err, const std::string &err_text) override |
| void | client_auth (Buffer &buf) override |
| void | send_push_request_callback (const Time::Duration &dur, const openvpn_io::error_code &e) |
| void | schedule_push_request_callback (const Time::Duration &dur) |
| virtual void | check_tls_warnings () |
| void | check_proto_warnings () |
| void | active (bool primary) override |
| Called when KeyContext transitions to ACTIVE state. | |
| bool | supports_epoch_data () override |
| void | housekeeping_callback (const openvpn_io::error_code &e) |
| void | set_housekeeping_timer () |
| void | set_cc_handshake_config (SSLLib::SSLAPI::Config::Ptr cfg) |
| Set the cc handshake config object. | |
| void | process_inactive (const OptionList &opt) |
| void | schedule_inactive_timer () |
| void | reset_inactive_timer (const count_t bytes_count) |
| void | inactive_callback (const openvpn_io::error_code &e) |
| void | process_echo (const OptionList &opt) |
| void | process_exception (const std::exception &e, const char *method_name) |
| void | recv_halt_restart (const std::string &msg) |
| void | schedule_info_hold_callback () |
| void | info_hold_callback (const openvpn_io::error_code &e) |
Private Member Functions inherited from openvpn::ProtoContextCallbackInterface | |
| virtual | ~ProtoContextCallbackInterface ()=default |
| virtual void | server_auth (const std::string &username, const SafeString &password, const std::string &peer_info, const AuthCert::Ptr &auth_cert) |
Private Member Functions inherited from openvpn::TransportClientParent | |
| virtual | ~TransportClientParent ()=default |
Private Member Functions inherited from openvpn::TunClientParent | |
| virtual | ~TunClientParent ()=default |
Static Private Attributes | |
| static const std::string | certcheckProto = "cck1" |
Additional Inherited Members | |
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. | |
Static Private Member Functions inherited from openvpn::ProtoContextCallbackInterface | |
| static void | write_empty_string (Buffer &buf) |
Definition at line 90 of file cliproto.hpp.
Definition at line 98 of file cliproto.hpp.
|
inline |
Definition at line 142 of file cliproto.hpp.
|
inlinevirtual |
Definition at line 339 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Called when KeyContext transitions to ACTIVE state.
Implements openvpn::ProtoContextCallbackInterface.
Definition at line 1393 of file cliproto.hpp.
|
inline |
Definition at line 318 of file cliproto.hpp.
|
inlineprivate |
|
inlineprivatevirtual |
|
inlineoverrideprivatevirtual |
Called on client to request username/password credentials. Should be overridden by derived class if credentials are required. username and password should be written into buf with write_auth_string().
Reimplemented from openvpn::ProtoContextCallbackInterface.
Definition at line 1244 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Sends out bytes to the network.
Implements openvpn::ProtoContextCallbackInterface.
Definition at line 722 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Implements openvpn::ProtoContextCallbackInterface.
Definition at line 936 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Implements openvpn::TransportClientParent.
Definition at line 514 of file cliproto.hpp.
|
inlineprivate |
Handles the ACC certcheck TLS handshake data exchange.
| msg_str | TLS handshake traffic |
Definition at line 1021 of file cliproto.hpp.
|
inlineprivate |
|
inline |
Definition at line 307 of file cliproto.hpp.
|
inline |
Definition at line 311 of file cliproto.hpp.
|
inline |
Definition at line 177 of file cliproto.hpp.
|
inlineprivate |
Definition at line 1410 of file cliproto.hpp.
|
inlineprivate |
Definition at line 1528 of file cliproto.hpp.
|
inlineprivate |
Definition at line 1625 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Implements openvpn::TransportClientParent.
Definition at line 507 of file cliproto.hpp.
|
inlineprivate |
| openvpn::ClientProto::Session::OPENVPN_EXCEPTION | ( | client_exception | ) |
| openvpn::ClientProto::Session::OPENVPN_EXCEPTION | ( | client_halt_restart | ) |
| openvpn::ClientProto::Session::OPENVPN_EXCEPTION | ( | max_pushed_options_exceeded | ) |
| openvpn::ClientProto::Session::OPENVPN_EXCEPTION | ( | proxy_exception | ) |
| openvpn::ClientProto::Session::OPENVPN_EXCEPTION | ( | transport_exception | ) |
| openvpn::ClientProto::Session::OPENVPN_EXCEPTION | ( | tun_exception | ) |
| openvpn::ClientProto::Session::OPENVPN_SIMPLE_EXCEPTION | ( | authentication_failed | ) |
| openvpn::ClientProto::Session::OPENVPN_SIMPLE_EXCEPTION | ( | inactive_timer_expired | ) |
| openvpn::ClientProto::Session::OPENVPN_SIMPLE_EXCEPTION | ( | relay_event | ) |
| openvpn::ClientProto::Session::OPENVPN_SIMPLE_EXCEPTION | ( | session_invalidated | ) |
|
inlineprivate |
Parses a AUTH_FAILED,TEMP string, extracts the flags and returns the human readable reason part of it, if there is one. The string passed has the format "[flag(s)]:reason".
Flags are optional and delimited by a comma (","). They are given as "key=value" strings. Currently there's support for parsing two keys:
The reason string is free text and returned verbatim.
| msg | The string to be parsed |
Definition at line 651 of file cliproto.hpp.
|
inline |
|
inline |
Post a control message to the control channel. This only intended to be used by consumers that either validated the message itself beforehand or construct a message in a way that it is always valid.
| msg | The message to send on the control channel. |
Definition at line 248 of file cliproto.hpp.
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineoverrideprivatevirtual |
Implements openvpn::TransportClientParent.
Definition at line 580 of file cliproto.hpp.
|
inline |
Definition at line 296 of file cliproto.hpp.
|
inline |
Definition at line 322 of file cliproto.hpp.
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
receive, validate, and dispatch ACC messages
| msg | the received message |
This function's main purpose is to receive a custom control message from the server, parse out the protocol and contents, validate the protocol is supported, and queue a ClientEvent for supported protocols to be handled later. It acts as the interface between the lower-level network code receiving the raw message, and the higher-level event handling logic.
Definition at line 994 of file cliproto.hpp.
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
Handles incoming PUSH_UPDATE message.
| msg | Comma-separated list of options prefixed with PUSH_UPDATE tag |
Definition at line 909 of file cliproto.hpp.
|
inlineprivate |
|
inlineprivate |
Definition at line 1512 of file cliproto.hpp.
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inlineprivate |
Definition at line 1283 of file cliproto.hpp.
|
inlineprivate |
|
inlineprivate |
Set the cc handshake config object.
| cfg | The config to use for initializing the SSLAPI |
Definition at line 1469 of file cliproto.hpp.
|
inlineprivate |
|
inline |
Definition at line 182 of file cliproto.hpp.
|
inline |
Start up the cert check handshake using the given certs and key.
| config | SSL Config setup with the correct keys and certificates |
Begins the handshake with Client Hello via the ACC.
Definition at line 333 of file cliproto.hpp.
|
inline |
|
inline |
Definition at line 291 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
the protocol context needs to know if the parent and its tun/transport layer are able to support epoch key data format to properly handshake this protocol feature
Implements openvpn::ProtoContextCallbackInterface.
Definition at line 1405 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Implements openvpn::TransportClientParent.
Definition at line 547 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Implements openvpn::TransportClientParent.
Definition at line 564 of file cliproto.hpp.
|
inline |
Definition at line 208 of file cliproto.hpp.
|
inline |
Definition at line 201 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Implements openvpn::TransportClientParent.
Definition at line 345 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Implements openvpn::TransportClientParent.
Definition at line 427 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Implements openvpn::TransportClientParent.
Definition at line 520 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Implements openvpn::TransportClientParent.
Definition at line 351 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Implements openvpn::TransportClientParent.
Definition at line 541 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Implements openvpn::TransportClientParent.
Definition at line 535 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Implements openvpn::TunClientParent.
Definition at line 1177 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Implements openvpn::TunClientParent.
Definition at line 1225 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Reimplemented from openvpn::TunClientParent.
Definition at line 1172 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Implements openvpn::TunClientParent.
Definition at line 1166 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Implements openvpn::TunClientParent.
Definition at line 1160 of file cliproto.hpp.
|
inlineoverrideprivatevirtual |
Implements openvpn::TunClientParent.
Definition at line 432 of file cliproto.hpp.
|
inline |
Definition at line 219 of file cliproto.hpp.
|
inline |
Posts a control message from the client API. To ensure the client that will always send valid message (e.g. no extra newlines or invalid) character this method will first check the message for validity before sending it to the control channel
| msg | control channel message |
Definition at line 231 of file cliproto.hpp.
|
private |
Definition at line 1688 of file cliproto.hpp.
|
private |
Definition at line 1729 of file cliproto.hpp.
|
inlinestaticprivate |
Definition at line 95 of file cliproto.hpp.
|
private |
Definition at line 1691 of file cliproto.hpp.
|
private |
Definition at line 1690 of file cliproto.hpp.
|
private |
Definition at line 1693 of file cliproto.hpp.
|
private |
Definition at line 1700 of file cliproto.hpp.
|
private |
Definition at line 1682 of file cliproto.hpp.
|
private |
Definition at line 1702 of file cliproto.hpp.
|
private |
Definition at line 1705 of file cliproto.hpp.
|
private |
Definition at line 1706 of file cliproto.hpp.
|
private |
Definition at line 1686 of file cliproto.hpp.
|
private |
Definition at line 1678 of file cliproto.hpp.
|
private |
Definition at line 1675 of file cliproto.hpp.
|
private |
Definition at line 1676 of file cliproto.hpp.
|
private |
Definition at line 1719 of file cliproto.hpp.
|
private |
Definition at line 1713 of file cliproto.hpp.
|
private |
Definition at line 1715 of file cliproto.hpp.
|
private |
Definition at line 1712 of file cliproto.hpp.
|
private |
Definition at line 1717 of file cliproto.hpp.
|
private |
Definition at line 1716 of file cliproto.hpp.
|
private |
Definition at line 1703 of file cliproto.hpp.
|
private |
Definition at line 1721 of file cliproto.hpp.
|
private |
Definition at line 1722 of file cliproto.hpp.
|
private |
Definition at line 1662 of file cliproto.hpp.
|
private |
Definition at line 1673 of file cliproto.hpp.
|
private |
Definition at line 1718 of file cliproto.hpp.
|
private |
Definition at line 1660 of file cliproto.hpp.
|
private |
Definition at line 1684 of file cliproto.hpp.
|
private |
Definition at line 1677 of file cliproto.hpp.
|
private |
Definition at line 1709 of file cliproto.hpp.
|
private |
Definition at line 1708 of file cliproto.hpp.
|
private |
Definition at line 1710 of file cliproto.hpp.
|
private |
Definition at line 1680 of file cliproto.hpp.
|
private |
Definition at line 1687 of file cliproto.hpp.
|
private |
Definition at line 1670 of file cliproto.hpp.
|
private |
Definition at line 1726 of file cliproto.hpp.
|
private |
Definition at line 1725 of file cliproto.hpp.
|
private |
Definition at line 1665 of file cliproto.hpp.
|
private |
Definition at line 1664 of file cliproto.hpp.
|
private |
Definition at line 1671 of file cliproto.hpp.
|
private |
Definition at line 1668 of file cliproto.hpp.
|
private |
Definition at line 1667 of file cliproto.hpp.