OpenVPN 3 Core Library
Loading...
Searching...
No Matches
ovpncli.hpp
Go to the documentation of this file.
1// OpenVPN -- An application to securely tunnel IP networks
2// over a single port, with support for SSL/TLS-based
3// session authentication and key exchange,
4// packet encryption, packet authentication, and
5// packet compression.
6//
7// Copyright (C) 2012- OpenVPN Inc.
8//
9// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10//
11
12// API for OpenVPN Client, may be used standalone or wrapped by swig.
13// Use ovpncli.i to wrap the API for swig.
14// The crux of the API is defined in OpenVPNClient (below)
15// and TunBuilderBase.
16
17#include <string>
18#include <unordered_set>
19#include <utility>
20#include <vector>
21#include <optional>
22
28
29namespace openvpn {
30class OptionList;
31class ProfileMerge;
32class Stop;
33
34namespace InitProcess {
35class Init;
36};
37
38namespace ClientAPI {
39// Represents an OpenVPN server and its friendly name
40// (client reads)
42{
43 std::string server;
44 std::string friendlyName;
45};
46
56{
57 // true if error
58 bool error = false;
59
60 // if error, message given here
61 std::string message;
62
63 // this username must be used with profile
64 std::string userlockedUsername;
65
66 // profile name of config
67 std::string profileName;
68
69 // "friendly" name of config
70 std::string friendlyName;
71
72 // true: no creds required, false: username/password required
73 bool autologin = false;
74
75 // if true, this is an External PKI profile (no cert or key directives)
76 bool externalPki = false;
77
78 // VPN server CA in PEM format as given in the configuration. This is the CA, the
79 // VPN server certificate is checked against. This is not a parsed version so it
80 // can have extra lines around the actual certificates that an X509 parser would
81 // ignore.
82 // Note that this can can be empty if the profile uses --peer-fingerprint instead of traditional PKI check.
83 std::string vpnCa;
84
85 // static challenge, may be empty, ignored if autologin
86 std::string staticChallenge;
87
88 // true if static challenge response should be echoed to UI, ignored if autologin
89 bool staticChallengeEcho = false;
90
91 // true if this profile requires a private key password
93
94 // true if user is allowed to save authentication password in UI
95 bool allowPasswordSave = false;
96
97 // information about the first remote item in config
98 std::string remoteHost; // will be overridden by Config::serverOverride if defined
99 std::string remotePort;
100 std::string remoteProto;
101
102 // optional list of user-selectable VPN servers
103 std::vector<ServerEntry> serverList;
104
105 // optional, values are "tap-windows6" and "wintun"
106 std::string windowsDriver;
107
110};
111
112// used to pass credentials to VPN core
113// (client writes)
115{
116 std::string username;
117 std::string password;
118
119 std::string http_proxy_user;
120 std::string http_proxy_pass;
121
122 // response to challenge
123 std::string response;
124
125 // Dynamic challenge/response cookie
127};
128
129// used to get session token from VPN core
130// (client reads)
132{
133 std::string username;
134 std::string session_id; // an OpenVPN Session ID, used as a proxy for password
135};
136
137// used to query challenge/response from user
138// (client reads)
140{
141 std::string challenge;
142 bool echo = false;
143 bool responseRequired = false;
144
145 std::string stateID;
146};
147
148// a basic key/value pair, used in Config below when OpenVPN profile is
149// passed as a dictionary
151{
152 KeyValue() = default;
153
154 KeyValue(std::string key_arg, std::string value_arg)
155 : key(std::move(key_arg)),
156 value(std::move(value_arg))
157 {
158 }
159
160 std::string key;
161 std::string value;
162};
163
164/* Settings in this struct do not need to be parsed, so we can share them
165 * between the parsed and unparsed client settings */
167{
168 // Set to identity OpenVPN GUI version.
169 // Format should be "<gui_identifier><space><version>"
170 // Passed to server as IV_GUI_VER.
171 std::string guiVersion;
172
173 // Set to a comma separated list of supported SSO mechanisms that may
174 // be signalled via INFO_PRE to the client.
175 // "openurl" deprecated version of webauth
176 // "webauth" to continue authentication by opening an url in a browser
177 // "crtext" gives a challenge response in text format that needs to
178 // responded via control channel. (
179 // Passed to the server as IV_SSO
180 std::string ssoMethods;
181
182 // Set to a comma separated list of supported custom app control channel
183 // protocols. The semantics of these protocols are determined by the
184 // app/server and not by the OpenVPN protocol.
186
187 // Override the string that is passed as IV_HWADDR to the server
188 std::string hwAddrOverride;
189
190 // Set the string that is passed to the server as IV_PLAT_VER
191 std::string platformVersion;
192
193 // Use a different server than that specified in "remote"
194 // option of profile
195 std::string serverOverride;
196
197 // Use a different port than that specified in "remote"
198 // option of profile
199 std::string portOverride;
200
201 // Connection timeout in seconds, or 0 to retry indefinitely
202 int connTimeout = 0;
203
204 // Keep tun interface active during pauses or reconnections
205 bool tunPersist = false;
206
207 // If true and a redirect-gateway profile doesn't also define
208 // DNS servers, use the standard Google DNS servers.
209 bool googleDnsFallback = false;
210
211 // If true --dhcp-option DOMAIN{-SEARCH} are parsed as split
212 // domains, ADAPTER_DOMAIN_SUFFIX is the only search domain
213#if defined(OPENVPN_PLATFORM_WIN) || defined(OPENVPN_PLATFORM_MAC) || defined(OPENVPN_PLATFORM_LINUX) || defined(OPENVPN_PLATFORM_IPHONE)
215#else
217#endif
218
219 // if true, do synchronous DNS lookup.
221
222 // Enable autologin sessions
223 bool autologinSessions = true;
224
225 // If true, consider AUTH_FAILED to be a non-fatal error,
226 // and retry the connection after a pause.
227 bool retryOnAuthFailed = false;
228
229 // If true, don't send client cert/key to peer.
230 bool disableClientCert = false;
231
232 // SSL library debug level
234
235 // private key password (optional)
237
238 // Default key direction parameter for tls-auth (0, 1, or
239 // -1 (bidirectional -- default)) if no key-direction parameter
240 // defined in profile. Generally should be -1 (bidirectional)
241 // for compatibility with 2.x branch
243
244 // Override the minimum TLS version:
245 // Will not lower the minimum if already a higher minimum has been
246 // specified by tls-version-min in the profile
247 // disabled -- don't specify a minimum, and disable any minimum
248 // specified in profile
249 // default or "" -- use profile minimum or system minimum
250 // tls_1_0 -- use TLS 1.0 minimum
251 // tls_1_1 -- use TLS 1.1 minimum
252 // tls_1_2 -- use TLS 1.2 minimum
253 // tls_1_3 -- use TLS 1.3 minimum
254
255
257
258 // Override or default the tls-cert-profile setting:
259 // default or "" -- use profile default
260 // legacy -- allow 1024-bit RSA certs signed with SHA1
261 // preferred -- require at least 2048-bit RSA certs signed
262 // with SHA256 or higher
263 // suiteb -- require NSA Suite-B
264 // legacy-default -- use legacy as the default if profile
265 // doesn't specify tls-cert-profile
266 // preferred-default -- use preferred as the default if profile
267 // doesn't specify tls-cert-profile
269
270 // Overrides the list of tls ciphers like the tls-cipher option
271 std::string tlsCipherList;
272
273 // Overrides the list of TLS 1.3 ciphersuites like the tls-ciphersuites
274 // option
276
277 // HTTP Proxy parameters (optional)
278 std::string proxyHost; // hostname or IP address of proxy
279 std::string proxyPort; // port number of proxy
280 std::string proxyUsername; // proxy credentials (optional)
281 std::string proxyPassword; // proxy credentials (optional)
282 bool proxyAllowCleartextAuth = false; // enables HTTP Basic auth
283
284 // Custom proxy implementation
285 bool altProxy = false;
286
287 // Enable automatic Data Channel Offload
288#if defined(ENABLE_OVPNDCO) || defined(ENABLE_OVPNDCOWIN)
289 bool dco = true;
290#else
291 bool dco = false;
292#endif
293
294 // pass through pushed "echo" directives via "ECHO" event
295 bool echo = false;
296
297 // pass through control channel INFO notifications via "INFO" event
298 bool info = false;
299
300 // Allow access to local LAN. This is for platforms like
301 // Android that disable local LAN access by default.
303
304#ifdef OPENVPN_PLATFORM_ANDROID
305 // Instead of setting include and exclude routes, calculate a set of
306 // include routes only to emulate the lack of excluding routes
307 // (Android earlier than Tiramisu (Android 13))
308 bool enableRouteEmulation = true;
309#endif
310
311 // Periodic convenience clock tick in milliseconds.
312 // Will call clock_tick() at a frequency defined by this parameter.
313 // Set to 0 to disable.
314 unsigned int clockTickMS = 0;
315
316 // Gremlin configuration (requires that the core is built with OPENVPN_GREMLIN)
317 std::string gremlinConfig;
318
319 // Use wintun instead of tap-windows6 on Windows
320 bool wintun = false;
321
322 // On Windows allow DNS resolvers on localhost, such as Umbrella Roaming Client
323 // This disables adding NRPT rule for "." zone and permits DNS requests to localhost
325
326 // Allow usage of legacy (cipher) algorithm that are no longer considered safe
327 // This includes BF-CBC, single DES and RC2 private key encryption.
328 // With OpenSSL 3.0 this also instructs OpenSSL to load the legacy provider.
330
331 // By default modern OpenVPN version (OpenVPN 2.6 and OpenVPN core 3.7) will only allow
332 // preferred algorithms (AES-GCM, Chacha20-Poly1305) that also work with the newer DCO
333 // implementations. If this is enabled, we fall back to allowing all algorithms (if these are
334 // supported by the crypto library)
336
337 // Generate an INFO_JSON/TUN_BUILDER_CAPTURE event
338 // with all tun builder properties pushed by server.
339 // Currently only implemented on Linux.
341};
342
343// OpenVPN config-file/profile. Includes a few settings that we do not just
344// copy but also parse
345// (client writes)
346struct Config : public ConfigCommon
347{
348 // OpenVPN profile as a string
349 std::string content;
350
351 // OpenVPN profile as series of key/value pairs (may be provided exclusively
352 // or in addition to content string above).
353 std::vector<KeyValue> contentList;
354
355 // Force a given transport protocol
356 // Should be tcp, udp, or adaptive.
357 std::string protoOverride;
358
359 // Force transport protocol IP version
360 // Should be 4 for IPv4 or 6 for IPv6.
362
363 // allowUnusedAddrFamilies preference
364 // no -- disable IPv6/IPv4, so tunnel will be IPv4 or IPv6 only if not dualstack
365 // yes -- Allow continuing using native IPv4/IPv6 connectivity for single IP family tunnel
366 // default (or empty string) -- leave decision to server/config
368
369 // Compression mode, one of:
370 // yes -- allow compression on both uplink and downlink
371 // asym -- allow compression on downlink only (i.e. server -> client)
372 // no (default if empty) -- support compression stubs only
373 std::string compressionMode;
374
375 // An ID used for get-certificate and RSA signing callbacks
376 // for External PKI profiles.
377 std::string externalPkiAlias;
378
379 // Pass custom key/value pairs to OpenVPN server.
380 std::vector<KeyValue> peerInfo;
381};
382
383// used to communicate VPN events such as connect, disconnect, etc.
384// (client reads)
385struct Event
386{
387 bool error = false; // true if error (fatal or nonfatal)
388 bool fatal = false; // true if fatal error (will disconnect)
389 std::string name; // event name
390 std::string info; // additional event info
391};
392
401{
402 std::string protocol;
403 std::string payload;
404};
405
406// used to communicate extra details about successful connection
407// (client reads)
409{
410 bool defined = false;
411 std::string user;
412 std::string serverHost;
413 std::string serverPort;
414 std::string serverProto;
415 std::string serverIp;
416 std::string vpnIp4;
417 std::string vpnIp6;
418 std::string vpnMtu;
419 std::string gw4;
420 std::string gw6;
421 std::string clientIp;
422 std::string tunName;
423};
424
425// returned by some methods as a status/error indication
426// (client reads)
427struct Status
428{
429 bool error = false; // true if error
430 std::string status; // an optional short error label that identifies the error
431 std::string message; // if error, message given here
432};
433
434// used to pass log lines
435// (client reads)
437{
438 LogInfo() = default;
439
440 LogInfo(std::string str)
441 : text(std::move(str))
442 {
443 }
444 std::string text; // log output (usually but not always one line)
445};
446
447// receives log messages
449{
450 virtual void log(const LogInfo &) = 0;
451 virtual ~LogReceiver() = default;
452};
453
454// used to pass stats for an interface
456{
457 long long bytesIn;
458 long long packetsIn;
459 long long errorsIn;
460 long long bytesOut;
461 long long packetsOut;
462 long long errorsOut;
463};
464
465// used to pass basic transport stats
467{
468 long long bytesIn;
469 long long bytesOut;
470 long long packetsIn;
471 long long packetsOut;
472
473 // number of binary milliseconds (1/1024th of a second) since
474 // last packet was received, or -1 if undefined
476};
477
478// return value of merge_config methods
480{
481 std::string status; // ProfileMerge::Status codes rendered as string
482 std::string errorText; // error string (augments status)
483 std::string basename; // profile basename
484 std::string profileContent; // unified profile
485 std::vector<std::string> refPathList; // list of all reference paths successfully read
486};
487
488// base class for External PKI queries
490{
491 bool error = false; // true if error occurred (client writes)
492 std::string errorText; // text describing error (client writes)
493 bool invalidAlias = false; // true if the error is caused by an invalid alias (client writes)
494 std::string alias; // the alias string, used to query cert/key (client reads)
495};
496
497// used to query for External PKI certificate
499{
500 // leaf cert
501 std::string cert; // (client writes)
502
503 // chain of intermediates and root (optional)
504 std::string supportingChain; // (client writes)
505};
506
507// Used to request an external certificate signature.
508// algorithm will determinate what signature is expected:
509// algorithm, hashalg and saltlen together determine what
510// should be used. hashalg and saltlen can be empty
511// - ECDSA
512// do a ECDSA signature.
513// - ECDSA hashalg=ALG
514// Use hashAlg for the ECDSA signature (e.g. SHA512withECDSA in Java)
515// - RSA_PKCS1_PADDING
516// data will be prefixed by an optional PKCS#1 digest prefix per RFC 3447.
517// - RSA_PKCS1_PSS_PADDING
518// Use PSS padding for the signature
519// - RSA_PKCS1_PSS_PADDING,saltlen=digest,hashalg=ALG
520// Use a PSS padding with hash algorithm ALG and a salt of length
521// of the digest (hash ALG).
523{
524 std::string data; // data rendered as base64 (client reads)
525 std::string sig; // RSA signature, rendered as base64 (client writes)
526 std::string algorithm;
527 std::string hashalg; // If non-empty use this algorith for hashing (e.g. SHA384)
528 std::string saltlen;
529};
530
531// used to override "remote" directives
533{
534 // components of "remote" directive (client writes),
535 std::string host; // either one of host
536 std::string ip; // or ip must be defined (or both)
537 std::string port;
538 std::string proto;
539 std::string error; // if non-empty, indicates an error
540};
541
542namespace Private {
543class ClientState;
544};
545
551{
552 /* To call parse_config */
553 friend class OpenVPNClient;
554
555 public:
557
559
561
562 // Read an OpenVPN profile that might contain external
563 // file references, returning a unified profile.
564 MergeConfig merge_config(const std::string &path, bool follow_references);
565
566 // Read an OpenVPN profile that might contain external
567 // file references, returning a unified profile.
568 MergeConfig merge_config_string(const std::string &config_content);
569
570 // Parse profile and determine needed credentials statically.
572
573 // Maximum size of profile that should be allowed
574 static long max_profile_size();
575
576 // Parse a dynamic challenge cookie, placing the result in dc.
577 // Return true on success or false if parse error.
578 static bool parse_dynamic_challenge(const std::string &cookie, DynamicChallenge &dc);
579
580 // Do a crypto library self test
581 std::string crypto_self_test();
582
583 // Returns platform description string
584 static std::string platform();
585
586 // Returns core copyright
587 static std::string copyright();
588
589 private:
591
592 static void parse_config(const Config &, EvalConfig &, OptionList &);
593
594 /* including initprocess.hpp here break since it pulls in logging
595 * (OPENVPN_LOG) which not setup when including this header, so break that
596 * cycle here with a pointer instead a normal member, std::unique_ptr
597 * and std::unique_ptr because they still need to have the initprocess.hpp
598 * included in the same compilation unit which breaks in the swig wrapped
599 * class, so we use a plain pointer and new/delete in constructor/destructor */
601};
602
603// Top-level OpenVPN client class.
604class OpenVPNClient : public TunBuilderBase, // expose tun builder virtual methods
605 public LogReceiver, // log message notification
606 public ExternalTun::Factory, // low-level tun override
607 public ExternalTransport::Factory, // low-level transport override
608 private ExternalPKIBase
609{
610 public:
612 virtual ~OpenVPNClient();
613
614 // Parse OpenVPN configuration file.
616
617 // Provide credentials and other options. Call before connect().
619
620 // Callback to "protect" a socket from being routed through the tunnel.
621 // Will be called from the thread executing connect().
622 // The remote and ipv6 are the remote host this socket will connect to
623 virtual bool socket_protect(openvpn_io::detail::socket_type socket, std::string remote, bool ipv6);
624
625 // Primary VPN client connect method, doesn't return until disconnect.
626 // Should be called by a worker thread. This method will make callbacks
627 // to event() and log() functions. Make sure to call eval_config()
628 // and possibly provide_creds() as well before this function.
629 Status connect();
630
631 // Return information about the most recent connection. Should be called
632 // after an event of type "CONNECTED".
634
635 // Writes current session token to tok and returns true.
636 // If session token is unavailable, false is returned and
637 // tok is unmodified.
638 bool session_token(SessionToken &tok);
639
640 // Stop the client. Only meaningful when connect() is running.
641 // May be called asynchronously from a different thread
642 // when connect() is running.
643 void stop();
644
645 // Pause the client -- useful to avoid continuous reconnection attempts
646 // when network is down. May be called from a different thread
647 // when connect() is running.
648 void pause(const std::string &reason);
649
650 // Resume the client after it has been paused. May be called from a
651 // different thread when connect() is running.
652 void resume();
653
654 // Do a disconnect/reconnect cycle n seconds from now. May be called
655 // from a different thread when connect() is running.
656 void reconnect(int seconds);
657
658 // When a connection is close to timeout, the core will call this
659 // method. If it returns false, the core will disconnect with a
660 // CONNECTION_TIMEOUT event. If true, the core will enter a PAUSE
661 // state.
662 virtual bool pause_on_connection_timeout() = 0;
663
664 // Get stats/error info. May be called from a different thread
665 // when connect() is running.
666
667 // number of stats
668 static int stats_n();
669
670 // return a stats name, index should be >= 0 and < stats_n()
671 static std::string stats_name(int index);
672
673 // return a stats value, index should be >= 0 and < stats_n()
674 long long stats_value(int index) const;
675
676 // return all stats in a bundle
677 std::vector<long long> stats_bundle() const;
678
679 // return tun stats only
681
682 // return transport stats only
684
685 // post control channel message
686 void post_cc_msg(const std::string &msg);
687
688 // send custom app control channel message
689 void send_app_control_channel_msg(const std::string &protocol, const std::string &msg);
690
701 void start_cert_check(const std::string &client_cert,
702 const std::string &clientkey,
703 const std::optional<const std::string> &ca = std::nullopt);
704
714 void start_cert_check_epki(const std::string &alias, const std::optional<const std::string> &ca);
715
716 // Callback for delivering events during connect() call.
717 // Will be called from the thread executing connect().
718 // Will also deliver custom message from the server like AUTH_PENDING AUTH
719 // events and custom control message events
720 virtual void event(const Event &) = 0;
721
722 // Call for delivering event from app custom control channel
723 virtual void acc_event(const AppCustomControlMessageEvent &) = 0;
724
725 // Callback for logging.
726 // Will be called from the thread executing connect().
727 virtual void log(const LogInfo &) override = 0;
728
729 // External PKI callbacks
730 // Will be called from the thread executing connect().
733
734 // Remote override callback (disabled by default).
735 virtual bool remote_override_enabled();
736 virtual void remote_override(RemoteOverride &);
737
738 // Periodic convenience clock tick, controlled by Config::clockTickMS
739 virtual void clock_tick();
740
741 // Hide protected methods/data from SWIG
742#ifdef SWIGJAVA
743 private:
744#else
745 protected:
746#endif
747
749
750 virtual void connect_attach();
751 virtual void connect_pre_run();
752 virtual void connect_run();
753 virtual void connect_session_stop();
754
755 virtual Stop *get_async_stop();
756
758
759 private:
760 void connect_setup(Status &, bool &);
761 void do_connect_async();
762 static Status status_from_exception(const std::exception &);
763 void parse_extras(const Config &, EvalConfig &);
766
767 friend class MyClientEvents;
768 void on_disconnect();
769
770 // from ExternalPKIBase
771 bool sign(const std::string &alias,
772 const std::string &data,
773 std::string &sig,
774 const std::string &algorithm,
775 const std::string &hashalg,
776 const std::string &saltlen) override;
777
778 // disable copy and assignment
779 OpenVPNClient(const OpenVPNClient &) = delete;
781};
782
783} // namespace ClientAPI
784} // namespace openvpn
OpenVPNClientHelper(OpenVPNClientHelper &)=delete
EvalConfig eval_config(const Config &config)
Definition ovpncli.cpp:759
MergeConfig merge_config(const std::string &path, bool follow_references)
Definition ovpncli.cpp:720
static void parse_config(const Config &, EvalConfig &, OptionList &)
Definition ovpncli.cpp:606
static bool parse_dynamic_challenge(const std::string &cookie, DynamicChallenge &dc)
Definition ovpncli.cpp:810
MergeConfig merge_config_string(const std::string &config_content)
Definition ovpncli.cpp:732
static MergeConfig build_merge_config(const ProfileMerge &)
Definition ovpncli.cpp:742
void send_app_control_channel_msg(const std::string &protocol, const std::string &msg)
Definition ovpncli.cpp:1320
virtual void external_pki_sign_request(ExternalPKISignRequest &)=0
virtual void log(const LogInfo &) override=0
TransportStats transport_stats() const
Definition ovpncli.cpp:1236
void post_cc_msg(const std::string &msg)
Definition ovpncli.cpp:1310
virtual void event(const Event &)=0
void start_cert_check_epki(const std::string &alias, const std::optional< const std::string > &ca)
Start up the cert check handshake using the given epki_alias string.
Definition ovpncli.cpp:1367
bool session_token(SessionToken &tok)
Definition ovpncli.cpp:1083
static Status status_from_exception(const std::exception &)
Definition ovpncli.cpp:1033
virtual void remote_override(RemoteOverride &)
Definition ovpncli.cpp:1153
InterfaceStats tun_stats() const
Definition ovpncli.cpp:1203
std::vector< long long > stats_bundle() const
Definition ovpncli.cpp:1182
void start_cert_check(const std::string &client_cert, const std::string &clientkey, const std::optional< const std::string > &ca=std::nullopt)
Start up the cert check handshake using the given certs and key.
Definition ovpncli.cpp:1350
void process_epki_cert_chain(const ExternalPKICertRequest &)
Definition ovpncli.cpp:827
void external_pki_error(const ExternalPKIRequestBase &, const Error::Type)
Definition ovpncli.cpp:1103
Status provide_creds(const ProvideCreds &)
Definition ovpncli.cpp:782
static std::string stats_name(int index)
Definition ovpncli.cpp:1162
virtual bool pause_on_connection_timeout()=0
void connect_setup(Status &, bool &)
Definition ovpncli.cpp:935
long long stats_value(int index) const
Definition ovpncli.cpp:1167
virtual void external_pki_cert_request(ExternalPKICertRequest &)=0
virtual bool socket_protect(openvpn_io::detail::socket_type socket, std::string remote, bool ipv6)
Definition ovpncli.cpp:805
OpenVPNClient & operator=(const OpenVPNClient &)=delete
Private::ClientState * state
Definition ovpncli.hpp:757
void pause(const std::string &reason)
Definition ovpncli.cpp:1280
EvalConfig eval_config(const Config &)
Definition ovpncli.cpp:768
bool sign(const std::string &alias, const std::string &data, std::string &sig, const std::string &algorithm, const std::string &hashalg, const std::string &saltlen) override
Definition ovpncli.cpp:1122
OpenVPNClient(const OpenVPNClient &)=delete
virtual void acc_event(const AppCustomControlMessageEvent &)=0
void parse_extras(const Config &, EvalConfig &)
Definition ovpncli.cpp:667
TunBuilder methods, loosely based on the Android VpnService.Builder abstraction.
Definition base.hpp:42
std::vector< KeyValue > peerInfo
Definition ovpncli.hpp:380
std::string allowUnusedAddrFamilies
Definition ovpncli.hpp:367
std::vector< KeyValue > contentList
Definition ovpncli.hpp:353
Struct containing configuration details parsed from an OpenVPN configuration file.
Definition ovpncli.hpp:56
std::vector< ServerEntry > serverList
Definition ovpncli.hpp:103
KeyValue(std::string key_arg, std::string value_arg)
Definition ovpncli.hpp:154
LogInfo(std::string str)
Definition ovpncli.hpp:440
virtual void log(const LogInfo &)=0
virtual ~LogReceiver()=default
std::vector< std::string > refPathList
Definition ovpncli.hpp:485
os<< "Session Name: "<< tbc-> session_name<< '\n';os<< "Layer: "<< tbc-> layer str()<< '\n'
remote_address ipv6
static const char config[]
#define msg(flags,...)