32#ifdef HAVE_CONFIG_VERSION_H
33#include "config-version.h"
74#ifdef CONFIGURE_GIT_REVISION
75 " [git:" CONFIGURE_GIT_REVISION CONFIGURE_GIT_FLAGS
"]"
78#if defined(ENABLE_CRYPTO_MBEDTLS)
80#elif defined(ENABLE_CRYPTO_OPENSSL)
92#ifdef ENABLE_COMP_STUB
99#ifdef PRODUCT_TAP_DEBUG
106#if defined(HAVE_IN_PKTINFO) && defined(HAVE_IPI_SPEC_DST)
108#elif defined(IP_RECVDSTADDR)
122#ifdef CONFIGURE_GIT_REVISION
123 " built on " __DATE__
134 "--config file : Read configuration options from file.\n"
135 "--help : Show options.\n"
136 "--version : Show copyright and version information.\n"
139 "--local host|* [port]: Local host name or IP address and port for bind.\n"
140 " If specified, OpenVPN will bindto this address. If unspecified,\n"
141 " OpenVPN will bind to all interfaces. '*' can be used as hostname\n"
142 " and means 'any host' (OpenVPN will listen on what is returned by the OS).\n"
143 " On a client, or in point-to-point mode, this can only be specified once (1 socket).\n"
144 " On an OpenVPN setup running as ``--server``, this can be specified multiple times\n"
145 " to open multiple listening sockets on different addresses and/or different ports.\n"
146 " In order to specify multiple listen ports without specifying an address, use '*'\n"
147 " to signal 'use what the operating system gives you as default', for\n"
148 " 'all IPv4 addresses' use '0.0.0.0', for 'all IPv6 addresses' use '::'.\n"
149 " ``--local`` implies ``--bind``.\n"
150 "--remote host [port] : Remote host name or ip address.\n"
151 "--remote-random : If multiple --remote options specified, choose one randomly.\n"
152 "--remote-random-hostname : Add a random string to remote DNS name.\n"
153 "--mode m : Major mode, m = 'p2p' (default, point-to-point) or 'server'.\n"
154 "--proto p : Use protocol p for communicating with peer.\n"
155 " p = udp (default), tcp-server, tcp-client\n"
156 " udp4, tcp4-server, tcp4-client\n"
157 " udp6, tcp6-server, tcp6-client\n"
158 "--proto-force p : only consider protocol p in list of connection profiles.\n"
160 "--connect-retry n [m] : For client, number of seconds to wait between\n"
161 " connection retries (default=%d). On repeated retries\n"
162 " the wait time is exponentially increased to a maximum of m\n"
164 "--connect-retry-max n : Maximum connection attempt retries, default infinite.\n"
165 "--http-proxy s p [up] [auth] : Connect to remote host\n"
166 " through an HTTP proxy at address s and port p.\n"
167 " If proxy authentication is required,\n"
168 " up is a file containing username/password on 2 lines, or\n"
169 " 'stdin' to prompt from console.\n"
170 "--http-proxy s p 'auto[-nct]' : Like the above directive, but automatically\n"
171 " determine auth method and query for username/password\n"
172 " if needed. auto-nct disables weak proxy auth methods.\n"
173 "--http-proxy-option type [parm] : Set extended HTTP proxy options.\n"
174 " Repeat to set multiple options.\n"
175 " VERSION version (default=1.0)\n"
176 " AGENT user-agent\n"
177 "--socks-proxy s [p] [up] : Connect to remote host through a Socks5 proxy at\n"
178 " address s and port p (default port = 1080).\n"
179 " If proxy authentication is required,\n"
180 " up is a file containing username/password on 2 lines, or\n"
181 " 'stdin' to prompt for console.\n"
182 "--socks-proxy-retry : Retry indefinitely on Socks proxy errors.\n"
183 "--resolv-retry n: If hostname resolve fails for --remote, retry\n"
184 " resolve for n seconds before failing (disabled by default).\n"
185 " Set n=\"infinite\" to retry indefinitely.\n"
186 "--preresolve : Resolve configured --remote, --local, and proxy hostnames at startup.\n"
187 "--float : Allow remote to change its IP address/port, such as through\n"
188 " DHCP (this is the default if --remote is not used).\n"
189 "--ipchange cmd : Run command cmd on remote ip address initial\n"
190 " setting or change -- execute as: cmd ip-address port#\n"
191 "--port port : TCP/UDP port # for both local and remote.\n"
192 "--lport port : TCP/UDP port # for local (default=%s). Implies --bind.\n"
193 "--rport port : TCP/UDP port # for remote (default=%s).\n"
194 "--bind : Bind to local address and port. (This is the default unless\n"
195 " --proto tcp-client"
199 "--nobind : Do not bind to local address and port.\n"
200 "--dev tunX|tapX : tun/tap device (X can be omitted for dynamic device).\n"
201 " Defaults to \"tun\" if neither --dev nor --dev-type is given.\n"
202 "--dev-type dt : Which device type are we using? (dt = tun or tap) Use\n"
203 " this option only if the tun/tap device used with --dev\n"
204 " does not begin with \"tun\" or \"tap\".\n"
205 "--dev-node node : Explicitly set the device node rather than using\n"
206 " /dev/net/tun, /dev/tun, /dev/tap, etc.\n"
207#if defined(ENABLE_DCO)
208 "--disable-dco : Do not attempt using Data Channel Offload.\n"
210 "--lladdr hw : Set the link layer address of the tap device.\n"
211 "--topology t : Set --dev tun topology: 'net30', 'p2p', or 'subnet'.\n"
213 "--iproute cmd : Use this command instead of default " IPROUTE_PATH ".\n"
215 "--ifconfig l rn : TUN: configure device to use IP address l as a local\n"
216 " endpoint and rn as a remote endpoint. l & rn should be\n"
217 " swapped on the other peer. l & rn must be private\n"
218 " addresses outside of the subnets used by either peer.\n"
219 " TAP: configure device to use IP address l as a local\n"
220 " endpoint and rn as a subnet mask.\n"
221 "--ifconfig-ipv6 l r : configure device to use IPv6 address l as local\n"
222 " endpoint (as a /64) and r as remote endpoint\n"
223 "--ifconfig-noexec : Don't actually execute ifconfig/netsh command, instead\n"
224 " pass --ifconfig parms by environment to scripts.\n"
225 "--ifconfig-nowarn : Don't warn if the --ifconfig option on this side of the\n"
226 " connection doesn't match the remote side.\n"
228 "--route-table table_id : Specify a custom routing table for use with --route(-ipv6).\n"
229 " If not specified, the id of the default routing table will be used.\n"
231 "--route network [netmask] [gateway] [metric] :\n"
232 " Add route to routing table after connection\n"
233 " is established. Multiple routes can be specified.\n"
234 " netmask default: 255.255.255.255\n"
235 " gateway default: taken from --route-gateway or --ifconfig\n"
236 " Specify default by leaving blank or setting to \"default\".\n"
237 "--route-ipv6 network/bits [gateway] [metric] :\n"
238 " Add IPv6 route to routing table after connection\n"
239 " is established. Multiple routes can be specified.\n"
240 " gateway default: taken from --route-ipv6-gateway or 'remote'\n"
241 " in --ifconfig-ipv6\n"
242 "--route-gateway gw|'dhcp' : Specify a default gateway for use with --route.\n"
243 "--route-ipv6-gateway gw : Specify a default gateway for use with --route-ipv6.\n"
244 "--route-metric m : Specify a default metric for use with --route.\n"
245 "--route-delay n [w] : Delay n seconds after connection initiation before\n"
246 " adding routes (may be 0). If not specified, routes will\n"
247 " be added immediately after tun/tap open. On Windows, wait\n"
248 " up to w seconds for TUN/TAP adapter to come up.\n"
249 "--route-up cmd : Run command cmd after routes are added.\n"
250 "--route-pre-down cmd : Run command cmd before routes are removed.\n"
251 "--route-noexec : Don't add routes automatically. Instead pass routes to\n"
252 " --route-up script using environmental variables.\n"
253 "--route-nopull : When used with --client or --pull, accept options pushed\n"
254 " by server EXCEPT for routes, dns, and dhcp options.\n"
255 "--allow-pull-fqdn : Allow client to pull DNS names from server for\n"
256 " --ifconfig, --route, and --route-gateway.\n"
257 "--redirect-gateway [flags]: Automatically execute routing\n"
258 " commands to redirect all outgoing IP traffic through the\n"
259 " VPN. Add 'local' flag if both " PACKAGE_NAME " servers are directly\n"
260 " connected via a common subnet, such as with WiFi.\n"
261 " Add 'def1' flag to set default route using using 0.0.0.0/1\n"
262 " and 128.0.0.0/1 rather than 0.0.0.0/0. Add 'bypass-dhcp'\n"
263 " flag to add a direct route to DHCP server, bypassing tunnel.\n"
264 " Add 'bypass-dns' flag to similarly bypass tunnel for DNS.\n"
265 "--redirect-private [flags]: Like --redirect-gateway, but omit actually changing\n"
266 " the default gateway. Useful when pushing private subnets.\n"
267 "--block-ipv6 : (Client) Instead sending IPv6 to the server generate\n"
268 " ICMPv6 host unreachable messages on the client.\n"
269 " (Server) Instead of forwarding IPv6 packets send\n"
270 " ICMPv6 host unreachable packets to the client.\n"
271 "--client-nat snat|dnat network netmask alias : on client add 1-to-1 NAT rule.\n"
272 "--push-peer-info : (client only) push client info to server.\n"
273 "--setenv name value : Set a custom environmental variable to pass to script.\n"
274 "--setenv FORWARD_COMPATIBLE 1 : Relax config file syntax checking to allow\n"
275 " directives for future OpenVPN versions to be ignored.\n"
276 "--ignore-unknown-option opt1 opt2 ...: Relax config file syntax. Allow\n"
277 " these options to be ignored when unknown\n"
278 "--script-security level: Where level can be:\n"
279 " 0 -- strictly no calling of external programs\n"
280 " 1 -- (default) only call built-ins such as ifconfig\n"
281 " 2 -- allow calling of built-ins and scripts\n"
282 " 3 -- allow password to be passed to scripts via env\n"
283 "--shaper n : Restrict output to peer to n bytes per second.\n"
284 "--keepalive n m : Helper option for setting timeouts in server mode. Send\n"
285 " ping once every n seconds, restart if ping not received\n"
287 "--inactive n [bytes] : Exit after n seconds of activity on tun/tap device\n"
288 " produces a combined in/out byte count < bytes.\n"
289 "--session-timeout n: Limit connection time to n seconds.\n"
290 "--ping-exit n : Exit if n seconds pass without reception of remote ping.\n"
291 "--ping-restart n: Restart if n seconds pass without reception of remote ping.\n"
292 "--ping-timer-rem: Run the --ping-exit/--ping-restart timer only if we have a\n"
294 "--ping n : Ping remote once every n seconds over TCP/UDP port.\n"
296 "--multihome : Configure a multi-homed UDP server.\n"
298 "--remap-usr1 s : On SIGUSR1 signals, remap signal (s='SIGHUP' or 'SIGTERM').\n"
299 "--persist-tun : Keep tun/tap device open across SIGUSR1 or --ping-restart.\n"
300 "--persist-remote-ip : Keep remote IP address across SIGUSR1 or --ping-restart.\n"
301 "--persist-local-ip : Keep local IP address across SIGUSR1 or --ping-restart.\n"
302#if PASSTOS_CAPABILITY
303 "--passtos : TOS passthrough (applies to IPv4 only).\n"
305 "--tun-mtu n : Take the tun/tap device MTU to be n and derive the\n"
306 " TCP/UDP MTU from it (default=%d).\n"
307 "--tun-mtu-extra n : Assume that tun/tap device might return as many\n"
308 " as n bytes more than the tun-mtu size on read\n"
309 " (default TUN=0 TAP=%d).\n"
310 "--tun-mtu-max n : Maximum pushable MTU (default and minimum=%d).\n"
311 "--link-mtu n : Take the TCP/UDP device MTU to be n and derive the tun MTU\n"
313 "--mtu-disc type : Should we do Path MTU discovery on TCP/UDP channel?\n"
314 " 'no' -- Never send DF (Don't Fragment) frames\n"
315 " 'maybe' -- Use per-route hints\n"
316 " 'yes' -- Always DF (Don't Fragment)\n"
317 "--mtu-test : Empirically measure and report MTU.\n"
318#ifdef ENABLE_FRAGMENT
319 "--fragment max : Enable internal datagram fragmentation so that no UDP\n"
320 " datagrams are sent which are larger than max bytes.\n"
321 " Adds 4 bytes of overhead per datagram.\n"
323 "--mssfix [n] : Set upper bound on TCP MSS, default = tun-mtu size\n"
324 " or --fragment max value, whichever is lower.\n"
325 "--sndbuf size : Set the TCP/UDP send buffer size.\n"
326 "--rcvbuf size : Set the TCP/UDP receive buffer size.\n"
327#if defined(TARGET_LINUX)
328 "--mark value : Mark encrypted packets being sent with value. The mark value\n"
329 " can be matched in policy routing and packetfilter rules.\n"
330 "--bind-dev dev : Bind to the given device when making connection to a peer or\n"
331 " listening for connections. This allows sending encrypted packets\n"
332 " via a VRF present on the system.\n"
334 "--txqueuelen n : Set the tun/tap TX queue length to n (Linux only).\n"
335 "--mlock : Disable Paging -- ensures key material and tunnel\n"
336 " data will never be written to disk.\n"
337 "--up cmd : Run command cmd after successful tun device open.\n"
338 " Execute as: cmd tun/tap-dev tun-mtu link-mtu \\\n"
339 " ifconfig-local-ip ifconfig-remote-ip\n"
340 " (pre --user or --group UID/GID change)\n"
341 "--up-delay : Delay tun/tap open and possible --up script execution\n"
342 " until after TCP/UDP connection establishment with peer.\n"
343 "--down cmd : Run command cmd after tun device close.\n"
344 " (post --user/--group UID/GID change and/or --chroot)\n"
345 " (command parameters are same as --up option)\n"
346 "--down-pre : Run --down command before TUN/TAP close.\n"
347 "--up-restart : Run up/down commands for all restarts including those\n"
348 " caused by --ping-restart or SIGUSR1\n"
349 "--user user : Set UID to user after initialization.\n"
350 "--group group : Set GID to group after initialization.\n"
351 "--chroot dir : Chroot to this directory after initialization.\n"
353 "--setcon context: Apply this SELinux context after initialization.\n"
355 "--cd dir : Change to this directory before initialization.\n"
356 "--daemon [name] : Become a daemon after initialization.\n"
357 " The optional 'name' parameter will be passed\n"
358 " as the program name to the system logger.\n"
359 "--syslog [name] : Output to syslog, but do not become a daemon.\n"
360 " See --daemon above for a description of the 'name' parm.\n"
361 "--log file : Output log to file which is created/truncated on open.\n"
362 "--log-append file : Append log to file, or create file if nonexistent.\n"
363 "--suppress-timestamps : Don't log timestamps to stdout/stderr.\n"
364 "--machine-readable-output : Always log timestamp, message flags to stdout/stderr.\n"
365 "--writepid file : Write main process ID to file.\n"
366 "--nice n : Change process priority (>0 = lower, <0 = higher).\n"
367 "--echo [parms ...] : Echo parameters to log output.\n"
368 "--verb n : Set output verbosity to n (default=%d):\n"
369 " (Level 3 is recommended if you want a good summary\n"
370 " of what's happening without being swamped by output).\n"
371 " : 0 -- no output except fatal errors\n"
372 " : 1 -- startup info + connection initiated messages +\n"
373 " non-fatal encryption & net errors\n"
374 " : 2,3 -- show TLS negotiations & route info\n"
375 " : 4 -- show parameters\n"
376 " : 5 -- show 'RrWw' chars on console for each packet sent\n"
377 " and received from TCP/UDP (caps) or tun/tap (lc)\n"
378 " : 6 to 11 -- debug messages of increasing verbosity\n"
379 "--mute n : Log at most n consecutive messages in the same category.\n"
380 "--status file [n] : Write operational status to file every n seconds.\n"
381 "--status-version [n] : Choose the status file format version number.\n"
382 " Currently, n can be 1, 2, or 3 (default=1).\n"
383 "--disable-occ : (DEPRECATED) Disable options consistency check between peers.\n"
385 "--gremlin mask : Special stress testing mode (for debugging only).\n"
388 "--compress alg : Use compression algorithm alg\n"
389 "--allow-compression: Specify whether compression should be allowed\n"
390#if defined(ENABLE_LZO)
391 "--comp-lzo : Use LZO compression -- may add up to 1 byte per\n"
392 " packet for incompressible data.\n"
393 "--comp-noadapt : Don't use adaptive compression when --comp-lzo\n"
397#ifdef ENABLE_MANAGEMENT
398 "--management ip port [pass] : Enable a TCP server on ip:port to handle\n"
399 " management functions. pass is a password file\n"
400 " or 'stdin' to prompt from console.\n"
402 " To listen on a unix domain socket, specific the pathname\n"
403 " in place of ip and use 'unix' as the port number.\n"
405 "--management-client : Management interface will connect as a TCP client to\n"
406 " ip/port rather than listen as a TCP server.\n"
407 "--management-query-passwords : Query management channel for private key\n"
408 " and auth-user-pass passwords.\n"
409 "--management-query-proxy : Query management channel for proxy information.\n"
410 "--management-query-remote : Query management channel for --remote directive.\n"
411 "--management-hold : Start " PACKAGE_NAME " in a hibernating state, until a client\n"
412 " of the management interface explicitly starts it.\n"
413 "--management-signal : Issue SIGUSR1 when management disconnect event occurs.\n"
414 "--management-forget-disconnect : Forget passwords when management disconnect\n"
416 "--management-up-down : Report tunnel up/down events to management interface.\n"
417 "--management-log-cache n : Cache n lines of log file history for usage\n"
418 " by the management channel.\n"
420 "--management-client-user u : When management interface is a unix socket, only\n"
421 " allow connections from user u.\n"
422 "--management-client-group g : When management interface is a unix socket, only\n"
423 " allow connections from group g.\n"
425 "--management-client-auth : gives management interface client the responsibility\n"
426 " to authenticate clients after their client certificate\n"
427 " has been verified.\n"
430 "--plugin m [str]: Load plug-in module m passing str as an argument\n"
431 " to its initialization function.\n"
433 "--vlan-tagging : Enable 802.1Q-based VLAN tagging.\n"
434 "--vlan-accept tagged|untagged|all : Set VLAN tagging mode. Default is 'all'.\n"
435 "--vlan-pvid v : Sets the Port VLAN Identifier. Defaults to 1.\n"
437 "Multi-Client Server options (when --mode server is used):\n"
438 "--server network netmask : Helper option to easily configure server mode.\n"
439 "--server-ipv6 network/bits : Configure IPv6 server mode.\n"
440 "--server-bridge [IP netmask pool-start-IP pool-end-IP] : Helper option to\n"
441 " easily configure ethernet bridging server mode.\n"
442 "--push \"option\" : Push a config file option back to the peer for remote\n"
443 " execution. Peer must specify --pull in its config file.\n"
444 "--push-reset : Don't inherit global push list for specific\n"
445 " client instance.\n"
446 "--push-remove opt : Remove options matching 'opt' from the push list for\n"
447 " a specific client instance.\n"
448 "--ifconfig-pool start-IP end-IP [netmask] : Set aside a pool of subnets\n"
449 " to be dynamically allocated to connecting clients.\n"
450 "--ifconfig-pool-persist file [seconds] : Persist/unpersist ifconfig-pool\n"
451 " data to file, at seconds intervals (default=600).\n"
452 " If seconds=0, file will be treated as read-only.\n"
453 "--ifconfig-ipv6-pool base-IP/bits : set aside an IPv6 network block\n"
454 " to be dynamically allocated to connecting clients.\n"
455 "--ifconfig-push local remote-netmask : Push an ifconfig option to remote,\n"
456 " overrides --ifconfig-pool dynamic allocation.\n"
457 " Only valid in a client-specific config file.\n"
458 "--ifconfig-ipv6-push local/bits remote : Push an ifconfig-ipv6 option to\n"
459 " remote, overrides --ifconfig-ipv6-pool allocation.\n"
460 " Only valid in a client-specific config file.\n"
461 "--iroute network [netmask] : Route subnet to client.\n"
462 "--iroute-ipv6 network/bits : Route IPv6 subnet to client.\n"
463 " Sets up internal routes only.\n"
464 " Only valid in a client-specific config file.\n"
465 "--disable : Client is disabled.\n"
466 " Only valid in a client-specific config file.\n"
467 "--override-username: Overrides the client-specific username to be used.\n"
468 " Only valid in a client-specific config file.\n"
469 "--verify-client-cert [none|optional|require] : perform no, optional or\n"
470 " mandatory client certificate verification.\n"
471 " Default is to require the client to supply a certificate.\n"
472 "--username-as-common-name : For auth-user-pass authentication, use\n"
473 " the authenticated username as the common name,\n"
474 " rather than the common name from the client cert.\n"
475 "--auth-user-pass-verify cmd method: Query client for username/password and\n"
476 " run command cmd to verify. If method='via-env', pass\n"
477 " user/pass via environment, if method='via-file', pass\n"
478 " user/pass via temporary file.\n"
479 "--auth-gen-token [lifetime] Generate a random authentication token which is pushed\n"
480 " to each client, replacing the password. Useful when\n"
481 " OTP based two-factor auth mechanisms are in use and\n"
482 " --reneg-* options are enabled. Optionally a lifetime in seconds\n"
483 " for generated tokens can be set.\n"
484 "--auth-user-pass-optional : Allow connections by clients that don't\n"
485 " specify a username/password.\n"
486 "--client-to-client : Internally route client-to-client traffic.\n"
487 "--duplicate-cn : Allow multiple clients with the same common name to\n"
488 " concurrently connect.\n"
489 "--client-connect cmd : Run command cmd on client connection.\n"
490 "--client-disconnect cmd : Run command cmd on client disconnection.\n"
491 "--client-config-dir dir : Directory for custom client config files.\n"
492 "--ccd-exclusive : Refuse connection unless custom client config is found.\n"
493 "--tmp-dir dir : Temporary directory, used for --client-connect return file and plugin communication.\n"
494 "--hash-size r v : Set the size of the real address hash table to r and the\n"
495 " virtual address table to v.\n"
496 "--bcast-buffers n : Allocate n broadcast buffers.\n"
497 "--tcp-queue-limit n : Maximum number of queued TCP output packets.\n"
498 "--tcp-nodelay : In server mode, push TCP_NODELAY to clients (it is\n"
499 " enabled by default on the local socket).\n"
500 "--learn-address cmd : Run command cmd to validate client virtual addresses.\n"
501 "--connect-freq n s : Allow a maximum of n new connections per s seconds.\n"
502 "--connect-freq-initial n s : Allow a maximum of n replies for initial connections attempts per s seconds.\n"
503 "--max-clients n : Allow a maximum of n simultaneously connected clients.\n"
504 "--max-routes-per-client n : Allow a maximum of n internal routes per client.\n"
505 "--stale-routes-check n [t] : Remove routes with a last activity timestamp\n"
506 " older than n seconds. Run this check every t\n"
507 " seconds (defaults to n).\n"
508 "--explicit-exit-notify [n] : In UDP server mode send [RESTART] command on exit/restart to connected\n"
509 " clients. n = 1 - reconnect to same server,\n"
510 " 2 - advance to next server, default=1.\n"
512 "--port-share host port [dir] : When run in TCP mode, proxy incoming HTTPS\n"
513 " sessions to a web server at host:port. dir specifies an\n"
514 " optional directory to write origin IP:port data.\n"
517 "Client options (when connecting to a multi-client server):\n"
518 "--client : Helper option to easily configure client mode.\n"
519 "--auth-user-pass [up] : Authenticate with server using username/password.\n"
520 " up is a file containing the username on the first line,\n"
521 " and a password on the second. If either the password or both\n"
522 " the username and the password are omitted OpenVPN will prompt\n"
523 " for them from console. If [up] is 'username-only', only username\n"
524 " will be prompted for from console or management interface.\n"
525 "--pull : Accept certain config file options from the peer as if they\n"
526 " were part of the local config file. Must be specified\n"
527 " when connecting to a '--mode server' remote host.\n"
528 "--pull-filter accept|ignore|reject t : Filter each option received from the\n"
529 " server if it starts with the text t. The action flag accept,\n"
530 " ignore or reject causes the option to be allowed, removed or\n"
531 " rejected with error. May be specified multiple times, and\n"
532 " each filter is applied in the order of appearance.\n"
533 "--dns server <n> <option> <value> [value ...] : Configure option for DNS server #n\n"
534 " Valid options are :\n"
535 " address <addr[:port]> [addr[:port] ...] : server addresses 4/6\n"
536 " resolve-domains <domain> [domain ...] : split domains\n"
537 " dnssec <yes|no|optional> : option to use DNSSEC\n"
538 " transport <DoH|DoT> : query server over HTTPS / TLS\n"
539 " sni <domain> : DNS server name indication\n"
540 "--dns search-domains <domain> [domain ...]:\n"
541 " Add domains to DNS domain search list\n"
542 "--dns-updown cmd|force|disable : Run cmd as user defined dns config command,\n"
543 " force running the default script or disable running it.\n"
544 "--auth-retry t : How to handle auth failures. Set t to\n"
545 " none (default), interact, or nointeract.\n"
546 "--static-challenge t e [<scrv1|concat>]: Enable static challenge/response protocol using\n"
547 " challenge text t, with e indicating echo flag (0|1)\n"
548 " and optional argument scrv1 or concat to use SCRV1 protocol or"
549 " concatenate response with password. Default is scrv1.\n"
550 "--connect-timeout n : when polling possible remote servers to connect to\n"
551 " in a round-robin fashion, spend no more than n seconds\n"
552 " waiting for a response before trying the next server.\n"
553 "--allow-recursive-routing : When this option is set, OpenVPN will not drop\n"
554 " incoming tun packets with same destination as host.\n"
555 "--explicit-exit-notify [n] : On exit/restart, send exit signal to\n"
556 " server/remote. n = # of retries, default=1.\n"
558 "Data Channel Encryption Options (must be compatible between peers):\n"
559 "(These options are meaningful for both Static Key & TLS-mode)\n"
560 "--auth alg : Authenticate packets with HMAC using message\n"
561 " digest algorithm alg (default=%s).\n"
562 " (usually adds 16 or 20 bytes per packet)\n"
563 " Set alg=none to disable authentication.\n"
564 "--cipher alg : Encrypt packets with cipher algorithm alg.\n"
565 " You should usually use --data-ciphers instead.\n"
566 " Set alg=none to disable encryption.\n"
567 "--data-ciphers list : List of ciphers that are allowed to be negotiated.\n"
568#ifndef ENABLE_CRYPTO_MBEDTLS
569 "--engine [name] : Enable OpenSSL hardware crypto engine functionality.\n"
571 "--mute-replay-warnings : Silence the output of replay warnings to log file.\n"
572 "--replay-window n [t] : Use a replay protection sliding window of size n\n"
573 " and a time window of t seconds.\n"
574 " Default n=%d t=%d\n"
575 "--replay-persist file : Persist replay-protection state across sessions\n"
577 "--test-crypto : Run a self-test of crypto features enabled.\n"
578 " For debugging only.\n"
580 "TLS Key Negotiation Options:\n"
581 "(These options are meaningful only for TLS-mode)\n"
582 "--tls-server : Enable TLS and assume server role during TLS handshake.\n"
583 "--tls-client : Enable TLS and assume client role during TLS handshake.\n"
584 "--ca file : Certificate authority file in .pem format containing\n"
585 " root certificate.\n"
586#ifndef ENABLE_CRYPTO_MBEDTLS
587 "--capath dir : A directory of trusted certificates (CAs"
590 "--dh file : File containing Diffie Hellman parameters\n"
591 " in .pem format (for --tls-server only).\n"
592 " Use \"openssl dhparam -out dh1024.pem 1024\" to generate.\n"
593 "--cert file : Local certificate in .pem format or a URI -- must be signed\n"
594 " by a Certificate Authority in --ca file used by the peer.\n"
595 "--extra-certs file : one or more PEM certs that complete the cert chain.\n"
596 "--key file : Local private key in .pem format or a URI.\n"
597 "--tls-version-min <version> ['or-highest'] : sets the minimum TLS version we\n"
598 " will accept from the peer. If version is unrecognized and 'or-highest'\n"
599 " is specified, require max TLS version supported by SSL implementation.\n"
600 "--tls-version-max <version> : sets the maximum TLS version we will use.\n"
601#ifndef ENABLE_CRYPTO_MBEDTLS
602 "--pkcs12 file : PKCS#12 file containing local private key, local certificate\n"
603 " and optionally the root CA certificate.\n"
604 "--x509-username-field : Field in x509 certificate containing the username.\n"
605 " Default is CN in the Subject field.\n"
607 "--verify-hash hash [algo] : Specify fingerprint for level-1 certificate.\n"
608 " Valid algo flags are SHA1 and SHA256. \n"
610 "--cryptoapicert select-string : Load the certificate and private key from the\n"
611 " Windows Certificate System Store.\n"
613 "--tls-cipher l : A list l of allowable TLS ciphers separated by : (optional).\n"
614 "--tls-ciphersuites l: A list of allowed TLS 1.3 cipher suites separated by : (optional)\n"
615 " : Use --show-tls to see a list of supported TLS ciphers (suites).\n"
616 "--tls-cert-profile p : Set the allowed certificate crypto algorithm profile\n"
617 " (default=legacy).\n"
618#ifndef ENABLE_CRYPTO_MBEDTLS
619 "--providers l : A list l of OpenSSL providers to load.\n"
621 "--tls-timeout n : Packet retransmit timeout on TLS control channel\n"
622 " if no ACK from remote within n seconds (default=%d).\n"
623 "--reneg-bytes n : Renegotiate data chan. key after n bytes sent and recvd.\n"
624 "--reneg-pkts n : Renegotiate data chan. key after n packets sent and recvd.\n"
625 "--reneg-sec max [min] : Renegotiate data chan. key after at most max (default=%d)\n"
626 " and at least min (defaults to 90%% of max on servers and equal\n"
627 " to max on clients).\n"
628 "--hand-window n : Data channel key exchange must finalize within n seconds\n"
629 " of handshake initiation by any peer (default=%d).\n"
630 "--tran-window n : Transition window -- old key can live this many seconds\n"
631 " after new key renegotiation begins (default=%d).\n"
632 "--single-session: Allow only one session (reset state on restart).\n"
633 "--tls-exit : Exit on TLS negotiation failure.\n"
634 "--tls-auth f [d]: Add an additional layer of authentication on top of the TLS\n"
635 " control channel to protect against attacks on the TLS stack\n"
636 " and DoS attacks.\n"
637 " f (required) is a shared-secret key file.\n"
638 " The optional d parameter controls key directionality.\n"
639 "--tls-crypt key : Add an additional layer of authenticated encryption on top\n"
640 " of the TLS control channel to hide the TLS certificate,\n"
641 " provide basic post-quantum security and protect against\n"
642 " attacks on the TLS stack and DoS attacks.\n"
643 " key (required) provides the pre-shared key file.\n"
644 "--tls-crypt-v2 key : For clients: use key as a client-specific tls-crypt key.\n"
645 " For servers: use key to decrypt client-specific keys. For\n"
646 " key generation (--genkey tls-crypt-v2-client): use key to\n"
647 " encrypt generated client-specific key. (See --tls-crypt.)\n"
648 "--genkey tls-crypt-v2-client [keyfile] [base64 metadata]: Generate a\n"
649 " fresh tls-crypt-v2 client key, and store to\n"
650 " keyfile. If supplied, include metadata in wrapped key.\n"
651 "--genkey tls-crypt-v2-server [keyfile] [base64 metadata]: Generate a\n"
652 " fresh tls-crypt-v2 server key, and store to keyfile\n"
653 "--tls-crypt-v2-verify cmd : Run command cmd to verify the metadata of the\n"
654 " client-supplied tls-crypt-v2 client key\n"
655 "--tls-crypt-v2-max-age n : Only accept tls-crypt-v2 client keys that have a\n"
656 " timestamp which is at most n days old.\n"
657 "--askpass [file]: Get PEM password from controlling tty before we daemonize.\n"
658 "--auth-nocache : Don't cache --askpass or --auth-user-pass passwords.\n"
659 "--crl-verify crl ['dir']: Check peer certificate against a CRL.\n"
660 "--tls-verify cmd: Run command cmd to verify the X509 name of a\n"
661 " pending TLS connection that has otherwise passed all other\n"
662 " tests of certification. cmd should return 0 to allow\n"
663 " TLS handshake to proceed, or 1 to fail. (cmd is\n"
664 " executed as 'cmd certificate_depth subject')\n"
665 "--verify-x509-name name: Accept connections only from a host with X509 subject\n"
666 " DN name. The remote host must also pass all other tests\n"
667 " of verification.\n"
668#ifndef ENABLE_CRYPTO_MBEDTLS
669 "--ns-cert-type t: (DEPRECATED) Require that peer certificate was signed with \n"
670 " an explicit nsCertType designation t = 'client' | 'server'.\n"
672 "--x509-track x : Save peer X509 attribute x in environment for use by\n"
673 " plugins and management interface.\n"
674 "--keying-material-exporter label len : Save Exported Keying Material (RFC5705)\n"
675 " of len bytes (min. 16 bytes) using label in environment for use by plugins.\n"
676 "--remote-cert-ku v ... : Require that the peer certificate was signed with\n"
677 " explicit key usage, you can specify more than one value.\n"
678 " value should be given in hex format.\n"
679 "--remote-cert-eku oid : Require that the peer certificate was signed with\n"
680 " explicit extended key usage. Extended key usage can be encoded\n"
681 " as an object identifier or OpenSSL string representation.\n"
682 "--remote-cert-tls t: Require that peer certificate was signed with explicit\n"
683 " key usage and extended key usage based on RFC3280 TLS rules.\n"
684 " t = 'client' | 'server'.\n"
688 "--pkcs11-providers provider ... : PKCS#11 provider to load.\n"
689 "--pkcs11-protected-authentication [0|1] ... : Use PKCS#11 protected authentication\n"
690 " path. Set for each provider.\n"
691 "--pkcs11-private-mode hex ... : PKCS#11 private key mode mask.\n"
692 " 0 : Try to determine automatically (default).\n"
694 " 2 : Use SignRecover.\n"
695 " 4 : Use Decrypt.\n"
697 "--pkcs11-cert-private [0|1] ... : Set if login should be performed before\n"
698 " certificate can be accessed. Set for each provider.\n"
699 "--pkcs11-pin-cache seconds : Number of seconds to cache PIN. The default is -1\n"
700 " cache until token is removed.\n"
701 "--pkcs11-id-management : Acquire identity from management interface.\n"
702 "--pkcs11-id serialized-id 'id' : Identity to use, get using standalone --show-pkcs11-ids\n"
705 "SSL Library information:\n"
706 "--show-ciphers : Show cipher algorithms to use with --cipher option.\n"
707 "--show-digests : Show message digest algorithms to use with --auth option.\n"
708 "--show-engines : Show hardware crypto accelerator engines (if available).\n"
709 "--show-tls : Show all TLS ciphers (TLS used only as a control channel).\n"
712 "Windows Specific:\n"
713 "--win-sys path : Pathname of Windows system directory. Default is the pathname\n"
714 " from SystemRoot environment variable.\n"
715 "--ip-win32 method : When using --ifconfig on Windows, set TAP-Windows adapter\n"
716 " IP address using method = manual, netsh, ipapi,\n"
717 " dynamic, or adaptive (default = adaptive).\n"
718 " Dynamic method allows two optional parameters:\n"
719 " offset: DHCP server address offset (> -256 and < 256).\n"
720 " If 0, use network address, if >0, take nth\n"
721 " address forward from network address, if <0,\n"
722 " take nth address backward from broadcast\n"
725 " lease-time: Lease time in seconds.\n"
726 " Default is one year.\n"
727 "--route-method : Which method to use for adding routes on Windows?\n"
728 " adaptive (default) -- Try ipapi then fall back to exe.\n"
729 " ipapi -- Use IP helper API.\n"
730 " exe -- Call the route.exe shell command.\n"
731 "--dhcp-option type [parm] : Set extended TAP-Windows properties, must\n"
732 " be used with --ip-win32 dynamic. For options\n"
733 " which allow multiple addresses,\n"
734 " --dhcp-option must be repeated.\n"
735 " DOMAIN name : Set DNS suffix\n"
736 " DOMAIN-SEARCH entry : Add entry to DNS domain search list\n"
737 " DNS addr : Set domain name server address(es) (IPv4 and IPv6)\n"
738 " NTP : Set NTP server address(es)\n"
739 " NBDD : Set NBDD server address(es)\n"
740 " WINS addr : Set WINS server address(es)\n"
741 " NBT type : Set NetBIOS over TCP/IP Node type\n"
742 " 1: B, 2: P, 4: M, 8: H\n"
743 " NBS id : Set NetBIOS scope ID\n"
744 " DISABLE-NBT : Disable Netbios-over-TCP/IP.\n"
745 "--dhcp-renew : Ask Windows to renew the TAP adapter lease on startup.\n"
746 "--dhcp-pre-release : Ask Windows to release the previous TAP adapter lease on\n"
748 "--register-dns : Run ipconfig /flushdns and ipconfig /registerdns\n"
749 " on connection initiation.\n"
750 "--tap-sleep n : Sleep for n seconds after TAP adapter open before\n"
751 " attempting to set adapter properties.\n"
752 "--pause-exit : When run from a console window, pause before exiting.\n"
753 "--service ex [0|1] : For use when " PACKAGE_NAME " is being instantiated by a\n"
754 " service, and should not be used directly by end-users.\n"
755 " ex is the name of an event object which, when\n"
756 " signaled, will cause " PACKAGE_NAME " to exit. A second\n"
757 " optional parameter controls the initial state of ex.\n"
758 "--show-net-up : Show " PACKAGE_NAME "'s view of routing table and net adapter list\n"
759 " after TAP adapter is up and routes have been added.\n"
760 "--block-outside-dns : Block DNS on other network adapters to prevent DNS leaks\n"
761 "Windows Standalone Options:\n"
763 "--show-adapters : Show all TAP-Windows adapters.\n"
764 "--show-net : Show " PACKAGE_NAME "'s view of routing table and net adapter list.\n"
765 "--show-valid-subnets : Show valid subnets for --dev tun emulation.\n"
766 "--allow-nonadmin [TAP-adapter] : Allow " PACKAGE_NAME " running without admin privileges\n"
767 " to access TAP adapter.\n"
770 "Generate a new key :\n"
771 "--genkey tls-auth file : Generate a new random key of type and write to file\n"
772 " (for use with --tls-auth or --tls-crypt)."
773#ifdef ENABLE_FEATURE_TUN_PERSIST
775 "Tun/tap config mode:\n"
776 "--mktun : Create a persistent tunnel.\n"
777 "--rmtun : Remove a persistent tunnel.\n"
778 "--dev tunX|tapX : tun/tap device\n"
779 "--dev-type dt : Device type. See tunnel options above for details.\n"
780 "--user user : User to set privilege to.\n"
781 "--group group : Group to set privilege to.\n"
785 "PKCS#11 standalone options:\n"
786#ifdef DEFAULT_PKCS11_MODULE
787 "--show-pkcs11-ids [provider] [cert_private] : Show PKCS#11 available ids.\n"
789 "--show-pkcs11-ids provider [cert_private] : Show PKCS#11 available ids.\n"
791 " --verb option can be added *BEFORE* this.\n"
794 "General Standalone Options:\n"
796 "--show-gateway [address]: Show info about gateway [to v4/v6 address].\n"
818 o->
ce.
af = AF_UNSPEC;
843#ifdef ENABLE_MANAGEMENT
848#ifdef ENABLE_FEATURE_TUN_PERSIST
889 o->pkcs11_pin_cache_period = -1;
904#ifdef ENABLE_DNS_UPDOWN_BY_DEFAULT
985setenv_foreign_option(
struct options *o,
const char *option,
const char *value,
struct env_set *es)
1004 ++
o->foreign_option_index;
1008 msg(
M_WARN,
"foreign_option: name/value overflow");
1020 for (current = *list, prev = NULL; current != NULL; current = current->
next)
1022 if (!strncmp(current->
string,
"foreign_option_",
sizeof(
"foreign_option_") - 1))
1024 const char *tmp_value = strchr(current->
string,
'=');
1025 if (tmp_value && ++tmp_value)
1027 if (!strncmp(tmp_value,
"dhcp-option ",
sizeof(
"dhcp-option ") - 1))
1035 *list = current->
next;
1051 bool succeeded =
false;
1059 ret =
getaddr(flags, ip_string, 0, &succeeded, NULL);
1060 if (!succeeded && error)
1075 const char *end = strchr(addr,
'/');
1083 size_t len = end - addr;
1085 memcpy(ret, addr, len);
1109 const char *cp = str;
1117 while (*cp && i < nbytes)
1120 if (!isxdigit(cp[0]) || !isxdigit(cp[1]) || (cp[2] !=
':' && cp[2] !=
'\0')
1121 || sscanf(cp,
"%x", &
byte) != 1)
1123 msg(msglevel,
"format error in hash fingerprint: %s", str);
1127 ret->
hash[i++] = (uint8_t)
byte;
1138 msg(msglevel,
"hash fingerprint is wrong length - expected %d bytes, got %d: %s", nbytes, i,
1141 else if (term !=
'\0')
1143 msg(msglevel,
"hash fingerprint too long - expected only %d bytes: %s", nbytes, str);
1168 while ((line =
strsep(&lines,
"\n")))
1171 while (isspace(*line))
1176 if (strlen(line) == 0 || *line ==
'#' || *line ==
';')
1200 struct in6_addr addr;
1203 msg(msglevel,
"--dhcp-option DNS: maximum of %u IPv6 dns servers can be specified",
1208 dns6_list[(*len)++] = addr;
1217 msg(msglevel,
"--dhcp-option %s: maximum of %u %s servers can be specified", name,
1228 array[(*len)++] = addr;
1233 msg(msglevel,
"dhcp-option parameter %s '%s' must be an IP address", name, parm);
1255 msg(msglevel,
"in --iroute %s %s : Bad network/subnet specification", network_str,
1274 msg(msglevel,
"in --iroute-ipv6 %s: Bad IPv6 prefix specification", prefix_str);
1329#ifdef ENABLE_MANAGEMENT
1341 if (flags && !strcmp(flags,
"nct"))
1365 for (
i = 0;
i <
l->len; ++
i)
1376 for (i = 0; i < l->
len; ++i)
1388 "Note: option http-proxy-override ignored because no TCP-based connection profiles are defined");
1412 const int new_cap = l->
capacity + 1;
1413 const size_t elem_size =
sizeof(*l->
array);
1419 "Unable to process more local options: out of memory. Number of entries = %d",
1424 l->
array = new_array;
1459 "Unable to process more connection options: out of memory. Number of entries = %d",
1495 "Unable to process more remote options: out of memory. Number of entries = %d",
1562 if (key_file && *key_file && !(*key_inline))
1578#ifdef ENABLE_CRYPTO_MBEDTLS
1581 msg(
M_USAGE,
"Parameter --capath cannot be used with the mbed TLS version of OpenVPN.");
1594 const char *
const str =
"You must define CA file (--ca)"
1595#ifndef ENABLE_CRYPTO_MBEDTLS
1596 " or CA path (--capath)"
1598 " and/or peer fingerprint verification (--peer-fingerprint)";
1602#define MUST_BE_UNDEF(parm, parm_name) \
1603 if (options->parm != defaults.parm) \
1605 msg(M_USAGE, use_err, parm_name); \
1607#define MUST_BE_FALSE(condition, parm_name) \
1610 msg(M_USAGE, use_err, parm_name); \
1638 msg(
M_USAGE,
"--proto tcp is ambiguous in this context. Please specify "
1639 "--proto tcp-server or --proto tcp-client");
1648 msg(
M_USAGE,
"multiple --local statements only allowed in --server mode");
1653 msg(
M_USAGE,
"--lladdr can only be used in --dev tap mode");
1661 msg(
M_USAGE,
"only one of --tun-mtu or --link-mtu may be defined");
1666 msg(
M_USAGE,
"--mtu-test only makes sense with --proto udp");
1679 msg(
M_USAGE,
"--local and --remote addresses must be distinct from --ifconfig "
1685 msg(
M_USAGE,
"local and remote/netmask --ifconfig addresses must be different");
1690 msg(
M_USAGE,
"--bind and --nobind can't be used together");
1695 msg(
M_USAGE,
"--lport and --nobind don't make sense when used together");
1700 msg(
M_USAGE,
"--nobind doesn't make sense unless used with --remote");
1710 msg(
M_USAGE,
"--remote and one of the --local addresses are the same");
1716 msg(
M_USAGE,
"--local addresses must be distinct from --ifconfig addresses");
1721 msg(
M_USAGE,
"--local and --nobind don't make sense when used together");
1728#ifdef ENABLE_MANAGEMENT
1734 "--management is not specified, however one or more options which modify the behavior of --management were specified");
1740 msg(
M_USAGE,
"--management-client-(user|group) can only be used on unix domain sockets");
1746 msg(
M_WARN,
"WARNING: Using --management on a TCP port WITHOUT "
1747 "passwords is STRONGLY discouraged and considered insecure");
1752#if !defined(HAVE_XKEY_PROVIDER)
1756 msg(
M_FATAL,
"management-external-key with TLS 1.3 or later requires "
1757 "nopadding argument/support");
1768 msg(
M_USAGE,
"On Windows, --ifconfig is required when --dev tun is used");
1774 msg(
M_USAGE,
"On Windows, --ip-win32 doesn't make sense unless --ifconfig is also used");
1779 const char *prefix =
"Some --dhcp-option or --dns options require DHCP server";
1782 msg(
M_USAGE,
"%s, which is not supported by the selected %s driver", prefix,
1788 msg(
M_USAGE,
"%s, which requires --ip-win32 dynamic or adaptive", prefix);
1797#ifdef ENABLE_FRAGMENT
1800 msg(
M_USAGE,
"--fragment can only be used with --proto udp");
1806 msg(
M_USAGE,
"--remote MUST be used in TCP Client mode");
1811 msg(
M_USAGE,
"--http-proxy MUST be used in TCP Client mode (i.e. --proto "
1817 msg(
M_USAGE,
"--http-proxy not specified but other http proxy options present");
1822 msg(
M_USAGE,
"--http-proxy can not be used together with --socks-proxy");
1827 msg(
M_USAGE,
"--socks-proxy can not be used in TCP Server mode");
1832 msg(
M_USAGE,
"TCP server mode allows at most one --remote address");
1840 const char use_err[] =
"--%s cannot be used with --mode server.";
1842#define USAGE_VALID_SERVER_PROTOS \
1843 "--mode server currently only supports " \
1844 "--proto values of udp, tcp-server, tcp4-server, or tcp6-server"
1845#ifdef TARGET_ANDROID
1846 msg(
M_FATAL,
"--mode server not supported on Android");
1850 msg(
M_USAGE,
"--mode server only works with --dev tun or --dev tap");
1855 msg(
M_WARN,
"--pull-filter ignored for --mode server");
1862 bool has_tcp =
false;
1870 msg(
M_USAGE,
"--port-share only works in TCP server mode "
1871 "(--proto values of tcp-server, tcp4-server, or tcp6-server)");
1876 msg(
M_USAGE,
"--mode server requires --tls-server");
1887 msg(
M_USAGE,
"<connection> cannot be used with --mode server");
1893 msg(
M_USAGE,
"--ipchange cannot be used with --mode server (use "
1894 "--client-connect instead)");
1903 "--connect-freq only works with --mode server --proto udp. Try --max-clients instead.");
1909 "The third parameter to --ifconfig-pool (netmask) is only valid in --dev tap mode");
1914 "--redirect-gateway cannot be used with --mode server (however --push \"redirect-gateway\" is fine)");
1922 "--ifconfig-pool-persist must be used with --ifconfig-pool or --ifconfig-ipv6-pool");
1926 msg(
M_USAGE,
"--ifconfig-ipv6-pool needs --ifconfig-ipv6");
1928 MUST_BE_UNDEF(allow_recursive_routing,
"allow-recursive-routing");
1932 "--auth-user-pass cannot be used with --mode server (it should be used on the client side only)");
1936 msg(
M_USAGE,
"--ccd-exclusive must be used with --client-config-dir");
1940 msg(
M_USAGE,
"--auth-gen-token needs a non-infinite "
1941 "--renegotiate_seconds setting");
1947 "--auth-gen-token renewal time needs to be at least "
1948 " two times --hand-window (%d).",
1954 const char *use_err =
1955 "--%s must be used with --management-client-auth, an --auth-user-pass-verify script, or plugin";
1959 "verify-client-cert none|optional");
1961 "username-as-common-name");
1963 "auth-user-pass-optional");
1968 msg(
M_USAGE,
"--vlan-tagging must be used with --dev tap");
1972 const char use_err[] =
"--%s requires --vlan-tagging";
1979 msg(
M_INFO,
"NOTE: TCP_NODELAY is always enabled locally; "
1980 "--tcp-nodelay is now only useful to push the flag to "
1981 "clients older than 2.7.6.");
1986 const char use_err[] =
"--%s requires --mode server";
1992 MUST_BE_UNDEF(ifconfig_pool_persist_filename,
"ifconfig-pool-persist");
1993 MUST_BE_UNDEF(ifconfig_ipv6_pool_defined,
"ifconfig-ipv6-pool");
1998 MUST_BE_UNDEF(client_crresponse_script,
"client-crresponse");
1999 MUST_BE_UNDEF(client_disconnect_script,
"client-disconnect");
2008 "verify-client-cert");
2013 msg(
M_WARN,
"DEPRECATED OPTION: --tcp-nodelay is always enabled on clients");
2015 MUST_BE_UNDEF(auth_user_pass_verify_script,
"auth-user-pass-verify");
2021 "--port-share requires TCP server mode (--mode server --proto tcp-server)");
2024 MUST_BE_UNDEF(stale_routes_check_interval,
"stale-routes-check");
2028 MUST_BE_UNDEF(force_key_material_export,
"force-key-material-export");
2032 msg(
M_WARN,
"Note: Using --push without --mode server is an "
2033 "unsupported configuration. Negotiation of OpenVPN "
2034 "features is expected to fail.");
2043 msg(
M_USAGE,
"specify only one of --tls-server, --tls-client, or --secret");
2054 msg(msglevel,
"DEPRECATION: No tls-client or tls-server option in "
2055 "configuration detected. OpenVPN 2.8 will remove the "
2056 "functionality to run a VPN without TLS. "
2057 "See the examples section in the manual page for "
2058 "examples of a similar quick setup with peer-fingerprint. "
2059 "OpenVPN 2.7 allows using this configuration when using "
2060 "--allow-deprecated-insecure-static-crypto but you should move "
2061 "to a proper configuration using TLS as soon as possible.");
2066 msg(
M_WARN,
"WARNING: POTENTIALLY DANGEROUS OPTION "
2067 "--verify-client-cert none|optional "
2068 "may accept clients which do not present a certificate");
2071 const unsigned int tls_ver_max =
2073 const unsigned int tls_ver_min =
2076 if (tls_ver_max > 0 && tls_ver_max < tls_ver_min)
2078 msg(
M_USAGE,
"--tls-version-min bigger than --tls-version-max");
2087 msg(
M_WARN,
"Option pkcs11-id is ignored as no pkcs11-providers are specified");
2089 else if (!
options->pkcs11_providers[0] &&
options->pkcs11_id_management)
2092 "Option pkcs11-id-management is ignored as no pkcs11-providers are specified");
2095 if (
options->pkcs11_providers[0])
2100 "Parameter --pkcs11-id cannot be used when --pkcs11-id-management is also specified.");
2102 if (!
options->pkcs11_id_management &&
options->pkcs11_id == NULL)
2105 "Parameter --pkcs11-id or --pkcs11-id-management should be specified.");
2107 const char use_err[] =
2108 "Parameter --%s cannot be used when --pkcs11-provider is also specified.";
2114#ifdef ENABLE_CRYPTOAPI
2120#ifdef ENABLE_CRYPTOAPI
2123 const char use_err[] =
2124 "Parameter --%s cannot be used when --cryptoapicert is also specified.";
2135#ifdef ENABLE_CRYPTO_MBEDTLS
2136 msg(
M_USAGE,
"Parameter --pkcs12 cannot be used with the mbed TLS version of OpenVPN.");
2138 const char use_err[] =
"Parameter --%s cannot be used when --pkcs12 is also specified.";
2150 msg(
M_USAGE,
"--key and --management-external-key are mutually exclusive");
2156 msg(
M_USAGE,
"--cert and --management-external-cert are mutually exclusive");
2161 "--management-external-cert must be used with --management-external-key");
2175 msg(
M_USAGE,
"No client-side authentication method is "
2176 "specified. You must use either "
2177 "--cert/--key, --pkcs12, or "
2178 "--auth-user-pass");
2183 msg(
M_USAGE,
"If you use one of --cert or --key, you must use them both");
2191 "certificate file (--cert) or PKCS#12 file (--pkcs12)");
2196 "private key file (--key) or PKCS#12 file (--pkcs12)");
2202 msg(
M_USAGE,
"--tls-auth and --tls-crypt are mutually exclusive");
2208 "--tls-crypt-v2, --tls-auth and --tls-crypt are mutually exclusive in client mode");
2218 const char use_err[] =
"Parameter %s can only be specified in TLS-mode, "
2219 "i.e. where --tls-server or --tls-client is also specified.";
2226#ifndef ENABLE_CRYPTO_MBEDTLS
2253 MUST_BE_UNDEF(pkcs11_private_mode[0],
"pkcs11-private-mode");
2265 msg(
M_USAGE,
"--auth-user-pass requires --pull");
2334 if (ce->
af == AF_INET6)
2336 msg(
M_INFO,
"WARNING: '--proto udp6' is not compatible with "
2337 "'--socks-proxy' today. Forcing IPv4 mode.");
2341 msg(
M_INFO,
"NOTICE: dual-stack mode for '--proto udp' does not "
2342 "work correctly with '--socks-proxy' today. Forcing IPv4.");
2369#ifdef ENABLE_FRAGMENT
2426 msg(
M_WARN,
"NOTICE: --explicit-exit-notify ignored for --proto tcp");
2455 msg(
M_INFO,
"Flag 'def1' added to --redirect-gateway (iservice is in use)");
2635#ifdef DEFAULT_PKCS11_MODULE
2641 options->pkcs11_providers[0] = DEFAULT_PKCS11_MODULE;
2668 msg(
M_WARN,
"Note: --client-to-client has no effect when using data "
2669 "channel offload: packets are always sent to the VPN "
2670 "interface and then routed based on the system routing table");
2675 msg(
M_WARN,
"Note: '--reneg-bytes' and '--reneg-pkts' are not supported "
2676 "by data channel offload; automatic key renegotiation "
2677 "mechanisms are sufficient for modern ciphers. "
2678 "Ignoring these options.");
2710 "Note: --cipher is not set. OpenVPN versions before 2.5 "
2711 "defaulted to BF-CBC as fallback when cipher negotiation "
2712 "failed in this case. If you need this fallback please add "
2713 "'--data-ciphers-fallback BF-CBC' to your configuration "
2714 "and/or add BF-CBC to --data-ciphers. E.g. "
2715 "--data-ciphers %s:BF-CBC",
2721 "DEPRECATED OPTION: --cipher set to '%s' but missing in "
2722 "--data-ciphers (%s). OpenVPN ignores --cipher for cipher "
2758 if (tls_ver_min == 0)
2766 else if (tls_ver_max == 0 || tls_ver_max >=
TLS_VER_1_2)
2827 "supported by the TLS library. Your system does not support this "
2828 "calculation anymore or your security policy (e.g. FIPS 140-2) "
2829 "forbids it. Connections will only work with peers running "
2830 "OpenVPN 2.6.0 or higher)");
2833 msg(
M_WARN,
"Automatically enabling option "
2834 "--force-tls-key-material-export");
2840#if defined(_WIN32) || defined(TARGET_ANDROID)
2900 msg(
M_WARN,
"WARNING: couldn't copy all --dns search-domains to TUN/TAP");
2909 bool non_standard_server_port =
false;
2914 non_standard_server_port =
true;
2926 bool overflow =
false;
2944 msg(
M_WARN,
"WARNING: couldn't copy all --dns server addresses to TUN/TAP");
2965dhcp_options_postprocess_dns(
struct options *o,
struct env_set *es)
2983 const int fo_count =
o->foreign_option_index;
2984 o->foreign_option_index = 0;
3008 buf_printf(&name,
"foreign_option_%d", ++
o->foreign_option_index);
3019 if (
dhcp->dns_len ||
dhcp->dns6_len)
3025 entry = &domain->
next;
3027 for (
unsigned int i = 0; i <
dhcp->domain_search_list_len; ++i)
3031 search_domain->
name =
dhcp->domain_search_list[i];
3032 entry = &search_domain->
next;
3036 const size_t max_addrs =
SIZE(server->
addr);
3037 for (
unsigned int i = 0; i <
dhcp->dns_len && server->
addr_count < max_addrs; ++i)
3043 for (
unsigned int i = 0; i <
dhcp->dns6_len && server->
addr_count < max_addrs; ++i)
3057 setenv_foreign_option(o,
"DOMAIN", d->
name, es);
3064 bool non_standard_server_port =
false;
3069 non_standard_server_port =
true;
3095 setenv_foreign_option(o, option, value, es);
3148 msg(
M_USAGE,
"--data-ciphers list contains unsupported ciphers or is too long.");
3157 for (
int i = 0;
i <
rl->len; ++
i)
3229 msg(
M_WARN,
"WARNING: Ignoring option 'dh' in tls-client mode, please only "
3230 "include this in your server configuration");
3233#if ENABLE_MANAGEMENT
3241 msg(
M_INFO,
"Using certificate fingerprint to verify peer (no CA "
3248 msg(
M_USAGE,
"Options 'config stdin' and 'remap-usr1 SIGHUP' are "
3249 "incompatible with each other.");
3276 msg(
M_WARN,
"Note: ignoring --dev-node as it has no effect when using "
3277 "data channel offload");
3298#if defined(_WIN32) || defined(TARGET_ANDROID)
3301 dhcp_options_postprocess_dns(o, es);
3308#if ENABLE_MANAGEMENT
3311 msg(
M_USAGE,
"'auth-user-pass username-only' cannot be used with static challenge");
3343#if defined(_WIN32) || defined(TARGET_ANDROID)
3346 dhcp_options_postprocess_dns(o, es);
3359 if (
streq(str,
"net30"))
3363 else if (
streq(str,
"p2p"))
3367 else if (
streq(str,
"subnet"))
3373 msg(msglevel,
"--topology must be net30, p2p, or subnet");
3415 if (
streq(option,
"interact"))
3419 else if (
streq(option,
"nointeract"))
3423 else if (
streq(option,
"none"))
3429 msg(msglevel,
"--auth-retry method must be 'interact', 'nointeract', or 'none'");
3444 return "nointeract";
3464 fprintf(fp,
"Usage message not available\n");
3514#define LZO_LIB_VER_STR ", LZO ", lzo_version_string()
3516#define LZO_LIB_VER_STR "", ""
3521#undef LZO_LIB_VER_STR
3536#ifdef CONFIGURE_DEFINES
3539#ifdef CONFIGURE_SPECIAL_BUILD
3554 msg(
M_USAGE,
"You must define %s", description);
3562 msg(msglevel,
"only one of --ping-exit or --ping-restart options may be specified");
3570 unsigned int val = 0;
3571 sscanf(str,
"%u", &val);
3576#define VERIFY_PERMISSION(mask) \
3578 if (!verify_permission(p[0], file, line, (mask), permission_mask, option_types_found, \
3579 msglevel, options, is_inline)) \
3587 const uint64_t allowed, uint64_t *found,
const msglvl_t msglevel,
3590 if (!(type & allowed))
3592 msg(msglevel,
"option '%s' cannot be used in this context (%s)", name, file);
3598 msg(msglevel,
"option '%s' is not expected to be inline (%s:%d)", name, file, line);
3619 msg(
M_WARN,
"Option '%s' in %s:%d is ignored by previous <connection> blocks ", name,
3624 msg(
M_WARN,
"Option '%s' is ignored by previous <connection> blocks", name);
3636#define NM_QUOTE_HINT (1 << 0)
3650 msg(msglevel,
"the --%s directive should have at most %d parameter%s.%s", p[0], max - 1,
3651 max >= 3 ?
"s" :
"",
3653 ?
" To pass a list of arguments as one of the parameters, try enclosing them in double quotes (\"\")."
3669#define RESET_OPTION_ROUTES(option_ptr, field) \
3672 option_ptr->field = NULL; \
3673 option_ptr->flags = 0; \
3678 const char *file,
int line,
const msglvl_t msglevel,
3679 const uint64_t permission_mask, uint64_t *option_types_found,
3684 if (
streq(p[0],
"ifconfig") && !p[1])
3690 else if (
streq(p[0],
"ifconfig-ipv6") && !p[1])
3697 else if (
streq(p[0],
"route") && !p[1])
3707 else if (
streq(p[0],
"route-ipv6") && !p[1])
3717 else if (
streq(p[0],
"route-gateway") && !p[1])
3723 else if (
streq(p[0],
"route-metric") && !p[1])
3728 else if (
streq(p[0],
"push-continuation") && !p[1])
3733 else if ((
streq(p[0],
"redirect-gateway") ||
streq(p[0],
"redirect-private")) && !p[1])
3747 else if (
streq(p[0],
"dns") && !p[1])
3753 else if (
streq(p[0],
"topology") && !p[1])
3759 else if (
streq(p[0],
"tun-mtu") && !p[1])
3766 else if (
streq(p[0],
"block-ipv6") && !p[1])
3771#if defined(_WIN32) || defined(TARGET_ANDROID)
3772 else if (
streq(p[0],
"dhcp-option") && !p[1])
3781 memset(o->
dns6, 0,
sizeof(o->
dns6));
3783 memset(o->
dns, 0,
sizeof(o->
dns));
3785 memset(o->
wins, 0,
sizeof(o->
wins));
3787 memset(o->
ntp, 0,
sizeof(o->
ntp));
3789 memset(o->
nbdd, 0,
sizeof(o->
nbdd));
3796#if defined(TARGET_ANDROID)
3797 o->http_proxy_port = 0;
3798 o->http_proxy = NULL;
3803 else if (
streq(p[0],
"block-outside-dns") && !p[1])
3809 else if (
streq(p[0],
"dhcp-option") && !p[1])
3817 msglvl_t msglevel_unknown = msglevel_fc;
3824 msglevel_unknown =
M_WARN;
3828 msg(msglevel_unknown,
3829 "Unrecognized option or missing or extra parameter(s) in %s:%d: -%s (%s)", file, line,
3834 msg(msglevel,
"Error occurred trying to remove %s option", p[0]);
3847 msg(msglevel,
"route parameter network/IP '%s' must be a valid address", p[1]);
3852 msg(msglevel,
"route parameter netmask '%s' must be an IP address", p[2]);
3858 msg(msglevel,
"route parameter gateway '%s' must be a valid address", p[3]);
3874 msg(msglevel,
"route-ipv6 parameter network/IP '%s' must be a valid address", p[1]);
3879 msg(msglevel,
"route-ipv6 parameter gateway '%s' must be a valid address", p[2]);
3890 if (
streq(p[1],
"search-domains") && p[2])
3895 msg(msglevel,
"--dns %s contain invalid characters", p[1]);
3899 else if (
streq(p[1],
"server") && p[2] && p[3] && p[4])
3904 msg(msglevel,
"--dns server: invalid priority value '%s'", p[2]);
3911 if (
streq(p[3],
"address"))
3913 for (
int i = 4; p[i]; ++i)
3917 msg(msglevel,
"--dns server %ld: malformed address or maximum exceeded '%s'",
3923 else if (
streq(p[3],
"resolve-domains"))
3927 msg(msglevel,
"--dns server %ld: %s contain invalid characters",
priority, p[3]);
3931 else if (
streq(p[3],
"dnssec") && !p[5])
3933 if (
streq(p[4],
"yes"))
3937 else if (
streq(p[4],
"no"))
3941 else if (
streq(p[4],
"optional"))
3947 msg(msglevel,
"--dns server %ld: malformed dnssec value '%s'",
priority, p[4]);
3951 else if (
streq(p[3],
"transport") && !p[5])
3953 if (
streq(p[4],
"plain"))
3957 else if (
streq(p[4],
"DoH"))
3961 else if (
streq(p[4],
"DoT"))
3967 msg(msglevel,
"--dns server %ld: malformed transport value '%s'",
priority, p[4]);
3971 else if (
streq(p[3],
"sni") && !p[5])
3975 msg(msglevel,
"--dns server %ld: %s contains invalid characters",
priority, p[3]);
3983 "--dns server %ld: unknown option type '%s' or missing or unknown parameter",
3990 msg(msglevel,
"--dns: unknown option type '%s' or missing or unknown parameter", p[1]);
3998 const char *file,
int line,
const int level,
const msglvl_t msglevel,
3999 const uint64_t permission_mask, uint64_t *option_types_found,
4005 if (
streq(p[0],
"route") && p[1] && !p[5])
4023 else if (
streq(p[0],
"route-ipv6") && p[1] && !p[4])
4041 else if (
streq(p[0],
"redirect-gateway") ||
streq(p[0],
"redirect-private"))
4059 else if (
streq(p[0],
"dns") && p[1])
4073#if defined(_WIN32) || defined(TARGET_ANDROID)
4074 else if (
streq(p[0],
"dhcp-option") && p[1] && !p[3])
4100#if defined(TARGET_ANDROID)
4101 o->http_proxy_port = 0;
4102 o->http_proxy = NULL;
4108 else if (
streq(p[0],
"dhcp-option") && p[1] && !p[3])
4119 option_types_found, es);
4122 msg(msglevel,
"Error occurred trying to update %s option", p[0]);
4127 const char *type,
bool in_chroot)
4132 "Multiple --%s scripts defined. "
4133 "The previously configured script is overridden.",
4136 *script = new_script;
4141 char script_name[100];
4142 snprintf(script_name,
sizeof(script_name),
"--%s script", type);
4157 msg(
M_WARN,
"WARNING: Compression for receiving enabled. "
4158 "Compression has been used in the past to break encryption. "
4159 "Compression support is deprecated and we recommend to disable "
4169 ret = ret || (
options->pkcs11_providers[0] != NULL);
4171#ifdef ENABLE_CRYPTOAPI
4178#if defined(__GNUC__) || defined(__clang__)
4179#pragma GCC diagnostic push
4180#pragma GCC diagnostic ignored "-Wsign-compare"
4185 const int level,
const msglvl_t msglevel,
const uint64_t permission_mask,
4186 uint64_t *option_types_found,
struct env_set *es)
4202 p[2] =
"setenv opt";
4210 file =
"[CMD-LINE]";
4213 if (
streq(p[0],
"help"))
4219 msg(msglevel,
"--help does not accept any parameters");
4223 if (
streq(p[0],
"version") && !p[1])
4228 else if (
streq(p[0],
"config") && p[1] && !p[2])
4239 option_types_found, es);
4242 else if (
streq(p[0],
"show-gateway") && !p[2])
4247 struct in6_addr remote_ipv6 = IN6ADDR_ANY_INIT;
4266 else if (
streq(p[0],
"echo") ||
streq(p[0],
"parameter"))
4290 if (
p[1] &&
strncmp(
p[1],
"msg", 3) == 0)
4294#ifdef ENABLE_MANAGEMENT
4303 msg(
M_WARN,
"echo/parameter option overflow");
4306#ifdef ENABLE_MANAGEMENT
4307 else if (
streq(
p[0],
"management") &&
p[1] &&
p[2] && !
p[4])
4312#if UNIX_SOCK_SUPPORT
4315 msg(msglevel,
"MANAGEMENT: this platform does not support unix domain sockets");
4327 else if (
streq(
p[0],
"management-client-user") &&
p[1] && !
p[2])
4332 else if (
streq(
p[0],
"management-client-group") &&
p[1] && !
p[2])
4337 else if (
streq(
p[0],
"management-query-passwords") && !
p[1])
4342 else if (
streq(
p[0],
"management-query-remote") && !
p[1])
4347 else if (
streq(
p[0],
"management-query-proxy") && !
p[1])
4352 else if (
streq(
p[0],
"management-hold") && !
p[1])
4357 else if (
streq(
p[0],
"management-signal") && !
p[1])
4362 else if (
streq(
p[0],
"management-forget-disconnect") && !
p[1])
4367 else if (
streq(
p[0],
"management-up-down") && !
p[1])
4372 else if (
streq(
p[0],
"management-client") && !
p[1])
4377 else if (
streq(
p[0],
"management-external-key"))
4386 else if (
streq(
p[
j],
"pkcs1"))
4394 else if (
streq(
p[
j],
"digest"))
4400 msg(msglevel,
"Unknown management-external-key flag: %s",
p[
j]);
4413 else if (
streq(
p[0],
"management-external-cert") &&
p[1] && !
p[2])
4419 else if (
streq(
p[0],
"management-client-auth") && !
p[1])
4424 else if (
streq(
p[0],
"management-log-cache") &&
p[1] && !
p[2])
4435 else if (
streq(
p[0],
"plugin") &&
p[1])
4444 msg(msglevel,
"plugin add failed: %s",
p[1]);
4449 else if (
streq(
p[0],
"mode") &&
p[1] && !
p[2])
4456 else if (
streq(
p[1],
"server"))
4462 msg(msglevel,
"Bad --mode parameter: %s",
p[1]);
4466 else if (
streq(
p[0],
"dev") &&
p[1] && !
p[2])
4471 else if (
streq(
p[0],
"dev-type") &&
p[1] && !
p[2])
4477 else if (
streq(
p[0],
"windows-driver") &&
p[1] && !
p[2])
4481 "DEPRECATED OPTION: windows-driver: In OpenVPN 2.7, the default Windows driver is ovpn-dco. "
4482 "If incompatible options are used, OpenVPN will fall back to tap-windows6. Wintun support has been removed.");
4485 else if (
streq(
p[0],
"disable-dco"))
4489 else if (
streq(
p[0],
"dev-node") &&
p[1] && !
p[2])
4494 else if (
streq(
p[0],
"lladdr") &&
p[1] && !
p[2])
4503 msg(msglevel,
"lladdr parm '%s' must be a MAC address",
p[1]);
4507 else if (
streq(
p[0],
"topology") &&
p[1] && !
p[2])
4512 else if (
streq(
p[0],
"tun-ipv6") && !
p[1])
4517 "Note: option tun-ipv6 is ignored because modern operating systems do not need special IPv6 tun handling anymore.");
4520#ifdef ENABLE_IPROUTE
4521 else if (
streq(
p[0],
"iproute") &&
p[1] && !
p[2])
4527 else if (
streq(
p[0],
"ifconfig") &&
p[1] &&
p[2] && !
p[3])
4538 msg(msglevel,
"ifconfig parms '%s' and '%s' must be valid addresses",
p[1],
p[2]);
4542 else if (
streq(
p[0],
"ifconfig-ipv6") &&
p[1] &&
p[2] && !
p[3])
4544 unsigned int netbits;
4551 msg(msglevel,
"ifconfig-ipv6: /netbits must be between 64 and 124, not '/%u'",
4562 msg(msglevel,
"ifconfig-ipv6 parms '%s' and '%s' must be valid addresses",
p[1],
p[2]);
4566 else if (
streq(
p[0],
"ifconfig-noexec") && !
p[1])
4571 else if (
streq(
p[0],
"ifconfig-nowarn") && !
p[1])
4576 else if (
streq(
p[0],
"local") &&
p[1] && !
p[4])
4588 if (strcmp(p[1],
"*") != 0)
4603 else if (
streq(p[0],
"remote-random") && !p[1])
4608 else if (
streq(p[0],
"connection") && p[1] && !p[3])
4619 option_types_found, es);
4623 "Each 'connection' block must contain exactly one 'remote' directive");
4639 else if (
streq(p[0],
"ignore-unknown-option") && p[1])
4644 const char **ignore;
4648 for (i = 1; p[i]; i++)
4668 for (j = 1; p[j]; j++)
4671 if (p[j][0] ==
'-' && p[j][1] ==
'-')
4684#if ENABLE_MANAGEMENT
4685 else if (
streq(p[0],
"http-proxy-override") && p[1] && p[2] && !p[4])
4695 else if (
streq(p[0],
"remote") && p[1] && !p[4])
4713 msg(msglevel,
"remote: bad protocol associated with host %s: '%s'", p[1], p[3]);
4734 else if (
streq(p[0],
"resolv-retry") && p[1] && !p[2])
4737 if (
streq(p[1],
"infinite"))
4746 else if ((
streq(p[0],
"preresolve") ||
streq(p[0],
"ip-remote-hint")) && !p[2])
4757 else if (
streq(p[0],
"connect-retry") && p[1] && !p[3])
4768 msg(
M_WARN,
"connect retry wait interval truncated to %d",
4778 else if ((
streq(p[0],
"connect-timeout") ||
streq(p[0],
"server-poll-timeout")) && p[1]
4784 else if (
streq(p[0],
"connect-retry-max") && p[1] && !p[2])
4789 else if (
streq(p[0],
"ipchange") && p[1])
4799 else if (
streq(p[0],
"float") && !p[1])
4805 else if (
streq(p[0],
"gremlin") && p[1] && !p[2])
4811 else if (
streq(p[0],
"chroot") && p[1] && !p[2])
4816 else if (
streq(p[0],
"cd") && p[1] && !p[2])
4821 msg(
M_ERR,
"cd to '%s' failed", p[1]);
4826#ifdef ENABLE_SELINUX
4827 else if (
streq(p[0],
"setcon") && p[1] && !p[2])
4830 options->selinux_context = p[1];
4833 else if (
streq(p[0],
"writepid") && p[1] && !p[2])
4838 else if (
streq(p[0],
"up") && p[1])
4847 else if (
streq(p[0],
"down") && p[1])
4856 else if (
streq(p[0],
"down-pre") && !p[1])
4861 else if (
streq(p[0],
"up-delay") && !p[1])
4866 else if (
streq(p[0],
"up-restart") && !p[1])
4871 else if (
streq(p[0],
"syslog") && !p[2])
4876 else if (
streq(p[0],
"daemon") && !p[2])
4890 "WARNING: Multiple --daemon directives specified, ignoring --daemon %s. (Note that initscripts sometimes add their own --daemon directive.)",
4896 else if (
streq(p[0],
"log") && p[1] && !p[2])
4902 else if (
streq(p[0],
"suppress-timestamps") && !p[1])
4908 else if (
streq(p[0],
"machine-readable-output") && !p[1])
4914 else if (
streq(p[0],
"log-append") && p[1] && !p[2])
4920 else if (
streq(p[0],
"mlock") && !p[1])
4925#if ENABLE_IP_PKTINFO
4926 else if (
streq(p[0],
"multihome") && !p[2])
4930 if (p[1] &&
streq(p[1],
"same-interface"))
4936 msg(msglevel,
"Unknown parameter to --multihome: %s", p[1]);
4940 else if (
streq(p[0],
"verb") && p[1] && !p[2])
4955 "NOTE: debug verbosity (--verb %d) is enabled but this build is "
4956 "built with --enable-small that lacks support for high --verb settings",
4961 else if (
streq(p[0],
"mute") && p[1] && !p[2])
4966 else if (
streq(p[0],
"errors-to-stderr") && !p[1])
4971 else if (
streq(p[0],
"status") && p[1] && !p[3])
4980 else if (
streq(p[0],
"status-version") && p[1] && !p[2])
4988 else if (
streq(p[0],
"remap-usr1") && p[1] && !p[2])
4991 if (
streq(p[1],
"SIGHUP"))
4995 else if (
streq(p[1],
"SIGTERM"))
5001 msg(msglevel,
"--remap-usr1 parm must be 'SIGHUP' or 'SIGTERM'");
5005 else if ((
streq(p[0],
"link-mtu") ||
streq(p[0],
"udp-mtu")) && p[1] && !p[2])
5011 else if (
streq(p[0],
"tun-mtu") && p[1] && !p[3])
5027 else if (
streq(p[0],
"tun-mtu-max") && p[1] && !p[2])
5032 else if (
streq(p[0],
"tun-mtu-extra") && p[1] && !p[2])
5040 else if (
streq(p[0],
"max-packet-size") && p[1] && !p[2])
5049 "Note: max-packet-size value outside of allowed "
5050 "control channel packet size (%d to %d), will use %d "
5060#ifdef ENABLE_FRAGMENT
5061 else if (
streq(p[0],
"mtu-dynamic"))
5064 msg(msglevel,
"--mtu-dynamic has been replaced by --fragment");
5067 else if (
streq(p[0],
"fragment") && p[1] && !p[3])
5075 if (p[2] &&
streq(p[2],
"mtu"))
5081 msg(msglevel,
"Unknown parameter to --fragment: %s", p[2]);
5085 else if (
streq(p[0],
"mtu-disc") && p[1] && !p[2])
5090 else if (
streq(p[0],
"mtu-test") && !p[1])
5095 else if (
streq(p[0],
"nice") && p[1] && !p[2])
5100 else if (
streq(p[0],
"rcvbuf") && p[1] && !p[2])
5105 else if (
streq(p[0],
"sndbuf") && p[1] && !p[2])
5110 else if (
streq(p[0],
"mark") && p[1] && !p[2])
5112#if defined(TARGET_LINUX)
5117 else if (
streq(p[0],
"socket-flags"))
5125 if (!
streq(p[j],
"TCP_NODELAY"))
5127 msg(msglevel,
"unknown socket flag: %s", p[j]);
5132 else if (
streq(p[0],
"bind-dev") && p[1])
5135 if (strlen(p[1]) < IFNAMSIZ)
5141 msg(msglevel,
"argument to --bind-dev is longer than allowed %d", IFNAMSIZ - 1);
5146 else if (
streq(p[0],
"txqueuelen") && p[1] && !p[2])
5152 msg(msglevel,
"--txqueuelen not supported on this OS");
5156 else if (
streq(p[0],
"shaper") && p[1] && !p[2])
5164 else if (
streq(p[0],
"port") && p[1] && !p[2])
5169 else if (
streq(p[0],
"lport") && p[1] && !p[2])
5174 if (!
streq(p[1],
"0"))
5180 else if (
streq(p[0],
"rport") && p[1] && !p[2])
5185 else if (
streq(p[0],
"bind") && !p[2])
5189 if (p[1] &&
streq(p[1],
"ipv6only"))
5194 else if (
streq(p[0],
"nobind") && !p[1])
5199 else if (
streq(p[0],
"fast-io") && !p[1])
5202 msg(
M_WARN,
"DEPRECATED OPTION: --fast-io option ignored.");
5204 else if (
streq(p[0],
"inactive") && p[1] && !p[3])
5214 "WARNING: '--inactive' with a 'bytes' value"
5215 " >2 Gbyte was silently ignored in older versions. If "
5216 " your VPN exits unexpectedly with 'Inactivity timeout'"
5217 " in %d seconds, revisit this value.",
5222 else if (
streq(p[0],
"session-timeout") && p[1] && !p[2])
5227 else if (
streq(p[0],
"proto") && p[1] && !p[2])
5234 msg(msglevel,
"Bad protocol: '%s'. Allowed protocols with --proto option: %s", p[1],
5241 else if (
streq(p[0],
"proto-force") && p[1] && !p[2])
5246 if (proto_force < 0)
5248 msg(msglevel,
"Bad --proto-force protocol: '%s'", p[1]);
5253 else if (
streq(p[0],
"http-proxy") && p[1] && !p[5])
5262 msg(msglevel,
"http-proxy port number not defined");
5276 if (
streq(p[3],
"auto"))
5280 else if (
streq(p[3],
"auto-nct"))
5300 else if (
streq(p[0],
"http-proxy-user-pass") && p[1])
5308 else if (
streq(p[0],
"http-proxy-retry") ||
streq(p[0],
"socks-proxy-retry") ||
streq(p[0],
"http-proxy-timeout"))
5311 msg(
M_WARN,
"DEPRECATED OPTION: %s option ignored.", p[0]);
5313 else if (
streq(p[0],
"http-proxy-option") && p[1] && !p[4])
5320 if (
streq(p[1],
"VERSION") && p[2] && !p[3])
5324 else if (
streq(p[1],
"AGENT") && p[2] && !p[3])
5328 else if ((
streq(p[1],
"EXT1") ||
streq(p[1],
"EXT2") ||
streq(p[1],
"CUSTOM-HEADER"))
5347 msg(msglevel,
"Cannot use more than %d http-proxy-option CUSTOM-HEADER : '%s'",
5354 custom_header->
name = p[2];
5355 custom_header->
content = p[3];
5360 msg(msglevel,
"Bad http-proxy-option or missing or extra parameter: '%s'", p[1]);
5363 else if (
streq(p[0],
"socks-proxy") && p[1] && !p[4])
5378 else if (
streq(p[0],
"keepalive") && p[1] && p[2] && !p[3])
5386 else if (
streq(p[0],
"ping") && p[1] && !p[2])
5392 else if (
streq(p[0],
"ping-exit") && p[1] && !p[2])
5399 else if (
streq(p[0],
"ping-restart") && p[1] && !p[2])
5406 else if (
streq(p[0],
"ping-timer-rem") && !p[1])
5411 else if (
streq(p[0],
"explicit-exit-notify") && !p[2])
5423 else if (
streq(p[0],
"persist-tun") && !p[1])
5428 else if (
streq(p[0],
"persist-key") && !p[1])
5431 msg(
M_WARN,
"DEPRECATED OPTION: --persist-key option ignored. "
5432 "Keys are now always persisted across restarts. ");
5434 else if (
streq(p[0],
"persist-local-ip") && !p[1])
5439 else if (
streq(p[0],
"persist-remote-ip") && !p[1])
5444 else if (
streq(p[0],
"client-nat") && p[1] && p[2] && p[3] && p[4] && !p[5])
5450 else if (
streq(p[0],
"route-table") && p[1] && !p[2])
5453 msg(
M_WARN,
"NOTE: --route-table is supported only on Linux when SITNL is built-in");
5458 else if (
streq(p[0],
"route") && p[1] && !p[5])
5468 else if (
streq(p[0],
"route-ipv6") && p[1] && !p[4])
5478 else if (
streq(p[0],
"max-routes") && !p[2])
5480 msg(
M_WARN,
"DEPRECATED OPTION: --max-routes option ignored.");
5482 else if (
streq(p[0],
"route-gateway") && p[1] && !p[2])
5485 if (
streq(p[1],
"dhcp"))
5498 msg(msglevel,
"route-gateway parm '%s' must be a valid address", p[1]);
5503 else if (
streq(p[0],
"route-ipv6-gateway") && p[1] && !p[2])
5511 msg(msglevel,
"route-ipv6-gateway parm '%s' must be a valid address", p[1]);
5515 else if (
streq(p[0],
"route-metric") && p[1] && !p[2])
5520 else if (
streq(p[0],
"route-delay") && !p[3])
5537 else if (
streq(p[0],
"route-up") && p[1])
5546 else if (
streq(p[0],
"route-pre-down") && p[1])
5555 else if (
streq(p[0],
"route-noexec") && !p[1])
5560 else if (
streq(p[0],
"route-nopull") && !p[1])
5565 else if (
streq(p[0],
"pull-filter") && p[1] && p[2] && !p[3])
5571 if (strcmp(
"accept", p[1]) == 0)
5575 else if (strcmp(
"ignore", p[1]) == 0)
5579 else if (strcmp(
"reject", p[1]) == 0)
5585 msg(msglevel,
"Unknown --pull-filter type: %s", p[1]);
5589 f->size = strlen(p[2]);
5591 else if (
streq(p[0],
"allow-pull-fqdn") && !p[1])
5596 else if (
streq(p[0],
"redirect-gateway") ||
streq(p[0],
"redirect-private"))
5604 msg(
M_WARN,
"WARNING: You have specified redirect-gateway and "
5605 "redirect-private at the same time (or the same option "
5606 "multiple times). This is not well supported and may lead to "
5607 "unexpected results");
5612 if (
streq(p[0],
"redirect-gateway"))
5616 for (j = 1; j <
MAX_PARMS && p[j] != NULL; ++j)
5618 if (
streq(p[j],
"local"))
5622 else if (
streq(p[j],
"autolocal"))
5626 else if (
streq(p[j],
"def1"))
5628#ifndef TARGET_ANDROID
5637 else if (
streq(p[j],
"bypass-dhcp"))
5641 else if (
streq(p[j],
"bypass-dns"))
5645 else if (
streq(p[j],
"block-local"))
5649 else if (
streq(p[j],
"ipv6"))
5654 else if (
streq(p[j],
"!ipv4"))
5660 msg(msglevel,
"unknown --%s flag: %s", p[0], p[j]);
5666 setenv_int(es,
"route_redirect_gateway_ipv4",
5671 setenv_int(es,
"route_redirect_gateway_ipv6",
5679 else if (
streq(p[0],
"block-ipv6") && !p[1])
5684 else if (
streq(p[0],
"remote-random-hostname") && !p[1])
5689 else if (
streq(p[0],
"setenv") && p[1] && !p[3])
5692 if (
streq(p[1],
"REMOTE_RANDOM_HOSTNAME") && !p[2])
5696 else if (
streq(p[1],
"GENERIC_CONFIG"))
5698 msg(msglevel,
"this is a generic configuration and cannot directly be used");
5701 else if (
streq(p[1],
"PUSH_PEER_INFO") && !p[2])
5705 else if (
streq(p[1],
"SERVER_POLL_TIMEOUT") && p[2])
5711 if (
streq(p[1],
"FORWARD_COMPATIBLE") && p[2] &&
streq(p[2],
"1"))
5718 else if (
streq(p[0],
"compat-mode") && p[1] && !p[3])
5720 unsigned int major, minor, patch;
5721 if (!(sscanf(p[1],
"%u.%u.%u", &major, &minor, &patch) == 3))
5723 msg(msglevel,
"cannot parse version number for --compat-mode: %s", p[1]);
5729 else if (
streq(p[0],
"setenv-safe") && p[1] && !p[3])
5734 else if (
streq(p[0],
"script-security") && p[1] && !p[2])
5743 else if (
streq(p[0],
"mssfix") && !p[3])
5773 if (p[2] &&
streq(p[2],
"mtu"))
5777 else if (p[2] &&
streq(p[2],
"fixed"))
5783 msg(msglevel,
"Unknown parameter to --mssfix: %s", p[2]);
5786 else if (
streq(p[0],
"disable-occ") && !p[1])
5791 else if (
streq(p[0],
"server") && p[1] && p[2] && !p[4])
5800 if (error || !network || !netmask)
5802 msg(msglevel,
"error parsing --server parameters");
5811 if (
streq(p[3],
"nopool"))
5817 msg(msglevel,
"error parsing --server: %s is not a recognized flag", p[3]);
5822 else if (
streq(p[0],
"server-ipv6") && p[1] && !p[2])
5825 struct in6_addr network;
5826 unsigned int netbits = 0;
5831 msg(msglevel,
"error parsing --server-ipv6 parameter");
5834 if (netbits < 64 || netbits > 124)
5836 msg(msglevel,
"--server-ipv6 settings: network must be between /64 and /124 (not /%u)",
5845 else if (
streq(p[0],
"server-bridge") && p[1] && p[2] && p[3] && p[4] && !p[5])
5849 in_addr_t ip, netmask, pool_start, pool_end;
5856 if (error || !ip || !netmask || !pool_start || !pool_end)
5858 msg(msglevel,
"error parsing --server-bridge parameters");
5867 else if (
streq(p[0],
"server-bridge") && p[1] &&
streq(p[1],
"nogw") && !p[2])
5873 else if (
streq(p[0],
"server-bridge") && !p[1])
5878 else if (
streq(p[0],
"push") && p[1] && !p[2])
5883 else if (
streq(p[0],
"push-reset") && !p[1])
5888 else if (
streq(p[0],
"push-remove") && p[1] && !p[2])
5894 else if (
streq(p[0],
"ifconfig-pool") && p[1] && p[2] && !p[4])
5909 msg(msglevel,
"error parsing --ifconfig-pool parameters");
5925 else if (
streq(p[0],
"ifconfig-pool-persist") && p[1] && !p[3])
5934 else if (
streq(p[0],
"ifconfig-ipv6-pool") && p[1] && !p[2])
5937 struct in6_addr network;
5938 unsigned int netbits = 0;
5943 msg(msglevel,
"error parsing --ifconfig-ipv6-pool parameters");
5946 if (netbits < 64 || netbits > 124)
5949 "--ifconfig-ipv6-pool settings: network must be between /64 and /124 (not /%u)",
5958 else if (
streq(p[0],
"hash-size") && p[1] && p[2] && !p[3])
5964 || !
atoi_constrained(p[2], &
virtual,
"hash-size virtual", 1, INT_MAX, msglevel))
5971 else if (
streq(p[0],
"connect-freq") && p[1] && p[2] && !p[3])
5976 if (!
atoi_constrained(p[1], &cf_max,
"connect-freq n", 1, INT_MAX, msglevel)
5977 || !
atoi_constrained(p[2], &cf_per,
"connect-freq seconds", 1, INT_MAX, msglevel))
5984 else if (
streq(p[0],
"connect-freq-initial") && p[1] && p[2] && !p[3])
5989 if (!
atoi_constrained(p[1], &cf_max,
"connect-freq-initial n", 1, INT_MAX, msglevel)
5990 || !
atoi_constrained(p[2], &cf_per,
"connect-freq-initial seconds", 1, INT_MAX, msglevel))
5997 else if (
streq(p[0],
"max-clients") && p[1] && !p[2])
6005 else if (
streq(p[0],
"max-routes-per-client") && p[1] && !p[2])
6010 else if (
streq(p[0],
"client-cert-not-required") && !p[1])
6014 "REMOVED OPTION: --client-cert-not-required, use '--verify-client-cert none' instead");
6016 else if (
streq(p[0],
"verify-client-cert") && !p[2])
6025 if (
streq(p[1],
"none"))
6029 else if (
streq(p[1],
"optional"))
6033 else if (!
streq(p[1],
"require"))
6036 "parameter to --verify-client-cert must be 'none', 'optional' or 'require'");
6041 else if (
streq(p[0],
"username-as-common-name") && !p[1])
6046 else if (
streq(p[0],
"auth-user-pass-optional") && !p[1])
6051 else if (
streq(p[0],
"opt-verify") && !p[1])
6054 msg(
M_INFO,
"DEPRECATED OPTION: --opt-verify was removed in OpenVPN 2.7.");
6056 else if (
streq(p[0],
"auth-user-pass-verify") && p[1])
6065 if (
streq(p[2],
"via-env"))
6069 else if (
streq(p[2],
"via-file"))
6076 "second parm to --auth-user-pass-verify must be 'via-env' or 'via-file'");
6083 "--auth-user-pass-verify requires a second parameter ('via-env' or 'via-file')");
6087 "auth-user-pass-verify",
true);
6089 else if (
streq(p[0],
"auth-gen-token"))
6095 for (
int i = 2; i <
MAX_PARMS && p[i] != NULL; i++)
6102 else if (
streq(p[i],
"external-auth"))
6108 msg(msglevel,
"Invalid argument to auth-gen-token: %s (%d)", p[i], i);
6112 else if (
streq(p[0],
"auth-gen-token-secret") && p[1] && !p[2])
6118 else if (
streq(p[0],
"client-connect") && p[1])
6127 else if (
streq(p[0],
"client-crresponse") && p[1])
6137 else if (
streq(p[0],
"client-disconnect") && p[1])
6147 else if (
streq(p[0],
"learn-address") && p[1])
6156 else if (
streq(p[0],
"tmp-dir") && p[1] && !p[2])
6161 else if (
streq(p[0],
"client-config-dir") && p[1] && !p[2])
6166 else if (
streq(p[0],
"ccd-exclusive") && !p[1])
6171 else if (
streq(p[0],
"bcast-buffers") && p[1] && !p[2])
6176 else if (
streq(p[0],
"tcp-queue-limit") && p[1] && !p[2])
6182 else if (
streq(p[0],
"port-share") && p[1] && p[2] && !p[4])
6185 options->port_share_host = p[1];
6186 options->port_share_port = p[2];
6187 options->port_share_journal_dir = p[3];
6190 else if (
streq(p[0],
"client-to-client") && !p[1])
6195 else if (
streq(p[0],
"duplicate-cn") && !p[1])
6200 else if (
streq(p[0],
"iroute") && p[1] && !p[3])
6205 else if (
streq(p[0],
"iroute-ipv6") && p[1] && !p[2])
6210 else if (
streq(p[0],
"ifconfig-push") && p[1] && p[2] && !p[4])
6217 if (local && remote_netmask)
6230 msg(msglevel,
"cannot parse --ifconfig-push addresses");
6234 else if (
streq(p[0],
"ifconfig-push-constraint") && p[1] && p[2] && !p[3])
6241 if (network && netmask)
6249 msg(msglevel,
"cannot parse --ifconfig-push-constraint addresses");
6253 else if (
streq(p[0],
"ifconfig-ipv6-push") && p[1] && !p[3])
6255 struct in6_addr local, remote;
6256 unsigned int netbits;
6262 msg(msglevel,
"cannot parse --ifconfig-ipv6-push addresses");
6270 msg(msglevel,
"cannot parse --ifconfig-ipv6-push addresses");
6280 "second argument to --ifconfig-ipv6-push missing and no global --ifconfig-ipv6 address set");
6291 else if (
streq(p[0],
"disable") && !p[1])
6296 else if (
streq(p[0],
"override-username") && p[1] && !p[2])
6302 "override-username exceeds the maximum length of %d "
6315 else if (
streq(p[0],
"tcp-nodelay") && !p[1])
6320 else if (
streq(p[0],
"stale-routes-check") && p[1] && !p[3])
6322 int ageing_time, check_interval;
6325 if (!
atoi_constrained(p[1], &ageing_time,
"stale-routes-check age", 1, INT_MAX, msglevel))
6333 "stale-routes-check interval", 1, INT_MAX, msglevel))
6340 check_interval = ageing_time;
6347 else if (
streq(p[0],
"client") && !p[1])
6352 else if (
streq(p[0],
"pull") && !p[1])
6357 else if (
streq(p[0],
"push-continuation") && p[1] && !p[2])
6362 else if (
streq(p[0],
"auth-user-pass") && !p[2])
6366 if (p[1] &&
streq(p[1],
"username-only"))
6381 else if (
streq(p[0],
"auth-retry") && p[1] && !p[2])
6386#ifdef ENABLE_MANAGEMENT
6387 else if (
streq(p[0],
"static-challenge") && p[1] && p[2] && !p[4])
6395 if (p[3] &&
streq(p[3],
"concat"))
6399 else if (p[3] && !
streq(p[3],
"scrv1"))
6401 msg(msglevel,
"--static-challenge: unknown format indicator '%s'", p[3]);
6406 else if (
streq(p[0],
"msg-channel") && p[1])
6410 HANDLE process = GetCurrentProcess();
6411 HANDLE handle = (HANDLE)((intptr_t)atoll(p[1]));
6413 DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS))
6415 msg(msglevel,
"could not duplicate service pipe handle");
6420 msg(msglevel,
"--msg-channel is only supported on Windows");
6425 else if (
streq(p[0],
"win-sys") && p[1] && !p[2])
6428 if (
streq(p[1],
"env"))
6430 msg(
M_INFO,
"NOTE: --win-sys env is default from OpenVPN 2.3. "
6431 "This entry will now be ignored. "
6432 "Please remove this entry from your configuration file.");
6439 else if (
streq(p[0],
"route-method") && p[1] && !p[2])
6442 if (
streq(p[1],
"adaptive"))
6446 else if (
streq(p[1],
"ipapi"))
6450 else if (
streq(p[1],
"exe"))
6456 msg(msglevel,
"--route method must be 'adaptive', 'ipapi', or 'exe'");
6460 else if (
streq(p[0],
"ip-win32") && p[1] && !p[4])
6469 msg(msglevel,
"Bad --ip-win32 method: '%s'. Allowed methods: %s", p[1],
6483 if (!
streq(p[2],
"default"))
6487 if (!
atoi_constrained(p[2], &offset,
"ip-win32 offset", -256, 256, msglevel))
6498 "ip-win32 lease time", 30, INT_MAX, msglevel))
6509 else if (
streq(p[0],
"dns-updown") && p[1])
6517 if (
streq(p[1],
"disable"))
6522 else if (
streq(p[1],
"force"))
6527 dns->
updown = DEFAULT_DNS_UPDOWN;
6542 else if (
streq(p[0],
"dns") && p[1])
6550 else if (
streq(p[0],
"dhcp-option") && p[1])
6553#if defined(_WIN32) || defined(TARGET_ANDROID)
6558 bool dhcp_optional =
false;
6560 if ((
streq(p[1],
"DOMAIN") ||
streq(p[1],
"ADAPTER_DOMAIN_SUFFIX")) && p[2] && !p[3])
6564 msg(msglevel,
"--dhcp-option %s contains invalid characters", p[1]);
6568 dhcp->domain = p[2];
6569 dhcp_optional =
true;
6571 else if (
streq(p[1],
"DOMAIN-SEARCH") && p[2] && !p[3])
6575 msg(msglevel,
"--dhcp-option %s contains invalid characters", p[1]);
6581 dhcp->domain_search_list[
dhcp->domain_search_list_len++] = p[2];
6585 msg(msglevel,
"--dhcp-option %s: maximum of %d search entries can be specified",
6588 dhcp_optional =
true;
6590 else if ((
streq(p[1],
"DNS") ||
streq(p[1],
"DNS6")) && p[2] && !p[3]
6593 if (strstr(p[2],
":"))
6600 dhcp_optional =
true;
6603#if defined(_WIN32) || defined(TARGET_ANDROID)
6604 else if (
streq(p[1],
"NBS") && p[2] && !p[3])
6609 else if (
streq(p[1],
"NBT") && p[2] && !p[3])
6612 if (!(t == 1 || t == 2 || t == 4 || t == 8))
6614 msg(msglevel,
"--dhcp-option NBT: parameter (%d) must be 1, 2, 4, or 8", t);
6620 else if (
streq(p[1],
"WINS") && p[2] && !p[3])
6625 else if (
streq(p[1],
"NTP") && p[2] && !p[3])
6630 else if (
streq(p[1],
"NBDD") && p[2] && !p[3])
6635 else if (
streq(p[1],
"DISABLE-NBT") && !p[2])
6640#if defined(TARGET_ANDROID)
6641 else if (
streq(p[1],
"PROXY_HTTP") && p[3] && !p[4])
6644 o->http_proxy = p[2];
6649 msg(msglevel,
"--dhcp-option: unknown option type '%s' or missing or unknown parameter",
6654 setenv_foreign_option(
options, p[1], p[2], es);
6659#if defined(_WIN32) || defined(TARGET_ANDROID)
6665 else if (
streq(p[0],
"show-adapters") && !p[1])
6671 else if (
streq(p[0],
"show-net") && !p[1])
6678 else if (
streq(p[0],
"show-net-up") && !p[1])
6683 else if (
streq(p[0],
"tap-sleep") && p[1] && !p[2])
6691 else if (
streq(p[0],
"dhcp-renew") && !p[1])
6696 else if (
streq(p[0],
"dhcp-pre-release") && !p[1])
6702 else if (
streq(p[0],
"dhcp-release") && !p[1])
6704 msg(
M_WARN,
"Obsolete option --dhcp-release detected. This is now on by default");
6706 else if (
streq(p[0],
"dhcp-internal") && p[1] && !p[2])
6708 unsigned int adapter_index;
6711 adapter_index =
atou(p[1]);
6723 else if (
streq(p[0],
"register-dns") && !p[1])
6728 else if (
streq(p[0],
"block-outside-dns") && !p[1])
6733 else if (
streq(p[0],
"rdns-internal") && !p[1])
6749 else if (
streq(p[0],
"show-valid-subnets") && !p[1])
6755 else if (
streq(p[0],
"pause-exit") && !p[1])
6760 else if (
streq(p[0],
"service") && p[1] && !p[3])
6769 else if (
streq(p[0],
"allow-nonadmin") && !p[2])
6775 else if (
streq(p[0],
"user") && p[1] && !p[2])
6778 msg(
M_WARN,
"NOTE: --user option is not implemented on Windows");
6780 else if (
streq(p[0],
"group") && p[1] && !p[2])
6783 msg(
M_WARN,
"NOTE: --group option is not implemented on Windows");
6786 else if (
streq(p[0],
"user") && p[1] && !p[2])
6791 else if (
streq(p[0],
"group") && p[1] && !p[2])
6796 else if (
streq(p[0],
"dhcp-option") && p[1] && !p[3])
6799 setenv_foreign_option(
options, p[1], p[2], es);
6801 else if (
streq(p[0],
"route-method") && p[1] && !p[2])
6807#if PASSTOS_CAPABILITY
6808 else if (
streq(p[0],
"passtos") && !p[1])
6814 else if (
streq(p[0],
"allow-compression") && p[1] && !p[2])
6818 if (
streq(p[1],
"no"))
6823 msg(msglevel,
"'--allow-compression no' conflicts with "
6824 " enabling compression");
6831 "Cannot set allow-compression to '%s' "
6832 "after set to 'no'",
6836 else if (
streq(p[1],
"asym"))
6840 else if (
streq(p[1],
"yes"))
6843 "DEPRECATED OPTION: \"--allow-compression yes\" has been removed. "
6844 "We will use \"asym\" mode instead. See the manual page for more information.");
6851 "bad allow-compression option: %s -- "
6852 "must be 'yes', 'no', or 'asym'",
6857 else if (
streq(p[0],
"comp-lzo") && !p[2])
6867 if (
streq(p[1],
"no"))
6875 else if (!(
streq(p[1],
"yes") ||
streq(p[1],
"adaptive")))
6877 msg(msglevel,
"bad comp-lzo option: %s -- must be 'yes', 'no', or 'adaptive'",
6884 else if (
streq(p[0],
"comp-noadapt") && !p[1])
6888 else if (
streq(p[0],
"compress") && !p[2])
6891 const char *alg =
"stub";
6897 if (
streq(alg,
"stub"))
6902 else if (
streq(alg,
"stub-v2"))
6907 else if (
streq(alg,
"migrate"))
6912 else if (
streq(alg,
"lzo"))
6917 else if (
streq(alg,
"lz4"))
6922 else if (
streq(alg,
"lz4-v2"))
6928 msg(msglevel,
"bad comp option: %s", alg);
6934 else if (
streq(p[0],
"show-ciphers") && !p[1])
6939 else if (
streq(p[0],
"show-digests") && !p[1])
6944 else if (
streq(p[0],
"show-engines") && !p[1])
6949 else if (
streq(p[0],
"key-direction") && p[1] && !p[2])
6956 if (key_direction >= 0)
6972 else if (
streq(p[0],
"secret") && p[1] && !p[3])
6974 msg(
M_WARN,
"DEPRECATED OPTION: The option --secret is deprecated.");
6978 if (!is_inline && p[2])
6983 if (key_direction >= 0)
6993 else if (
streq(p[0],
"allow-deprecated-insecure-static-crypto"))
6998 else if (
streq(p[0],
"genkey") && !p[4])
7008 if (
streq(p[1],
"secret") ||
streq(p[1],
"tls-auth") ||
streq(p[1],
"tls-crypt"))
7012 else if (
streq(p[1],
"tls-crypt-v2-server"))
7016 else if (
streq(p[1],
"tls-crypt-v2-client"))
7024 else if (
streq(p[1],
"auth-token"))
7030 msg(msglevel,
"unknown --genkey type: %s", p[1]);
7038 else if (
streq(p[0],
"auth") && p[1] && !p[2])
7043 else if (
streq(p[0],
"cipher") && p[1] && !p[2])
7048 else if (
streq(p[0],
"data-ciphers-fallback") && p[1] && !p[2])
7054 else if ((
streq(p[0],
"data-ciphers") ||
streq(p[0],
"ncp-ciphers")) && p[1] && !p[2])
7057 if (
streq(p[0],
"ncp-ciphers"))
7059 msg(
M_INFO,
"Note: Treating option '--ncp-ciphers' as "
7060 " '--data-ciphers' (renamed in OpenVPN 2.5).");
7064 else if (
streq(p[0],
"key-derivation") && p[1])
7069 if (
streq(p[1],
"tls-ekm"))
7075 msg(msglevel,
"Unknown key-derivation method %s", p[1]);
7078 else if (
streq(p[0],
"protocol-flags") && p[1])
7084 for (
size_t j = 1; j <
MAX_PARMS && p[j] != NULL; j++)
7086 if (
streq(p[j],
"cc-exit"))
7090 else if (
streq(p[j],
"tls-ekm"))
7094 else if (
streq(p[j],
"dyn-tls-crypt"))
7098 else if (
streq(p[j],
"aead-epoch"))
7104 msg(msglevel,
"Unknown protocol-flags flag: %s", p[j]);
7108 else if (
streq(p[0],
"force-tls-key-material-export"))
7113 else if (
streq(p[0],
"prng") && p[1] && !p[3])
7115 msg(
M_WARN,
"NOTICE: --prng option ignored (SSL library PRNG is used)");
7117 else if (
streq(p[0],
"no-replay") && !p[1])
7121 msg(
M_FATAL,
"--no-replay was removed in OpenVPN 2.7. "
7122 "Update your configuration.");
7124 else if (
streq(p[0],
"replay-window") && !p[3])
7146 msg(msglevel,
"replay-window option is missing window size parameter");
7150 else if (
streq(p[0],
"mute-replay-warnings") && !p[1])
7155 else if (
streq(p[0],
"replay-persist") && p[1] && !p[2])
7160 else if (
streq(p[0],
"test-crypto") && !p[1])
7165#ifndef ENABLE_CRYPTO_MBEDTLS
7166 else if (
streq(p[0],
"engine") && !p[2])
7179 else if (
streq(p[0],
"providers") && p[1])
7181 for (
size_t j = 1; j <
MAX_PARMS && p[j] != NULL; j++)
7186 else if (
streq(p[0],
"show-tls") && !p[1])
7191 else if ((
streq(p[0],
"show-curves") ||
streq(p[0],
"show-groups")) && !p[1])
7196 else if (
streq(p[0],
"ecdh-curve") && p[1] && !p[2])
7199 msg(
M_WARN,
"Consider setting groups/curves preference with "
7200 "tls-groups instead of forcing a specific curve with "
7204 else if (
streq(p[0],
"tls-server") && !p[1])
7209 else if (
streq(p[0],
"tls-client") && !p[1])
7214 else if (
streq(p[0],
"ca") && p[1] && !p[2])
7220#ifndef ENABLE_CRYPTO_MBEDTLS
7221 else if (
streq(p[0],
"capath") && p[1] && !p[2])
7227 else if (
streq(p[0],
"dh") && p[1] && !p[2])
7233 else if (
streq(p[0],
"cert") && p[1] && !p[2])
7239 else if (
streq(p[0],
"extra-certs") && p[1] && !p[2])
7245 else if ((
streq(p[0],
"verify-hash") && p[1] && !p[3])
7246 || (
streq(p[0],
"peer-fingerprint") && p[1] && !p[2]))
7250 int verify_hash_depth = 0;
7251 if (
streq(p[0],
"verify-hash"))
7253 msg(
M_WARN,
"DEPRECATED OPTION: The option --verify-hash is deprecated. "
7254 "You should switch to the either use the level 1 certificate as "
7255 "--ca option, use --tls-verify or use --peer-fingerprint");
7257 verify_hash_depth = 1;
7267 "ERROR: Setting %s not allowed. --verify-hash and"
7268 " --peer-fingerprint are mutually exclusive",
7273 if (
streq(p[0],
"verify-hash"))
7275 if ((!p[2] && !is_inline) || (p[2] &&
streq(p[2],
"SHA1")))
7280 else if (p[2] && !
streq(p[2],
"SHA256"))
7283 "invalid or unsupported hashing algorithm: %s "
7284 "(only SHA1 and SHA256 are supported)",
7304 while (listend->
next)
7306 listend = listend->
next;
7308 listend->
next = newlist;
7311#if defined(ENABLE_CRYPTOAPI) && defined(HAVE_XKEY_PROVIDER)
7312 else if (
streq(p[0],
"cryptoapicert") && p[1] && !p[2])
7318 else if (
streq(p[0],
"key") && p[1] && !p[2])
7324 else if (
streq(p[0],
"tls-version-min") && p[1] && !p[3])
7330 msg(msglevel,
"unknown tls-version-min parameter: %s", p[1]);
7334#ifdef ENABLE_CRYPTO_MBEDTLS
7337 msg(
M_WARN,
"--tls-version-min %s is not supported by mbedtls, using 1.2", p[1]);
7345 else if (
streq(p[0],
"tls-version-max") && p[1] && !p[2])
7351 msg(msglevel,
"unknown tls-version-max parameter: %s", p[1]);
7357#ifndef ENABLE_CRYPTO_MBEDTLS
7358 else if (
streq(p[0],
"pkcs12") && p[1] && !p[2])
7365 else if (
streq(p[0],
"askpass") && !p[2])
7377 else if (
streq(p[0],
"auth-nocache") && !p[1])
7382 else if (
streq(p[0],
"auth-token") && p[1] && !p[2])
7386#ifdef ENABLE_MANAGEMENT
7393 else if (
streq(p[0],
"auth-token-user") && p[1] && !p[2])
7398 else if (
streq(p[0],
"single-session") && !p[1])
7403 else if (
streq(p[0],
"push-peer-info") && !p[1])
7408 else if (
streq(p[0],
"tls-exit") && !p[1])
7413 else if (
streq(p[0],
"tls-cipher") && p[1] && !p[2])
7418 else if (
streq(p[0],
"tls-cert-profile") && p[1] && !p[2])
7423 else if (
streq(p[0],
"tls-ciphersuites") && p[1] && !p[2])
7428 else if (
streq(p[0],
"tls-groups") && p[1] && !p[2])
7433 else if (
streq(p[0],
"crl-verify") && p[1] && ((p[2] &&
streq(p[2],
"dir")) || !p[2]))
7436 if (p[2] &&
streq(p[2],
"dir"))
7443 else if (
streq(p[0],
"tls-verify") && p[1])
7453 else if (
streq(p[0],
"tls-export-cert") && p[1] && !p[2])
7458 else if (
streq(p[0],
"compat-names"))
7461 msg(msglevel,
"--compat-names was removed in OpenVPN 2.5. "
7462 "Update your configuration.");
7465 else if (
streq(p[0],
"no-name-remapping") && !p[1])
7468 msg(msglevel,
"--no-name-remapping was removed in OpenVPN 2.5. "
7469 "Update your configuration.");
7472 else if (
streq(p[0],
"verify-x509-name") && p[1] && strlen(p[1]) && !p[3])
7478 if (
streq(p[2],
"subject"))
7482 else if (
streq(p[2],
"name"))
7486 else if (
streq(p[2],
"name-prefix"))
7492 msg(msglevel,
"unknown X.509 name type: %s", p[2]);
7499 else if (
streq(p[0],
"ns-cert-type") && p[1] && !p[2])
7501#ifdef ENABLE_CRYPTO_MBEDTLS
7502 msg(msglevel,
"--ns-cert-type is not available with mbedtls.");
7506 if (
streq(p[1],
"server"))
7510 else if (
streq(p[1],
"client"))
7516 msg(msglevel,
"--ns-cert-type must be 'client' or 'server'");
7521 else if (
streq(p[0],
"remote-cert-ku"))
7526 for (j = 1; j <
MAX_PARMS && p[j] != NULL; ++j)
7536 else if (
streq(p[0],
"remote-cert-eku") && p[1] && !p[2])
7541 else if (
streq(p[0],
"remote-cert-tls") && p[1] && !p[2])
7545 if (
streq(p[1],
"server"))
7550 else if (
streq(p[1],
"client"))
7557 msg(msglevel,
"--remote-cert-tls must be 'client' or 'server'");
7561 else if (
streq(p[0],
"tls-timeout") && p[1] && !p[2])
7573 else if (
streq(p[0],
"reneg-bytes") && p[1] && !p[2])
7581 else if (
streq(p[0],
"reneg-pkts") && p[1] && !p[2])
7589 else if (
streq(p[0],
"reneg-sec") && p[1] && !p[3])
7598 else if (
streq(p[0],
"hand-window") && p[1] && !p[2])
7603 else if (
streq(p[0],
"tran-window") && p[1] && !p[2])
7608 else if (
streq(p[0],
"tls-auth") && p[1] && !p[3])
7610 int key_direction = -1;
7619 if (!is_inline && p[2])
7622 if (key_direction < 0)
7635 if (!is_inline && p[2])
7638 if (key_direction < 0)
7646 else if (
streq(p[0],
"tls-crypt") && p[1] && !p[3])
7660 else if (
streq(p[0],
"tls-crypt-v2") && p[1] && !p[3])
7674 if (p[2] &&
streq(p[2],
"force-cookie"))
7678 else if (p[2] &&
streq(p[2],
"allow-noncookie"))
7684 msg(msglevel,
"Unsupported tls-crypt-v2 argument: %s", p[2]);
7687 else if (
streq(p[0],
"tls-crypt-v2-verify") && p[1] && !p[2])
7692 else if (
streq(p[0],
"tls-crypt-v2-max-age") && p[1])
7700 else if (
streq(p[0],
"x509-track") && p[1] && !p[2])
7705 else if (
streq(p[0],
"x509-username-field") && p[1])
7708 for (
size_t j = 1; j <
MAX_PARMS && p[j] != NULL; ++j)
7714 msg(msglevel,
"Unsupported x509-username-field extension: %s", s);
7720 else if (
streq(p[0],
"show-pkcs11-ids") && !p[3])
7722 const char *provider = p[1];
7723 bool cert_private = (p[2] == NULL ? false : (
atoi_warn(p[2], msglevel) != 0));
7725#ifdef DEFAULT_PKCS11_MODULE
7728 provider = DEFAULT_PKCS11_MODULE;
7733 long i = strtol(provider, &endp, 10);
7739 provider = DEFAULT_PKCS11_MODULE;
7746 msg(msglevel,
"--show-pkcs11-ids requires a provider parameter");
7753 show_pkcs11_ids(provider, cert_private);
7756 else if (
streq(p[0],
"pkcs11-providers") && p[1])
7762 for (j = 1; j <
MAX_PARMS && p[j] != NULL; ++j)
7764 options->pkcs11_providers[j - 1] = p[j];
7767 else if (
streq(p[0],
"pkcs11-protected-authentication"))
7773 for (j = 1; j <
MAX_PARMS && p[j] != NULL; ++j)
7775 options->pkcs11_protected_authentication[j - 1] =
7779 else if (
streq(p[0],
"pkcs11-private-mode") && p[1])
7785 for (j = 1; j <
MAX_PARMS && p[j] != NULL; ++j)
7787 sscanf(p[j],
"%x", &(
options->pkcs11_private_mode[j - 1]));
7790 else if (
streq(p[0],
"pkcs11-cert-private"))
7796 for (j = 1; j <
MAX_PARMS && p[j] != NULL; ++j)
7801 else if (
streq(p[0],
"pkcs11-pin-cache") && p[1] && !p[2])
7806 else if (
streq(p[0],
"pkcs11-id") && p[1] && !p[2])
7811 else if (
streq(p[0],
"pkcs11-id-management") && !p[1])
7814 options->pkcs11_id_management =
true;
7817 else if (
streq(p[0],
"rmtun") && !p[1])
7823 else if (
streq(p[0],
"mktun") && !p[1])
7829 else if (
streq(p[0],
"peer-id") && p[1] && !p[2])
7835 else if (
streq(p[0],
"keying-material-exporter") && p[1] && p[2])
7839 if (strncmp(p[1],
"EXPORTER", 8))
7841 msg(msglevel,
"Keying material exporter label must begin with "
7852 p[0], 16, 4095, msglevel))
7859 else if (
streq(p[0],
"allow-recursive-routing") && !p[1])
7864 else if (
streq(p[0],
"vlan-tagging") && !p[1])
7869 else if (
streq(p[0],
"vlan-accept") && p[1] && !p[2])
7872 if (
streq(p[1],
"tagged"))
7876 else if (
streq(p[1],
"untagged"))
7880 else if (
streq(p[1],
"all"))
7886 msg(msglevel,
"--vlan-accept must be 'tagged', 'untagged' or 'all'");
7890 else if (
streq(p[0],
"vlan-pvid") && p[1] && !p[2])
7904 msglvl_t msglevel_unknown = msglevel_fc;
7911 msglevel_unknown =
M_WARN;
7917 msg(msglevel_unknown,
7918 "Unrecognized option or missing or extra parameter(s) in %s:%d: %s (%s)", file,
7923 msg(msglevel_unknown,
"Unrecognized option or missing or extra parameter(s): --%s (%s)",
7931#if defined(__GNUC__) || defined(__clang__)
7932#pragma GCC diagnostic pop
void buf_clear(struct buffer *buf)
Zeroise and reset a buffer.
bool buf_printf(struct buffer *buf, const char *format,...)
printf-style append to a buffer with overflow check.
void gc_transfer(struct gc_arena *dest, struct gc_arena *src)
Move all allocations from one garbage collection arena to another.
void * gc_realloc(void *ptr, size_t size, struct gc_arena *a)
allows to realloc a pointer previously allocated by gc_malloc or gc_realloc
bool string_defined_equal(const char *s1, const char *s2)
void * gc_malloc(size_t size, bool clear, struct gc_arena *a)
Allocate memory and, optionally, zero it.
struct buffer alloc_buf_gc(size_t size, struct gc_arena *gc)
Allocate a buffer of the given size under garbage collection.
int string_array_len(const char **array)
Return the number of elements in a NULL-terminated array of strings.
struct buffer buffer_read_from_file(const char *filename, struct gc_arena *gc)
buffer_read_from_file - copy the content of a file into a buffer
char * string_substitute(const char *src, char from, char to, struct gc_arena *gc)
char * string_alloc(const char *str, struct gc_arena *gc)
Duplicate a string, allocating memory under garbage collection.
Buffer management functions and garbage collection.
static void gc_detach(struct gc_arena *a)
Detach all allocations from an arena without freeing them.
#define BSTR(buf)
Return the buffer content pointer cast to char *.
#define ALLOC_ARRAY_GC(dptr, type, n, gc)
Allocate a garbage-collected array of n elements of the given type.
static bool buf_valid(const struct buffer *buf)
Return true iff buf is valid.
static void gc_init(struct gc_arena *a)
Initialise a garbage collection arena to an empty state.
#define ALLOC_OBJ_CLEAR_GC(dptr, type, gc)
Allocate and zero-initialise a garbage-collected object of the given type.
#define ALLOC_OBJ_GC(dptr, type, gc)
Allocate a garbage-collected object of the given type (uninitialised).
static void gc_free(struct gc_arena *a)
Free all allocations in a garbage collection arena.
static struct gc_arena gc_new(void)
Allocate and return a new, empty garbage collection arena.
bool check_cmd_access(const char *command, const char *opt, const char *chroot)
Verifies that the path in the "command" that comes after certain script options (e....
void options_postprocess_filechecks(struct options *options)
Sanity check of all file/dir options.
void add_client_nat_to_option_list(struct client_nat_option_list *dest, const char *type, const char *network, const char *netmask, const char *foreign_network, msglvl_t msglevel)
struct client_nat_option_list * new_client_nat_list(struct gc_arena *gc)
struct client_nat_option_list * clone_client_nat_option_list(const struct client_nat_option_list *src, struct gc_arena *gc)
void copy_client_nat_option_list(struct client_nat_option_list *dest, const struct client_nat_option_list *src)
#define TLS_CHANNEL_BUF_SIZE
#define TLS_CHANNEL_MTU_MIN
bool check_compression_settings_valid(struct compress_options *info, msglvl_t msglevel)
Checks if the compression settings are valid.
#define COMP_F_ALLOW_STUB_ONLY
Only accept stub compression, even with COMP_F_ADVERTISE_STUBS_ONLY we still accept other compression...
#define COMP_F_SWAP
initial command byte is swapped with last byte in buffer to preserve payload alignment
#define COMP_ALG_LZ4
LZ4 algorithm.
#define COMP_F_ALLOW_NOCOMP_ONLY
Do not allow compression framing (breaks DCO)
#define COMP_F_ALLOW_ASYM
Compression was explicitly set to allow asymetric compression.
#define COMP_ALGV2_UNCOMPRESSED
#define COMP_ALG_STUB
support compression command byte and framing without actual compression
#define COMP_ALG_LZO
LZO algorithm.
#define COMP_F_ADVERTISE_STUBS_ONLY
tell server that we only support compression stubs
#define COMP_F_MIGRATE
push stub-v2 or comp-lzo no when we see a client with comp-lzo in occ
static bool comp_non_stub_enabled(const struct compress_options *info)
char * strsep(char **stringp, const char *delim)
#define CONFIGURE_DEFINES
int ascii2keydirection(msglvl_t msglevel, const char *str)
bool check_tls_prf_working(void)
Checks if the current TLS library supports the TLS 1.0 PRF with MD5+SHA1 that OpenVPN uses when TLS K...
Data Channel Cryptography Module.
#define CO_USE_TLS_KEY_MATERIAL_EXPORT
Bit-flag indicating that data channel key derivation is done using TLS keying material export [RFC570...
#define CO_USE_DYNAMIC_TLS_CRYPT
Bit-flag indicating that renegotiations are using tls-crypt with a TLS-EKM derived key.
#define CO_EPOCH_DATA_KEY_FORMAT
Bit-flag indicating the epoch the data format.
#define KEY_DIRECTION_BIDIRECTIONAL
#define CO_USE_CC_EXIT_NOTIFY
Bit-flag indicating that explicit exit notifies should be sent via the control channel instead of usi...
#define SHA_DIGEST_LENGTH
#define SHA256_DIGEST_LENGTH
static bool dco_check_startup_option(msglvl_t msglevel, const struct options *o)
static bool dco_check_option(msglvl_t msglevel, const struct options *o)
static const char * dco_version_string(struct gc_arena *gc)
bool dns_options_verify(msglvl_t msglevel, const struct dns_options *o)
Checks validity of DNS options.
void dns_options_postprocess_pull(struct dns_options *o)
Merges pulled DNS servers with static ones into an ordered list.
bool dns_server_addr_parse(struct dns_server *server, const char *addr)
Parses a string IPv4 or IPv6 address and optional colon separated port, into a in_addr or in6_addr re...
bool dns_domain_list_append(struct dns_domain **entry, char **domains, struct gc_arena *gc)
Appends safe DNS domain parameters to a linked list.
struct dns_server * dns_server_get(struct dns_server **entry, long priority, struct gc_arena *gc)
Find or create DNS server with priority in a linked list.
bool dns_server_priority_parse(long *priority, const char *str, bool pulled)
Parses a string DNS server priority and validates it.
struct dns_options clone_dns_options(const struct dns_options *o, struct gc_arena *gc)
Makes a deep copy of the passed DNS options.
void dns_options_preprocess_pull(struct dns_options *o)
Saves and resets the server options, so that pulled ones don't mix in.
static bool dns_updown_user_set(const struct dns_options *o)
Returns whether dns-updown is user defined.
static bool dns_updown_forced(const struct dns_options *o)
Returns whether dns-updown is forced to run.
static bool validate_domain(const char *domain)
void setenv_int(struct env_set *es, const char *name, int value)
void setenv_str_i(struct env_set *es, const char *name, const char *value, const int i)
void setenv_str(struct env_set *es, const char *name, const char *value)
const char * env_set_get(const struct env_set *es, const char *name)
void setenv_str_safe(struct env_set *es, const char *name, const char *value)
bool env_set_del(struct env_set *es, const char *str)
void setenv_long_long(struct env_set *es, const char *name, long long value)
Interface functions to the internal and external multiplexers.
#define RELIABLE_MAX_INITIAL_TIMEOUT
Maximum initial timeout (–tls-timeout) we accept.
void helper_setdefault_topology(struct options *o)
Set –topology default depending on –mode.
void helper_tcp_nodelay(struct options *o)
void helper_client_server(struct options *o)
void helper_keepalive(struct options *o)
static int max_int(int x, int y)
static int constrain_int(int x, int min, int max)
static int tls_verify(struct openvpn_plugin_args_func_in const *args)
void management_auth_token(const char *token)
void management_echo(struct management *man, const char *string, const bool pull)
#define MF_FORGET_DISCONNECT
#define MF_EXTERNAL_KEY_PKCS1PAD
#define MF_EXTERNAL_KEY_PSSPAD
#define MF_EXTERNAL_KEY_NOPADDING
#define MF_QUERY_PASSWORDS
#define MF_EXTERNAL_KEY_DIGEST
#define MF_CONNECT_AS_CLIENT
int translate_mtu_discover_type_name(const char *name)
#define TAP_MTU_EXTRA_DEFAULT
#define TUN_MTU_MAX
Maximum MTU we accept for MTU related options.
static bool learn_address_script(const struct multi_context *m, const struct multi_instance *mi, const char *op, const struct mroute_addr *addr)
static int net_ctx_init(struct context *c, openvpn_net_ctx_t *ctx)
void errors_to_stderr(void)
void open_syslog(const char *pgmname, bool stdio_to_null)
void redirect_stdout_stderr(const char *file, bool append)
void openvpn_exit(const int status)
void set_suppress_timestamps(bool suppressed)
void set_machine_readable_output(bool parsable)
FILE * msg_fp(const msglvl_t flags)
bool set_debug_level(const int level, const unsigned int flags)
#define OPENVPN_EXIT_STATUS_USAGE
#define OPENVPN_EXIT_STATUS_GOOD
#define RESET_OPTION_ROUTES(option_ptr, field)
static void rol6_check_alloc(struct options *options)
static void options_postprocess_verify_ce(const struct options *options, const struct connection_entry *ce)
static void options_postprocess_mutate_ce(struct options *o, struct connection_entry *ce)
static void usage_version(void)
static in_addr_t get_ip_addr(const char *ip_string, msglvl_t msglevel, bool *error)
static struct pull_filter * alloc_pull_filter(struct options *o)
#define USAGE_VALID_SERVER_PROTOS
static void pre_connect_save(struct options *o)
static void setenv_connection_entry(struct env_set *es, const struct connection_entry *e, const int i)
static int global_auth_retry
bool options_postprocess_pull(struct options *o, struct env_set *es)
void remove_option(struct context *c, struct options *options, char *p[], bool is_inline, const char *file, int line, const msglvl_t msglevel, const uint64_t permission_mask, uint64_t *option_types_found, struct env_set *es)
Resets options found in the PUSH_UPDATE message that are preceded by the - flag.
void uninit_options(struct options *o)
static void connection_entry_load_re(struct connection_entry *ce, const struct remote_entry *re)
int parse_topology(const char *str, const msglvl_t msglevel)
void show_windows_version(const unsigned int flags)
#define VERIFY_PERMISSION(mask)
bool key_is_external(const struct options *options)
static void check_ca_required(const struct options *options)
static struct http_proxy_options * parse_http_proxy_override(const char *server, const char *port, const char *flags, struct gc_arena *gc)
void init_options(struct options *o)
static void tuntap_options_postprocess_dns(struct options *o)
Postprocess DNS related settings.
static void dhcp_option_dns6_parse(const char *parm, struct in6_addr *dns6_list, unsigned int *len, msglvl_t msglevel)
static char * get_ipv6_addr_no_netbits(const char *addr, struct gc_arena *gc)
Returns newly allocated string containing address part without "/nn".
static void option_iroute_ipv6(struct options *o, const char *prefix_str, msglvl_t msglevel)
static bool check_route_option(struct options *options, char *p[], const msglvl_t msglevel, bool pull_mode)
void show_dco_version(const unsigned int flags)
void rol_check_alloc(struct options *options)
static struct local_list * alloc_local_list_if_undef(struct connection_entry *ce, struct gc_arena *gc)
static void dhcp_option_address_parse(const char *name, const char *parm, in_addr_t *array, unsigned int *len, msglvl_t msglevel)
static void helper_hashmap_sizes(struct options *o)
Sets the internal hash maps sizes according to the max_clients.
static void set_user_script(struct options *options, const char **script, const char *new_script, const char *type, bool in_chroot)
void update_option(struct context *c, struct options *options, char *p[], bool is_inline, const char *file, int line, const int level, const msglvl_t msglevel, const uint64_t permission_mask, uint64_t *option_types_found, struct env_set *es)
Processes an option to update.
static bool verify_permission(const char *name, const char *file, int line, const uint64_t type, const uint64_t allowed, uint64_t *found, const msglvl_t msglevel, struct options *options, bool is_inline)
static struct verify_hash_list * parse_hash_fingerprint_multiline(const char *str, int nbytes, msglvl_t msglevel, struct gc_arena *gc)
Parses a string consisting of multiple lines of hexstrings and checks if each string has the correct ...
static bool no_more_than_n_args(const msglvl_t msglevel, char *p[], const int max, const unsigned int flags)
static void options_postprocess_mutate_le(struct connection_entry *ce, struct local_entry *le, int mode)
void options_postprocess(struct options *options, struct env_set *es)
const char * auth_retry_print(void)
static struct remote_entry * alloc_remote_entry(struct options *options, const msglvl_t msglevel)
void show_library_versions(const unsigned int flags)
void setenv_settings(struct env_set *es, const struct options *o)
static const char usage_message[]
static struct connection_list * alloc_connection_list_if_undef(struct options *options)
static void cnol_check_alloc(struct options *options)
static void options_postprocess_mutate(struct options *o, struct env_set *es)
void options_detach(struct options *o)
static unsigned int atou(const char *str)
void pre_connect_restore(struct options *o, struct gc_arena *gc)
static struct pull_filter_list * alloc_pull_filter_list(struct options *o)
const char * print_topology(const int topology)
static struct verify_hash_list * parse_hash_fingerprint(const char *str, int nbytes, msglvl_t msglevel, struct gc_arena *gc)
Parses a hexstring and checks if the string has the correct length.
static bool check_dns_option(struct options *options, char *p[], const msglvl_t msglevel, bool pull_mode)
static void options_postprocess_cipher(struct options *o)
static void options_set_backwards_compatible_options(struct options *o)
Changes default values so that OpenVPN can be compatible with the user specified version.
#define MUST_BE_FALSE(condition, parm_name)
#define MUST_BE_UNDEF(parm, parm_name)
static void options_postprocess_http_proxy_override(struct options *o)
static void options_postprocess_mutate_invariant(struct options *options)
static bool ipv6_addr_safe_hexplusbits(const char *ipv6_prefix_spec)
const char title_string[]
static void setenv_local_entry(struct env_set *es, const struct local_entry *e, const int i)
static void remap_redirect_gateway_flags(struct options *opt)
static msglvl_t msglevel_forward_compatible(struct options *options, const msglvl_t msglevel)
bool auth_retry_set(const msglvl_t msglevel, const char *option)
static struct remote_list * alloc_remote_list_if_undef(struct options *options)
static bool check_route6_option(struct options *options, char *p[], const msglvl_t msglevel, bool pull_mode)
void notnull(const char *arg, const char *description)
static struct local_entry * alloc_local_entry(struct connection_entry *ce, const msglvl_t msglevel, struct gc_arena *gc)
static void show_compression_warning(struct compress_options *info)
static void options_process_mutate_prf(struct options *o)
void add_option(struct options *options, char *p[], bool is_inline, const char *file, int line, const int level, const msglvl_t msglevel, const uint64_t permission_mask, uint64_t *option_types_found, struct env_set *es)
bool has_udp_in_local_list(const struct options *options)
static void option_iroute(struct options *o, const char *network_str, const char *netmask_str, msglvl_t msglevel)
static void options_postprocess_verify(const struct options *o)
static void connection_entry_preload_key(const char **key_file, bool *key_inline, struct gc_arena *gc)
static struct connection_entry * alloc_connection_entry(struct options *options, const msglvl_t msglevel)
static bool need_compatibility_before(const struct options *o, unsigned int version)
The option –compat-mode is used to set up default settings to values used on the specified openvpn ve...
#define MODE_POINT_TO_POINT
#define PUF_TYPE_ACCEPT
filter type to accept a matching option
#define SF_TCP_NODELAY_HELPER
#define OPT_P_INSTANCE
allowed in ccd, client-connect etc
#define OPT_P_NCP
Negotiable crypto parameters.
#define OPT_P_ROUTE_TABLE
#define CONNECTION_LIST_SIZE
#define OPT_P_U_REDIR_GATEWAY
#define OPT_P_EXPLICIT_NOTIFY
#define PUF_TYPE_IGNORE
filter type to ignore a matching option
static bool dco_enabled(const struct options *o)
Returns whether the current configuration has dco enabled.
#define PUF_TYPE_REJECT
filter type to reject and trigger SIGUSR1
void read_config_file(struct options *options, const char *file, int level, const char *top_file, const int top_line, const msglvl_t msglevel, const uint64_t permission_mask, uint64_t *option_types_found, struct env_set *es)
@ GENKEY_TLS_CRYPTV2_SERVER
@ GENKEY_TLS_CRYPTV2_CLIENT
#define SF_NO_PUSH_ROUTE_GATEWAY
#define PLUGIN_OPTION_LIST(opt)
#define ROUTE_OPTION_FLAGS(o)
static void show_debug_warning(const unsigned int flags)
#define OPT_P_ROUTE_EXTRAS
void read_config_string(const char *prefix, struct options *options, const char *config, const msglvl_t msglevel, const uint64_t permission_mask, uint64_t *option_types_found, struct env_set *es)
#define MAN_CLIENT_AUTH_ENABLED(opt)
@ VLAN_ONLY_UNTAGGED_OR_PRIORITY
int atoi_warn(const char *str, msglvl_t msglevel)
Converts a str to an integer if the string can be represented as an integer number.
int positive_atoi(const char *str, msglvl_t msglevel)
Converts a str to a positive number if the string represents a postive integer number.
bool positive_atoll(const char *str, int64_t *value, const char *name, msglvl_t msglevel)
Converts a str to an integer if the string can be represented as an integer number and is >= 0.
bool valid_integer(const char *str, bool positive)
Checks if the string is a valid integer by checking if it can be converted to an integer.
bool atoi_constrained(const char *str, int *value, const char *name, int min, int max, msglvl_t msglevel)
Converts a str to an integer if the string can be represented as an integer number and is between min...
#define MAX_SEQ_BACKTRACK
#define MIN_SEQ_BACKTRACK
#define DEFAULT_SEQ_BACKTRACK
#define MAX_TIME_BACKTRACK
#define DEFAULT_TIME_BACKTRACK
#define MIN_TIME_BACKTRACK
struct plugin_option_list * plugin_option_list_new(struct gc_arena *gc)
bool plugin_option_list_add(struct plugin_option_list *list, char **p, struct gc_arena *gc)
bool ifconfig_pool_verify_range(const msglvl_t msglevel, const in_addr_t start, const in_addr_t end)
#define OPENVPN_8021Q_MIN_VID
#define OPENVPN_8021Q_MAX_VID
struct http_proxy_options * init_http_proxy_options_once(struct http_proxy_options **hpo, struct gc_arena *gc)
#define MAX_CUSTOM_HTTP_HEADER
void push_reset(struct options *o)
void push_options(struct options *o, char **p, msglvl_t msglevel, struct gc_arena *gc)
void clone_push_list(struct options *o)
void push_remove_option(struct options *o, const char *p)
bool is_special_addr(const char *addr_str)
struct route_option_list * clone_route_option_list(const struct route_option_list *src, struct gc_arena *a)
int netmask_to_netbits2(in_addr_t netmask)
struct route_ipv6_option_list * new_route_ipv6_option_list(struct gc_arena *a)
void delete_routes_v6(struct route_ipv6_list *rl6, const struct tuntap *tt, unsigned int flags, const struct env_set *es, openvpn_net_ctx_t *ctx)
void get_default_gateway_ipv6(struct route_ipv6_gateway_info *rgi6, const struct in6_addr *dest, openvpn_net_ctx_t *ctx)
void add_route_ipv6_to_option_list(struct route_ipv6_option_list *l, const char *prefix, const char *gateway, const char *metric, int table_id)
void copy_route_option_list(struct route_option_list *dest, const struct route_option_list *src, struct gc_arena *a)
void copy_route_ipv6_option_list(struct route_ipv6_option_list *dest, const struct route_ipv6_option_list *src, struct gc_arena *a)
void print_default_gateway(const msglvl_t msglevel, const struct route_gateway_info *rgi, const struct route_ipv6_gateway_info *rgi6)
void get_default_gateway(struct route_gateway_info *rgi, in_addr_t dest, openvpn_net_ctx_t *ctx)
Retrieves the best gateway for a given destination based on the routing table.
struct route_ipv6_option_list * clone_route_ipv6_option_list(const struct route_ipv6_option_list *src, struct gc_arena *a)
struct route_option_list * new_route_option_list(struct gc_arena *a)
void show_routes(msglvl_t msglevel)
void delete_routes_v4(struct route_list *rl, const struct tuntap *tt, unsigned int flags, const struct env_set *es, openvpn_net_ctx_t *ctx)
void add_route_to_option_list(struct route_option_list *l, const char *network, const char *netmask, const char *gateway, const char *metric, int table_id)
#define ROUTE_METHOD_SERVICE
#define ROUTE_METHOD_IPAPI
#define ROUTE_METHOD_ADAPTIVE
void script_security_set(int level)
#define SSEC_PW_ENV
allow calling of built-in programs and user-defined scripts that may receive a password as an environ...
#define SSEC_NONE
strictly no calling of external programs
bool get_ipv6_addr(const char *hostname, struct in6_addr *network, unsigned int *netbits, msglvl_t msglevel)
Translate an IPv6 addr or hostname from string form to in6_addr.
in_addr_t getaddr(unsigned int flags, const char *hostname, int resolve_retry_seconds, bool *succeeded, struct signal_info *sig_info)
Translate an IPv4 addr or hostname from string form to in_addr_t.
#define RESOLV_RETRY_INFINITE
#define SF_USE_IP_PKTINFO
#define SF_HOST_RANDOMIZE
#define SF_PKTINFO_COPY_IIF
const char * proto2ascii(int proto, sa_family_t af, bool display_form)
bool mac_addr_safe(const char *mac_addr)
const char * proto2ascii_all(struct gc_arena *gc)
sa_family_t ascii2af(const char *proto_name)
bool ipv6_addr_safe(const char *ipv6_text_addr)
const char * print_in6_addr(struct in6_addr a6, unsigned int flags, struct gc_arena *gc)
bool ip_or_dns_addr_safe(const char *addr, const bool allow_fqdn)
int ascii2proto(const char *proto_name)
const char * print_in_addr_t(in_addr_t addr, unsigned int flags, struct gc_arena *gc)
bool ip_addr_dotted_quad_safe(const char *dotted_quad)
static bool proto_is_net(int proto)
static bool proto_is_udp(int proto)
Returns if the protocol being used is UDP.
#define GETADDR_HOST_ORDER
static bool proto_is_dgram(int proto)
Return if the protocol is datagram (UDP)
void ssl_set_auth_token_user(const char *username)
void ssl_set_auth_nocache(void)
static bool push_peer_info(struct buffer *buf, struct tls_multi *multi, struct tls_session *session)
Prepares the IV_ and UV_ variables that are part of the exchange to signal the peer's capabilities.
int tls_version_parse(const char *vstr, const char *extra)
void ssl_set_auth_token(const char *token)
bool ssl_get_auth_nocache(void)
Control Channel SSL/Data channel negotiation module.
#define X509_USERNAME_FIELD_DEFAULT
const char * get_ssl_library_version(void)
return a pointer to a static memory area containing the name and version number of the SSL library in...
#define TLS_VER_BAD
Parse a TLS version specifier.
#define EXPORT_KEY_DATA_LABEL
int tls_version_max(void)
Return the maximum TLS version (as a TLS_VER_x constant) supported by current SSL implementation.
#define SSLF_TLS_VERSION_MAX_SHIFT
#define SSLF_CLIENT_CERT_OPTIONAL
#define SSLF_AUTH_USER_PASS_OPTIONAL
#define SSLF_CLIENT_CERT_NOT_REQUIRED
#define SSLF_CRL_VERIFY_DIR
#define SSLF_TLS_DEBUG_ENABLED
#define SSLF_TLS_VERSION_MAX_MASK
#define SSLF_TLS_VERSION_MIN_SHIFT
#define SSLF_TLS_VERSION_MIN_MASK
#define SSLF_USERNAME_AS_COMMON_NAME
void options_postprocess_setdefault_ncpciphers(struct options *o)
Checks for availibility of Chacha20-Poly1305 and sets the ncp_cipher to either AES-256-GCM:AES-128-GC...
bool tls_item_in_cipher_list(const char *item, const char *list)
Return true iff item is present in the colon-separated zero-terminated cipher list.
void append_cipher_to_ncp_list(struct options *o, const char *ciphername)
Appends the cipher specified by the ciphernamer parameter to to the o->ncp_ciphers list.
char * mutate_ncp_cipher_list(const char *list, struct gc_arena *gc)
Check whether the ciphers in the supplied list are supported.
Control Channel SSL/Data dynamic negotiation Module This file is split from ssl.h to be able to unit ...
Control Channel Verification Module.
#define OPENVPN_KU_REQUIRED
Require keyUsage to be present in cert (0xFFFF is an invalid KU value)
#define VERIFY_X509_SUBJECT_DN
#define VERIFY_X509_SUBJECT_RDN
#define NS_CERT_CHECK_CLIENT
Do not perform Netscape certificate type verification.
#define VERIFY_X509_SUBJECT_RDN_PREFIX
#define NS_CERT_CHECK_SERVER
Do not perform Netscape certificate type verification.
bool x509_username_field_ext_supported(const char *extname)
Return true iff the supplied extension field is supported by the –x509-username-field option.
void x509_track_add(const struct x509_track **ll_head, const char *name, msglvl_t msglevel, struct gc_arena *gc)
Wrapper structure for dynamically allocated memory.
uint8_t * data
Pointer to the allocated memory.
int len
Length in bytes of the actual content within the allocated memory.
struct local_list * local_list
int connect_retry_seconds
bool tls_crypt_v2_force_cookie
int connect_retry_seconds_max
const char * tls_crypt_file
const char * tls_crypt_v2_file
bool tun_mtu_extra_defined
const char * socks_proxy_port
struct http_proxy_options * http_proxy_options
bool tls_crypt_file_inline
bool tls_auth_file_inline
int explicit_exit_notification
const char * socks_proxy_authfile
const char * socks_proxy_server
const char * tls_auth_file
bool tls_crypt_v2_file_inline
struct connection_entry ** array
struct route_list * route_list
List of routing information.
struct route_ipv6_list * route_ipv6_list
struct tuntap * tuntap
Tun/tap virtual network interface.
Contains all state information for one tunnel.
openvpn_net_ctx_t net_ctx
Networking API opaque context.
struct options options
Options loaded from command line or configuration file.
struct context_1 c1
Level 1 context.
in_addr_t dns[N_DHCP_ADDR]
struct dns_server * servers
struct dhcp_options from_dhcp
enum dns_updown_flags updown_flags
struct dns_domain * search_domains
union dns_server_addr::@0 in
struct dns_server_addr addr[8]
struct dns_domain * domains
enum dns_server_transport transport
Garbage collection arena used to keep track of dynamically allocated memory.
const char * http_version
const char * auth_method_string
struct http_custom_header custom_headers[MAX_CUSTOM_HTTP_HEADER]
const char * auth_file_up
struct iroute_ipv6 * next
struct local_entry ** array
struct tuntap_options tuntap_options
int ping_rec_timeout_action
bool tuntap_options_defined
struct route_option_list * routes
struct compress_options comp
const char * ifconfig_local
struct dns_options dns_options
const char * route_default_gateway
const char * ifconfig_ipv6_local
struct route_ipv6_option_list * routes_ipv6
struct client_nat_option_list * client_nat
const char * route_ipv6_default_gateway
int resolve_retry_seconds
const char * genkey_extra_data
struct compress_options comp
struct http_proxy_options * http_proxy_override
int push_ifconfig_ipv6_netbits
struct connection_list * connection_list
const char * management_port
bool tls_crypt_file_inline
const char * ifconfig_ipv6_remote
int max_routes_per_client
const char * ncp_ciphers_conf
The original ncp_ciphers specified by the user in the configuration.
enum vlan_acceptable_frames vlan_accept
in_addr_t push_ifconfig_constraint_network
struct options_pre_connect * pre_connect
int renegotiate_seconds_min
const char * auth_token_secret_file
unsigned int imported_protocol_flags
const char * tls_export_peer_cert_dir
const char * cryptoapi_cert
unsigned int backwards_compatible
What version we should try to be compatible with as major * 10000 + minor * 100 + patch,...
hash_algo_type verify_hash_algo
int scheduled_exit_interval
int stale_routes_ageing_time
int management_state_buffer_size
const char * tls_auth_file
struct provider_list providers
struct in6_addr server_network_ipv6
int management_echo_buffer_size
bool use_peer_id
Whether the data channel uses the DATA_V2 header (peer-id).
unsigned remote_cert_ku[MAX_PARMS]
bool server_bridge_defined
const char * keying_material_exporter_label
const char * remote_cert_eku
in_addr_t ifconfig_pool_netmask
bool server_bridge_proxy_dhcp
bool allow_recursive_routing
const char * exit_event_name
const char * ifconfig_ipv6_local
bool auth_user_pass_verify_script_via_file
int ifconfig_pool_persist_refresh_freq
uint64_t push_option_types_found
bool push_ifconfig_defined
bool ifconfig_pool_defined
const char * packet_id_file
const char * tls_crypt_v2_file
int management_log_history_cache
in_addr_t server_bridge_netmask
const char * ip_remote_hint
struct route_option_list * routes
in_addr_t ifconfig_pool_end
int64_t inactivity_minimum_bytes
bool ifconfig_ipv6_pool_defined
unsigned int server_flags
bool push_ifconfig_ipv6_blocked
const char * client_disconnect_script
struct remote_list * remote_list
const char * key_pass_file
bool mute_replay_warnings
const char * tls_crypt_file
const char * ifconfig_local
char * x509_username_field[MAX_PARMS]
struct connection_entry ce
struct iroute_ipv6 * iroutes_ipv6
struct push_list push_list
struct tuntap_options tuntap_options
struct verify_hash_list * verify_hash
const char * tls_cert_profile
int64_t renegotiate_packets
unsigned int management_flags
const char * route_default_gateway
in_addr_t push_ifconfig_local_alias
struct dns_options dns_options
bool exit_event_initial_state
struct static_challenge_info sc_info
bool auth_token_call_auth
uint32_t virtual_hash_size
const char * learn_address_script
const char * auth_user_pass_file
int stale_routes_check_interval
struct plugin_option_list * plugin_list
const char * tls_crypt_v2_verify_script
const char * auth_user_pass_verify_script
const char * extra_certs_file
int ifconfig_ipv6_pool_netbits
in_addr_t push_ifconfig_constraint_netmask
const char * route_ipv6_default_gateway
bool priv_key_file_inline
int ping_rec_timeout_action
bool auth_user_pass_file_inline
bool enable_ncp_fallback
If defined fall back to ciphername if NCP fails.
const char * route_predown_script
in_addr_t push_ifconfig_local
const char ** ignore_unknown_option
int route_default_table_id
bool auth_token_secret_file_inline
bool extra_certs_file_inline
bool push_ifconfig_constraint_defined
int keying_material_exporter_length
bool force_key_material_export
const char * cipher_list_tls13
int status_file_update_freq
const char * management_client_user
bool allow_deprecated_insecure_static_crypto
struct pull_filter_list * pull_filter_list
const char * management_certificate
const char * genkey_filename
const struct x509_track * x509_track
bool auth_user_pass_username_only
bool shared_secret_file_inline
struct in6_addr push_ifconfig_ipv6_remote
const char * management_addr
const char * client_connect_script
const char * verify_x509_name
bool route_gateway_via_dhcp
bool push_ifconfig_ipv6_defined
const char * override_username
const char * client_crresponse_script
struct route_ipv6_option_list * routes_ipv6
bool machine_readable_output
const char * priv_key_file
bool tls_auth_file_inline
bool tls_crypt_v2_file_inline
in_addr_t server_bridge_pool_start
struct client_nat_option_list * client_nat
struct in6_addr push_ifconfig_ipv6_local
uint64_t push_update_options_found
const char * ifconfig_remote_netmask
in_addr_t server_bridge_pool_end
enum tun_driver_type windows_driver
int64_t renegotiate_bytes
const char * route_script
in_addr_t ifconfig_pool_start
const char * management_user_pass
unsigned int server_netbits_ipv6
in_addr_t push_ifconfig_remote_netmask
in_addr_t server_bridge_ip
const char * shared_secret_file
const char * management_client_group
struct in6_addr ifconfig_ipv6_pool_base
const char * client_config_dir
enum genkey_type genkey_type
const char * ifconfig_pool_persist_filename
int ifconfig_ipv6_netbits
const char * names[MAX_PARMS]
struct pull_filter * tail
struct pull_filter * head
struct pull_filter * next
struct remote_entry ** array
const char * challenge_text
struct in6_addr dns6[N_DHCP_ADDR]
in_addr_t nbdd[N_DHCP_ADDR]
in_addr_t ntp[N_DHCP_ADDR]
in_addr_t wins[N_DHCP_ADDR]
uint8_t netbios_node_type
in_addr_t dns[N_DHCP_ADDR]
const char * netbios_scope
unsigned int domain_search_list_len
bool dhcp_masq_custom_offset
const char * domain_search_list[N_SEARCH_LIST_LEN]
struct verify_hash_list * next
uint8_t hash[SHA256_DIGEST_LENGTH]
unsigned short sa_family_t
static bool pkcs11_id_management
void ipconfig_register_dns(const struct env_set *es)
int dev_type_enum(const char *dev, const char *dev_type)
void show_tap_win_adapters(msglvl_t msglevel, msglvl_t warnlevel)
bool dhcp_renew_by_adapter_index(const DWORD adapter_index)
int ascii2ipset(const char *name)
bool dhcp_release_by_adapter_index(const DWORD adapter_index)
void tap_allow_nonadmin_access(const char *dev_node)
void show_adapters(msglvl_t msglevel)
const char * ipset2ascii_all(struct gc_arena *gc)
void show_valid_win32_tun_subnets(void)
const char * print_tun_backend_driver(enum tun_driver_type driver)
Return a string representation of the tun backed driver type.
#define IPW32_SET_ADAPTIVE
#define DHCP_OPTIONS_DHCP_REQUIRED
#define N_SEARCH_LIST_LEN
#define IPW32_SET_DHCP_MASQ
@ WINDOWS_DRIVER_UNSPECIFIED
@ WINDOWS_DRIVER_TAP_WINDOWS6
#define IPW32_SET_ADAPTIVE_DELAY_WINDOW
#define DHCP_OPTIONS_DHCP_OPTIONAL
static bool is_tun_afunix(const char *devnode)
Checks whether a –dev-node parameter specifies a AF_UNIX device.
void set_win_sys_path(const char *newpath, struct env_set *es)
const char * win32_version_string(struct gc_arena *gc)
Get Windows version string with architecture info.
void set_pause_exit_win32(void)