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