|
OpenVPN 3 Core Library
|
Namespaces | |
| namespace | Acceptor |
| namespace | AEAD |
| namespace | AEADEpoch |
| namespace | AsioBoundSocket |
| namespace | AsioPolySock |
| namespace | AuthStatus |
| namespace | AWS |
| namespace | bigmutex |
| namespace | bmq_dgram |
| namespace | bmq_stream |
| namespace | BufAllocFlags |
| namespace | BufferBE |
| namespace | BufferFormat |
| namespace | BufHex |
| namespace | C2os |
| namespace | CF |
| namespace | ClientAPI |
| namespace | ClientEvent |
| namespace | ClientProto |
| namespace | crypto |
| namespace | Crypto |
| namespace | CryptoAlgs |
| namespace | DCOTransport |
| namespace | Endian |
| namespace | Error |
| namespace | ExternalTransport |
| namespace | ExternalTun |
| namespace | Gremlin |
| namespace | HaltRestart |
| namespace | HostList |
| namespace | HostPort |
| namespace | HTTP |
| namespace | HTTPProxy |
| namespace | HTTPProxyTransport |
| namespace | InitProcess |
| namespace | IP |
| namespace | IPChecksum |
| namespace | IPCommon |
| namespace | IPv4 |
| namespace | IPv6 |
| namespace | json |
| namespace | KoRekey |
| namespace | KUParse |
| namespace | Listen |
| namespace | Log |
| namespace | logging |
| namespace | LZ4 |
| namespace | lzo_asym_impl |
| namespace | Mac |
| namespace | ManClientInstance |
| namespace | mbedtls_ctx_private |
| namespace | MbedTLSCrypto |
| namespace | MbedTLSPKI |
| namespace | MSF |
| namespace | NSCert |
| namespace | numeric_util |
| namespace | oob |
| namespace | OpenSSLCrypto |
| namespace | OpenSSLPKI |
| namespace | OpenSSLSign |
| namespace | path |
| namespace | PeerInfo |
| namespace | Ping4 |
| namespace | Ping6 |
| namespace | Pipe |
| namespace | PKCS1 |
| namespace | PKType |
| namespace | print_detail |
| namespace | print_formatted_detail |
| namespace | ProfileParseLimits |
| namespace | proto_context_private |
| namespace | reliable |
| namespace | RGWFlags |
| namespace | SelfTest |
| namespace | SFINAE |
| namespace | SNI |
| namespace | SockOpt |
| namespace | Split |
| namespace | SSLConst |
| namespace | SSLLib |
| namespace | string |
| namespace | StringTempl |
| namespace | TCPTransport |
| namespace | TimeSpec |
| namespace | TLSCertProfile |
| namespace | TLSRemote |
| namespace | TLSVersion |
| namespace | TransportClientInstance |
| namespace | TunBuilderClient |
| namespace | TunBuilderSetup |
| namespace | TunClientInstance |
| namespace | TunLinux |
| namespace | TunLinuxSetup |
| namespace | TunMac |
| namespace | TunNetlink |
| namespace | TunNull |
| namespace | TunWin |
| DNS utilities for Windows. | |
| namespace | UDPTransport |
| namespace | Unicode |
| namespace | URL |
| namespace | UserPass |
| namespace | ValidateCreds |
| namespace | VPNServerPool |
| namespace | WebSocket |
| namespace | Win |
| namespace | WS |
| namespace | X509Track |
Enumerations | |
| enum | { NULL_ON_ENOENT = (1 << 8) } |
| enum class | TunWrapObjRetain { NO_RETAIN , RETAIN , NO_RETAIN_NO_REPLACE } |
| enum | { TUN_MTU_DEFAULT = 1500 } |
Functions | |
| std::string | quote_ip (const std::string &ip_addr) |
| template<typename ErrorCode > | |
| std::string | errinfo (ErrorCode err) |
| template<class EPRANGE > | |
| std::string | asio_resolver_results_to_string (const EPRANGE &endpoint_range) |
| size_t | buf_clamp_read (const size_t size) |
| size_t | buf_clamp_write (const size_t size) |
| template<typename T_ > | |
| BufferAllocatedType (const BufferType< T_ > &, BufferFlags) -> BufferAllocatedType< unsigned char > | |
| template<typename T > | |
| ConstBufferType< T > & | const_buffer_ref (BufferType< T > &src) |
| template<typename T > | |
| const ConstBufferType< T > & | const_buffer_ref (const BufferType< T > &src) |
| template<typename AlignT , typename T > | |
| AlignT * | align_as (BufferAllocatedType< T > &buf) |
| Aligns buffer.data() to the required value and returns a pointer to the aligned object. | |
| OPENVPN_EXCEPTION (buf_read_error) | |
| bool | buf_read (const int fd, Buffer &buf, const std::string &title) |
| BufferList | buf_read (const int fd, const std::string &title) |
| std::string | buf_to_string (const Buffer &buf) |
| std::string | buf_to_string (const ConstBuffer &buf) |
| void | buf_write_string (Buffer &buf, const std::string &str) |
| void | buf_write_string (Buffer &buf, const char *str) |
| BufferPtr | buf_from_string (const std::string &str) |
| BufferPtr | buf_from_string (const char *str) |
| BufferAllocated | buf_alloc_from_string (const std::string &str) |
| BufferAllocated | buf_alloc_from_string (const char *str) |
| void | buf_append_string (Buffer &buf, const std::string &str) |
| void | buf_append_string (Buffer &buf, const char *str) |
| ConstBuffer | const_buf_from_string (const std::string &str) |
| const char * | buf_c_str (const Buffer &buf) |
| bool | buf_eq_str (const Buffer &buf, const std::string &str) |
| template<typename Elem , typename Traits > | |
| std::basic_ostream< Elem, Traits > & | operator<< (std::basic_ostream< Elem, Traits > &os, const SafeString &ss) |
| template<typename T > | |
| requires ::std::is_trivially_copyable_v< T > T | alignment_safe_extract (const void *toAlign) noexcept |
| Converts a byte buffer to the desired type, avoiding undefined behavior due to alignment. | |
| template<typename T , std::size_t N> | |
| constexpr std::size_t | array_size (T(&)[N]) |
| bool | async_sleep_milliseconds (int milliseconds, Stop *async_stop) |
| void | base64_init_static () |
| void | base64_uninit_static () |
| template<typename T > | |
| std::enable_if< 4==sizeof(T), T >::type | bin_prefix (const unsigned char *data) |
| template<typename T > | |
| std::enable_if< 8==sizeof(T), T >::type | bin_prefix (const unsigned char *data) |
| template<typename T > | |
| T | bin_prefix (const unsigned char *data, const size_t len) |
| template<typename T > | |
| T | bin_prefix_floor (const unsigned char *data, const size_t len, const T floor) |
| template<typename T > | |
| T | clamp (T value, T low, T high) |
| template<typename T > | |
| T | clamp_nonzero (T value, T low, T high) |
| template<typename F > requires std::invocable<F> | |
| CleanupType< F > | Cleanup (F method) noexcept(std::is_nothrow_move_constructible_v< F >) |
| Factory function to create a CleanupType object. | |
| void | log_compress (const std::string &prefix, const size_t orig_size, const size_t new_size) |
| int | n_cores () |
| OPENVPN_EXCEPTION (daemon_err) | |
| LogSetup::Ptr | log_setup (const std::string &log_fn, const SetUserGroup *user_group, const bool log_append, const int log_versions, const bool stdin_to_dev_null, const bool combine_out_err) |
| void | daemonize () |
| LogSetup::Ptr | daemonize (const std::string &log_fn, const SetUserGroup *user_group, const bool log_append, const int log_versions) |
| void | write_pid (const std::string &fn) |
| std::string | cxx_demangle (const char *mangled_name) |
| OPENVPN_EXCEPTION (enum_dir_error) | |
| template<typename F > | |
| bool | enum_dir (const std::string &dirname, F func) |
| std::vector< std::string > | enum_dir (const std::string &dirname, const size_t size_hint=0, const bool sort=false) |
| void | throw_ref (const std::exception &e) |
| template<typename T > | |
| bool | is_pow2 (const T v) |
| template<typename T > | |
| int | log2 (const T v) |
| OPENVPN_UNTAGGED_EXCEPTION (file_exception) | |
| OPENVPN_UNTAGGED_EXCEPTION_INHERIT (file_exception, open_file_error) | |
| OPENVPN_UNTAGGED_EXCEPTION_INHERIT (file_exception, file_too_large) | |
| OPENVPN_UNTAGGED_EXCEPTION_INHERIT (file_exception, file_is_binary) | |
| OPENVPN_UNTAGGED_EXCEPTION_INHERIT (file_exception, file_not_utf8) | |
| std::string | read_text_simple (const std::string &filename) |
| BufferPtr | read_binary (const std::string &filename, const std::uint64_t max_size=0, const BufferFlags buffer_flags=BufAllocFlags::NO_FLAGS) |
| BufferPtr | read_binary_linear (const std::string &filename, const std::uint64_t max_size=0, const size_t block_size=1024) |
| std::string | read_text (const std::string &filename, const std::uint64_t max_size=0) |
| std::string | read_text_utf8 (const std::string &filename, const std::uint64_t max_size=0) |
| std::string | read_stdin () |
| void | write_binary (const std::string &filename, const Buffer &buf) |
| template<typename BUFLIST > | |
| void | write_binary_list (const std::string &filename, const BUFLIST &buflist) |
| void | write_string (const std::string &filename, const std::string &str) |
| void | write_binary_atomic (const std::string &fn, const std::string &tmpdir, const mode_t mode, const std::uint64_t mtime_ns, const ConstBuffer &buf, StrongRandomAPI &rng) |
| void | write_binary_atomic (const std::string &fn, const std::string &tmpdir, const mode_t mode, const std::uint64_t mtime_ns, const Buffer &buf, StrongRandomAPI &rng) |
| OPENVPN_EXCEPTION (file_unix_error) | |
| void | write_binary_unix (const std::string &fn, const mode_t mode, const std::uint64_t mtime_ns, const void *buf, const ssize_t size) |
| void | write_binary_unix (const std::string &fn, const mode_t mode, const std::uint64_t mtime_ns, const Buffer &buf) |
| void | write_binary_unix (const std::string &fn, const mode_t mode, const std::uint64_t mtime_ns, const ConstBuffer &buf) |
| void | write_text_unix (const std::string &fn, const mode_t mode, const std::uint64_t mtime_ns, const std::string &content) |
| BufferPtr | read_binary_unix (const std::string &fn, const std::uint64_t max_size=0, const unsigned int enoent_option=0, std::uint64_t *mtime_ns=nullptr) |
| template<typename STRING > | |
| int | read_binary_unix_fast (const STRING &fn, Buffer &out, std::uint64_t *mtime_ns=nullptr) |
| std::string | read_text_unix (const std::string &filename, const std::uint64_t max_size=0, const unsigned int enoent_option=0, std::uint64_t *mtime_ns=nullptr) |
| template<typename... Args> | |
| std::string | printd (char delim, Args... args) |
| template<typename... Args> | |
| std::string | print (Args... args) |
| template<typename... Args> | |
| std::string | prints (Args... args) |
| template<typename... Args> | |
| std::string | printfmt (const std::string &fmt, Args... args) |
| std::string | get_password (const char *prompt) |
| char | render_hex_char (const int c, const bool caps=false) |
| int | parse_hex_char (const int c) |
| std::string | render_hex (const unsigned char *data, size_t size, const bool caps=false) |
| std::string | render_hex (const void *data, const size_t size, const bool caps=false) |
| std::string | render_hex_sep (const unsigned char *data, size_t size, const char sep, const bool caps=false) |
| std::string | render_hex_sep (const void *data, const size_t size, const char sep, const bool caps=false) |
| template<typename V > | |
| std::string | render_hex_generic (const V &data, const bool caps=false) |
| std::string | dump_hex (const unsigned char *data, size_t size) |
| std::string | dump_hex (void *data, size_t size) |
| std::string | dump_hex (const std::string &str) |
| template<typename V > | |
| std::string | dump_hex (const V &data) |
| OPENVPN_SIMPLE_EXCEPTION (parse_hex_error) | |
| template<typename V > | |
| void | parse_hex (V &dest, const std::string &str) |
| template<typename T > | |
| bool | parse_hex_number (const char *str, T &retval) |
| template<typename T > | |
| bool | parse_hex_number (const std::string &str, T &retval) |
| template<typename T > | |
| T | parse_hex_number (const std::string &str) |
| template<typename T > | |
| std::string | render_hex_number (T value, const bool caps=false) |
| std::string | render_hex_number (unsigned char uc, const bool caps=false) |
| std::string | get_hostname () |
| template<typename BaseT , typename T > requires std::is_arithmetic_v<T> | |
| constexpr bool | operator== (IntrinsicType< BaseT, T > lhs, IntrinsicType< BaseT, T > rhs) noexcept |
| Equality comparison operator. | |
| template<typename BaseT , typename T > requires std::is_arithmetic_v<T> | |
| constexpr auto | operator<=> (IntrinsicType< BaseT, T > lhs, IntrinsicType< BaseT, T > rhs) noexcept |
| Equality comparison operator. | |
| template<typename BaseT , typename T > requires std::is_arithmetic_v<T> | |
| constexpr BaseT | operator+ (IntrinsicType< BaseT, T > lhs, IntrinsicType< BaseT, T > rhs) noexcept |
| Addition operator. | |
| template<typename BaseT , typename T > requires std::is_arithmetic_v<T> | |
| constexpr BaseT | operator- (IntrinsicType< BaseT, T > lhs, IntrinsicType< BaseT, T > rhs) noexcept |
| Subtraction operator. | |
| template<typename BaseT , typename T > requires std::is_arithmetic_v<T> | |
| constexpr BaseT | operator* (IntrinsicType< BaseT, T > lhs, IntrinsicType< BaseT, T > rhs) noexcept |
| Multiplication operator. | |
| template<typename BaseT , typename T > requires std::is_arithmetic_v<T> | |
| constexpr BaseT | operator/ (IntrinsicType< BaseT, T > lhs, IntrinsicType< BaseT, T > rhs) noexcept |
| Division operator. | |
| template<typename BaseT , typename T > requires std::is_integral_v<T> | |
| constexpr BaseT | operator~ (IntrinsicType< BaseT, T > t) noexcept |
| Performs bitwise NOT operation on an IntrinsicType. | |
| template<typename BaseT , typename T > requires std::is_integral_v<T> | |
| constexpr BaseT | operator| (IntrinsicType< BaseT, T > l, IntrinsicType< BaseT, T > r) noexcept |
| Performs bitwise OR operation between two IntrinsicType objects. | |
| template<typename BaseT , typename T > requires std::is_integral_v<T> | |
| constexpr BaseT | operator& (IntrinsicType< BaseT, T > l, IntrinsicType< BaseT, T > r) noexcept |
| Performs bitwise AND operation between two IntrinsicType objects. | |
| void | log_rotate (const std::string &fn, const int max_versions) |
| template<typename TypeT , typename RcT = RC<thread_unsafe_refcount>, typename... ArgsT> | |
| auto | make_rc (ArgsT &&...args) |
| Helper function to create a reference-counted object with the default thread-unsafe reference counting policy. | |
| int | update_file_mod_time_nanoseconds (const std::string &filename, const std::uint64_t nanoseconds_since_epooch) |
| int | update_file_mod_time_nanoseconds (const int fd, const std::uint64_t nanoseconds_since_epooch) |
| OPENVPN_EXCEPTION (number_parse_exception) | |
| template<typename T > | |
| bool | parse_number (const char *str, T &retval, const bool nondigit_term=false) |
| template<typename T > | |
| bool | parse_number (const std::string &str, T &retval) |
| template<typename T > | |
| T | parse_number_throw (const std::string &str, const std::string &error) |
| template<typename T > | |
| T | parse_number_throw (const std::string &str, const char *error) |
| template<typename T > | |
| T | parse_number_throw (const char *str, const char *error) |
| template<typename T > | |
| bool | parse_number_validate (const std::string &numstr, const size_t max_len, const T minimum, const T maximum, T *value_return=nullptr) |
| bool | is_number (std::string_view str) |
| OPENVPN_EXCEPTION_WITH_CODE (option_error, ERR_PROFILE_OPTION, ERR_INVALID_OPTION_DNS, ERR_INVALID_OPTION_CRYPTO, ERR_INVALID_CONFIG, ERR_INVALID_OPTION_PUSHED, ERR_INVALID_OPTION_VAL) | |
| const char * | platform_name () |
| std::string | platform_string (const std::string &title, const std::string &app_version) |
| std::string | platform_string () |
| pid_t | system_cmd_async (const std::string &cmd, const Argv &argv, const Environ *env, RedirectBase *redir, const sigset_t *sigmask) |
| int | system_cmd_post (const pid_t pid) |
| int | system_cmd (const std::string &cmd, const Argv &argv, RedirectBase *redir, const Environ *env, const sigset_t *sigmask) |
| int | system_cmd (const std::string &cmd, const Argv &argv) |
| int | system_cmd (const Argv &argv) |
| int | system_cmd (const std::string &cmd, const Argv &argv, const Environ *env, RedirectPipe::InOut &inout, unsigned int redirect_pipe_flags, const sigset_t *sigmask) |
| template<typename R > | |
| void | intrusive_ptr_add_ref (R *rcptr) noexcept |
| Helper to increment a ref count. | |
| template<typename R > | |
| void | intrusive_ptr_release (R *rcptr) noexcept |
| Helper to decrement a ref count. | |
| OPENVPN_OSTREAM (SessionID64, to_string) | |
| OPENVPN_OSTREAM (SessionID128, to_string) | |
| std::string | signal_name (const int signum) |
| OPENVPN_EXCEPTION (signaling_exception) | |
| bool | is_directory (const std::string &pathname, const bool follow_symlinks=false) |
| time_t | file_mod_time (const std::string &filename) |
| std::uint64_t | stat_mod_time_nanoseconds (const struct stat &s) |
| std::uint64_t | file_mod_time_nanoseconds (const char *filename) |
| std::uint64_t | file_mod_time_nanoseconds (const std::string &filename) |
| std::uint64_t | fd_mod_time_nanoseconds (const int fd) |
| std::uint64_t | file_mod_time_milliseconds (const std::string &filename) |
| std::string | strerror_str (const int errnum) |
| std::string | tmp_filename (const std::string &fn, const std::string &tmpdir, StrongRandomAPI &rng) |
| template<typename T > requires (!requires(T a) { std::to_string(a); }) && requires(std::ostream &os, const T &t) { os << t; } | |
| std::string | to_string (const T &t) |
| Convert a value to a string. | |
| template<typename T > | |
| void | delete_slab (T *ptr) |
| void | unreachable () |
| template<typename THREAD_COMMON > | |
| void | event_loop_wait_barrier (THREAD_COMMON &tc, const unsigned int seconds=WAIT_BARRIER_TIMEOUT) |
| ssize_t | write_retry (int fd, const void *buf, size_t count) |
| void | write_private (const std::string &path, const void *buf, ssize_t count) |
| void | write_private (const std::string &path, const Buffer &buf) |
| void | write_private (const std::string &path, const std::string &str) |
| bool | is_bs64_cipher (const CryptoAlgs::Type cipher) |
| OPENVPN_EXCEPTION (crypto_dc_select) | |
| void | ovpn_hkdf_expand (const uint8_t *secret, const uint8_t *info, int info_len, uint8_t *out, int out_len) |
| void | ovpn_expand_label (const uint8_t *secret, size_t secret_len, const uint8_t *label, size_t label_len, const uint8_t *context, size_t context_len, uint8_t *out, size_t out_len) |
| OPENVPN_EXCEPTION (epoch_key_exception) | |
| std::string | tls_crypt_v2_pem_to_string (const BufferAllocated &pem) |
| Convert a pem_encode() output buffer into a std::string. | |
| Frame::Ptr | frame_init (const bool align_adjust_3_1, const size_t tun_mtu_max, const size_t control_channel_payload, const bool verbose) |
| Frame::Context | frame_init_context_simple (const size_t payload) |
| Frame::Ptr | frame_init_simple (const size_t payload) |
| void | init_openssl (const std::string &engine) |
| void | uninit_openssl () |
| void | tcp_adjust_checksum (int acc, std::uint16_t &cksum) |
| std::uint16_t | udp_checksum (const std::uint8_t *buf, const unsigned int len_udp, const std::uint8_t *src_addr, const std::uint8_t *dest_addr) |
| int | bind_to_core (const int core_id) |
| int | exclude_from_core (const int core_id) |
| int | daemon_pid (const std::string &cmd, const std::string &pidfile) |
| bool | is_daemon_alive (const std::string &cmd, const std::string &pidfile) |
| static mbedtls_compat_group_id | mbedtls_compat_get_group_id (const mbedtls_ecp_curve_info *curve_info) |
| static void | mbedtls_ssl_conf_groups (mbedtls_ssl_config *conf, mbedtls_compat_group_id *groups) |
| const std::string | get_ssl_library_version () |
| std::string | crypto_self_test_mbedtls () |
| std::string | get_hwaddr (IP::Addr server_addr) |
| OPENVPN_EXCEPTION (openssl_engine_error) | |
| void | openssl_setup_engine (const std::string &engine) |
| std::string | openssl_error () |
| std::string | openssl_error (const int ssl_error) |
| void | openssl_clear_error_stack () |
| void | openssl_reseed_rng () |
| std::string | render_options_sanitized (const OptionList &opt, const unsigned int render_flags) |
| std::string | sanitize_control_message (const std::string &src_str) |
| std::uint32_t | rand32_distribute (const std::uint32_t seed, const std::uint32_t end) |
| OPENVPN_EXCEPTION (parse_acc_message) | |
| const tls_cipher_name_pair * | tls_get_cipher_name_pair (const std::string &ciphername) |
| bool | is_openvpn_protocol (const unsigned char *p, std::size_t len) |
| Given either the first 2 or 3 bytes of an initial client -> server data payload, return true if the protocol is that of an OpenVPN client attempting to connect with an OpenVPN server. | |
| double | cpu_time (const bool thread=false) |
| void | set_duration_parm (Time::Duration &dur, const std::string &name, const std::string &valstr, const unsigned int min_value, const bool x2, const bool ms) |
| const Option * | load_duration_parm (Time::Duration &dur, const std::string &name, const OptionList &opt, const unsigned int min_value, const bool x2, const bool allow_ms) |
| Time::Duration | load_duration_default (const std::string &name, const OptionList &opt, const Time::Duration &default_duration, const unsigned int min_value, const bool x2, const bool allow_ms) |
| Time::Duration | skew_duration (const Time::Duration &dur, const Time::Duration &min, const unsigned int flux_order, RandomAPI &rng) |
| std::uint64_t | milliseconds_since_epoch () |
| nanotime_t | nanoseconds_since_epoch () |
| OPENVPN_SIMPLE_EXCEPTION (get_time_error) | |
| std::string | date_time (const time_t t) |
| std::string | date_time_utc (const time_t t) |
| std::string | date_time (const struct timeval *tv, const bool msecs) |
| std::string | nanosec_time_to_string (const std::uint64_t ns_time) |
| std::string | date_time () |
| std::string | date_time_store_time_t (time_t &save) |
| std::string | date_time_rfc822 (const time_t t) |
| std::string | date_time_rfc822 () |
| static uint64_t | ovpn_nla_get_uint (struct nlattr *attr) |
| OPENVPN_EXCEPTION (macdns_watchdog_error) | |
| unsigned int | parse_tun_mtu (const OptionList &opt, unsigned int default_value) |
| unsigned int | parse_tun_mtu_max (const OptionList &opt, unsigned int default_value) |
Variables | |
| const Base64 * | base64 |
| const Base64 * | base64_urlsafe |
| static constexpr mode_t | WRITE_BINARY_UNIX_EXISTING = 010000 |
| static constexpr unsigned int | WAIT_BARRIER_TIMEOUT = 30 |
| static constexpr const char * | tls_crypt_v2_server_key_name = "OpenVPN tls-crypt-v2 server key" |
| static constexpr const char * | tls_crypt_v2_client_key_name = "OpenVPN tls-crypt-v2 client key" |
| static const tls_cipher_name_pair | tls_cipher_name_translation_table [] |
| constexpr std::uint32_t | INVALID_ADAPTER_INDEX = static_cast<std::uint32_t>(-1) |
This class implements the parsing and generating of app custom control channel messages
| using openvpn::AsyncResolvableTCP = typedef AsyncResolvable<openvpn_io::ip::tcp::resolver> |
Definition at line 24 of file async_resolve.hpp.
| using openvpn::AsyncResolvableUDP = typedef AsyncResolvable<openvpn_io::ip::udp::resolver> |
Definition at line 23 of file async_resolve.hpp.
| using openvpn::Buffer = typedef BufferType<unsigned char> |
Definition at line 1895 of file buffer.hpp.
| using openvpn::BufferAllocated = typedef BufferAllocatedType<unsigned char> |
Definition at line 1897 of file buffer.hpp.
| using openvpn::BufferAllocatedRc = typedef RcEnable<BufferAllocated, RC<thread_unsafe_refcount> > |
Definition at line 1898 of file buffer.hpp.
| using openvpn::BufferAllocatedTS = typedef RcEnable<BufferAllocated, RC<thread_safe_refcount> > |
Definition at line 1905 of file buffer.hpp.
| using openvpn::BufferList = typedef BufferCollection<std::list> |
Definition at line 108 of file buflist.hpp.
| using openvpn::BufferPtr = typedef RCPtr<BufferAllocatedRc> |
Definition at line 1899 of file buffer.hpp.
| using openvpn::BufferPtrTS = typedef RCPtr<BufferAllocatedTS> |
Definition at line 1906 of file buffer.hpp.
| using openvpn::BufferVector = typedef BufferCollection<std::vector> |
Definition at line 109 of file buflist.hpp.
| using openvpn::CompressLZO = typedef CompressLZOAsym |
Definition at line 26 of file lzoselect.hpp.
| using openvpn::ConstBuffer = typedef ConstBufferType<unsigned char> |
Definition at line 1896 of file buffer.hpp.
| using openvpn::count_t = typedef long long |
| using openvpn::mbedtls_compat_group_id = typedef mbedtls_ecp_group_id |
Definition at line 185 of file sslctx.hpp.
| typedef std::uint64_t openvpn::nanotime_t |
| using openvpn::olong = typedef long |
| using openvpn::oulong = typedef unsigned long |
| typedef int(* openvpn::ovpn_nl_cb) (struct nl_msg *msg, void *arg) |
| using openvpn::PacketIDControlReceive = typedef PacketIDControlReceiveType<8, 30> |
Definition at line 367 of file packet_id_control.hpp.
| using openvpn::PacketIDDataReceive = typedef PacketIDDataReceiveType<8, 30> |
Definition at line 496 of file packet_id_data.hpp.
Definition at line 80 of file runcontext.hpp.
Definition at line 79 of file runcontext.hpp.
| using openvpn::SessionID128 = typedef SessionIDType<16> |
Definition at line 184 of file sess_id.hpp.
| using openvpn::SessionID64 = typedef SessionIDType<8> |
Definition at line 183 of file sess_id.hpp.
| using openvpn::SocketProtect = typedef BaseSocketProtect |
Definition at line 36 of file socket_protect.hpp.
| using openvpn::SplitLines = typedef SplitLinesType<std::string> |
Definition at line 181 of file splitlines.hpp.
| using openvpn::ssl_external_pki = typedef SSLFactoryAPI::ssl_external_pki |
Definition at line 26 of file extpki.hpp.
| using openvpn::Time = typedef TimeType<oulong> |
| using openvpn::TimePtr = typedef Time * |
| using openvpn::unique_ptr_del = typedef std::unique_ptr<T, std::function<void(T *)> > |
Definition at line 21 of file uniqueptr.hpp.
| using openvpn::unique_ptr_slab = typedef std::unique_ptr<T, slab_deleter<T> > |
Definition at line 55 of file uniqueptr.hpp.
| anonymous enum |
| Enumerator | |
|---|---|
| NULL_ON_ENOENT | |
Definition at line 113 of file fileunix.hpp.
| anonymous enum |
| Enumerator | |
|---|---|
| TUN_MTU_DEFAULT | |
Definition at line 18 of file tunmtu.hpp.
|
strong |
| Enumerator | |
|---|---|
| NO_RETAIN | |
| RETAIN | |
| NO_RETAIN_NO_REPLACE | |
Definition at line 21 of file tunwrap.hpp.
|
inline |
Aligns buffer.data() to the required value and returns a pointer to the aligned object.
| AlignT | Type to align for |
| buf | The buffer instance holding the possibly misaligned structure |
Definition at line 1943 of file buffer.hpp.
|
noexcept |
Converts a byte buffer to the desired type, avoiding undefined behavior due to alignment.
Replaces a simple cast with an alignment safe alternative. Useful when scraping data out of wire oriented buffers and so on.
| T | type to convert to |
| toAlign | starting address of the bytes to be converted |
Definition at line 37 of file alignment.hpp.
|
constexpr |
|
inline |
|
inline |
Definition at line 26 of file asyncsleep.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 27 of file binprefix.hpp.
|
inline |
Definition at line 37 of file binprefix.hpp.
|
inline |
Definition at line 44 of file binprefix.hpp.
|
inline |
Definition at line 58 of file binprefix.hpp.
|
inline |
Definition at line 73 of file bufstr.hpp.
|
inline |
|
inline |
Definition at line 88 of file bufstr.hpp.
|
inline |
|
inline |
Definition at line 102 of file bufstr.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 108 of file bufstr.hpp.
|
inline |
Definition at line 55 of file bufstr.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 43 of file bufread.hpp.
|
inline |
|
inline |
Definition at line 28 of file bufstr.hpp.
|
inline |
Definition at line 40 of file bufstr.hpp.
|
inline |
| openvpn::BufferAllocatedType | ( | const BufferType< T_ > & | , |
| BufferFlags | |||
| ) | -> BufferAllocatedType< unsigned char > |
| T openvpn::clamp | ( | T | value, |
| T | low, | ||
| T | high | ||
| ) |
| T openvpn::clamp_nonzero | ( | T | value, |
| T | low, | ||
| T | high | ||
| ) |
|
inlinenoexcept |
Factory function to create a CleanupType object.
| F | The type of the callable to run on destruction. |
| method | The callable to be executed on destruction. |
This function simplifies the creation of CleanupType objects by deducing the type of the callable and forwarding it to the CleanupType constructor.
Definition at line 124 of file cleanup.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 1926 of file buffer.hpp.
|
inline |
Retrieve the time (in seconds) the current process or thread has been running. Runing time includes both system and user times.
| thread | Boolean flag controlling if process or thread runtime should be returned |
Definition at line 76 of file cputime.hpp.
|
inline |
|
inline |
Definition at line 24 of file demangle.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 114 of file daemon.hpp.
|
inline |
|
inline |
Definition at line 96 of file timestr.hpp.
|
inline |
Definition at line 62 of file timestr.hpp.
|
inline |
|
inline |
Definition at line 164 of file timestr.hpp.
|
inline |
|
inline |
| void openvpn::delete_slab | ( | T * | ptr | ) |
|
inline |
Renders a combined hexadecimal and character dump of a std::string buffer, with the typical 16 bytes split between hexadecimal and character separation per line.
| str | std::string containing the buffer to render |
Definition at line 311 of file hexstr.hpp.
|
inline |
Renders a combined hexadecimal and character dump of a buffer, with the typical 16 bytes split between hexadecimal and character separation per line.
| data | Unsigned char pointer to the buffer to dump. |
| size | Size of the buffer to render. |
Definition at line 253 of file hexstr.hpp.
|
inline |
Renders a combined hexadecimal and character dump of a std::vector<T> based buffer, with the typical 16 bytes split between hexadecimal and character separation per line.
| data | std::vector<T> containing the buffer to render |
Definition at line 328 of file hexstr.hpp.
|
inline |
Renders a combined hexadecimal and character dump of a buffer, with the typical 16 bytes split between hexadecimal and character separation per line.
| data | Void pointer to the buffer to dump. |
| size | Size of the buffer to render. |
Definition at line 296 of file hexstr.hpp.
|
inline |
Definition at line 51 of file enumdir.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 24 of file hostname.hpp.
|
inline |
|
inline |
|
inline |
Reports a human readable string of the SSL library in use and its version. E.g. mbed TLS 1.2.4
Definition at line 1701 of file sslctx.hpp.
|
inline |
|
inlinenoexcept |
Helper to increment a ref count.
| R | type that has an incrementable member refcount_ |
| rcptr | pointer to instance of R |
Helper function template to implement incrementing of a member 'refcount_' of a type R; acts as an adapter layer to implement this funtionality as well as some conditionally built debug logging.
Definition at line 1395 of file rc.hpp.
|
inlinenoexcept |
Helper to decrement a ref count.
| R | type that has an decrementable member refcount_ |
| rcptr | pointer to instance of R |
Helper function template to implement decrementing of a member 'refcount_' of a type R; acts as an adapter layer to implement this funtionality as well as some conditionally built debug logging and a conditionally built notify hook.
Definition at line 1413 of file rc.hpp.
|
inline |
|
inline |
Definition at line 43 of file daemon_alive.hpp.
|
inline |
|
inline |
|
inline |
Given either the first 2 or 3 bytes of an initial client -> server data payload, return true if the protocol is that of an OpenVPN client attempting to connect with an OpenVPN server.
| p | Buffer containing packet data. |
| len | Packet (buffer) length. |
Definition at line 30 of file is_openvpn_protocol.hpp.
|
inline |
|
inline |
Definition at line 68 of file durhelper.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
| auto openvpn::make_rc | ( | ArgsT &&... | args | ) |
Helper function to create a reference-counted object with the default thread-unsafe reference counting policy.
| TypeT | The type of the object to be created. |
| RcT | The RC type that shall be used, defaults to RC<thread_unsafe_refcount> |
| ArgsT | The types of the arguments to be forwarded to the constructor of TypeT. |
| args | The arguments to be forwarded to the constructor of TypeT. |
Definition at line 77 of file make_rc.hpp.
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
Definition at line 117 of file timestr.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 21 of file reseed.hpp.
|
inline |
| openvpn::OPENVPN_EXCEPTION | ( | buf_read_error | ) |
| openvpn::OPENVPN_EXCEPTION | ( | crypto_dc_select | ) |
| openvpn::OPENVPN_EXCEPTION | ( | daemon_err | ) |
| openvpn::OPENVPN_EXCEPTION | ( | enum_dir_error | ) |
| openvpn::OPENVPN_EXCEPTION | ( | epoch_key_exception | ) |
| openvpn::OPENVPN_EXCEPTION | ( | file_unix_error | ) |
| openvpn::OPENVPN_EXCEPTION | ( | macdns_watchdog_error | ) |
| openvpn::OPENVPN_EXCEPTION | ( | number_parse_exception | ) |
| openvpn::OPENVPN_EXCEPTION | ( | openssl_engine_error | ) |
| openvpn::OPENVPN_EXCEPTION | ( | parse_acc_message | ) |
| openvpn::OPENVPN_EXCEPTION | ( | signaling_exception | ) |
| openvpn::OPENVPN_EXCEPTION_WITH_CODE | ( | option_error | , |
| ERR_PROFILE_OPTION | , | ||
| ERR_INVALID_OPTION_DNS | , | ||
| ERR_INVALID_OPTION_CRYPTO | , | ||
| ERR_INVALID_CONFIG | , | ||
| ERR_INVALID_OPTION_PUSHED | , | ||
| ERR_INVALID_OPTION_VAL | |||
| ) |
| openvpn::OPENVPN_OSTREAM | ( | SessionID128 | , |
| to_string | |||
| ) |
| openvpn::OPENVPN_OSTREAM | ( | SessionID64 | , |
| to_string | |||
| ) |
| openvpn::OPENVPN_SIMPLE_EXCEPTION | ( | get_time_error | ) |
| openvpn::OPENVPN_SIMPLE_EXCEPTION | ( | parse_hex_error | ) |
Declaration of a hexadecimal parsing error exception class
| openvpn::OPENVPN_UNTAGGED_EXCEPTION | ( | file_exception | ) |
| openvpn::OPENVPN_UNTAGGED_EXCEPTION_INHERIT | ( | file_exception | , |
| file_is_binary | |||
| ) |
| openvpn::OPENVPN_UNTAGGED_EXCEPTION_INHERIT | ( | file_exception | , |
| file_not_utf8 | |||
| ) |
| openvpn::OPENVPN_UNTAGGED_EXCEPTION_INHERIT | ( | file_exception | , |
| file_too_large | |||
| ) |
| openvpn::OPENVPN_UNTAGGED_EXCEPTION_INHERIT | ( | file_exception | , |
| open_file_error | |||
| ) |
|
constexprnoexcept |
Performs bitwise AND operation between two IntrinsicType objects.
| BaseT | The base type of the IntrinsicType |
| T | The underlying value type of the IntrinsicType |
| l | The left operand of the AND operation |
| r | The right operand of the AND operation |
Definition at line 304 of file intrinsic_type.hpp.
|
constexprnoexcept |
Multiplication operator.
| lhs | The left operand of the operation |
| rhs | The right operand of the operation |
Definition at line 241 of file intrinsic_type.hpp.
|
constexprnoexcept |
Addition operator.
| lhs | The left operand of the operation |
| rhs | The right operand of the operation |
Definition at line 215 of file intrinsic_type.hpp.
|
constexprnoexcept |
Subtraction operator.
| lhs | The left operand of the operation |
| rhs | The right operand of the operation |
Definition at line 228 of file intrinsic_type.hpp.
|
constexprnoexcept |
Division operator.
| lhs | The left operand of the operation |
| rhs | The right operand of the operation |
Definition at line 254 of file intrinsic_type.hpp.
| std::basic_ostream< Elem, Traits > & openvpn::operator<< | ( | std::basic_ostream< Elem, Traits > & | os, |
| const SafeString & | ss | ||
| ) |
Definition at line 1 of file safestr.hpp.
|
constexprnoexcept |
Equality comparison operator.
| lhs | The left operand of the operation |
| rhs | The right operand of the operation |
Definition at line 202 of file intrinsic_type.hpp.
|
constexprnoexcept |
Equality comparison operator.
| lhs | The left operand of the operation |
| rhs | The right operand of the operation |
Definition at line 189 of file intrinsic_type.hpp.
|
constexprnoexcept |
Performs bitwise OR operation between two IntrinsicType objects.
| BaseT | The base type of the IntrinsicType |
| T | The underlying value type of the IntrinsicType |
| l | The left operand of the OR operation |
| r | The right operand of the OR operation |
Definition at line 287 of file intrinsic_type.hpp.
|
constexprnoexcept |
Performs bitwise NOT operation on an IntrinsicType.
| BaseT | The base type of the IntrinsicType |
| T | The underlying value type of the IntrinsicType |
| t | The IntrinsicType object to perform NOT operation on |
Definition at line 270 of file intrinsic_type.hpp.
| void openvpn::ovpn_expand_label | ( | const uint8_t * | secret, |
| size_t | secret_len, | ||
| const uint8_t * | label, | ||
| size_t | label_len, | ||
| const uint8_t * | context, | ||
| size_t | context_len, | ||
| uint8_t * | out, | ||
| size_t | out_len | ||
| ) |
Variant of the RFC 8446 TLS 1.3 HKDF-Expand-Label function with the following differences/restrictions:
| secret | Input secret |
| secret_len | length of the input secret |
| label | Label for the exported key material |
| label_len | length of the label |
| context | optional context |
| context_len | length of the context |
| out | output keying material |
| out_len | length of output keying material |
Note, this function accepts size_t parameter only to make using this function easier. All values must be uin16_t or smaller.
Definition at line 56 of file data_epoch.cpp.
| void openvpn::ovpn_hkdf_expand | ( | const uint8_t * | secret, |
| const uint8_t * | info, | ||
| int | info_len, | ||
| uint8_t * | out, | ||
| int | out_len | ||
| ) |
Implementation of the RFC5869 HKDF-Expand function with the following restrictions
| secret | the input keying material (HMAC key) |
| info | context and application specific information |
| info_len | length of the application specific information |
| out | output keying material |
| out_len | length of output keying material |
Definition at line 21 of file data_epoch.cpp.
|
static |
|
inline |
Parses a std::string containing a hexadecimal value into a std::vector<T>.
| dest | std::vector<T> destination buffer to use. |
| str | std::string& containing the hexadecimal string to parse. |
| parse_hex_error | will throw this exception if the input is invalid/not parsable as a hexadecimal number. |
Definition at line 350 of file hexstr.hpp.
|
inline |
Parses a character in the range {0..9,A-F,a-f} to an integer value. Used to convert hexadecimal character to integer. Only a single character is parsed by this function.
| c | Character to be be parsed. |
Definition at line 64 of file hexstr.hpp.
|
inline |
Parses a char buffer (C string) containing a hexadecimal string into a templated (T) variable. The input buffer MUST be NULL terminated.
| str | Char pointer (char *) to the buffer to be parsed. |
| retval | Return buffer where the parsed value is stored. |
Definition at line 381 of file hexstr.hpp.
|
inline |
Parses a std::string containing a hexadecimal string into a templated (T) variable.
| str | std::string containing the hexadecimal string to be parsed. |
Definition at line 438 of file hexstr.hpp.
|
inline |
Variant of parse_hex_number(const char *, ...) which takes a std::string as the input.
| str | std::string containing the hexadecimal string to be parsed. |
| retval | Return buffer where the parsed value is stored. |
Definition at line 417 of file hexstr.hpp.
|
inline |
|
inline |
Definition at line 69 of file number.hpp.
|
inline |
Definition at line 93 of file number.hpp.
|
inline |
Definition at line 84 of file number.hpp.
|
inline |
Definition at line 75 of file number.hpp.
|
inline |
Definition at line 102 of file number.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 22 of file platform_string.hpp.
|
inline |
Definition at line 58 of file format.hpp.
|
inline |
|
inline |
|
inline |
| std::string openvpn::quote_ip | ( | const std::string & | ip_addr | ) |
Definition at line 19 of file quoteip.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Render a byte buffer (unsigned char *) as a hexadecimal string.
| data | Unsigned char pointer to buffer to render. |
| size | size_t of the number of bytes to parse from the buffer. |
| caps | Boolean (default false) which sets the outout to be either lower case (false) or upper case (true). |
Definition at line 133 of file hexstr.hpp.
|
inline |
Render a byte buffer (void *) as a hexadecimal string.
| data | Void pointer to buffer to render. |
| size | size_t of the number of bytes to parse from the buffer. |
| caps | Boolean (default false) which sets the outout to be either lower case (false) or upper case (true). |
Definition at line 159 of file hexstr.hpp.
|
inline |
Renders an integer value within the hexadecimal range (0-15) to a hexadecimal character.
| c | Integer to render as a hexadecimal character. |
| caps | Boolean (default false) which sets the outout to be either lower case (false) or upper case (true). |
Definition at line 42 of file hexstr.hpp.
|
inline |
Render a std::vector<T> container as a hexadecimal string. T must be a data type compatible with RenderHexByte(const unsigned char,...)
| data | std::vector<T> containing the data to render |
| caps | Boolean (default false) which sets the outout to be either lower case (false) or upper case (true). |
Definition at line 228 of file hexstr.hpp.
| std::string openvpn::render_hex_number | ( | T | value, |
| const bool | caps = false |
||
| ) |
Renders a templated T variable containing a numeric value into a std::string containing a hexadecimal representation.
| value | Numeric (T) value to represent as hexadecimal. |
| caps | Boolean (default false) which sets the outout to be either lower case (false) or upper case (true). |
Definition at line 459 of file hexstr.hpp.
|
inline |
Renders a single byte as a hexadecimal string
| uc | Unsigned char (byte) to be represented as hexadecimal. |
| caps | Boolean (default false) which sets the outout to be either lower case (false) or upper case (true). |
Definition at line 482 of file hexstr.hpp.
|
inline |
Variant of render_hex(const unsiged char *,...) which adds a separator between each byte
| data | Unsigned char pointer to buffer to render. |
| size | size_t of the number of bytes to parse from the buffer. |
| sep | A single character to use as the separator. |
| caps | Boolean (default false) which sets the outout to be either lower case (false) or upper case (true). |
Definition at line 178 of file hexstr.hpp.
|
inline |
Variant of render_hex(const void *,...) which adds a separator between each byte
| data | Void pointer to buffer to render. |
| size | size_t of the number of bytes to parse from the buffer. |
| sep | A single character to use as the separator. |
| caps | Boolean (default false) which sets the outout to be either lower case (false) or upper case (true). |
Definition at line 210 of file hexstr.hpp.
|
inline |
|
inline |
Definition at line 43 of file sanitize.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 80 of file durhelper.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 109 of file process.hpp.
|
inline |
Definition at line 103 of file process.hpp.
|
inline |
Definition at line 120 of file process.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 191 of file exception.hpp.
|
inline |
Convert a pem_encode() output buffer into a std::string.
The buffer holds exactly the bytes pem_encode() wrote, and the two SSL backends disagree on what those are: OpenSSL emits no NUL terminator (reading the buffer as a C string overruns the allocation), while mbedTLS appends one and counts it in the buffer size. Consume the explicit length and drop any trailing NUL so both backends yield the same PEM text.
| pem | Buffer filled by SSLLib::PEMAPI::pem_encode(). |
Definition at line 56 of file tls_crypt_v2.hpp.
|
inline |
|
inline |
|
inline |
Convert a value to a string.
| T | The type of the value to convert |
| t | The value to convert |
Definition at line 45 of file to_string.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 59 of file modstat.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 57 of file fileatomic.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 89 of file fileunix.hpp.
|
inline |
Definition at line 97 of file fileunix.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 77 of file writeprivate.hpp.
|
inline |
Definition at line 82 of file writeprivate.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 299 of file base64.hpp.
|
inline |
Definition at line 300 of file base64.hpp.
|
constexpr |
Definition at line 29 of file tunbase.hpp.
|
static |
SSL/TLS Cipher suite name translation table
Definition at line 26 of file iana_ciphers.hpp.
|
staticconstexpr |
Definition at line 42 of file tls_crypt_v2.hpp.
|
staticconstexpr |
Definition at line 41 of file tls_crypt_v2.hpp.
|
staticconstexpr |
Definition at line 23 of file waitbarrier.hpp.
|
staticconstexpr |
Definition at line 43 of file fileunix.hpp.