OpenVPN
options.h
Go to the documentation of this file.
1 /*
2  * OpenVPN -- An application to securely tunnel IP networks
3  * over a single UDP port, with support for SSL/TLS-based
4  * session authentication and key exchange,
5  * packet encryption, packet authentication, and
6  * packet compression.
7  *
8  * Copyright (C) 2002-2021 OpenVPN Inc <sales@openvpn.net>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2
12  * as published by the Free Software Foundation.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23 
24 /*
25  * 2004-01-28: Added Socks5 proxy support
26  * (Christof Meerwald, http://cmeerw.org)
27  */
28 
29 #ifndef OPTIONS_H
30 #define OPTIONS_H
31 
32 #include "basic.h"
33 #include "common.h"
34 #include "mtu.h"
35 #include "route.h"
36 #include "tun.h"
37 #include "socket.h"
38 #include "plugin.h"
39 #include "manage.h"
40 #include "proxy.h"
41 #include "comp.h"
42 #include "pushlist.h"
43 #include "clinat.h"
44 #include "crypto_backend.h"
45 
46 
47 /*
48  * Maximum number of parameters associated with an option,
49  * including the option name itself.
50  */
51 #define MAX_PARMS 16
52 
53 /*
54  * Max size of options line and parameter.
55  */
56 #define OPTION_PARM_SIZE 256
57 #define OPTION_LINE_SIZE 256
58 
59 extern const char title_string[];
60 
61 /* certain options are saved before --pull modifications are applied */
63 {
66 
69 
72 
73  const char *route_default_gateway;
75 
78 
79  const char* ciphername;
80  const char* authname;
81 
85 
87 #ifdef USE_COMP
88  struct compress_options comp;
89 #endif
90 };
91 
92 #if !defined(ENABLE_CRYPTO_OPENSSL) && !defined(ENABLE_CRYPTO_MBEDTLS)
93 #error "At least one of OpenSSL or mbed TLS needs to be defined."
94 #endif
95 
97 {
98  int proto;
100  const char *local_port;
102  const char *remote_port;
103  const char *local;
104  const char *remote;
113  const char *socks_proxy_server;
114  const char *socks_proxy_port;
115  const char *socks_proxy_authfile;
116 
117  int tun_mtu; /* MTU of tun device */
118  bool tun_mtu_defined; /* true if user overriding parm with command line option */
121  int link_mtu; /* MTU of device over which tunnel packets pass via TCP/UDP */
122  bool link_mtu_defined; /* true if user overriding parm with command line option */
123 
124  /* Advanced MTU negotiation and datagram fragmentation options */
125  int mtu_discover_type; /* used if OS supports setting Path MTU discovery options on socket */
126 
127  int fragment; /* internal fragmentation size */
128  int mssfix; /* Upper bound on TCP MSS */
129  bool mssfix_default; /* true if --mssfix was supplied without a parameter */
130 
131  int explicit_exit_notification; /* Explicitly tell peer when we are exiting via OCC_EXIT or [RESTART] message */
132 
133 #define CE_DISABLED (1<<0)
134 #define CE_MAN_QUERY_PROXY (1<<1)
135 #define CE_MAN_QUERY_REMOTE_UNDEF 0
136 #define CE_MAN_QUERY_REMOTE_QUERY 1
137 #define CE_MAN_QUERY_REMOTE_ACCEPT 2
138 #define CE_MAN_QUERY_REMOTE_MOD 3
139 #define CE_MAN_QUERY_REMOTE_SKIP 4
140 #define CE_MAN_QUERY_REMOTE_MASK (0x07)
141 #define CE_MAN_QUERY_REMOTE_SHIFT (2)
142  unsigned int flags;
143 
144  /* Shared secret used for TLS control channel authentication */
145  const char *tls_auth_file;
148 
149  /* Shared secret used for TLS control channel authenticated encryption */
150  const char *tls_crypt_file;
152 
153  /* Client-specific secret or server key used for TLS control channel
154  * authenticated encryption v2 */
155  const char *tls_crypt_v2_file;
157 };
158 
160 {
161  const char *remote;
162  const char *remote_port;
163  int proto;
165 };
166 
167 #define CONNECTION_LIST_SIZE 64
168 
170 {
171  int len;
172  int current;
174 };
175 
177 {
178  int len;
180 };
181 
183 {
187 };
188 
190 {
191 #define RH_HOST_LEN 80
192  char host[RH_HOST_LEN];
193 #define RH_PORT_LEN 20
194  char port[RH_PORT_LEN];
195 };
196 
202 };
203 
205 {
206  /* We support SHA256 and SHA1 fingerpint. In the case of using the
207  * deprecated SHA1, only the first 20 bytes of each list item are used */
210 };
211 
212 /* Command line options */
213 struct options
214 {
215  struct gc_arena gc;
216  bool gc_owned;
217 
218  /* first config file */
219  const char *config;
220 
221  /* major mode */
222 #define MODE_POINT_TO_POINT 0
223 #define MODE_SERVER 1
224  int mode;
225 
226  /* enable forward compatibility for post-2.1 features */
228  /* list of options that should be ignored even if unknown */
229  const char **ignore_unknown_option;
230 
231  /* persist parms */
234 
235  const char *key_pass_file;
241  bool genkey;
243  const char *genkey_filename;
244  const char *genkey_extra_data;
245 
246  /* Networking parms */
248  struct connection_entry ce;
250 
252  /* Do not advanced the connection or remote addr list*/
254  /* Counts the number of unsuccessful connection attempts */
255  unsigned int unsuccessful_attempts;
256 
257 #if ENABLE_MANAGEMENT
259 #endif
260 
262 
264  const char *ipchange;
265  const char *dev;
266  const char *dev_type;
267  const char *dev_node;
268  const char *lladdr;
269  int topology; /* one of the TOP_x values from proto.h */
270  const char *ifconfig_local;
272  const char *ifconfig_ipv6_local;
274  const char *ifconfig_ipv6_remote;
277  int shaper;
278 
280 
281  bool mtu_test;
282 
283 #ifdef ENABLE_MEMSTATS
284  char *memstats_fn;
285 #endif
286 
287  bool mlock;
288 
289  int keepalive_ping; /* a proxy for ping/ping-restart */
291 
292  int inactivity_timeout; /* --inactive */
294 
295  int ping_send_timeout; /* Send a TCP/UDP ping to remote every n seconds */
296  int ping_rec_timeout; /* Expect a TCP/UDP ping from remote at least once every n seconds */
297  bool ping_timer_remote; /* Run ping timer only if we have a remote address */
298 
299 #define PING_UNDEF 0
300 #define PING_EXIT 1
301 #define PING_RESTART 2
302  int ping_rec_timeout_action; /* What action to take on ping_rec_timeout (exit or restart)? */
303 
304  bool persist_tun; /* Don't close/reopen TUN/TAP dev on SIGUSR1 or PING_RESTART */
305  bool persist_local_ip; /* Don't re-resolve local address on SIGUSR1 or PING_RESTART */
306  bool persist_remote_ip; /* Don't re-resolve remote address on SIGUSR1 or PING_RESTART */
307  bool persist_key; /* Don't re-read key files on SIGUSR1 or PING_RESTART */
308 
309 #if PASSTOS_CAPABILITY
310  bool passtos;
311 #endif
312 
313  int resolve_retry_seconds; /* If hostname resolve fails, retry for n seconds */
315  const char *ip_remote_hint;
316 
318 
319  /* Misc parms */
320  const char *username;
321  const char *groupname;
322  const char *chroot_dir;
323  const char *cd_dir;
324 #ifdef ENABLE_SELINUX
325  char *selinux_context;
326 #endif
327  const char *writepid;
328  const char *up_script;
329  const char *down_script;
331  bool down_pre;
332  bool up_delay;
334  bool daemon;
335 
337 
338  bool log;
341  int nice;
343  int mute;
344 
345 #ifdef ENABLE_DEBUG
346  int gremlin;
347 #endif
348 
349  const char *status_file;
352 
353  /* optimize TUN/TAP/UDP writes */
354  bool fast_io;
355 
356 #ifdef USE_COMP
357  struct compress_options comp;
358 #endif
359 
360  /* buffer sizes */
361  int rcvbuf;
362  int sndbuf;
363 
364  /* mark value */
365  int mark;
366  char *bind_dev;
367 
368  /* socket flags */
369  unsigned int sockflags;
370 
371  /* route management */
372  const char *route_script;
373  const char *route_predown_script;
386  bool allow_pull_fqdn; /* as a client, allow server to push a FQDN for certain parameters */
388 
389  /* Enable options consistency check between peers */
390  bool occ;
391 
392 #ifdef ENABLE_MANAGEMENT
393  const char *management_addr;
394  const char *management_port;
395  const char *management_user_pass;
400 
403 
404  /* Mask of MF_ values of manage.h */
405  unsigned int management_flags;
407 #endif
408 
409 #ifdef ENABLE_PLUGIN
411 #endif
412 
413  /* the tmp dir is for now only used in the P2P server context */
414  const char *tmp_dir;
418  bool server_ipv6_defined; /* IPv6 */
419  struct in6_addr server_network_ipv6; /* IPv6 */
420  unsigned int server_netbits_ipv6; /* IPv6 */
421 
422 #define SF_NOPOOL (1<<0)
423 #define SF_TCP_NODELAY_HELPER (1<<1)
424 #define SF_NO_PUSH_ROUTE_GATEWAY (1<<2)
425  unsigned int server_flags;
426 
428 
434 
442 
443  bool ifconfig_ipv6_pool_defined; /* IPv6 */
444  struct in6_addr ifconfig_ipv6_pool_base; /* IPv6 */
446 
451  const char *learn_address_script;
452  const char *client_config_dir;
454  bool disable;
457  struct iroute *iroutes;
458  struct iroute_ipv6 *iroutes_ipv6; /* IPv6 */
466  bool push_ifconfig_ipv4_blocked; /* IPv4 */
467  bool push_ifconfig_ipv6_defined; /* IPv6 */
468  struct in6_addr push_ifconfig_ipv6_local; /* IPv6 */
470  struct in6_addr push_ifconfig_ipv6_remote; /* IPv6 */
471  bool push_ifconfig_ipv6_blocked; /* IPv6 */
474  int cf_max;
475  int cf_per;
480 
489 
490 #if PORT_SHARE
491  char *port_share_host;
492  char *port_share_port;
493  const char *port_share_journal_dir;
494 #endif
495 
496  bool client;
497  bool pull; /* client pull of config options from server */
500  const char *auth_user_pass_file;
502 
504 
505 #ifdef ENABLE_MANAGEMENT
506  struct static_challenge_info sc_info;
507 #endif
508  /* Cipher parms */
509  const char *shared_secret_file;
512  const char *ciphername;
516  const char *ncp_ciphers;
517  const char *authname;
518  const char *prng_hash;
520  const char *engine;
521  bool replay;
525  const char *packet_id_file;
527 #ifdef ENABLE_PREDICTION_RESISTANCE
528  bool use_prediction_resistance;
529 #endif
530 
531  /* TLS (control channel) parms */
534  const char *ca_file;
536  const char *ca_path;
537  const char *dh_file;
539  const char *cert_file;
541  const char *extra_certs_file;
543  const char *priv_key_file;
545  const char *pkcs12_file;
547  const char *cipher_list;
548  const char *cipher_list_tls13;
549  const char *tls_groups;
550  const char *tls_cert_profile;
551  const char *ecdh_curve;
552  const char *tls_verify;
554  const char *verify_x509_name;
555  const char *tls_export_cert;
556  const char *crl_file;
558 
559  int ns_cert_type; /* set to 0, NS_CERT_CHECK_SERVER, or NS_CERT_CHECK_CLIENT */
560  unsigned remote_cert_ku[MAX_PARMS];
561  const char *remote_cert_eku;
566  unsigned int ssl_flags; /* set to SSLF_x flags from ssl.h */
567 
568 #ifdef ENABLE_PKCS11
569  const char *pkcs11_providers[MAX_PARMS];
570  unsigned pkcs11_private_mode[MAX_PARMS];
571  bool pkcs11_protected_authentication[MAX_PARMS];
572  bool pkcs11_cert_private[MAX_PARMS];
573  int pkcs11_pin_cache_period;
574  const char *pkcs11_id;
575  bool pkcs11_id_management;
576 #endif
577 
578 #ifdef ENABLE_CRYPTOAPI
579  const char *cryptoapi_cert;
580 #endif
581  /* Per-packet timeout on control channel */
583 
584  /* Data channel key renegotiation parameters */
589 
590  /* Data channel key handshake must finalize
591  * within n seconds of handshake initiation. */
593 
594 #ifdef ENABLE_X509ALTUSERNAME
595  /* Field list used to be the username in X509 cert. */
596  char *x509_username_field[MAX_PARMS];
597 #endif
598 
599  /* Old key allowed to live n seconds after new key goes active */
601 
602  /* Shared secret used for TLS control channel authentication */
603  const char *tls_auth_file;
605 
606  /* Shared secret used for TLS control channel authenticated encryption */
607  const char *tls_crypt_file;
609 
610  /* Client-specific secret or server key used for TLS control channel
611  * authenticated encryption v2 */
612  const char *tls_crypt_v2_file;
614 
616 
618 
619  /* Allow only one session */
621 
623 
624  bool tls_exit;
625 
626  const struct x509_track *x509_track;
627 
628  /* special state parms */
630 
631 #ifdef _WIN32
632  HANDLE msg_channel;
633  const char *exit_event_name;
638  enum windows_driver_type windows_driver;
639 #endif
640 
642  uint32_t peer_id;
643 
644 #ifdef HAVE_EXPORT_KEYING_MATERIAL
645  /* Keying Material Exporters [RFC 5705] */
646  const char *keying_material_exporter_label;
647  int keying_material_exporter_length;
648 #endif
649 
651  enum vlan_acceptable_frames vlan_accept;
652  uint16_t vlan_pvid;
653 
655 
656  /* Useful when packets sent by openvpn itself are not subject
657  * to the routing tables that would move packets into the tunnel. */
659 
660  /* data channel crypto flags set by push/pull. Reuses the CO_* crypto_flags */
662 };
663 
664 #define streq(x, y) (!strcmp((x), (y)))
665 
666 /*
667  * Option classes.
668  */
669 #define OPT_P_GENERAL (1<<0)
670 #define OPT_P_UP (1<<1)
671 #define OPT_P_ROUTE (1<<2)
672 #define OPT_P_IPWIN32 (1<<3)
673 #define OPT_P_SCRIPT (1<<4)
674 #define OPT_P_SETENV (1<<5)
675 #define OPT_P_SHAPER (1<<6)
676 #define OPT_P_TIMER (1<<7)
677 #define OPT_P_PERSIST (1<<8)
678 #define OPT_P_PERSIST_IP (1<<9)
679 #define OPT_P_COMP (1<<10) /* TODO */
680 #define OPT_P_MESSAGES (1<<11)
681 #define OPT_P_NCP (1<<12)
682 #define OPT_P_TLS_PARMS (1<<13) /* TODO */
683 #define OPT_P_MTU (1<<14) /* TODO */
684 #define OPT_P_NICE (1<<15)
685 #define OPT_P_PUSH (1<<16)
686 #define OPT_P_INSTANCE (1<<17)
687 #define OPT_P_CONFIG (1<<18)
688 #define OPT_P_EXPLICIT_NOTIFY (1<<19)
689 #define OPT_P_ECHO (1<<20)
690 #define OPT_P_INHERIT (1<<21)
691 #define OPT_P_ROUTE_EXTRAS (1<<22)
692 #define OPT_P_PULL_MODE (1<<23)
693 #define OPT_P_PLUGIN (1<<24)
694 #define OPT_P_SOCKBUF (1<<25)
695 #define OPT_P_SOCKFLAGS (1<<26)
696 #define OPT_P_CONNECTION (1<<27)
697 #define OPT_P_PEER_ID (1<<28)
698 #define OPT_P_INLINE (1<<29)
699 
700 #define OPT_P_DEFAULT (~(OPT_P_INSTANCE|OPT_P_PULL_MODE))
701 
702 #define PULL_DEFINED(opt) ((opt)->pull)
703 #define PUSH_DEFINED(opt) ((opt)->push_list)
704 
705 #ifndef PULL_DEFINED
706 #define PULL_DEFINED(opt) (false)
707 #endif
708 
709 #ifndef PUSH_DEFINED
710 #define PUSH_DEFINED(opt) (false)
711 #endif
712 
713 #ifdef _WIN32
714 #define ROUTE_OPTION_FLAGS(o) ((o)->route_method & ROUTE_METHOD_MASK)
715 #else
716 #define ROUTE_OPTION_FLAGS(o) (0)
717 #endif
718 
719 #define SHAPER_DEFINED(opt) ((opt)->shaper)
720 
721 #ifdef ENABLE_PLUGIN
722 #define PLUGIN_OPTION_LIST(opt) ((opt)->plugin_list)
723 #else
724 #define PLUGIN_OPTION_LIST(opt) (NULL)
725 #endif
726 
727 #ifdef ENABLE_MANAGEMENT
728 #define MAN_CLIENT_AUTH_ENABLED(opt) ((opt)->management_flags & MF_CLIENT_AUTH)
729 #else
730 #define MAN_CLIENT_AUTH_ENABLED(opt) (false)
731 #endif
732 
733 void parse_argv(struct options *options,
734  const int argc,
735  char *argv[],
736  const int msglevel,
737  const unsigned int permission_mask,
738  unsigned int *option_types_found,
739  struct env_set *es);
740 
741 void notnull(const char *arg, const char *description);
742 
743 void usage_small(void);
744 
745 void show_library_versions(const unsigned int flags);
746 
747 #ifdef _WIN32
748 void show_windows_version(const unsigned int flags);
749 
750 #endif
751 
752 void init_options(struct options *o, const bool init_gc);
753 
754 void uninit_options(struct options *o);
755 
756 void setenv_settings(struct env_set *es, const struct options *o);
757 
758 void show_settings(const struct options *o);
759 
760 bool string_defined_equal(const char *s1, const char *s2);
761 
762 const char *options_string_version(const char *s, struct gc_arena *gc);
763 
764 char *options_string(const struct options *o,
765  const struct frame *frame,
766  struct tuntap *tt,
767  openvpn_net_ctx_t *ctx,
768  bool remote,
769  struct gc_arena *gc);
770 
771 bool options_cmp_equal_safe(char *actual, const char *expected, size_t actual_n);
772 
773 void options_warning_safe(char *actual, const char *expected, size_t actual_n);
774 
775 bool options_cmp_equal(char *actual, const char *expected);
776 
777 void options_warning(char *actual, const char *expected);
778 
790  const char *opt_name, struct gc_arena *gc);
791 
792 
793 void options_postprocess(struct options *options);
794 
795 void pre_connect_save(struct options *o);
796 
797 void pre_connect_restore(struct options *o, struct gc_arena *gc);
798 
799 bool apply_push_options(struct options *options,
800  struct buffer *buf,
801  unsigned int permission_mask,
802  unsigned int *option_types_found,
803  struct env_set *es);
804 
805 void options_detach(struct options *o);
806 
807 void options_server_import(struct options *o,
808  const char *filename,
809  int msglevel,
810  unsigned int permission_mask,
811  unsigned int *option_types_found,
812  struct env_set *es);
813 
814 void pre_pull_default(struct options *o);
815 
816 void rol_check_alloc(struct options *options);
817 
818 int parse_line(const char *line,
819  char *p[],
820  const int n,
821  const char *file,
822  const int line_num,
823  int msglevel,
824  struct gc_arena *gc);
825 
826 /*
827  * parse/print topology coding
828  */
829 
830 int parse_topology(const char *str, const int msglevel);
831 
832 const char *print_topology(const int topology);
833 
834 /*
835  * Manage auth-retry variable
836  */
837 
838 #define AR_NONE 0
839 #define AR_INTERACT 1
840 #define AR_NOINTERACT 2
841 
842 int auth_retry_get(void);
843 
844 bool auth_retry_set(const int msglevel, const char *option);
845 
846 const char *auth_retry_print(void);
847 
849  const char *config,
850  const int msglevel,
851  const unsigned int permission_mask,
852  unsigned int *option_types_found,
853  struct env_set *es);
854 
855 #endif /* ifndef OPTIONS_H */
void options_warning_safe(char *actual, const char *expected, size_t actual_n)
Definition: options.c:4158
bool remote_float
Definition: options.h:105
const char * tls_crypt_file
Definition: options.h:607
const char * status_file
Definition: options.h:349
const char * ecdh_curve
Definition: options.h:551
int ifconfig_pool_persist_refresh_freq
Definition: options.h:441
bool persist_remote_ip
Definition: options.h:306
const char * route_ipv6_default_gateway
Definition: options.h:74
int sndbuf
Definition: options.h:362
struct route_ipv6_option_list * routes_ipv6
Definition: options.h:382
const char * management_certificate
Definition: options.h:406
const char * socks_proxy_port
Definition: options.h:114
bool options_cmp_equal(char *actual, const char *expected)
Definition: options.c:3993
bool tun_mtu_defined
Definition: options.h:118
Definition: tun.h:155
bool ncp_enabled
Definition: options.h:515
unsigned int management_flags
Definition: options.h:405
struct client_nat_option_list * client_nat
Definition: options.h:387
bool verify_hash_no_ca
Definition: options.h:565
void show_windows_version(const unsigned int flags)
Definition: options.c:4412
bool block_outside_dns
Definition: options.h:637
bool mute_replay_warnings
Definition: options.h:522
bool show_curves
Definition: options.h:240
bool push_ifconfig_ipv6_blocked
Definition: options.h:471
bool exit_event_initial_state
Definition: options.h:634
const char * cipher_list
Definition: options.h:547
struct client_nat_option_list * client_nat
Definition: options.h:77
bool tls_server
Definition: options.h:532
bool enable_ncp_fallback
If defined fall back to ciphername if NCP fails.
Definition: options.h:513
bool tls_crypt_v2_file_inline
Definition: options.h:613
const char * cert_file
Definition: options.h:539
const char * tls_cert_profile
Definition: options.h:550
int management_log_history_cache
Definition: options.h:396
const char * ifconfig_pool_persist_filename
Definition: options.h:440
const char * chroot_dir
Definition: options.h:322
bool allow_pull_fqdn
Definition: options.h:386
bool server_bridge_proxy_dhcp
Definition: options.h:427
const char * dev
Definition: options.h:265
int ping_rec_timeout_action
Definition: options.h:302
bool auth_token_generate
Definition: options.h:483
int foreign_option_index
Definition: options.h:629
Packet geometry parameters.
Definition: mtu.h:93
const char * ca_path
Definition: options.h:536
const char * ca_file
Definition: options.h:534
bool string_defined_equal(const char *s1, const char *s2)
Definition: options.c:4466
const char * ciphername
Definition: options.h:79
bool extra_certs_file_inline
Definition: options.h:542
bool cert_file_inline
Definition: options.h:540
const char * tls_auth_file
Definition: options.h:603
const char * learn_address_script
Definition: options.h:451
const char * shared_secret_file
Definition: options.h:509
const char * priv_key_file
Definition: options.h:543
bool enable_c2c
Definition: options.h:472
#define RH_PORT_LEN
Definition: options.h:193
int push_ifconfig_ipv6_netbits
Definition: options.h:469
uint32_t peer_id
Definition: options.h:642
bool tls_auth_file_inline
Definition: options.h:604
struct remote_list * remote_list
Definition: options.h:251
bool tls_crypt_v2_file_inline
Definition: options.h:156
unsigned short sa_family_t
Definition: syshead.h:402
bool client_nat_defined
Definition: options.h:76
Definition: options.h:96
int renegotiate_seconds
Definition: options.h:587
bool persist_key
Definition: options.h:307
int replay_window
Definition: options.h:523
int persist_mode
Definition: options.h:233
int connect_retry_seconds
Definition: options.h:109
in_addr_t push_ifconfig_remote_netmask
Definition: options.h:461
void usage_small(void)
Definition: options.c:4404
bool ifconfig_pool_defined
Definition: options.h:436
const char * auth_retry_print(void)
Definition: options.c:4350
int rcvbuf
Definition: options.h:361
int inactivity_minimum_bytes
Definition: options.h:293
const char title_string[]
Definition: options.c:67
struct connection_list * connection_list
Definition: options.h:249
#define RH_HOST_LEN
Definition: options.h:191
const char * exit_event_name
Definition: options.h:633
bool route_noexec
Definition: options.h:377
unsigned int sockflags
Definition: options.h:369
const char * tls_crypt_file
Definition: options.h:150
const char * genkey_extra_data
Definition: options.h:244
struct http_proxy_options * http_proxy_override
Definition: options.h:258
const char * route_script
Definition: options.h:372
int proto_force
Definition: options.h:279
int management_state_buffer_size
Definition: options.h:398
int resolve_retry_seconds
Definition: options.h:313
int route_method
Definition: options.h:636
hash_algo_type
Types referencing specific message digest hashing algorithms.
const char * auth_token_secret_file
Definition: options.h:487
bool tls_crypt_file_inline
Definition: options.h:608
#define in_addr_t
Definition: config-msvc.h:103
const char * config
Definition: options.h:219
int route_delay
Definition: options.h:378
vlan_acceptable_frames
Definition: options.h:182
#define MAX_PARMS
Definition: options.h:51
const char * down_script
Definition: options.h:329
const char * cryptoapi_cert
Definition: options.h:579
const char * local_port
Definition: options.h:100
const char * route_predown_script
Definition: options.h:373
int cf_max
Definition: options.h:474
bool down_pre
Definition: options.h:331
int keepalive_timeout
Definition: options.h:290
void * openvpn_net_ctx_t
Definition: networking.h:26
bool push_peer_info
Definition: options.h:622
int renegotiate_seconds_min
Definition: options.h:588
bool tls_crypt_file_inline
Definition: options.h:151
int handshake_window
Definition: options.h:592
bool tuntap_options_defined
Definition: options.h:64
bool allow_recursive_routing
Definition: options.h:658
in_addr_t ifconfig_pool_end
Definition: options.h:438
struct remote_host_store * rh_store
Definition: options.h:261
int parse_topology(const char *str, const int msglevel)
Definition: options.c:4271
const char * client_disconnect_script
Definition: options.h:450
int explicit_exit_notification
Definition: options.h:131
int status_file_update_freq
Definition: options.h:351
int verify_x509_type
Definition: options.h:553
unsigned int unsuccessful_attempts
Definition: options.h:255
bool auth_token_call_auth
Definition: options.h:485
int ping_rec_timeout_action
Definition: options.h:84
const char * prng_hash
Definition: options.h:518
int scheduled_exit_interval
Definition: options.h:503
int ping_rec_timeout
Definition: options.h:296
const char * pkcs12_file
Definition: options.h:545
void options_server_import(struct options *o, const char *filename, int msglevel, unsigned int permission_mask, unsigned int *option_types_found, struct env_set *es)
Definition: options.c:5072
bool ifconfig_noexec
Definition: options.h:275
bool fast_io
Definition: options.h:354
int key_direction
Definition: options.h:511
bool link_mtu_defined
Definition: options.h:122
const char * options_string_version(const char *s, struct gc_arena *gc)
Definition: options.c:4164
bool gc_owned
Definition: options.h:216
unsigned int data_channel_crypto_flags
Definition: options.h:661
bool route_delay_defined
Definition: options.h:380
bool tls_exit
Definition: options.h:624
int key_direction
Definition: options.h:147
bool route_nopull
Definition: options.h:384
list flags
const char * tls_export_cert
Definition: options.h:555
const char * route_default_gateway
Definition: options.h:374
const char * ncp_ciphers
Definition: options.h:516
int cf_per
Definition: options.h:475
int remap_sigusr1
Definition: options.h:336
bool remote_random
Definition: options.h:263
bool auth_user_pass_verify_script_via_file
Definition: options.h:482
const char * tls_verify
Definition: options.h:552
bool push_ifconfig_constraint_defined
Definition: options.h:463
in_addr_t push_ifconfig_local
Definition: options.h:460
int parse_line(const char *line, char *p[], const int n, const char *file, const int line_num, int msglevel, struct gc_arena *gc)
Definition: options.c:4510
bool suppress_timestamps
Definition: options.h:339
bool crl_file_inline
Definition: options.h:557
int tun_mtu
Definition: options.h:117
const char * verify_x509_name
Definition: options.h:554
const char * socks_proxy_server
Definition: options.h:113
int ns_cert_type
Definition: options.h:559
const char * management_write_peer_info_file
Definition: options.h:399
in_addr_t server_bridge_pool_start
Definition: options.h:432
struct plugin_option_list * plugin_list
Definition: options.h:410
int proto
Definition: options.h:98
bool server_defined
Definition: options.h:415
int verbosity
Definition: options.h:342
bool show_net_up
Definition: options.h:635
int stale_routes_check_interval
Definition: options.h:478
bool show_engines
Definition: options.h:238
int verify_hash_depth
Definition: options.h:564
int foreign_option_index
Definition: options.h:86
uint16_t vlan_pvid
Definition: options.h:652
int mode
Definition: options.h:224
bool show_tls_ciphers
Definition: options.h:239
bool ifconfig_ipv6_pool_defined
Definition: options.h:443
bool ccd_exclusive
Definition: options.h:453
bool ca_file_inline
Definition: options.h:535
in_addr_t push_ifconfig_constraint_netmask
Definition: options.h:465
bool occ
Definition: options.h:390
bool local_port_defined
Definition: options.h:101
struct route_ipv6_option_list * routes_ipv6
Definition: options.h:71
int ifconfig_ipv6_netbits
Definition: options.h:273
bool tls_client
Definition: options.h:533
const char * authname
Definition: options.h:517
int shaper
Definition: options.h:277
int connect_retry_max
Definition: options.h:247
bool show_digests
Definition: options.h:237
const char * route_default_gateway
Definition: options.h:73
bool genkey
Definition: options.h:241
int topology
Definition: options.h:269
struct iroute * iroutes
Definition: options.h:457
int mssfix
Definition: options.h:128
void setenv_settings(struct env_set *es, const struct options *o)
Definition: options.c:978
const char * remote_port
Definition: options.h:162
int virtual_hash_size
Definition: options.h:448
const struct x509_track * x509_track
Definition: options.h:626
const char ** ignore_unknown_option
Definition: options.h:229
int proto
Definition: options.h:163
void parse_argv(struct options *options, const int argc, char *argv[], const int msglevel, const unsigned int permission_mask, unsigned int *option_types_found, struct env_set *es)
Definition: options.c:4934
HANDLE msg_channel
Definition: options.h:632
int tcp_queue_limit
Definition: options.h:456
bool auth_token_secret_file_inline
Definition: options.h:488
const char * socks_proxy_authfile
Definition: options.h:115
const char * client_config_dir
Definition: options.h:452
const char * ciphername
Definition: options.h:512
int renegotiate_bytes
Definition: options.h:585
struct http_proxy_options * http_proxy_options
Definition: options.h:112
const char * remote_cert_eku
Definition: options.h:561
bool vlan_tagging
Definition: options.h:650
in_addr_t server_bridge_ip
Definition: options.h:430
in_addr_t server_netmask
Definition: options.h:417
int prng_nonce_secret_len
Definition: options.h:519
const char * extra_certs_file
Definition: options.h:541
unsigned int ssl_flags
Definition: options.h:566
int max_routes_per_client
Definition: options.h:477
const char * lladdr
Definition: options.h:268
int renegotiate_packets
Definition: options.h:586
int n_bcast_buf
Definition: options.h:455
const char * auth_user_pass_file
Definition: options.h:500
int connect_retry_seconds_max
Definition: options.h:110
const char * management_user_pass
Definition: options.h:395
in_addr_t ifconfig_pool_start
Definition: options.h:437
bool mtu_test
Definition: options.h:281
windows_driver_type
Definition: tun.h:47
bool push_ifconfig_ipv4_blocked
Definition: options.h:466
int ping_send_timeout
Definition: options.h:295
struct options_pre_connect * pre_connect
Definition: options.h:501
const char * remote
Definition: options.h:104
hash_algo_type verify_hash_algo
Definition: options.h:563
const char * tls_crypt_v2_verify_script
Definition: options.h:617
int auth_retry_get(void)
Definition: options.c:4321
char * options_string_extract_option(const char *options_string, const char *opt_name, struct gc_arena *gc)
Given an OpenVPN options string, extract the value of an option.
Definition: options.c:4172
const char * tls_crypt_v2_file
Definition: options.h:612
void options_warning(char *actual, const char *expected)
Definition: options.c:3999
bool push_ifconfig_defined
Definition: options.h:459
void rol_check_alloc(struct options *options)
Definition: options.c:1459
void show_settings(const struct options *o)
Definition: options.c:1571
const char * genkey_filename
Definition: options.h:243
const char * ifconfig_ipv6_remote
Definition: options.h:274
bool resolve_in_advance
Definition: options.h:314
const char * writepid
Definition: options.h:327
const char * ifconfig_ipv6_local
Definition: options.h:272
struct verify_hash_list * verify_hash
Definition: options.h:562
const char * tls_groups
Definition: options.h:549
const char * management_port
Definition: options.h:394
bool log
Definition: options.h:338
const char * client_connect_script
Definition: options.h:449
const char * cd_dir
Definition: options.h:323
int inactivity_timeout
Definition: options.h:292
const char * up_script
Definition: options.h:328
const char * ipchange
Definition: options.h:264
unsigned int flags
Definition: options.h:142
bool forward_compatible
Definition: options.h:227
bool ifconfig_nowarn
Definition: options.h:276
in_addr_t ifconfig_pool_netmask
Definition: options.h:439
void options_string_import(struct options *options, const char *config, const int msglevel, const unsigned int permission_mask, unsigned int *option_types_found, struct env_set *es)
Definition: options.c:5092
bool client
Definition: options.h:496
bool pkcs12_file_inline
Definition: options.h:546
bool disable
Definition: options.h:454
const char * remote_port
Definition: options.h:102
bool user_script_used
Definition: options.h:330
int push_continuation
Definition: options.h:498
void init_options(struct options *o, const bool init_gc)
Definition: options.c:784
const char * ip_remote_hint
Definition: options.h:315
const char * key_pass_file
Definition: options.h:235
int nice
Definition: options.h:341
unsigned int push_option_types_found
Definition: options.h:499
const char * tmp_dir
Definition: options.h:414
int route_default_metric
Definition: options.h:376
int max_clients
Definition: options.h:476
bool no_advance
Definition: options.h:253
int transition_window
Definition: options.h:600
bool mlock
Definition: options.h:287
const char * remote
Definition: options.h:161
bool show_ciphers
Definition: options.h:236
int status_file_version
Definition: options.h:350
const char * local
Definition: options.h:103
int route_delay_window
Definition: options.h:379
char * bind_dev
Definition: options.h:366
bool up_delay
Definition: options.h:332
void pre_connect_save(struct options *o)
Definition: options.c:3583
int keepalive_ping
Definition: options.h:289
bool push_ifconfig_ipv6_defined
Definition: options.h:467
int replay_time
Definition: options.h:524
const char * dev_node
Definition: options.h:267
sa_family_t af
Definition: options.h:164
int connect_timeout
Definition: options.h:111
Wrapper structure for dynamically allocated memory.
Definition: buffer.h:60
void options_postprocess(struct options *options)
Definition: options.c:3569
in_addr_t server_network
Definition: options.h:416
void pre_connect_restore(struct options *o, struct gc_arena *gc)
Definition: options.c:3625
const char * cipher_list_tls13
Definition: options.h:548
int real_hash_size
Definition: options.h:447
struct route_option_list * routes
Definition: options.h:68
in_addr_t push_ifconfig_local_alias
Definition: options.h:462
const char * print_topology(const int topology)
Definition: options.c:4293
bool apply_push_options(struct options *options, struct buffer *buf, unsigned int permission_mask, unsigned int *option_types_found, struct env_set *es)
Definition: options.c:5042
const char * auth_user_pass_verify_script
Definition: options.h:481
const char * tls_crypt_v2_metadata
Definition: options.h:615
genkey_type
Definition: options.h:197
Definition: route.h:234
int mute
Definition: options.h:343
struct route_option_list * routes
Definition: options.h:381
struct iroute_ipv6 * iroutes_ipv6
Definition: options.h:458
const char * management_addr
Definition: options.h:393
int tun_mtu_extra
Definition: options.h:119
struct pull_filter_list * pull_filter_list
Definition: options.h:654
bool routes_ipv6_defined
Definition: options.h:70
#define SHA256_DIGEST_LENGTH
bool options_cmp_equal_safe(char *actual, const char *expected, size_t actual_n)
Definition: options.c:4135
unsigned int server_flags
Definition: options.h:425
bool machine_readable_output
Definition: options.h:340
bool daemon
Definition: options.h:334
Garbage collection arena used to keep track of dynamically allocated memory.
Definition: buffer.h:116
bool single_session
Definition: options.h:620
sa_family_t af
Definition: options.h:99
char * options_string(const struct options *o, const struct frame *frame, struct tuntap *tt, openvpn_net_ctx_t *ctx, bool remote, struct gc_arena *gc)
Definition: options.c:3781
const char * management_client_group
Definition: options.h:402
void show_library_versions(const unsigned int flags)
Definition: options.c:4421
int tls_timeout
Definition: options.h:582
bool auth_token_gen_secret_file
Definition: options.h:484
bool bind_local
Definition: options.h:108
bool use_peer_id
Definition: options.h:641
unsigned int server_netbits_ipv6
Definition: options.h:420
const char * ifconfig_local
Definition: options.h:270
bool pull
Definition: options.h:497
int mtu_discover_type
Definition: options.h:125
void pre_pull_default(struct options *o)
int auth_token_lifetime
Definition: options.h:486
void notnull(const char *arg, const char *description)
Definition: options.c:4457
bool bind_ipv6_only
Definition: options.h:107
Definition: options.h:159
const char * packet_id_file
Definition: options.h:525
bool server_ipv6_defined
Definition: options.h:418
const char * dh_file
Definition: options.h:537
void options_detach(struct options *o)
Definition: options.c:1450
const char * management_client_user
Definition: options.h:401
const char * tls_auth_file
Definition: options.h:145
Definition: argv.h:35
bool ping_timer_remote
Definition: options.h:297
bool mssfix_default
Definition: options.h:129
bool tls_auth_file_inline
Definition: options.h:146
in_addr_t server_bridge_pool_end
Definition: options.h:433
in_addr_t push_ifconfig_constraint_network
Definition: options.h:464
bool auth_retry_set(const int msglevel, const char *option)
Definition: options.c:4327
bool persist_config
Definition: options.h:232
bool replay
Definition: options.h:521
bool test_crypto
Definition: options.h:526
bool persist_tun
Definition: options.h:304
const char * groupname
Definition: options.h:321
bool tun_mtu_extra_defined
Definition: options.h:120
bool block_ipv6
Definition: options.h:383
Definition: list.h:58
bool dh_file_inline
Definition: options.h:538
struct verify_hash_list * next
Definition: options.h:209
bool duplicate_cn
Definition: options.h:473
int stale_routes_ageing_time
Definition: options.h:479
const char * engine
Definition: options.h:520
int management_echo_buffer_size
Definition: options.h:397
#define CONNECTION_LIST_SIZE
Definition: options.h:167
const char * ifconfig_remote_netmask
Definition: options.h:271
in_addr_t server_bridge_netmask
Definition: options.h:431
bool server_bridge_defined
Definition: options.h:429
bool bind_defined
Definition: options.h:106
int mark
Definition: options.h:365
const char * username
Definition: options.h:320
bool shared_secret_file_inline
Definition: options.h:510
bool priv_key_file_inline
Definition: options.h:544
void uninit_options(struct options *o)
Definition: options.c:892
int ifconfig_ipv6_pool_netbits
Definition: options.h:445
int fragment
Definition: options.h:127
const char * dev_type
Definition: options.h:266
bool route_gateway_via_dhcp
Definition: options.h:385
bool up_restart
Definition: options.h:333
const char * authname
Definition: options.h:80
const char * route_ipv6_default_gateway
Definition: options.h:375
int link_mtu
Definition: options.h:121
const char * tls_crypt_v2_file
Definition: options.h:155
bool persist_local_ip
Definition: options.h:305
const char * crl_file
Definition: options.h:556