]> git.ipfire.org Git - thirdparty/openvpn.git/blame - options.h
Change variadic macros to C99 style.
[thirdparty/openvpn.git] / options.h
CommitLineData
6fbf66fa
JY
1/*
2 * OpenVPN -- An application to securely tunnel IP networks
3 * over a single UDP port, with support for SSL/TLS-based
4 * session authentication and key exchange,
5 * packet encryption, packet authentication, and
6 * packet compression.
7 *
564a2109 8 * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
6fbf66fa
JY
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2
12 * as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program (see the file COPYING included with this
21 * distribution); if not, write to the Free Software Foundation, Inc.,
22 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24
25/*
26 * 2004-01-28: Added Socks5 proxy support
27 * (Christof Meerwald, http://cmeerw.org)
28 */
29
30#ifndef OPTIONS_H
31#define OPTIONS_H
32
33#include "basic.h"
34#include "common.h"
35#include "mtu.h"
36#include "route.h"
37#include "tun.h"
38#include "socket.h"
39#include "plugin.h"
40#include "manage.h"
41#include "proxy.h"
537073fd 42#include "lzo.h"
3eee126e 43#include "pushlist.h"
6fbf66fa
JY
44
45/*
46 * Maximum number of parameters associated with an option,
47 * including the option name itself.
48 */
49#define MAX_PARMS 16
50
51/*
52 * Max size of options line and parameter.
53 */
54#define OPTION_PARM_SIZE 256
55#define OPTION_LINE_SIZE 256
56
57extern const char title_string[];
58
59#if P2MP
60
6fbf66fa
JY
61/* certain options are saved before --pull modifications are applied */
62struct options_pre_pull
63{
64 bool tuntap_options_defined;
65 struct tuntap_options tuntap_options;
66
67 bool routes_defined;
673f583f 68 struct route_option_list *routes;
6fbf66fa
JY
69
70 int foreign_option_index;
71};
72
73#endif
74
4e9a51d7
JY
75struct connection_entry
76{
77 int proto;
78 int local_port;
79 bool local_port_defined;
80 int remote_port;
81 bool port_option_used;
82 const char *local;
83 const char *remote;
84 bool remote_float;
85 bool bind_defined;
86 bool bind_local;
87 int connect_retry_seconds;
88 bool connect_retry_defined;
89 int connect_retry_max;
90 int connect_timeout;
91 bool connect_timeout_defined;
92#ifdef ENABLE_HTTP_PROXY
93 struct http_proxy_options *http_proxy_options;
94#endif
95#ifdef ENABLE_SOCKS
96 const char *socks_proxy_server;
97 int socks_proxy_port;
fc1fa9ff 98 const char *socks_proxy_authfile;
4e9a51d7
JY
99 bool socks_proxy_retry;
100#endif
3cf6c932
JY
101
102# define CE_DISABLED (1<<0)
103#if HTTP_PROXY_FALLBACK
104# define CE_HTTP_PROXY_FALLBACK (1<<1)
105 time_t ce_http_proxy_fallback_timestamp; /* time when fallback http_proxy_options was last updated */
106#endif
107
108 unsigned int flags;
4e9a51d7
JY
109};
110
111struct remote_entry
112{
113 const char *remote;
114 int remote_port;
115 int proto;
116};
117
118#ifdef ENABLE_CONNECTION
119
120#define CONNECTION_LIST_SIZE 64
121
122struct connection_list
123{
124 int len;
125 int current;
3cf6c932 126 int n_cycles;
4e9a51d7
JY
127 bool no_advance;
128 struct connection_entry *array[CONNECTION_LIST_SIZE];
129};
130
131struct remote_list
132{
133 int len;
134 struct remote_entry *array[CONNECTION_LIST_SIZE];
135};
136
137#endif
138
3cf6c932
JY
139#if HTTP_PROXY_FALLBACK
140struct hpo_store
141{
142 struct http_proxy_options hpo;
143 char server[80];
144};
145#endif
146
6fbf66fa
JY
147/* Command line options */
148struct options
149{
150 struct gc_arena gc;
4e9a51d7 151 bool gc_owned;
6fbf66fa
JY
152
153 /* first config file */
154 const char *config;
155
156 /* major mode */
157# define MODE_POINT_TO_POINT 0
158# define MODE_SERVER 1
159 int mode;
160
373faab1
JY
161 /* enable forward compatibility for post-2.1 features */
162 bool forward_compatible;
163
6fbf66fa
JY
164 /* persist parms */
165 bool persist_config;
166 int persist_mode;
167
168#ifdef USE_CRYPTO
169 const char *key_pass_file;
170 bool show_ciphers;
171 bool show_digests;
172 bool show_engines;
173#ifdef USE_SSL
174 bool show_tls_ciphers;
175#endif
176 bool genkey;
177#endif
178
179 /* Networking parms */
4e9a51d7
JY
180 struct connection_entry ce;
181
182#ifdef ENABLE_CONNECTION
3cf6c932 183 char *remote_ip_hint;
4e9a51d7 184 struct connection_list *connection_list;
6fbf66fa 185 struct remote_list *remote_list;
3cf6c932 186 bool force_connection_list;
4e9a51d7
JY
187#endif
188
189#ifdef GENERAL_PROXY_SUPPORT
190 struct auto_proxy_info *auto_proxy_info;
191#endif
192
3cf6c932
JY
193#if HTTP_PROXY_FALLBACK
194 bool http_proxy_fallback;
195 struct http_proxy_options *http_proxy_override;
196 struct hpo_store *hpo_store; /* used to store dynamic proxy info given by management interface */
197#endif
198
6fbf66fa
JY
199 bool remote_random;
200 const char *ipchange;
6fbf66fa
JY
201 const char *dev;
202 const char *dev_type;
203 const char *dev_node;
e12fe286 204 const char *lladdr;
3c7f2f55 205 int topology; /* one of the TOP_x values from proto.h */
6fbf66fa
JY
206 const char *ifconfig_local;
207 const char *ifconfig_remote_netmask;
208 bool ifconfig_noexec;
209 bool ifconfig_nowarn;
210#ifdef HAVE_GETTIMEOFDAY
211 int shaper;
212#endif
213 int tun_mtu; /* MTU of tun device */
214 int tun_mtu_extra;
215 bool tun_mtu_extra_defined;
216 int link_mtu; /* MTU of device over which tunnel packets pass via TCP/UDP */
217 bool tun_mtu_defined; /* true if user overriding parm with command line option */
218 bool link_mtu_defined; /* true if user overriding parm with command line option */
219
51e6e5b0
JY
220 int proto_force;
221
6fbf66fa
JY
222 /* Advanced MTU negotiation and datagram fragmentation options */
223 int mtu_discover_type; /* used if OS supports setting Path MTU discovery options on socket */
224
225#ifdef ENABLE_OCC
226 bool mtu_test;
227#endif
228
229 int fragment; /* internal fragmentation size */
230
231 bool mlock;
232
233 int keepalive_ping; /* a proxy for ping/ping-restart */
234 int keepalive_timeout;
235
838911cc
JY
236 int inactivity_timeout; /* --inactive */
237 int inactivity_minimum_bytes;
238
6fbf66fa
JY
239 int ping_send_timeout; /* Send a TCP/UDP ping to remote every n seconds */
240 int ping_rec_timeout; /* Expect a TCP/UDP ping from remote at least once every n seconds */
241 bool ping_timer_remote; /* Run ping timer only if we have a remote address */
242 bool tun_ipv6; /* Build tun dev that supports IPv6 */
243
244# define PING_UNDEF 0
245# define PING_EXIT 1
246# define PING_RESTART 2
247 int ping_rec_timeout_action; /* What action to take on ping_rec_timeout (exit or restart)? */
248
249#ifdef ENABLE_OCC
250 int explicit_exit_notification; /* Explicitly tell peer when we are exiting via OCC_EXIT message */
251#endif
252
253 bool persist_tun; /* Don't close/reopen TUN/TAP dev on SIGUSR1 or PING_RESTART */
254 bool persist_local_ip; /* Don't re-resolve local address on SIGUSR1 or PING_RESTART */
255 bool persist_remote_ip; /* Don't re-resolve remote address on SIGUSR1 or PING_RESTART */
256 bool persist_key; /* Don't re-read key files on SIGUSR1 or PING_RESTART */
257
258 int mssfix; /* Upper bound on TCP MSS */
259 bool mssfix_default; /* true if --mssfix was supplied without a parameter */
260
261#if PASSTOS_CAPABILITY
262 bool passtos;
263#endif
264
265 int resolve_retry_seconds; /* If hostname resolve fails, retry for n seconds */
266
267 struct tuntap_options tuntap_options;
268
269 /* Misc parms */
270 const char *username;
271 const char *groupname;
272 const char *chroot_dir;
273 const char *cd_dir;
99385447
JY
274#ifdef HAVE_SETCON
275 char *selinux_context;
276#endif
6fbf66fa
JY
277 const char *writepid;
278 const char *up_script;
279 const char *down_script;
280 bool down_pre;
281 bool up_delay;
282 bool up_restart;
283 bool daemon;
284
285 int remap_sigusr1;
286
287 /* inetd modes defined in socket.h */
288 int inetd;
289
290 bool log;
291 bool suppress_timestamps;
292 int nice;
293 int verbosity;
294 int mute;
295
296#ifdef ENABLE_DEBUG
297 int gremlin;
298#endif
299
300 const char *status_file;
301 int status_file_version;
302 int status_file_update_freq;
303
304 /* optimize TUN/TAP/UDP writes */
305 bool fast_io;
306
307#ifdef USE_LZO
537073fd
JY
308 /* LZO_x flags from lzo.h */
309 unsigned int lzo;
6fbf66fa
JY
310#endif
311
312 /* buffer sizes */
313 int rcvbuf;
314 int sndbuf;
315
00d39170
JY
316 /* socket flags */
317 unsigned int sockflags;
318
6fbf66fa
JY
319 /* route management */
320 const char *route_script;
321 const char *route_default_gateway;
40ac3d7a 322 int route_default_metric;
6fbf66fa
JY
323 bool route_noexec;
324 int route_delay;
325 int route_delay_window;
326 bool route_delay_defined;
673f583f 327 int max_routes;
6fbf66fa 328 struct route_option_list *routes;
3c7f2f55 329 bool route_nopull;
03731db3 330 bool route_gateway_via_dhcp;
0a838de8 331 bool allow_pull_fqdn; /* as a client, allow server to push a FQDN for certain parameters */
6fbf66fa 332
6fbf66fa
JY
333#ifdef ENABLE_OCC
334 /* Enable options consistency check between peers */
335 bool occ;
336#endif
337
338#ifdef ENABLE_MANAGEMENT
339 const char *management_addr;
340 int management_port;
341 const char *management_user_pass;
342 int management_log_history_cache;
343 int management_echo_buffer_size;
344 int management_state_buffer_size;
8d33c060 345 const char *management_write_peer_info_file;
90efcacb 346
bb564a59
JY
347 const char *management_client_user;
348 const char *management_client_group;
349
90efcacb
JY
350 /* Mask of MF_ values of manage.h */
351 unsigned int management_flags;
6fbf66fa
JY
352#endif
353
354#ifdef ENABLE_PLUGIN
355 struct plugin_option_list *plugin_list;
356#endif
357
6fbf66fa
JY
358#if P2MP
359
360#if P2MP_SERVER
361 bool server_defined;
362 in_addr_t server_network;
363 in_addr_t server_netmask;
364
3c7f2f55 365# define SF_NOPOOL (1<<0)
ae3b3746 366# define SF_TCP_NODELAY_HELPER (1<<1)
148329ca 367# define SF_NO_PUSH_ROUTE_GATEWAY (1<<2)
3c7f2f55
JY
368 unsigned int server_flags;
369
03731db3
JY
370 bool server_bridge_proxy_dhcp;
371
6fbf66fa
JY
372 bool server_bridge_defined;
373 in_addr_t server_bridge_ip;
374 in_addr_t server_bridge_netmask;
375 in_addr_t server_bridge_pool_start;
376 in_addr_t server_bridge_pool_end;
377
3eee126e 378 struct push_list push_list;
6fbf66fa
JY
379 bool ifconfig_pool_defined;
380 in_addr_t ifconfig_pool_start;
381 in_addr_t ifconfig_pool_end;
382 in_addr_t ifconfig_pool_netmask;
383 const char *ifconfig_pool_persist_filename;
384 int ifconfig_pool_persist_refresh_freq;
6fbf66fa
JY
385 int real_hash_size;
386 int virtual_hash_size;
387 const char *client_connect_script;
388 const char *client_disconnect_script;
389 const char *learn_address_script;
390 const char *tmp_dir;
391 const char *client_config_dir;
392 bool ccd_exclusive;
393 bool disable;
394 int n_bcast_buf;
395 int tcp_queue_limit;
396 struct iroute *iroutes;
397 bool push_ifconfig_defined;
398 in_addr_t push_ifconfig_local;
399 in_addr_t push_ifconfig_remote_netmask;
3c7f2f55
JY
400 bool push_ifconfig_constraint_defined;
401 in_addr_t push_ifconfig_constraint_network;
402 in_addr_t push_ifconfig_constraint_netmask;
6fbf66fa
JY
403 bool enable_c2c;
404 bool duplicate_cn;
405 int cf_max;
406 int cf_per;
407 int max_clients;
408 int max_routes_per_client;
409
6fbf66fa
JY
410 const char *auth_user_pass_verify_script;
411 bool auth_user_pass_verify_script_via_file;
24ce3b27 412 unsigned int ssl_flags; /* set to SSLF_x flags from ssl.h */
6add6b2f
JY
413#if PORT_SHARE
414 char *port_share_host;
415 int port_share_port;
416#endif
6fbf66fa
JY
417#endif
418
419 bool client;
420 bool pull; /* client pull of config options from server */
3eee126e 421 int push_continuation;
6fbf66fa
JY
422 const char *auth_user_pass_file;
423 struct options_pre_pull *pre_pull;
424
e1e977f3
JY
425 int server_poll_timeout;
426
6fbf66fa
JY
427 int scheduled_exit_interval;
428
429#endif
430
431#ifdef USE_CRYPTO
432 /* Cipher parms */
433 const char *shared_secret_file;
c959fc74
JY
434#if ENABLE_INLINE_FILES
435 const char *shared_secret_file_inline;
436#endif
6fbf66fa
JY
437 int key_direction;
438 bool ciphername_defined;
439 const char *ciphername;
440 bool authname_defined;
441 const char *authname;
442 int keysize;
03bfb228
JY
443 const char *prng_hash;
444 int prng_nonce_secret_len;
6fbf66fa
JY
445 const char *engine;
446 bool replay;
447 bool mute_replay_warnings;
448 int replay_window;
449 int replay_time;
450 const char *packet_id_file;
451 bool use_iv;
452 bool test_crypto;
453
454#ifdef USE_SSL
455 /* TLS (control channel) parms */
456 bool tls_server;
457 bool tls_client;
458 const char *ca_file;
e9c5e170 459 const char *ca_path;
6fbf66fa
JY
460 const char *dh_file;
461 const char *cert_file;
462 const char *priv_key_file;
463 const char *pkcs12_file;
464 const char *cipher_list;
465 const char *tls_verify;
39238d1b 466 const char *tls_export_cert;
6fbf66fa
JY
467 const char *tls_remote;
468 const char *crl_file;
d40f2b20
JY
469
470#if ENABLE_INLINE_FILES
471 const char *ca_file_inline;
472 const char *cert_file_inline;
473 char *priv_key_file_inline;
474 const char *dh_file_inline;
2e8ff6c1 475 const char *pkcs12_file_inline; /* contains the base64 encoding of pkcs12 file */
d40f2b20
JY
476#endif
477
6fbf66fa 478 int ns_cert_type; /* set to 0, NS_SSL_SERVER, or NS_SSL_CLIENT */
411e89ae
JY
479 unsigned remote_cert_ku[MAX_PARMS];
480 const char *remote_cert_eku;
bed73623
JY
481
482#ifdef ENABLE_PKCS11
ce98fd24 483 const char *pkcs11_providers[MAX_PARMS];
718526e0 484 unsigned pkcs11_private_mode[MAX_PARMS];
18597b93
JY
485 bool pkcs11_protected_authentication[MAX_PARMS];
486 bool pkcs11_cert_private[MAX_PARMS];
487 int pkcs11_pin_cache_period;
ce98fd24 488 const char *pkcs11_id;
1bda73a7 489 bool pkcs11_id_management;
bed73623
JY
490#endif
491
6fbf66fa
JY
492#ifdef WIN32
493 const char *cryptoapi_cert;
494#endif
495
496 /* data channel key exchange method */
497 int key_method;
498
499 /* Per-packet timeout on control channel */
500 int tls_timeout;
501
502 /* Data channel key renegotiation parameters */
503 int renegotiate_bytes;
504 int renegotiate_packets;
505 int renegotiate_seconds;
506
507 /* Data channel key handshake must finalize
508 within n seconds of handshake initiation. */
509 int handshake_window;
510
2e8337de
EM
511 /* Field used to be the username in X509 cert. */
512 char *x509_username_field;
513
6fbf66fa
JY
514 /* Old key allowed to live n seconds after new key goes active */
515 int transition_window;
516
517 /* Special authentication MAC for TLS control channel */
518 const char *tls_auth_file; /* shared secret */
c959fc74
JY
519#if ENABLE_INLINE_FILES
520 const char *tls_auth_file_inline;
521#endif
6fbf66fa
JY
522
523 /* Allow only one session */
524 bool single_session;
525
aaf72974
JY
526#ifdef ENABLE_PUSH_PEER_INFO
527 bool push_peer_info;
528#endif
529
6fbf66fa
JY
530 bool tls_exit;
531
532#endif /* USE_SSL */
533#endif /* USE_CRYPTO */
534
535 /* special state parms */
536 int foreign_option_index;
537
538#ifdef WIN32
539 const char *exit_event_name;
540 bool exit_event_initial_state;
541 bool show_net_up;
542 int route_method;
543#endif
544};
545
546#define streq(x, y) (!strcmp((x), (y)))
547
548/*
549 * Option classes.
550 */
551#define OPT_P_GENERAL (1<<0)
552#define OPT_P_UP (1<<1)
553#define OPT_P_ROUTE (1<<2)
554#define OPT_P_IPWIN32 (1<<3)
555#define OPT_P_SCRIPT (1<<4)
556#define OPT_P_SETENV (1<<5)
557#define OPT_P_SHAPER (1<<6)
558#define OPT_P_TIMER (1<<7)
559#define OPT_P_PERSIST (1<<8)
560#define OPT_P_PERSIST_IP (1<<9)
561#define OPT_P_COMP (1<<10) /* TODO */
562#define OPT_P_MESSAGES (1<<11)
563#define OPT_P_CRYPTO (1<<12) /* TODO */
564#define OPT_P_TLS_PARMS (1<<13) /* TODO */
565#define OPT_P_MTU (1<<14) /* TODO */
566#define OPT_P_NICE (1<<15)
567#define OPT_P_PUSH (1<<16)
568#define OPT_P_INSTANCE (1<<17)
569#define OPT_P_CONFIG (1<<18)
570#define OPT_P_EXPLICIT_NOTIFY (1<<19)
571#define OPT_P_ECHO (1<<20)
572#define OPT_P_INHERIT (1<<21)
3c7f2f55
JY
573#define OPT_P_ROUTE_EXTRAS (1<<22)
574#define OPT_P_PULL_MODE (1<<23)
575#define OPT_P_PLUGIN (1<<24)
00d39170
JY
576#define OPT_P_SOCKBUF (1<<25)
577#define OPT_P_SOCKFLAGS (1<<26)
4e9a51d7 578#define OPT_P_CONNECTION (1<<27)
6fbf66fa 579
3c7f2f55 580#define OPT_P_DEFAULT (~(OPT_P_INSTANCE|OPT_P_PULL_MODE))
6fbf66fa
JY
581
582#if P2MP
583#define PULL_DEFINED(opt) ((opt)->pull)
584#if P2MP_SERVER
585#define PUSH_DEFINED(opt) ((opt)->push_list)
586#endif
587#endif
588
589#ifndef PULL_DEFINED
590#define PULL_DEFINED(opt) (false)
591#endif
592
593#ifndef PUSH_DEFINED
594#define PUSH_DEFINED(opt) (false)
595#endif
596
597#ifdef WIN32
598#define ROUTE_OPTION_FLAGS(o) ((o)->route_method & ROUTE_METHOD_MASK)
599#else
600#define ROUTE_OPTION_FLAGS(o) (0)
601#endif
602
603#ifdef HAVE_GETTIMEOFDAY
604#define SHAPER_DEFINED(opt) ((opt)->shaper)
605#else
606#define SHAPER_DEFINED(opt) (false)
607#endif
608
609#ifdef ENABLE_PLUGIN
610#define PLUGIN_OPTION_LIST(opt) ((opt)->plugin_list)
611#else
612#define PLUGIN_OPTION_LIST(opt) (NULL)
613#endif
614
90efcacb
JY
615#ifdef MANAGEMENT_DEF_AUTH
616#define MAN_CLIENT_AUTH_ENABLED(opt) ((opt)->management_flags & MF_CLIENT_AUTH)
617#else
618#define MAN_CLIENT_AUTH_ENABLED(opt) (false)
619#endif
620
6fbf66fa
JY
621void parse_argv (struct options *options,
622 const int argc,
623 char *argv[],
624 const int msglevel,
625 const unsigned int permission_mask,
626 unsigned int *option_types_found,
627 struct env_set *es);
628
629void notnull (const char *arg, const char *description);
630
631void usage_small (void);
632
4e9a51d7 633void init_options (struct options *o, const bool init_gc);
6fbf66fa
JY
634void uninit_options (struct options *o);
635
636void setenv_settings (struct env_set *es, const struct options *o);
637void show_settings (const struct options *o);
638
639bool string_defined_equal (const char *s1, const char *s2);
640
641#ifdef ENABLE_OCC
642
643const char *options_string_version (const char* s, struct gc_arena *gc);
644
645char *options_string (const struct options *o,
646 const struct frame *frame,
647 struct tuntap *tt,
648 bool remote,
649 struct gc_arena *gc);
650
bb564a59 651bool options_cmp_equal_safe (char *actual, const char *expected, size_t actual_n);
6fbf66fa 652void options_warning_safe (char *actual, const char *expected, size_t actual_n);
bb564a59 653bool options_cmp_equal (char *actual, const char *expected);
6fbf66fa
JY
654void options_warning (char *actual, const char *expected);
655
656#endif
657
4e9a51d7 658void options_postprocess (struct options *options);
6fbf66fa
JY
659
660void pre_pull_save (struct options *o);
661void pre_pull_restore (struct options *o);
662
663bool apply_push_options (struct options *options,
664 struct buffer *buf,
665 unsigned int permission_mask,
666 unsigned int *option_types_found,
667 struct env_set *es);
668
669bool is_persist_option (const struct options *o);
670bool is_stateful_restart (const struct options *o);
671
672void options_detach (struct options *o);
673
674void options_server_import (struct options *o,
675 const char *filename,
676 int msglevel,
677 unsigned int permission_mask,
678 unsigned int *option_types_found,
679 struct env_set *es);
680
681void pre_pull_default (struct options *o);
682
683void rol_check_alloc (struct options *options);
684
685int parse_line (const char *line,
686 char *p[],
687 const int n,
688 const char *file,
689 const int line_num,
690 int msglevel,
691 struct gc_arena *gc);
692
3c7f2f55
JY
693/*
694 * parse/print topology coding
695 */
696
697int parse_topology (const char *str, const int msglevel);
698const char *print_topology (const int topology);
699
6fbf66fa
JY
700/*
701 * Manage auth-retry variable
702 */
703
704#if P2MP
705
706#define AR_NONE 0
707#define AR_INTERACT 1
708#define AR_NOINTERACT 2
709
710int auth_retry_get (void);
711bool auth_retry_set (const int msglevel, const char *option);
712const char *auth_retry_print (void);
713
714#endif
715
90efcacb 716void options_string_import (struct options *options,
3c7f2f55
JY
717 const char *config,
718 const int msglevel,
719 const unsigned int permission_mask,
720 unsigned int *option_types_found,
721 struct env_set *es);
722
4e9a51d7
JY
723/*
724 * inline functions
725 */
726static inline bool
727connection_list_defined (const struct options *o)
728{
729#ifdef ENABLE_CONNECTION
730 return o->connection_list != NULL;
731#else
732 return false;
733#endif
734}
735
736static inline void
737connection_list_set_no_advance (struct options *o)
738{
739#ifdef ENABLE_CONNECTION
740 if (o->connection_list)
741 o->connection_list->no_advance = true;
742#endif
743}
744
3cf6c932
JY
745#if HTTP_PROXY_FALLBACK
746
747struct http_proxy_options *
748parse_http_proxy_fallback (struct context *c,
749 const char *server,
750 const char *port,
751 const char *flags,
752 const int msglevel);
753
754#endif /* HTTP_PROXY_FALLBACK */
755
3c7f2f55 756#endif