OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn Namespace Reference

Support deferred server-side state creation when client connects. More...

Namespaces

namespace  Acceptor
 
namespace  AEAD
 
namespace  AEADEpoch
 
namespace  AppleCrypto
 
namespace  AsioBoundSocket
 
namespace  AsioPolySock
 
namespace  AuthStatus
 
namespace  AWS
 
namespace  bigmutex
 
namespace  bmq_dgram
 
namespace  bmq_stream
 
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  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  TunIPRoute
 
namespace  TunLinux
 
namespace  TunLinuxSetup
 
namespace  TunMac
 
 
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
 

Classes

class  AccHandshaker
 defines a class that handles SSL/TLS handshaking More...
 
struct  Action
 
class  ActionList
 
struct  ActionListFactory
 
struct  ActionListReversed
 
class  ActionThread
 
struct  AddrPort
 
class  Agent
 
struct  AltProxy
 
struct  AppControlMessageConfig
 
class  AppControlMessageReceiver
 
struct  AppleCryptoAPI
 
class  AppleRandom
 
class  AppleSSLContext
 
class  AppleVersion
 
class  Argv
 
class  ArgvWrapper
 
struct  AsioClock
 
class  AsioConstBufferSeq2
 
class  AsioContextStore
 
class  ASIOSignals
 
class  AsioStopScope
 
class  AsioTimer
 
class  AsioTimerSafe
 
class  AsioWork
 
class  AsyncResolvable
 
class  AuthCert
 
class  AuthCreds
 
class  AutoReset
 
class  Base64
 
class  BaseSocketProtect
 
struct  BufAllocFlags
 
class  BufferAllocatedType
 
struct  BufferCollection
 
class  BufferComplete
 
class  BufferComposed
 
class  BufferException
 report various types of exceptions or errors that may occur when working with buffers More...
 
class  BufferLimit
 
class  BufferLineIterator
 
class  BufferStream
 
class  BufferStreamOut
 
class  BufferType
 
class  CertCRLListTemplate
 
class  CFException
 
class  ChallengeResponse
 
class  CipherContext
 
class  CircList
 
class  CleanupType
 
struct  ClientConfigParsed
 
class  ClientConnect
 
class  ClientCreds
 
class  ClientHalt
 
class  ClientLifeCycle
 
class  ClientOptions
 
class  CoarseTime
 
struct  Command
 
class  CommonNameReject
 
class  Compress
 
class  CompressContext
 
class  CompressLZ4
 
class  CompressLZ4Base
 
class  CompressLZ4v2
 
class  CompressLZO
 
class  CompressLZOAsym
 
class  CompressNull
 
class  CompressSnappy
 
class  CompressStub
 
class  CompressStubV2
 
class  ConstBufferType
 Immutable buffer with double ended access and adjustable free space at both ends. More...
 
class  crypto_init
 
class  CryptoCHM
 
class  CryptoContextCHM
 
class  CryptoDCContext
 
class  CryptoDCFactory
 
class  CryptoDCInstance
 
class  CryptoDCSelect
 
class  CryptoDCSettings
 
class  CryptoDCSettingsData
 
class  CryptoDigestFactory
 
class  CryptoDigestInstance
 
class  CryptoHMACInstance
 
class  CryptoOvpnHMACContext
 
class  CryptoOvpnHMACFactory
 
class  CryptoOvpnHMACInstance
 
class  CryptoTLSCryptContext
 
class  CryptoTLSCryptFactory
 
class  CryptoTLSCryptInstance
 
class  CryptoTLSCryptMetadataFactory
 
class  CryptoTLSPRFFactory
 
class  CryptoTLSPRFInstance
 
class  DataChannelEpoch
 
class  DataLimit
 
struct  DCO
 
class  DecryptCHM
 
struct  DestructorBase
 
class  DevURand
 
struct  DHCP
 
class  DHCPCapture
 
struct  DHCPPacket
 
class  DigestFactory
 
class  DigestInstance
 
class  DnsAddress
 A name server address and optional port. More...
 
class  DnsDomain
 A DNS domain name. More...
 
class  DnsOptions
 All DNS options set with the –dns or –dhcp-option directive. More...
 
struct  DnsOptionsMerger
 
struct  DnsOptionsParser
 
class  DnsServer
 DNS settings for a name server. More...
 
class  DSDict
 
struct  EmulateExcludeRoute
 
struct  EmulateExcludeRouteFactory
 
class  EmulateExcludeRouteFactoryImpl
 
class  EmulateExcludeRouteImpl
 
class  EncryptCHM
 
class  EnumIface
 
class  Environ
 
struct  EpochDataChannelCryptoContext
 
struct  EpochDataChannelDecryptContext
 
struct  EpochDataChannelEncryptContext
 
class  EpochKey
 
class  ErrorCode
 
struct  EthHeader
 
class  Exception
 
class  ExceptionCode
 
class  ExternalPKIBase
 
class  ExternalPKIECImpl
 
class  ExternalPKIImpl
 
class  ExternalPKIRsaImpl
 
class  Frame
 
class  Function
 
class  Function< R(A...), N, INTERN_ONLY >
 
class  GeNL
 
class  Glob
 
class  HashString
 
class  HMACInstance
 
struct  ICMPv4
 
struct  ICMPv6
 
class  IndexedTitle
 
class  iOSActiveInterface
 
class  IPCollisionDetectBase
 
struct  IPv4Header
 
class  IPv4ReversePathFilter
 
struct  IPv6Header
 
class  IPVerFlags
 
class  Layer
 
class  LexQuoteMixin
 Helper class to handle quote processing. More...
 
class  Link
 
class  LinuxGW
 
struct  LinuxGW46
 
struct  LinuxGW46Netlink
 
class  LinuxGWNetlink
 
class  LinuxRoute
 
struct  LogBase
 The logging interface, simple, logs a string. More...
 
class  LogBaseSimple
 
class  LogBaseSimpleMac
 
class  LogOutputCollector
 
class  LogPeriod
 
class  LogReopen
 
class  LogSetup
 
class  MACAddr
 
class  MacDNS
 
class  MacDNSWatchdog
 
class  MacGatewayInfo
 
class  MacLifeCycle
 
class  MacProxySettings
 
class  MacSleep
 
class  MbedTLSContext
 
struct  MbedTLSCryptoAPI
 
class  MbedTLSException
 
class  MbedTLSPEM
 
class  MbedTLSRandom
 
class  MemQBase
 
class  MemQDgram
 
class  MemQStream
 
class  MessageWindow
 
class  Mode
 
struct  MSSCtrlParms
 
class  MSSFix
 
struct  MSSParms
 
class  MTRand
 
class  MultiLogSetup
 
class  NullLex
 
class  OMICore
 
class  OpenSSLContext
 
struct  OpenSSLCryptoAPI
 
class  OpenSSLException
 
class  OpenSSLPEM
 
class  OpenSSLRandom
 
class  OpenSSLSessionCache
 
class  OpenVPNStaticKey
 
class  Option
 
class  OptionList
 
class  OptionListContinuation
 
struct  OvpnDcoPeer
 
class  OvpnHMAC
 
class  OvpnHMACContext
 
class  OvpnHMACFactory
 
class  OvpnHMACInstance
 
struct  PacketIDControl
 
class  PacketIDControlReceiveType
 
class  PacketIDControlSend
 
struct  PacketIDData
 
class  PacketIDDataReceiveType
 
class  PacketIDDataSend
 
class  PacketStream
 
class  PacketStreamResidual
 
class  ParseClientConfig
 
struct  ParseTunSpec
 
struct  PeerAddr
 
struct  PeerFingerprint
 
struct  PeerFingerprints
 
struct  PeerStats
 
class  PersistentFile
 
class  PrintFormatted
 
class  ProcFS
 
class  ProfileMerge
 
class  ProfileMergeFromString
 
class  Protocol
 
class  ProtoContext
 
class  ProtoContextCallbackInterface
 
struct  ProtoContextCompressionOptions
 
class  ProtoSessionID
 
class  ProtoStackBase
 
struct  ProxyListener
 
class  ProxySettings
 
class  PsidCookie
 Interface to integrate this component into the server implementation. More...
 
class  PsidCookieAddrInfoBase
 Interface to communicate the server's address semantics. More...
 
class  PsidCookieImpl
 Implements the PsidCookie interface. More...
 
class  PsidCookieTransportBase
 Interface to provide access to the server's transport capability. More...
 
class  Ptb
 
class  PThreadBarrier
 
class  PushContinuationFragment
 
class  PushedOptionsFilter
 
class  PushLex
 
struct  PushOptionsBase
 
struct  PushOptionsMerger
 
struct  Rand2
 
class  RandomAPI
 Abstract base class for random number generators. More...
 
class  RandomByteStore
 
class  RC
 Reference count base class for objects tracked by RCPtr. Disallows copying and assignment. More...
 
class  RCCopyable
 Reference count base class for objects tracked by RCPtr. Allows copying and assignment. More...
 
class  RcEnable
 A class template that enables reference counting for a given type. More...
 
class  RCPtr
 The smart pointer class. More...
 
class  RCWeak
 Reference count base class for objects tracked by RCPtr. Like RC, but also allows weak pointers and release notification callables. More...
 
class  RCWeakPtr
 implements a weak pointer for reference counted objects. More...
 
class  Reachability
 
class  ReachabilityBase
 
struct  ReachabilityInterface
 
class  ReachabilityTracker
 
class  ReachabilityViaInternet
 
class  ReachabilityViaWiFi
 
class  ReconnectNotify
 
struct  RedirectBase
 
class  RedirectGatewayFlags
 
class  RedirectNull
 
class  RedirectPipe
 
class  RedirectStd
 
struct  RedirectStdFD
 
class  RedirectTemp
 
class  ReliableAck
 
class  ReliableMessageBase
 
class  ReliableRecvTemplate
 
class  ReliableSendTemplate
 
class  RemoteList
 
class  RenderHexByte
 
class  RunContext
 
struct  RunContextBase
 
struct  RunContextLogEntry
 
class  SafeString
 A string-like type that clears the buffer contents on delete. More...
 
class  SaveCurrentLogObject
 
class  ScopedAsioStream
 
class  ScopedFD
 
class  ServerProto
 
class  ServerPushList
 
struct  ServerThreadType
 
class  SessionIDType
 
class  SessionStats
 
class  SetUserGroup
 
class  SetUserGroupRetainCap
 
class  Signal
 
class  SignalBlocker
 
struct  SignalBlockerDefault
 
struct  SignalBlockerPipe
 
class  slab_deleter
 
struct  SpaceMatch
 
class  SplitLinesType
 
class  SSLAPI
 
class  SslApiBuilder
 The SslApiBuilder struct is used to initialize and configure an SSL/TLS API in OpenVPN. More...
 
class  SSLConfigAPI
 
class  SSLFactoryAPI
 
class  StandardLex
 
class  StaticBuffer
 
class  StaticKey
 
class  Stop
 
class  StrongRandomAPI
 Abstract base class for cryptographically strong random number generators. More...
 
struct  TCPHeader
 
class  TempFile
 
class  thread_safe_refcount
 Implements a memory fenced ref count. More...
 
class  thread_unsafe_refcount
 implements a simple reference count for objects. More...
 
struct  TimeSkew
 
class  TimeType
 
struct  tls_cipher_name_pair
 
class  TLSCrypt
 
class  TLSCryptContext
 
class  TLSCryptFactory
 
class  TLSCryptInstance
 
class  TLSCryptMetadata
 
class  TLSCryptMetadataFactory
 
class  TLSCryptV2ClientKey
 
class  TLSCryptV2ServerKey
 
class  TLSPRF
 
class  TLSPRFFactory
 
class  TLSPRFInstance
 
class  TLSSessionTicketBase
 
class  TokenEncrypt
 
struct  TokenEncryptDecrypt
 
struct  TransportClient
 
struct  TransportClientFactory
 
struct  TransportClientParent
 
class  TransportMutateStream
 
class  TransportRelayFactory
 
struct  TransportServer
 
struct  TransportServerFactory
 
class  TriStateSetting
 
class  TunBuilderBase
 TunBuilder methods, loosely based on the Android VpnService.Builder abstraction. More...
 
class  TunBuilderCapture
 
struct  TunClient
 
struct  TunClientFactory
 
struct  TunClientParent
 
struct  TunConfigFlags
 
class  TunIO
 
class  TunPersistTemplate
 
class  TunProp
 
class  TunWrapAsioStream
 
class  TunWrapTemplate
 
struct  UDPHeader
 
class  UMask
 
struct  UMaskDaemon
 
struct  UMaskPrivate
 
class  UnixCommandAgent
 
class  UseCount
 
class  VerifyX509Name
 
class  VPNServerNetblock
 
class  WeakRandomAPI
 Abstract base class for pseudo random number generators. More...
 
class  WinCmd
 
class  WinCommandAgent
 
class  WinSleep
 
class  WritePid
 
class  XKeyExternalPKIImpl
 
class  XmitFD
 
class  Xml
 

Typedefs

typedef AppleSSLContext::Ptr AppleSSLContextPtr
 
using Buffer = BufferType< unsigned char >
 
using ConstBuffer = ConstBufferType< unsigned char >
 
using BufferAllocated = BufferAllocatedType< unsigned char >
 
using BufferAllocatedRc = RcEnable< BufferAllocated, RC< thread_unsafe_refcount > >
 
using BufferPtr = RCPtr< BufferAllocatedRc >
 
using BufferAllocatedTS = RcEnable< BufferAllocated, RC< thread_safe_refcount > >
 
using BufferPtrTS = RCPtr< BufferAllocatedTS >
 
typedef BufferCollection< std::list > BufferList
 
typedef BufferCollection< std::vector > BufferVector
 
typedef AsyncResolvable< openvpn_io::ip::udp::resolver > AsyncResolvableUDP
 
typedef AsyncResolvable< openvpn_io::ip::tcp::resolver > AsyncResolvableTCP
 
typedef long long count_t
 
typedef long olong
 
typedef unsigned long oulong
 
typedef ServerThreadType< RCWeak< thread_safe_refcount > > ServerThreadWeakBase
 
typedef ServerThreadType< RC< thread_safe_refcount > > ServerThreadBase
 
typedef SessionIDType< 8 > SessionID64
 
typedef SessionIDType< 16 > SessionID128
 
typedef SplitLinesType< std::string > SplitLines
 
template<typename T >
using unique_ptr_del = std::unique_ptr< T, std::function< void(T *)> >
 
template<typename T >
using unique_ptr_slab = std::unique_ptr< T, slab_deleter< T > >
 
typedef CompressLZOAsym CompressLZO
 
typedef PacketIDControlReceiveType< 8, 30 > PacketIDControlReceive
 
typedef PacketIDDataReceiveType< 8, 30 > PacketIDDataReceive
 
using ssl_external_pki = SSLFactoryAPI::ssl_external_pki
 
typedef std::uint64_t nanotime_t
 
typedef TimeType< oulongTime
 
typedef TimeTimePtr
 
typedef BaseSocketProtect SocketProtect
 
typedef int(* ovpn_nl_cb) (struct nl_msg *msg, void *arg)
 

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 >
ConstBufferType< T > & const_buffer_ref (BufferType< T > &src)
 
template<typename T >
const ConstBufferType< T > & const_buffer_ref (const BufferType< T > &src)
 
 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 , typename = std::enable_if_t<std::is_trivially_copyable<T>::value>>
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 >
bin_prefix (const unsigned char *data, const size_t len)
 
template<typename T >
bin_prefix_floor (const unsigned char *data, const size_t len, const T floor)
 
template<typename T >
clamp (T value, T low, T high)
 
template<typename T >
clamp_nonzero (T value, T low, T high)
 
template<typename F >
CleanupType< F > Cleanup (F method) noexcept
 
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 unsigned int buffer_flags=0)
 
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 buffer_flags=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 buffer_flags=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 >
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 ()
 
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 >
parse_number_throw (const std::string &str, const std::string &error)
 
template<typename T >
parse_number_throw (const std::string &str, const char *error)
 
template<typename 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 (const char *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 sleep_milliseconds (const unsigned int milliseconds)
 
bool file_exists (const std::string &filename)
 
bool file_exists_nonempty (const std::string &filename)
 
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 , typename std::enable_if< std::is_arithmetic< T >::value, int >::type = 0>
std::string to_string (T value)
 
template<typename T , typename std::enable_if<!std::is_arithmetic< T >::value, int >::type = 0>
std::string to_string (const T &value)
 
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)
 
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 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)
 
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_pairtls_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 Optionload_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 ()
 
 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 Base64base64
 
const Base64base64_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 []
 

Detailed Description

Support deferred server-side state creation when client connects.

This class implements the parsing and generating of app custom control channel messages

Creating OpenVPN protocol tracking state upon receipt of an initial client HARD_RESET packet invites the bad actor to flood the server with connection requests maintaining anonymity by spoofing the client's source address. Not only does this invite resource exhaustion, but, because of reliability layer retries, it creates an amplification attack as the server retries its un-acknowledged HARD_RESET replies to the spoofed address.

This solution treats the server's 64-bit protocol session ID ("Psid or psid") as a cookie that allows the server to defer state creation. It is ported here to openvpn3 from original work in OpenVPN. Unlike the randomly created server psid generated in psid.hpp for the server's HARD_RESET reply, this approach derives the server psid via an HMAC of information from the incoming client OpenVPN HARD_RESET control message (i.e., the psid cookie). This allows the server to verify the client as it returns the server psid in it's second packet, only then creating protocol state.

Not only does this prevent the resource exhaustion, but it has the happy consequence of avoiding the amplification attack. Since no state is created on the first packet, there is no reliability layer; and, hence, no retries of the server's HARD_RESET reply.

Typedef Documentation

◆ AppleSSLContextPtr

Definition at line 486 of file sslctx.hpp.

◆ AsyncResolvableTCP

typedef AsyncResolvable<openvpn_io::ip::tcp::resolver> openvpn::AsyncResolvableTCP

Definition at line 24 of file async_resolve.hpp.

◆ AsyncResolvableUDP

typedef AsyncResolvable<openvpn_io::ip::udp::resolver> openvpn::AsyncResolvableUDP

Definition at line 23 of file async_resolve.hpp.

◆ Buffer

using openvpn::Buffer = typedef BufferType<unsigned char>

Definition at line 1855 of file buffer.hpp.

◆ BufferAllocated

using openvpn::BufferAllocated = typedef BufferAllocatedType<unsigned char>

Definition at line 1857 of file buffer.hpp.

◆ BufferAllocatedRc

◆ BufferAllocatedTS

◆ BufferList

Definition at line 108 of file buflist.hpp.

◆ BufferPtr

Definition at line 1859 of file buffer.hpp.

◆ BufferPtrTS

Definition at line 1866 of file buffer.hpp.

◆ BufferVector

Definition at line 109 of file buflist.hpp.

◆ CompressLZO

Definition at line 26 of file lzoselect.hpp.

◆ ConstBuffer

using openvpn::ConstBuffer = typedef ConstBufferType<unsigned char>

Definition at line 1856 of file buffer.hpp.

◆ count_t

typedef long long openvpn::count_t

Definition at line 16 of file count.hpp.

◆ nanotime_t

typedef std::uint64_t openvpn::nanotime_t

Definition at line 20 of file epoch.hpp.

◆ olong

typedef long openvpn::olong

Definition at line 23 of file olong.hpp.

◆ oulong

typedef unsigned long openvpn::oulong

Definition at line 24 of file olong.hpp.

◆ ovpn_nl_cb

typedef int(* openvpn::ovpn_nl_cb) (struct nl_msg *msg, void *arg)

Definition at line 36 of file genl.hpp.

◆ PacketIDControlReceive

◆ PacketIDDataReceive

Definition at line 498 of file packet_id_data.hpp.

◆ ServerThreadBase

◆ ServerThreadWeakBase

◆ SessionID128

Definition at line 184 of file sess_id.hpp.

◆ SessionID64

Definition at line 183 of file sess_id.hpp.

◆ SocketProtect

Definition at line 36 of file socket_protect.hpp.

◆ SplitLines

typedef SplitLinesType<std::string> openvpn::SplitLines

Definition at line 181 of file splitlines.hpp.

◆ ssl_external_pki

using openvpn::ssl_external_pki = typedef SSLFactoryAPI::ssl_external_pki

Definition at line 26 of file extpki.hpp.

◆ Time

Definition at line 492 of file time.hpp.

◆ TimePtr

Definition at line 494 of file time.hpp.

◆ unique_ptr_del

template<typename T >
using openvpn::unique_ptr_del = typedef std::unique_ptr<T, std::function<void(T *)> >

Definition at line 21 of file uniqueptr.hpp.

◆ unique_ptr_slab

template<typename T >
using openvpn::unique_ptr_slab = typedef std::unique_ptr<T, slab_deleter<T> >

Definition at line 55 of file uniqueptr.hpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TUN_MTU_DEFAULT 

Definition at line 18 of file tunmtu.hpp.

◆ anonymous enum

anonymous enum
Enumerator
NULL_ON_ENOENT 

Definition at line 113 of file fileunix.hpp.

◆ TunWrapObjRetain

enum class openvpn::TunWrapObjRetain
strong
Enumerator
NO_RETAIN 
RETAIN 
NO_RETAIN_NO_REPLACE 

Definition at line 21 of file tunwrap.hpp.

Function Documentation

◆ alignment_safe_extract()

template<typename T , typename = std::enable_if_t<std::is_trivially_copyable<T>::value>>
T openvpn::alignment_safe_extract ( const void *  toAlign)
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.

Template Parameters
Ttype to convert to
Parameters
toAlignstarting address of the bytes to be converted
Returns
T output value and type

Definition at line 30 of file alignment.hpp.

◆ array_size()

template<typename T , std::size_t N>
constexpr std::size_t openvpn::array_size ( T(&)  [N])
constexpr

Definition at line 19 of file arraysize.hpp.

Here is the caller graph for this function:

◆ asio_resolver_results_to_string()

template<class EPRANGE >
std::string openvpn::asio_resolver_results_to_string ( const EPRANGE &  endpoint_range)
inline

Definition at line 31 of file asioresolverres.hpp.

Here is the caller graph for this function:

◆ async_sleep_milliseconds()

bool openvpn::async_sleep_milliseconds ( int  milliseconds,
Stop async_stop 
)
inline

Definition at line 25 of file asyncsleep.hpp.

◆ base64_init_static()

void openvpn::base64_init_static ( )
inline

Definition at line 302 of file base64.hpp.

Here is the caller graph for this function:

◆ base64_uninit_static()

void openvpn::base64_uninit_static ( )
inline

Definition at line 310 of file base64.hpp.

Here is the caller graph for this function:

◆ bin_prefix() [1/3]

template<typename T >
std::enable_if< 4==sizeof(T), T >::type openvpn::bin_prefix ( const unsigned char *  data)
inline

Definition at line 27 of file binprefix.hpp.

◆ bin_prefix() [2/3]

template<typename T >
std::enable_if< 8==sizeof(T), T >::type openvpn::bin_prefix ( const unsigned char *  data)
inline

Definition at line 37 of file binprefix.hpp.

◆ bin_prefix() [3/3]

template<typename T >
T openvpn::bin_prefix ( const unsigned char *  data,
const size_t  len 
)
inline

Definition at line 44 of file binprefix.hpp.

◆ bin_prefix_floor()

template<typename T >
T openvpn::bin_prefix_floor ( const unsigned char *  data,
const size_t  len,
const T  floor 
)
inline

Definition at line 58 of file binprefix.hpp.

◆ bind_to_core()

int openvpn::bind_to_core ( const int  core_id)
inline

Definition at line 23 of file core.hpp.

◆ buf_alloc_from_string() [1/2]

BufferAllocated openvpn::buf_alloc_from_string ( const char *  str)
inline

Definition at line 73 of file bufstr.hpp.

◆ buf_alloc_from_string() [2/2]

BufferAllocated openvpn::buf_alloc_from_string ( const std::string &  str)
inline

Definition at line 64 of file bufstr.hpp.

Here is the caller graph for this function:

◆ buf_append_string() [1/2]

void openvpn::buf_append_string ( Buffer buf,
const char *  str 
)
inline

Definition at line 88 of file bufstr.hpp.

◆ buf_append_string() [2/2]

void openvpn::buf_append_string ( Buffer buf,
const std::string &  str 
)
inline

Definition at line 82 of file bufstr.hpp.

Here is the caller graph for this function:

◆ buf_c_str()

const char * openvpn::buf_c_str ( const Buffer buf)
inline

Definition at line 102 of file bufstr.hpp.

◆ buf_clamp_read()

size_t openvpn::buf_clamp_read ( const size_t  size)
inline

Definition at line 23 of file bufclamp.hpp.

Here is the caller graph for this function:

◆ buf_clamp_write()

size_t openvpn::buf_clamp_write ( const size_t  size)
inline

Definition at line 32 of file bufclamp.hpp.

Here is the caller graph for this function:

◆ buf_eq_str()

bool openvpn::buf_eq_str ( const Buffer buf,
const std::string &  str 
)
inline

Definition at line 108 of file bufstr.hpp.

◆ buf_from_string() [1/2]

BufferPtr openvpn::buf_from_string ( const char *  str)
inline

Definition at line 55 of file bufstr.hpp.

◆ buf_from_string() [2/2]

BufferPtr openvpn::buf_from_string ( const std::string &  str)
inline

Definition at line 46 of file bufstr.hpp.

Here is the caller graph for this function:

◆ buf_read() [1/2]

bool openvpn::buf_read ( const int  fd,
Buffer buf,
const std::string &  title 
)
inline

Definition at line 29 of file bufread.hpp.

Here is the caller graph for this function:

◆ buf_read() [2/2]

BufferList openvpn::buf_read ( const int  fd,
const std::string &  title 
)
inline

Definition at line 43 of file bufread.hpp.

◆ buf_to_string() [1/2]

std::string openvpn::buf_to_string ( const Buffer buf)
inline

Definition at line 22 of file bufstr.hpp.

Here is the caller graph for this function:

◆ buf_to_string() [2/2]

std::string openvpn::buf_to_string ( const ConstBuffer buf)
inline

Definition at line 28 of file bufstr.hpp.

◆ buf_write_string() [1/2]

void openvpn::buf_write_string ( Buffer buf,
const char *  str 
)
inline

Definition at line 40 of file bufstr.hpp.

◆ buf_write_string() [2/2]

void openvpn::buf_write_string ( Buffer buf,
const std::string &  str 
)
inline

Definition at line 34 of file bufstr.hpp.

Here is the caller graph for this function:

◆ clamp()

template<typename T >
T openvpn::clamp ( value,
low,
high 
)

Definition at line 19 of file clamp.hpp.

Here is the caller graph for this function:

◆ clamp_nonzero()

template<typename T >
T openvpn::clamp_nonzero ( value,
low,
high 
)

Definition at line 31 of file clamp.hpp.

◆ Cleanup()

template<typename F >
CleanupType< F > openvpn::Cleanup ( method)
inlinenoexcept

Definition at line 43 of file cleanup.hpp.

Here is the caller graph for this function:

◆ const_buf_from_string()

ConstBuffer openvpn::const_buf_from_string ( const std::string &  str)
inline

Definition at line 95 of file bufstr.hpp.

Here is the caller graph for this function:

◆ const_buffer_ref() [1/2]

template<typename T >
ConstBufferType< T > & openvpn::const_buffer_ref ( BufferType< T > &  src)
inline

Definition at line 1873 of file buffer.hpp.

Here is the caller graph for this function:

◆ const_buffer_ref() [2/2]

template<typename T >
const ConstBufferType< T > & openvpn::const_buffer_ref ( const BufferType< T > &  src)
inline

Definition at line 1879 of file buffer.hpp.

◆ cpu_time()

double openvpn::cpu_time ( const bool  thread = false)
inline

Retrieve the time (in seconds) the current process or thread has been running. Runing time includes both system and user times.

Parameters
threadBoolean flag controlling if process or thread runtime should be returned
Returns
Returns a double containing number of seconds the current process (PID) or thread has been running. On errors -1.0 is returned.

Definition at line 76 of file cputime.hpp.

◆ crypto_self_test_mbedtls()

std::string openvpn::crypto_self_test_mbedtls ( )
inline

Definition at line 30 of file selftest.hpp.

Here is the caller graph for this function:

◆ cxx_demangle()

std::string openvpn::cxx_demangle ( const char *  mangled_name)
inline

Definition at line 24 of file demangle.hpp.

◆ daemon_pid()

int openvpn::daemon_pid ( const std::string &  cmd,
const std::string &  pidfile 
)
inline

Definition at line 20 of file daemon_alive.hpp.

Here is the caller graph for this function:

◆ daemonize() [1/2]

void openvpn::daemonize ( )
inline

Definition at line 100 of file daemon.hpp.

Here is the caller graph for this function:

◆ daemonize() [2/2]

LogSetup::Ptr openvpn::daemonize ( const std::string &  log_fn,
const SetUserGroup user_group,
const bool  log_append,
const int  log_versions 
)
inline

Definition at line 114 of file daemon.hpp.

◆ date_time() [1/3]

std::string openvpn::date_time ( )
inline

Definition at line 139 of file timestr.hpp.

Here is the caller graph for this function:

◆ date_time() [2/3]

std::string openvpn::date_time ( const struct timeval *  tv,
const bool  msecs 
)
inline

Definition at line 96 of file timestr.hpp.

◆ date_time() [3/3]

std::string openvpn::date_time ( const time_t  t)
inline

Definition at line 62 of file timestr.hpp.

◆ date_time_rfc822() [1/2]

std::string openvpn::date_time_rfc822 ( )
inline

Definition at line 185 of file timestr.hpp.

Here is the caller graph for this function:

◆ date_time_rfc822() [2/2]

std::string openvpn::date_time_rfc822 ( const time_t  t)
inline

Definition at line 164 of file timestr.hpp.

◆ date_time_store_time_t()

std::string openvpn::date_time_store_time_t ( time_t &  save)
inline

Definition at line 150 of file timestr.hpp.

Here is the caller graph for this function:

◆ date_time_utc()

std::string openvpn::date_time_utc ( const time_t  t)
inline

Definition at line 78 of file timestr.hpp.

Here is the caller graph for this function:

◆ delete_slab()

template<typename T >
void openvpn::delete_slab ( T *  ptr)

Definition at line 36 of file uniqueptr.hpp.

Here is the caller graph for this function:

◆ dump_hex() [1/4]

std::string openvpn::dump_hex ( const std::string &  str)
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.

Parameters
strstd::string containing the buffer to render
Returns
Returns a string containing a preformatted output of the hexadecimal dump.

Definition at line 313 of file hexstr.hpp.

◆ dump_hex() [2/4]

std::string openvpn::dump_hex ( const unsigned char *  data,
size_t  size 
)
inline

Renders a combined hexadecimal and character dump of a buffer, with the typical 16 bytes split between hexadecimal and character separation per line.

Parameters
dataUnsigned char pointer to the buffer to dump.
sizeSize of the buffer to render.
Returns
Returns a string containing a preformatted output of the hexadecimal dump.

Definition at line 255 of file hexstr.hpp.

Here is the caller graph for this function:

◆ dump_hex() [3/4]

template<typename V >
std::string openvpn::dump_hex ( const V &  data)
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.

Parameters
datastd::vector<T> containing the buffer to render
Returns
Returns a string containing a preformatted output of the hexadecimal dump.

Definition at line 330 of file hexstr.hpp.

◆ dump_hex() [4/4]

std::string openvpn::dump_hex ( void *  data,
size_t  size 
)
inline

Renders a combined hexadecimal and character dump of a buffer, with the typical 16 bytes split between hexadecimal and character separation per line.

Parameters
dataVoid pointer to the buffer to dump.
sizeSize of the buffer to render.
Returns
Returns a string containing a preformatted output of the hexadecimal dump.

Definition at line 298 of file hexstr.hpp.

◆ enum_dir() [1/2]

std::vector< std::string > openvpn::enum_dir ( const std::string &  dirname,
const size_t  size_hint = 0,
const bool  sort = false 
)
inline

Definition at line 51 of file enumdir.hpp.

◆ enum_dir() [2/2]

template<typename F >
bool openvpn::enum_dir ( const std::string &  dirname,
func 
)
inline

Definition at line 33 of file enumdir.hpp.

Here is the caller graph for this function:

◆ errinfo()

template<typename ErrorCode >
std::string openvpn::errinfo ( ErrorCode  err)
inline

Definition at line 23 of file asioerr.hpp.

Here is the caller graph for this function:

◆ event_loop_wait_barrier()

template<typename THREAD_COMMON >
void openvpn::event_loop_wait_barrier ( THREAD_COMMON &  tc,
const unsigned int  seconds = WAIT_BARRIER_TIMEOUT 
)
inline

Definition at line 27 of file waitbarrier.hpp.

Here is the caller graph for this function:

◆ exclude_from_core()

int openvpn::exclude_from_core ( const int  core_id)
inline

Definition at line 37 of file core.hpp.

◆ fd_mod_time_nanoseconds()

std::uint64_t openvpn::fd_mod_time_nanoseconds ( const int  fd)
inline

Definition at line 97 of file stat.hpp.

Here is the caller graph for this function:

◆ file_exists()

bool openvpn::file_exists ( const std::string &  filename)
inline

Definition at line 23 of file stat.hpp.

Here is the caller graph for this function:

◆ file_exists_nonempty()

bool openvpn::file_exists_nonempty ( const std::string &  filename)
inline

Check if file exists AND is nonempty.

Parameters
filenameFile to check.
Returns
true if file exists AND is nonempty.

Definition at line 37 of file stat.hpp.

◆ file_mod_time()

time_t openvpn::file_mod_time ( const std::string &  filename)
inline

Definition at line 60 of file stat.hpp.

◆ file_mod_time_milliseconds()

std::uint64_t openvpn::file_mod_time_milliseconds ( const std::string &  filename)
inline

Definition at line 107 of file stat.hpp.

◆ file_mod_time_nanoseconds() [1/2]

std::uint64_t openvpn::file_mod_time_nanoseconds ( const char *  filename)
inline

Definition at line 81 of file stat.hpp.

Here is the caller graph for this function:

◆ file_mod_time_nanoseconds() [2/2]

std::uint64_t openvpn::file_mod_time_nanoseconds ( const std::string &  filename)
inline

Definition at line 91 of file stat.hpp.

◆ frame_init()

Frame::Ptr openvpn::frame_init ( const bool  align_adjust_3_1,
const size_t  tun_mtu_max,
const size_t  control_channel_payload,
const bool  verbose 
)
inline

Definition at line 23 of file frame_init.hpp.

Here is the caller graph for this function:

◆ frame_init_context_simple()

Frame::Context openvpn::frame_init_context_simple ( const size_t  payload)
inline

Definition at line 61 of file frame_init.hpp.

Here is the caller graph for this function:

◆ frame_init_simple()

Frame::Ptr openvpn::frame_init_simple ( const size_t  payload)
inline

Definition at line 70 of file frame_init.hpp.

Here is the caller graph for this function:

◆ get_hostname()

std::string openvpn::get_hostname ( )
inline

Definition at line 24 of file hostname.hpp.

◆ get_hwaddr()

std::string openvpn::get_hwaddr ( IP::Addr  server_addr)
inline

Definition at line 31 of file hwaddr.hpp.

Here is the caller graph for this function:

◆ get_password()

std::string openvpn::get_password ( const char *  prompt)
inline

Definition at line 29 of file getpw.hpp.

Here is the caller graph for this function:

◆ get_ssl_library_version()

const std::string openvpn::get_ssl_library_version ( )
inline

Reports a human readable string of the SSL library in use and its version. E.g. mbed TLS 1.2.4

Returns
a human readable SSL library version string

Definition at line 1679 of file sslctx.hpp.

Here is the caller graph for this function:

◆ init_openssl()

void openvpn::init_openssl ( const std::string &  engine)
inline

Definition at line 35 of file engineinit.hpp.

Here is the caller graph for this function:

◆ intrusive_ptr_add_ref()

template<typename R >
void openvpn::intrusive_ptr_add_ref ( R *  rcptr)
inlinenoexcept

Helper to increment a ref count.

Template Parameters
Rtype that has an incrementable member refcount_
Parameters
rcptrpointer to instance of R
Todo:
consider removing debug cout

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 1400 of file rc.hpp.

Here is the caller graph for this function:

◆ intrusive_ptr_release()

template<typename R >
void openvpn::intrusive_ptr_release ( R *  rcptr)
inlinenoexcept

Helper to decrement a ref count.

Template Parameters
Rtype that has an decrementable member refcount_
Parameters
rcptrpointer to instance of R
Todo:
consider removing debug cout

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 1418 of file rc.hpp.

Here is the caller graph for this function:

◆ is_bs64_cipher()

bool openvpn::is_bs64_cipher ( const CryptoAlgs::Type  cipher)
inline

Definition at line 29 of file bs64_data_limit.hpp.

Here is the caller graph for this function:

◆ is_daemon_alive()

bool openvpn::is_daemon_alive ( const std::string &  cmd,
const std::string &  pidfile 
)
inline

Definition at line 43 of file daemon_alive.hpp.

◆ is_directory()

bool openvpn::is_directory ( const std::string &  pathname,
const bool  follow_symlinks = false 
)
inline

Definition at line 48 of file stat.hpp.

◆ is_number()

bool openvpn::is_number ( const char *  str)
inline

Definition at line 126 of file number.hpp.

Here is the caller graph for this function:

◆ is_openvpn_protocol()

bool openvpn::is_openvpn_protocol ( const unsigned char *  p,
std::size_t  len 
)
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.

Parameters
pBuffer containing packet data.
lenPacket (buffer) length.
Returns
true if we're dealing with an OpenVPN client, false otherwise.

Definition at line 30 of file is_openvpn_protocol.hpp.

◆ is_pow2()

template<typename T >
bool openvpn::is_pow2 ( const T  v)
inline

Definition at line 136 of file ffs.hpp.

◆ load_duration_default()

Time::Duration openvpn::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 
)
inline

Definition at line 68 of file durhelper.hpp.

◆ load_duration_parm()

const Option * openvpn::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 
)
inline

Definition at line 41 of file durhelper.hpp.

Here is the caller graph for this function:

◆ log2()

template<typename T >
int openvpn::log2 ( const T  v)
inline

Definition at line 142 of file ffs.hpp.

◆ log_compress()

void openvpn::log_compress ( const std::string  prefix,
const size_t  orig_size,
const size_t  new_size 
)
inline

Definition at line 15 of file complog.hpp.

Here is the caller graph for this function:

◆ log_rotate()

void openvpn::log_rotate ( const std::string &  fn,
const int  max_versions 
)
inline

Definition at line 20 of file logrotate.hpp.

Here is the caller graph for this function:

◆ log_setup()

LogSetup::Ptr openvpn::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 
)
inline

Definition at line 68 of file daemon.hpp.

Here is the caller graph for this function:

◆ make_rc()

template<typename TypeT , typename RcT = RC<thread_unsafe_refcount>, typename... ArgsT>
auto openvpn::make_rc ( ArgsT &&...  args)

Helper function to create a reference-counted object with the default thread-unsafe reference counting policy.

Template Parameters
TypeTThe type of the object to be created.
RcTThe RC type that shall be used, defaults to RC<thread_unsafe_refcount>
ArgsTThe types of the arguments to be forwarded to the constructor of TypeT.
Parameters
argsThe arguments to be forwarded to the constructor of TypeT.
Returns
A reference-counted object of type TypeT, using the default thread-unsafe reference counting policy.
Note
This function is a convenience wrapper around make_rc_impl, using the default RC<thread_unsafe_refcount> as the reference counting policy.

Definition at line 77 of file make_rc.hpp.

◆ milliseconds_since_epoch()

std::uint64_t openvpn::milliseconds_since_epoch ( )
inline

Definition at line 22 of file epoch.hpp.

◆ n_cores()

int openvpn::n_cores ( )
inline

Definition at line 32 of file core.hpp.

Here is the caller graph for this function:

◆ nanosec_time_to_string()

std::string openvpn::nanosec_time_to_string ( const std::uint64_t  ns_time)
inline

Definition at line 117 of file timestr.hpp.

◆ nanoseconds_since_epoch()

nanotime_t openvpn::nanoseconds_since_epoch ( )
inline

Definition at line 30 of file epoch.hpp.

◆ openssl_clear_error_stack()

void openvpn::openssl_clear_error_stack ( )
inline

Definition at line 247 of file error.hpp.

Here is the caller graph for this function:

◆ openssl_error() [1/2]

std::string openvpn::openssl_error ( )
inline

Definition at line 235 of file error.hpp.

◆ openssl_error() [2/2]

std::string openvpn::openssl_error ( const int  ssl_error)
inline

Definition at line 241 of file error.hpp.

◆ openssl_reseed_rng()

void openvpn::openssl_reseed_rng ( )
inline

Definition at line 21 of file reseed.hpp.

◆ openssl_setup_engine()

void openvpn::openssl_setup_engine ( const std::string &  engine)
inline

Definition at line 34 of file engine.hpp.

Here is the caller graph for this function:

◆ OPENVPN_EXCEPTION() [1/11]

openvpn::OPENVPN_EXCEPTION ( buf_read_error  )

◆ OPENVPN_EXCEPTION() [2/11]

openvpn::OPENVPN_EXCEPTION ( crypto_dc_select  )

◆ OPENVPN_EXCEPTION() [3/11]

openvpn::OPENVPN_EXCEPTION ( daemon_err  )

◆ OPENVPN_EXCEPTION() [4/11]

openvpn::OPENVPN_EXCEPTION ( enum_dir_error  )

◆ OPENVPN_EXCEPTION() [5/11]

openvpn::OPENVPN_EXCEPTION ( epoch_key_exception  )

◆ OPENVPN_EXCEPTION() [6/11]

openvpn::OPENVPN_EXCEPTION ( file_unix_error  )

◆ OPENVPN_EXCEPTION() [7/11]

openvpn::OPENVPN_EXCEPTION ( macdns_watchdog_error  )

◆ OPENVPN_EXCEPTION() [8/11]

openvpn::OPENVPN_EXCEPTION ( number_parse_exception  )

◆ OPENVPN_EXCEPTION() [9/11]

openvpn::OPENVPN_EXCEPTION ( openssl_engine_error  )

◆ OPENVPN_EXCEPTION() [10/11]

openvpn::OPENVPN_EXCEPTION ( parse_acc_message  )

◆ OPENVPN_EXCEPTION() [11/11]

openvpn::OPENVPN_EXCEPTION ( signaling_exception  )

◆ OPENVPN_EXCEPTION_WITH_CODE()

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_OSTREAM() [1/2]

openvpn::OPENVPN_OSTREAM ( SessionID128  ,
to_string   
)

◆ OPENVPN_OSTREAM() [2/2]

openvpn::OPENVPN_OSTREAM ( SessionID64  ,
to_string   
)

◆ OPENVPN_SIMPLE_EXCEPTION() [1/2]

openvpn::OPENVPN_SIMPLE_EXCEPTION ( get_time_error  )

◆ OPENVPN_SIMPLE_EXCEPTION() [2/2]

openvpn::OPENVPN_SIMPLE_EXCEPTION ( parse_hex_error  )

Declaration of a hexadecimal parsing error exception class

◆ OPENVPN_UNTAGGED_EXCEPTION()

openvpn::OPENVPN_UNTAGGED_EXCEPTION ( file_exception  )

◆ OPENVPN_UNTAGGED_EXCEPTION_INHERIT() [1/4]

openvpn::OPENVPN_UNTAGGED_EXCEPTION_INHERIT ( file_exception  ,
file_is_binary   
)

◆ OPENVPN_UNTAGGED_EXCEPTION_INHERIT() [2/4]

openvpn::OPENVPN_UNTAGGED_EXCEPTION_INHERIT ( file_exception  ,
file_not_utf8   
)

◆ OPENVPN_UNTAGGED_EXCEPTION_INHERIT() [3/4]

openvpn::OPENVPN_UNTAGGED_EXCEPTION_INHERIT ( file_exception  ,
file_too_large   
)

◆ OPENVPN_UNTAGGED_EXCEPTION_INHERIT() [4/4]

openvpn::OPENVPN_UNTAGGED_EXCEPTION_INHERIT ( file_exception  ,
open_file_error   
)

◆ operator<<()

template<typename Elem , typename Traits >
std::basic_ostream< Elem, Traits > & openvpn::operator<< ( std::basic_ostream< Elem, Traits > &  os,
const SafeString ss 
)

Definition at line 1 of file safestr.hpp.

◆ ovpn_expand_label()

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 must 32 bytes in length
  • label prefix is "ovpn " instead of "tls13 "
  • HASH is always SHA256
Parameters
secretInput secret
secret_lenlength of the input secret
labelLabel for the exported key material
label_lenlength of the label
contextoptional context
context_lenlength of the context
outoutput keying material
out_lenlength 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.

Here is the caller graph for this function:

◆ ovpn_hkdf_expand()

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

  • salt is always assumed to be zero length (ie not supported)
  • IKM (secret) is assumed to be always 32 bytes
  • HASH is always SHA256
Parameters
secretthe input keying material (HMAC key)
infocontext and application specific information
info_lenlength of the application specific information
outoutput keying material
out_lenlength of output keying material

Definition at line 21 of file data_epoch.cpp.

Here is the caller graph for this function:

◆ parse_hex()

template<typename V >
void openvpn::parse_hex ( V &  dest,
const std::string &  str 
)
inline

Parses a std::string containing a hexadecimal value into a std::vector<T>.

Parameters
deststd::vector<T> destination buffer to use.
strstd::string& containing the hexadecimal string to parse.
Exceptions
parse_hex_errorwill throw this exception if the input is invalid/not parsable as a hexadecimal number.

Definition at line 352 of file hexstr.hpp.

Here is the caller graph for this function:

◆ parse_hex_char()

int openvpn::parse_hex_char ( const int  c)
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.

Parameters
cCharacter to be be parsed.
Returns
Returns an integer value of the hexadecimal input. If the input character is invalid, outside of {0..9,A-F,a-f}, it will return -1.

Definition at line 65 of file hexstr.hpp.

Here is the caller graph for this function:

◆ parse_hex_number() [1/3]

template<typename T >
bool openvpn::parse_hex_number ( const char *  str,
T &  retval 
)
inline

Parses a char buffer (C string) containing a hexadecimal string into a templated (T) variable. The input buffer MUST be NULL terminated.

Warning
There are NO overflow checks.
Parameters
strChar pointer (char *) to the buffer to be parsed.
retvalReturn buffer where the parsed value is stored.
Returns
Returns true on successful parsing, otherwise false.

Definition at line 383 of file hexstr.hpp.

Here is the caller graph for this function:

◆ parse_hex_number() [2/3]

template<typename T >
T openvpn::parse_hex_number ( const std::string &  str)
inline

Parses a std::string containing a hexadecimal string into a templated (T) variable.

Remarks
Currently doesn't detect overflow
Parameters
strstd::string containing the hexadecimal string to be parsed.
Returns
Returns a template T variable containing the parsed value on success. Will throw the parse_hex_error exception on parsing errors.

Definition at line 440 of file hexstr.hpp.

◆ parse_hex_number() [3/3]

template<typename T >
bool openvpn::parse_hex_number ( const std::string &  str,
T &  retval 
)
inline

Variant of parse_hex_number(const char *, ...) which takes a std::string as the input.

Parameters
strstd::string containing the hexadecimal string to be parsed.
retvalReturn buffer where the parsed value is stored.
Returns
Returns true on successful parsing, otherwise false.

Definition at line 419 of file hexstr.hpp.

◆ parse_number() [1/2]

template<typename T >
bool openvpn::parse_number ( const char *  str,
T &  retval,
const bool  nondigit_term = false 
)
inline

Definition at line 34 of file number.hpp.

Here is the caller graph for this function:

◆ parse_number() [2/2]

template<typename T >
bool openvpn::parse_number ( const std::string &  str,
T &  retval 
)
inline

Definition at line 68 of file number.hpp.

◆ parse_number_throw() [1/3]

template<typename T >
T openvpn::parse_number_throw ( const char *  str,
const char *  error 
)
inline

Definition at line 94 of file number.hpp.

◆ parse_number_throw() [2/3]

template<typename T >
T openvpn::parse_number_throw ( const std::string &  str,
const char *  error 
)
inline

Definition at line 84 of file number.hpp.

◆ parse_number_throw() [3/3]

template<typename T >
T openvpn::parse_number_throw ( const std::string &  str,
const std::string &  error 
)
inline

Definition at line 74 of file number.hpp.

◆ parse_number_validate()

template<typename T >
bool openvpn::parse_number_validate ( const std::string &  numstr,
const size_t  max_len,
const T  minimum,
const T  maximum,
T *  value_return = nullptr 
)
inline

Definition at line 104 of file number.hpp.

◆ parse_tun_mtu()

unsigned int openvpn::parse_tun_mtu ( const OptionList opt,
unsigned int  default_value 
)
inline

Definition at line 23 of file tunmtu.hpp.

Here is the caller graph for this function:

◆ parse_tun_mtu_max()

unsigned int openvpn::parse_tun_mtu_max ( const OptionList opt,
unsigned int  default_value 
)
inline

Definition at line 28 of file tunmtu.hpp.

Here is the caller graph for this function:

◆ platform_name()

const char * openvpn::platform_name ( )
inline

Definition at line 21 of file platform_name.hpp.

Here is the caller graph for this function:

◆ platform_string() [1/2]

std::string openvpn::platform_string ( )
inline

Definition at line 61 of file platform_string.hpp.

Here is the caller graph for this function:

◆ platform_string() [2/2]

std::string openvpn::platform_string ( const std::string &  title,
const std::string &  app_version 
)
inline

Definition at line 22 of file platform_string.hpp.

◆ print()

template<typename... Args>
std::string openvpn::print ( Args...  args)
inline

Definition at line 58 of file format.hpp.

◆ printd()

template<typename... Args>
std::string openvpn::printd ( char  delim,
Args...  args 
)
inline

Definition at line 50 of file format.hpp.

Here is the caller graph for this function:

◆ printfmt()

template<typename... Args>
std::string openvpn::printfmt ( const std::string &  fmt,
Args...  args 
)
inline

Definition at line 314 of file format.hpp.

Here is the caller graph for this function:

◆ prints()

template<typename... Args>
std::string openvpn::prints ( Args...  args)
inline

Definition at line 64 of file format.hpp.

Here is the caller graph for this function:

◆ quote_ip()

std::string openvpn::quote_ip ( const std::string &  ip_addr)

Definition at line 19 of file quoteip.hpp.

◆ rand32_distribute()

std::uint32_t openvpn::rand32_distribute ( const std::uint32_t  seed,
const std::uint32_t  end 
)
inline

Definition at line 21 of file randistrib.hpp.

Here is the caller graph for this function:

◆ read_binary()

BufferPtr openvpn::read_binary ( const std::string &  filename,
const std::uint64_t  max_size = 0,
const unsigned int  buffer_flags = 0 
)
inline

Definition at line 56 of file file.hpp.

Here is the caller graph for this function:

◆ read_binary_linear()

BufferPtr openvpn::read_binary_linear ( const std::string &  filename,
const std::uint64_t  max_size = 0,
const size_t  block_size = 1024 
)
inline

Definition at line 95 of file file.hpp.

Here is the caller graph for this function:

◆ read_binary_unix()

BufferPtr openvpn::read_binary_unix ( const std::string &  fn,
const std::uint64_t  max_size = 0,
const unsigned int  buffer_flags = 0,
std::uint64_t *  mtime_ns = nullptr 
)
inline

Definition at line 117 of file fileunix.hpp.

Here is the caller graph for this function:

◆ read_binary_unix_fast()

template<typename STRING >
int openvpn::read_binary_unix_fast ( const STRING &  fn,
Buffer out,
std::uint64_t *  mtime_ns = nullptr 
)
inline

Definition at line 172 of file fileunix.hpp.

Here is the caller graph for this function:

◆ read_stdin()

std::string openvpn::read_stdin ( )
inline

Definition at line 160 of file file.hpp.

Here is the caller graph for this function:

◆ read_text()

std::string openvpn::read_text ( const std::string &  filename,
const std::uint64_t  max_size = 0 
)
inline

Definition at line 127 of file file.hpp.

Here is the caller graph for this function:

◆ read_text_simple()

std::string openvpn::read_text_simple ( const std::string &  filename)
inline

Definition at line 44 of file file.hpp.

◆ read_text_unix()

std::string openvpn::read_text_unix ( const std::string &  filename,
const std::uint64_t  max_size = 0,
const unsigned int  buffer_flags = 0,
std::uint64_t *  mtime_ns = nullptr 
)
inline

Definition at line 195 of file fileunix.hpp.

Here is the caller graph for this function:

◆ read_text_utf8()

std::string openvpn::read_text_utf8 ( const std::string &  filename,
const std::uint64_t  max_size = 0 
)
inline

Definition at line 136 of file file.hpp.

Here is the caller graph for this function:

◆ render_hex() [1/2]

std::string openvpn::render_hex ( const unsigned char *  data,
size_t  size,
const bool  caps = false 
)
inline

Render a byte buffer (unsigned char *) as a hexadecimal string.

Parameters
dataUnsigned char pointer to buffer to render.
sizesize_t of the number of bytes to parse from the buffer.
capsBoolean (default false) which sets the outout to be either lower case (false) or upper case (true).
Returns
Returns a std::string of the complete hexadecimal representation

Definition at line 135 of file hexstr.hpp.

Here is the caller graph for this function:

◆ render_hex() [2/2]

std::string openvpn::render_hex ( const void *  data,
const size_t  size,
const bool  caps = false 
)
inline

Render a byte buffer (void *) as a hexadecimal string.

Parameters
dataVoid pointer to buffer to render.
sizesize_t of the number of bytes to parse from the buffer.
capsBoolean (default false) which sets the outout to be either lower case (false) or upper case (true).
Returns
Returns a std::string of the complete hexadecimal representation.

Definition at line 161 of file hexstr.hpp.

◆ render_hex_char()

char openvpn::render_hex_char ( const int  c,
const bool  caps = false 
)
inline

Renders an integer value within the hexadecimal range (0-15) to a hexadecimal character.

Parameters
cInteger to render as a hexadecimal character.
capsBoolean (default false) which sets the outout to be either lower case (false) or upper case (true).
Returns
Returns a char with the hexadecimal representation of the input value. If the value is out-of-range (outside of 0-15), it will be replaced with a questionmark (?).

Definition at line 42 of file hexstr.hpp.

Here is the caller graph for this function:

◆ render_hex_generic()

template<typename V >
std::string openvpn::render_hex_generic ( const V &  data,
const bool  caps = false 
)
inline

Render a std::vector<T> container as a hexadecimal string. T must be a data type compatible with RenderHexByte(const unsigned char,...)

Parameters
datastd::vector<T> containing the data to render
capsBoolean (default false) which sets the outout to be either lower case (false) or upper case (true).
Returns
Returns a std::string of the complete hexadecimal representation.

Definition at line 230 of file hexstr.hpp.

Here is the caller graph for this function:

◆ render_hex_number() [1/2]

template<typename T >
std::string openvpn::render_hex_number ( value,
const bool  caps = false 
)

Renders a templated T variable containing a numeric value into a std::string containing a hexadecimal representation.

Parameters
valueNumeric (T) value to represent as hexadecimal.
capsBoolean (default false) which sets the outout to be either lower case (false) or upper case (true).
Returns
Retuns a std::string containing the hexadecimal representation on succes. Will throw a parse_hex_error exception on parsing errors.

Definition at line 461 of file hexstr.hpp.

Here is the caller graph for this function:

◆ render_hex_number() [2/2]

std::string openvpn::render_hex_number ( unsigned char  uc,
const bool  caps = false 
)
inline

Renders a single byte as a hexadecimal string

Parameters
ucUnsigned char (byte) to be represented as hexadecimal.
capsBoolean (default false) which sets the outout to be either lower case (false) or upper case (true).
Returns
Returns a std::string with the hexadecimal representation of the input value. The result will always contain only two characters.

Definition at line 484 of file hexstr.hpp.

◆ render_hex_sep() [1/2]

std::string openvpn::render_hex_sep ( const unsigned char *  data,
size_t  size,
const char  sep,
const bool  caps = false 
)
inline

Variant of render_hex(const unsiged char *,...) which adds a separator between each byte

Parameters
dataUnsigned char pointer to buffer to render.
sizesize_t of the number of bytes to parse from the buffer.
sepA single character to use as the separator.
capsBoolean (default false) which sets the outout to be either lower case (false) or upper case (true).
Returns
Returns a std::string of the complete hexadecimal representation with each byte separated by a given character.

Definition at line 180 of file hexstr.hpp.

Here is the caller graph for this function:

◆ render_hex_sep() [2/2]

std::string openvpn::render_hex_sep ( const void *  data,
const size_t  size,
const char  sep,
const bool  caps = false 
)
inline

Variant of render_hex(const void *,...) which adds a separator between each byte

Parameters
dataVoid pointer to buffer to render.
sizesize_t of the number of bytes to parse from the buffer.
sepA single character to use as the separator.
capsBoolean (default false) which sets the outout to be either lower case (false) or upper case (true).
Returns
Returns a std::string of the complete hexadecimal representation with each byte separated by a given character.

Definition at line 212 of file hexstr.hpp.

◆ render_options_sanitized()

std::string openvpn::render_options_sanitized ( const OptionList opt,
const unsigned int  render_flags 
)
inline

Definition at line 25 of file sanitize.hpp.

Here is the caller graph for this function:

◆ sanitize_control_message()

std::string openvpn::sanitize_control_message ( const std::string &  src_str)
inline

Definition at line 43 of file sanitize.hpp.

◆ set_duration_parm()

void openvpn::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 
)
inline

Definition at line 20 of file durhelper.hpp.

Here is the caller graph for this function:

◆ signal_name()

std::string openvpn::signal_name ( const int  signum)
inline

Definition at line 19 of file signal_name.hpp.

Here is the caller graph for this function:

◆ skew_duration()

Time::Duration openvpn::skew_duration ( const Time::Duration &  dur,
const Time::Duration &  min,
const unsigned int  flux_order,
RandomAPI rng 
)
inline

Definition at line 80 of file durhelper.hpp.

◆ sleep_milliseconds()

bool openvpn::sleep_milliseconds ( const unsigned int  milliseconds)
inline

Definition at line 26 of file sleep.hpp.

Here is the caller graph for this function:

◆ stat_mod_time_nanoseconds()

std::uint64_t openvpn::stat_mod_time_nanoseconds ( const struct stat &  s)
inline

Definition at line 70 of file stat.hpp.

Here is the caller graph for this function:

◆ strerror_str()

std::string openvpn::strerror_str ( const int  errnum)
inline

Definition at line 21 of file strerror.hpp.

Here is the caller graph for this function:

◆ system_cmd() [1/4]

int openvpn::system_cmd ( const Argv argv)
inline

Definition at line 109 of file process.hpp.

◆ system_cmd() [2/4]

int openvpn::system_cmd ( const std::string &  cmd,
const Argv argv 
)
inline

Definition at line 103 of file process.hpp.

◆ system_cmd() [3/4]

int openvpn::system_cmd ( const std::string &  cmd,
const Argv argv,
const Environ env,
RedirectPipe::InOut inout,
unsigned int  redirect_pipe_flags,
const sigset_t *  sigmask 
)
inline

Definition at line 120 of file process.hpp.

◆ system_cmd() [4/4]

int openvpn::system_cmd ( const std::string &  cmd,
const Argv argv,
RedirectBase redir,
const Environ env,
const sigset_t *  sigmask 
)
inline

Definition at line 90 of file process.hpp.

Here is the caller graph for this function:

◆ system_cmd_async()

pid_t openvpn::system_cmd_async ( const std::string &  cmd,
const Argv argv,
const Environ env,
RedirectBase redir,
const sigset_t *  sigmask 
)
inline

Definition at line 35 of file process.hpp.

Here is the caller graph for this function:

◆ system_cmd_post()

int openvpn::system_cmd_post ( const pid_t  pid)
inline

Definition at line 78 of file process.hpp.

Here is the caller graph for this function:

◆ tcp_adjust_checksum()

void openvpn::tcp_adjust_checksum ( int  acc,
std::uint16_t &  cksum 
)
inline

Definition at line 64 of file tcp.hpp.

Here is the caller graph for this function:

◆ throw_ref()

void openvpn::throw_ref ( const std::exception &  e)
inline

Definition at line 192 of file exception.hpp.

◆ tls_get_cipher_name_pair()

const tls_cipher_name_pair * openvpn::tls_get_cipher_name_pair ( const std::string &  ciphername)
inline

Definition at line 152 of file iana_ciphers.hpp.

Here is the caller graph for this function:

◆ tmp_filename()

std::string openvpn::tmp_filename ( const std::string &  fn,
const std::string &  tmpdir,
StrongRandomAPI rng 
)
inline

Definition at line 22 of file tmpfilename.hpp.

Here is the caller graph for this function:

◆ to_string() [1/2]

template<typename T , typename std::enable_if<!std::is_arithmetic< T >::value, int >::type = 0>
std::string openvpn::to_string ( const T &  value)
inline

Definition at line 46 of file to_string.hpp.

◆ to_string() [2/2]

template<typename T , typename std::enable_if< std::is_arithmetic< T >::value, int >::type = 0>
std::string openvpn::to_string ( value)
inline

Definition at line 33 of file to_string.hpp.

Here is the caller graph for this function:

◆ udp_checksum()

std::uint16_t openvpn::udp_checksum ( const std::uint8_t *  buf,
const unsigned int  len_udp,
const std::uint8_t *  src_addr,
const std::uint8_t *  dest_addr 
)
inline

Definition at line 34 of file udp.hpp.

Here is the caller graph for this function:

◆ unreachable()

void openvpn::unreachable ( )
inline

Definition at line 19 of file unreachable.hpp.

Here is the caller graph for this function:

◆ update_file_mod_time_nanoseconds() [1/2]

int openvpn::update_file_mod_time_nanoseconds ( const int  fd,
const std::uint64_t  nanoseconds_since_epooch 
)
inline

Definition at line 59 of file modstat.hpp.

◆ update_file_mod_time_nanoseconds() [2/2]

int openvpn::update_file_mod_time_nanoseconds ( const std::string &  filename,
const std::uint64_t  nanoseconds_since_epooch 
)
inline

Definition at line 53 of file modstat.hpp.

Here is the caller graph for this function:

◆ write_binary()

void openvpn::write_binary ( const std::string &  filename,
const Buffer buf 
)
inline

Definition at line 173 of file file.hpp.

Here is the caller graph for this function:

◆ write_binary_atomic() [1/2]

void openvpn::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 
)
inline

Definition at line 57 of file fileatomic.hpp.

◆ write_binary_atomic() [2/2]

void openvpn::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 
)
inline

Definition at line 35 of file fileatomic.hpp.

Here is the caller graph for this function:

◆ write_binary_list()

template<typename BUFLIST >
void openvpn::write_binary_list ( const std::string &  filename,
const BUFLIST &  buflist 
)
inline

Definition at line 185 of file file.hpp.

◆ write_binary_unix() [1/3]

void openvpn::write_binary_unix ( const std::string &  fn,
const mode_t  mode,
const std::uint64_t  mtime_ns,
const Buffer buf 
)
inline

Definition at line 89 of file fileunix.hpp.

◆ write_binary_unix() [2/3]

void openvpn::write_binary_unix ( const std::string &  fn,
const mode_t  mode,
const std::uint64_t  mtime_ns,
const ConstBuffer buf 
)
inline

Definition at line 97 of file fileunix.hpp.

◆ write_binary_unix() [3/3]

void openvpn::write_binary_unix ( const std::string &  fn,
const mode_t  mode,
const std::uint64_t  mtime_ns,
const void *  buf,
const ssize_t  size 
)
inline

Definition at line 44 of file fileunix.hpp.

Here is the caller graph for this function:

◆ write_pid()

void openvpn::write_pid ( const std::string &  fn)
inline

Definition at line 124 of file daemon.hpp.

Here is the caller graph for this function:

◆ write_private() [1/3]

void openvpn::write_private ( const std::string &  path,
const Buffer buf 
)
inline

Definition at line 77 of file writeprivate.hpp.

◆ write_private() [2/3]

void openvpn::write_private ( const std::string &  path,
const std::string &  str 
)
inline

Definition at line 82 of file writeprivate.hpp.

◆ write_private() [3/3]

void openvpn::write_private ( const std::string &  path,
const void *  buf,
ssize_t  count 
)
inline

Definition at line 47 of file writeprivate.hpp.

Here is the caller graph for this function:

◆ write_retry()

ssize_t openvpn::write_retry ( int  fd,
const void *  buf,
size_t  count 
)
inline

Definition at line 20 of file write.hpp.

Here is the caller graph for this function:

◆ write_string()

void openvpn::write_string ( const std::string &  filename,
const std::string &  str 
)
inline

Definition at line 199 of file file.hpp.

Here is the caller graph for this function:

◆ write_text_unix()

void openvpn::write_text_unix ( const std::string &  fn,
const mode_t  mode,
const std::uint64_t  mtime_ns,
const std::string &  content 
)
inline

Definition at line 105 of file fileunix.hpp.

Here is the caller graph for this function:

Variable Documentation

◆ base64

const Base64* openvpn::base64
inline

Definition at line 299 of file base64.hpp.

◆ base64_urlsafe

const Base64* openvpn::base64_urlsafe
inline

Definition at line 300 of file base64.hpp.

◆ tls_cipher_name_translation_table

const tls_cipher_name_pair openvpn::tls_cipher_name_translation_table[]
static

SSL/TLS Cipher suite name translation table

Definition at line 25 of file iana_ciphers.hpp.

◆ tls_crypt_v2_client_key_name

constexpr const char* openvpn::tls_crypt_v2_client_key_name = "OpenVPN tls-crypt-v2 client key"
staticconstexpr

Definition at line 37 of file tls_crypt_v2.hpp.

◆ tls_crypt_v2_server_key_name

constexpr const char* openvpn::tls_crypt_v2_server_key_name = "OpenVPN tls-crypt-v2 server key"
staticconstexpr

Definition at line 36 of file tls_crypt_v2.hpp.

◆ WAIT_BARRIER_TIMEOUT

constexpr unsigned int openvpn::WAIT_BARRIER_TIMEOUT = 30
staticconstexpr

Definition at line 23 of file waitbarrier.hpp.

◆ WRITE_BINARY_UNIX_EXISTING

constexpr mode_t openvpn::WRITE_BINARY_UNIX_EXISTING = 010000
staticconstexpr

Definition at line 43 of file fileunix.hpp.