config.c 297 KB
Newer Older
1

2
/* Copyright (c) 2001 Matej Pfajfar.
Roger Dingledine's avatar
Roger Dingledine committed
3
 * Copyright (c) 2001-2004, Roger Dingledine.
4
 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
Nick Mathewson's avatar
Nick Mathewson committed
5
 * Copyright (c) 2007-2018, The Tor Project, Inc. */
6
/* See LICENSE for licensing information */
7

Nick Mathewson's avatar
Nick Mathewson committed
8
/**
9
 * \file config.c
10
11
12
13
14
15
16
17
18
19
20
21
 * \brief Code to interpret the user's configuration of Tor.
 *
 * This module handles torrc configuration file, including parsing it,
 * combining it with torrc.defaults and the command line, allowing
 * user changes to it (via editing and SIGHUP or via the control port),
 * writing it back to disk (because of SAVECONF from the control port),
 * and -- most importantly, acting on it.
 *
 * The module additionally has some tools for manipulating and
 * inspecting values that are calculated as a result of the
 * configured options.
 *
22
 * <h3>How to add new options</h3>
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
 *
 * To add new items to the torrc, there are a minimum of three places to edit:
 * <ul>
 *   <li>The or_options_t structure in or.h, where the options are stored.
 *   <li>The option_vars_ array below in this module, which configures
 *       the names of the torrc options, their types, their multiplicities,
 *       and their mappings to fields in or_options_t.
 *   <li>The manual in doc/tor.1.txt, to document what the new option
 *       is, and how it works.
 * </ul>
 *
 * Additionally, you might need to edit these places too:
 * <ul>
 *   <li>options_validate() below, in case you want to reject some possible
 *       values of the new configuration option.
 *   <li>options_transition_allowed() below, in case you need to
 *       forbid some or all changes in the option while Tor is
 *       running.
 *   <li>options_transition_affects_workers(), in case changes in the option
 *       might require Tor to relaunch or reconfigure its worker threads.
 *   <li>options_transition_affects_descriptor(), in case changes in the
 *       option might require a Tor relay to build and publish a new server
 *       descriptor.
 *   <li>options_act() and/or options_act_reversible(), in case there's some
 *       action that needs to be taken immediately based on the option's
 *       value.
 * </ul>
 *
 * <h3>Changing the value of an option</h3>
 *
 * Because of the SAVECONF command from the control port, it's a bad
 * idea to change the value of any user-configured option in the
 * or_options_t.  If you want to sometimes do this anyway, we recommend
 * that you create a secondary field in or_options_t; that you have the
 * user option linked only to the secondary field; that you use the
 * secondary field to initialize the one that Tor actually looks at; and that
 * you use the one Tor looks as the one that you modify.
Nick Mathewson's avatar
Nick Mathewson committed
60
61
 **/

62
#define CONFIG_PRIVATE
63
64
65
66
67
68
69
70
71
#include "core/or/or.h"
#include "feature/client/bridges.h"
#include "feature/client/addressmap.h"
#include "core/or/channel.h"
#include "core/or/circuitbuild.h"
#include "core/or/circuitlist.h"
#include "core/or/circuitmux.h"
#include "core/or/circuitmux_ewma.h"
#include "core/or/circuitstats.h"
72
#include "lib/compress/compress.h"
73
#include "app/config/config.h"
74
#include "lib/encoding/confline.h"
75
76
77
78
79
80
81
#include "core/mainloop/connection.h"
#include "core/or/connection_edge.h"
#include "core/or/connection_or.h"
#include "feature/dircache/consdiffmgr.h"
#include "feature/control/control.h"
#include "app/config/confparse.h"
#include "core/mainloop/cpuworker.h"
82
83
#include "lib/crypt_ops/crypto_rand.h"
#include "lib/crypt_ops/crypto_util.h"
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#include "feature/dircache/dirserv.h"
#include "feature/relay/dns.h"
#include "core/or/dos.h"
#include "feature/client/entrynodes.h"
#include "core/or/git_revision.h"
#include "feature/stats/geoip.h"
#include "feature/hibernate/hibernate.h"
#include "core/mainloop/main.h"
#include "feature/nodelist/networkstatus.h"
#include "feature/nodelist/nodelist.h"
#include "core/or/policies.h"
#include "core/or/relay.h"
#include "feature/rend/rendclient.h"
#include "feature/rend/rendservice.h"
#include "feature/hs/hs_config.h"
#include "feature/stats/rephist.h"
#include "feature/relay/router.h"
101
#include "lib/sandbox/sandbox.h"
102
103
104
105
106
107
108
#include "feature/nodelist/routerlist.h"
#include "feature/nodelist/routerset.h"
#include "core/or/scheduler.h"
#include "app/config/statefile.h"
#include "feature/client/transports.h"
#include "feature/relay/ext_orport.h"
#include "feature/dircommon/voting_schedule.h"
109
#ifdef _WIN32
110
111
#include <shlobj.h>
#endif
112
113
114
115
116
117
118
119
120
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
Roger Dingledine's avatar
Roger Dingledine committed
121

122
#include "lib/meminfo/meminfo.h"
123
#include "lib/osinfo/uname.h"
124
125
126
127
128
#include "lib/process/daemon.h"
#include "lib/process/pidfile.h"
#include "lib/process/restrict.h"
#include "lib/process/setuid.h"
#include "lib/process/subprocess.h"
129
#include "lib/net/gethostname.h"
130
#include "lib/thread/numcpus.h"
131

132
#include "lib/encoding/keyval.h"
133
#include "lib/fs/conffile.h"
134
#include "lib/evloop/procmon.h"
135

136
137
#include "feature/dirauth/dirvote.h"
#include "feature/dirauth/mode.h"
138

139
140
#include "core/or/connection_st.h"
#include "core/or/port_cfg_st.h"
141

142
143
144
145
146
147
#ifdef HAVE_SYSTEMD
#   if defined(__COVERITY__) && !defined(__INCLUDE_LEVEL__)
/* Systemd's use of gcc's __INCLUDE_LEVEL__ extension macro appears to confuse
 * Coverity. Here's a kludge to unconfuse it.
 */
#   define __INCLUDE_LEVEL__ 2
148
#endif /* defined(__COVERITY__) && !defined(__INCLUDE_LEVEL__) */
149
#include <systemd/sd-daemon.h>
150
#endif /* defined(HAVE_SYSTEMD) */
151

152
/* Prefix used to indicate a Unix socket in a FooPort configuration. */
153
static const char unix_socket_prefix[] = "unix:";
154
155
156
/* Prefix used to indicate a Unix socket with spaces in it, in a FooPort
 * configuration. */
static const char unix_q_socket_prefix[] = "unix:\"";
157

158
159
160
161
/* limits for TCP send and recv buffer size used for constrained sockets */
#define MIN_CONSTRAINED_TCP_BUFFER 2048
#define MAX_CONSTRAINED_TCP_BUFFER 262144  /* 256k */

162
163
164
165
166
/** macro to help with the bulk rename of *DownloadSchedule to
 * *DowloadInitialDelay . */
#define DOWNLOAD_SCHEDULE(name) \
  { #name "DownloadSchedule", #name "DownloadInitialDelay", 0, 1 }

167
168
/** A list of abbreviations and aliases to map command-line options, obsolete
 * option names, or alternative option names, to their current values. */
169
static config_abbrev_t option_abbrevs_[] = {
170
171
172
173
  PLURAL(AuthDirBadDirCC),
  PLURAL(AuthDirBadExitCC),
  PLURAL(AuthDirInvalidCC),
  PLURAL(AuthDirRejectCC),
174
  PLURAL(EntryNode),
175
176
  PLURAL(ExcludeNode),
  PLURAL(FirewallPort),
177
  PLURAL(LongLivedPort),
178
179
  PLURAL(HiddenServiceNode),
  PLURAL(HiddenServiceExcludeNode),
180
  PLURAL(NumCPU),
181
  PLURAL(RendNode),
182
  PLURAL(RecommendedPackage),
183
  PLURAL(RendExcludeNode),
184
185
  PLURAL(StrictEntryNode),
  PLURAL(StrictExitNode),
186
  PLURAL(StrictNode),
187
  { "l", "Log", 1, 0},
188
  { "AllowUnverifiedNodes", "AllowInvalidNodes", 0, 0},
189
190
  { "AutomapHostSuffixes", "AutomapHostsSuffixes", 0, 0},
  { "AutomapHostOnResolve", "AutomapHostsOnResolve", 0, 0},
191
192
193
  { "BandwidthRateBytes", "BandwidthRate", 0, 0},
  { "BandwidthBurstBytes", "BandwidthBurst", 0, 0},
  { "DirFetchPostPeriod", "StatusFetchPeriod", 0, 0},
194
  { "DirServer", "DirAuthority", 0, 0}, /* XXXX later, make this warn? */
195
  { "MaxConn", "ConnLimit", 0, 1},
196
  { "MaxMemInCellQueues", "MaxMemInQueues", 0, 0},
197
198
199
  { "ORBindAddress", "ORListenAddress", 0, 0},
  { "DirBindAddress", "DirListenAddress", 0, 0},
  { "SocksBindAddress", "SocksListenAddress", 0, 0},
200
201
202
203
  { "UseHelperNodes", "UseEntryGuards", 0, 0},
  { "NumHelperNodes", "NumEntryGuards", 0, 0},
  { "UseEntryNodes", "UseEntryGuards", 0, 0},
  { "NumEntryNodes", "NumEntryGuards", 0, 0},
204
205
  { "ResolvConf", "ServerDNSResolvConfFile", 0, 1},
  { "SearchDomains", "ServerDNSSearchDomains", 0, 1},
206
  { "ServerDNSAllowBrokenResolvConf", "ServerDNSAllowBrokenConfig", 0, 0},
207
  { "PreferTunnelledDirConns", "PreferTunneledDirConns", 0, 0},
208
  { "BridgeAuthoritativeDirectory", "BridgeAuthoritativeDir", 0, 0},
209
  { "HashedControlPassword", "__HashedControlSessionPassword", 1, 0},
210
  { "VirtualAddrNetwork", "VirtualAddrNetworkIPv4", 0, 0},
211
  { "SocksSocketsGroupWritable", "UnixSocksGroupWritable", 0, 1},
212
213
214
  { "_HSLayer2Nodes", "HSLayer2Nodes", 0, 1 },
  { "_HSLayer3Nodes", "HSLayer3Nodes", 0, 1 },

215
216
217
218
219
220
221
222
223
224
  DOWNLOAD_SCHEDULE(ClientBootstrapConsensusAuthority),
  DOWNLOAD_SCHEDULE(ClientBootstrapConsensusAuthorityOnly),
  DOWNLOAD_SCHEDULE(ClientBootstrapConsensusFallback),
  DOWNLOAD_SCHEDULE(TestingBridge),
  DOWNLOAD_SCHEDULE(TestingBridgeBootstrap),
  DOWNLOAD_SCHEDULE(TestingClient),
  DOWNLOAD_SCHEDULE(TestingClientConsensus),
  DOWNLOAD_SCHEDULE(TestingServer),
  DOWNLOAD_SCHEDULE(TestingServerConsensus),

225
226
  { NULL, NULL, 0, 0},
};
227

228
229
230
231
/** dummy instance of or_options_t, used for type-checking its
 * members with CONF_CHECK_VAR_TYPE. */
DUMMY_TYPECHECK_INSTANCE(or_options_t);

Nick Mathewson's avatar
Nick Mathewson committed
232
233
234
235
/** An entry for config_vars: "The option <b>name</b> has type
 * CONFIG_TYPE_<b>conftype</b>, and corresponds to
 * or_options_t.<b>member</b>"
 */
236
#define VAR(name,conftype,member,initvalue)                             \
Neel Chauhan's avatar
Neel Chauhan committed
237
  { name, CONFIG_TYPE_ ## conftype, offsetof(or_options_t, member),     \
238
      initvalue CONF_TEST_MEMBERS(or_options_t, conftype, member) }
239
240
241
/** As VAR, but the option name and member name are the same. */
#define V(member,conftype,initvalue)                                    \
  VAR(#member, conftype, member, initvalue)
Nick Mathewson's avatar
Nick Mathewson committed
242
/** An entry for config_vars: "The option <b>name</b> is obsolete." */
243
244
245
#ifdef TOR_UNIT_TESTS
#define OBSOLETE(name) { name, CONFIG_TYPE_OBSOLETE, 0, NULL, {.INT=NULL} }
#else
246
#define OBSOLETE(name) { name, CONFIG_TYPE_OBSOLETE, 0, NULL }
247
#endif
248

249
250
251
252
253
254
255
256
257
258
259
/**
 * Macro to declare *Port options.  Each one comes in three entries.
 * For example, most users should use "SocksPort" to configure the
 * socks port, but TorBrowser wants to use __SocksPort so that it
 * isn't stored by SAVECONF.  The SocksPortLines virtual option is
 * used to query both options from the controller.
 */
#define VPORT(member)                                           \
  VAR(#member "Lines", LINELIST_V, member ## _lines, NULL),     \
  VAR(#member, LINELIST_S, member ## _lines, NULL),             \
  VAR("__" #member, LINELIST_S, member ## _lines, NULL)
260

Nick Mathewson's avatar
Nick Mathewson committed
261
262
263
264
/** Array of configuration options.  Until we disallow nonstandard
 * abbreviations, order is significant, since the first matching option will
 * be chosen first.
 */
265
static config_var_t option_vars_[] = {
266
  V(AccountingMax,               MEMUNIT,  "0 bytes"),
267
  VAR("AccountingRule",          STRING,   AccountingRule_option,  "max"),
268
269
  V(AccountingStart,             STRING,   NULL),
  V(Address,                     STRING,   NULL),
Nick Mathewson's avatar
Nick Mathewson committed
270
  OBSOLETE("AllowDotExit"),
271
  OBSOLETE("AllowInvalidNodes"),
272
  V(AllowNonRFC953Hostnames,     BOOL,     "0"),
273
  OBSOLETE("AllowSingleHopCircuits"),
274
  OBSOLETE("AllowSingleHopExits"),
275
276
  V(AlternateBridgeAuthority,    LINELIST, NULL),
  V(AlternateDirAuthority,       LINELIST, NULL),
277
  OBSOLETE("AlternateHSAuthority"),
278
  V(AssumeReachable,             BOOL,     "0"),
279
280
  OBSOLETE("AuthDirBadDir"),
  OBSOLETE("AuthDirBadDirCCs"),
281
  V(AuthDirBadExit,              LINELIST, NULL),
282
  V(AuthDirBadExitCCs,           CSV,      ""),
283
  V(AuthDirInvalid,              LINELIST, NULL),
284
  V(AuthDirInvalidCCs,           CSV,      ""),
285
  V(AuthDirFastGuarantee,        MEMUNIT,  "100 KB"),
286
  V(AuthDirGuardBWGuarantee,     MEMUNIT,  "2 MB"),
287
  V(AuthDirPinKeys,              BOOL,     "1"),
288
  V(AuthDirReject,               LINELIST, NULL),
289
  V(AuthDirRejectCCs,            CSV,      ""),
290
  OBSOLETE("AuthDirRejectUnlisted"),
291
  OBSOLETE("AuthDirListBadDirs"),
292
  V(AuthDirListBadExits,         BOOL,     "0"),
293
  V(AuthDirMaxServersPerAddr,    UINT,     "2"),
294
  OBSOLETE("AuthDirMaxServersPerAuthAddr"),
295
  V(AuthDirHasIPv6Connectivity,  BOOL,     "0"),
296
297
298
299
  VAR("AuthoritativeDirectory",  BOOL, AuthoritativeDir,    "0"),
  V(AutomapHostsOnResolve,       BOOL,     "0"),
  V(AutomapHostsSuffixes,        CSV,      ".onion,.exit"),
  V(AvoidDiskWrites,             BOOL,     "0"),
300
301
  V(BandwidthBurst,              MEMUNIT,  "1 GB"),
  V(BandwidthRate,               MEMUNIT,  "1 GB"),
302
303
  V(BridgeAuthoritativeDir,      BOOL,     "0"),
  VAR("Bridge",                  LINELIST, Bridges,    NULL),
304
  V(BridgePassword,              STRING,   NULL),
305
  V(BridgeRecordUsageByCountry,  BOOL,     "1"),
306
  V(BridgeRelay,                 BOOL,     "0"),
307
  V(BridgeDistribution,          STRING,   NULL),
308
309
  VAR("CacheDirectory",          FILENAME, CacheDirectory_option, NULL),
  V(CacheDirectoryGroupReadable, BOOL,     "0"),
310
  V(CellStatistics,              BOOL,     "0"),
311
  V(PaddingStatistics,           BOOL,     "1"),
312
  V(LearnCircuitBuildTimeout,    BOOL,     "1"),
313
  V(CircuitBuildTimeout,         INTERVAL, "0"),
314
315
  OBSOLETE("CircuitIdleTimeout"),
  V(CircuitsAvailableTimeout,    INTERVAL, "0"),
316
  V(CircuitStreamTimeout,        INTERVAL, "0"),
317
  V(CircuitPriorityHalflife,     DOUBLE,  "-1.0"), /*negative:'Use default'*/
318
  V(ClientDNSRejectInternalAddresses, BOOL,"1"),
319
  V(ClientOnly,                  BOOL,     "0"),
320
321
  V(ClientPreferIPv6ORPort,      AUTOBOOL, "auto"),
  V(ClientPreferIPv6DirPort,     AUTOBOOL, "auto"),
322
  V(ClientRejectInternalAddresses, BOOL,   "1"),
323
  V(ClientTransportPlugin,       LINELIST, NULL),
324
  V(ClientUseIPv6,               BOOL,     "0"),
325
  V(ClientUseIPv4,               BOOL,     "1"),
326
  V(ConsensusParams,             STRING,   NULL),
327
  V(ConnLimit,                   UINT,     "1000"),
328
  V(ConnDirectionStatistics,     BOOL,     "0"),
329
330
331
  V(ConstrainedSockets,          BOOL,     "0"),
  V(ConstrainedSockSize,         MEMUNIT,  "8192"),
  V(ContactInfo,                 STRING,   NULL),
332
  OBSOLETE("ControlListenAddress"),
333
  VPORT(ControlPort),
334
  V(ControlPortFileGroupReadable,BOOL,     "0"),
335
  V(ControlPortWriteToFile,      FILENAME, NULL),
336
  V(ControlSocket,               LINELIST, NULL),
337
  V(ControlSocketsGroupWritable, BOOL,     "0"),
338
  V(UnixSocksGroupWritable,    BOOL,     "0"),
339
340
341
  V(CookieAuthentication,        BOOL,     "0"),
  V(CookieAuthFileGroupReadable, BOOL,     "0"),
  V(CookieAuthFile,              STRING,   NULL),
342
  V(CountPrivateBandwidth,       BOOL,     "0"),
343
  VAR("DataDirectory",           FILENAME, DataDirectory_option, NULL),
344
  V(DataDirectoryGroupReadable,  BOOL,     "0"),
345
  V(DisableOOSCheck,             BOOL,     "1"),
346
  V(DisableNetwork,              BOOL,     "0"),
347
  V(DirAllowPrivateAddresses,    BOOL,     "0"),
348
  V(TestingAuthDirTimeToLearnReachability, INTERVAL, "30 minutes"),
349
  OBSOLETE("DirListenAddress"),
350
  V(DirPolicy,                   LINELIST, NULL),
351
  VPORT(DirPort),
352
  V(DirPortFrontPage,            FILENAME, NULL),
353
  VAR("DirReqStatistics",        BOOL,     DirReqStatistics_option, "1"),
354
  VAR("DirAuthority",            LINELIST, DirAuthorities, NULL),
355
  V(DirCache,                    BOOL,     "1"),
356
357
358
359
360
  /* A DirAuthorityFallbackRate of 0.1 means that 0.5% of clients try an
   * authority when all fallbacks are up, and 2% try an authority when 25% of
   * fallbacks are down. (We rebuild the list when 25% of fallbacks are down).
   *
   * We want to reduce load on authorities, but keep these two figures within
Nick Mathewson's avatar
Nick Mathewson committed
361
362
   * an order of magnitude, so there isn't too much load shifting to
   * authorities when fallbacks go down. */
363
  V(DirAuthorityFallbackRate,    DOUBLE,   "0.1"),
364
  V(DisableAllSwap,              BOOL,     "0"),
365
  V(DisableDebuggerAttachment,   BOOL,     "1"),
366
  OBSOLETE("DisableIOCP"),
367
  OBSOLETE("DisableV2DirectoryInfo_"),
368
  OBSOLETE("DynamicDHGroups"),
369
  VPORT(DNSPort),
370
  OBSOLETE("DNSListenAddress"),
371
372
373
  /* DoS circuit creation options. */
  V(DoSCircuitCreationEnabled,   AUTOBOOL, "auto"),
  V(DoSCircuitCreationMinConnections,      UINT, "0"),
374
  V(DoSCircuitCreationRate,      UINT,     "0"),
375
376
377
378
379
380
381
382
383
  V(DoSCircuitCreationBurst,     UINT,     "0"),
  V(DoSCircuitCreationDefenseType,         INT,  "0"),
  V(DoSCircuitCreationDefenseTimePeriod,   INTERVAL, "0"),
  /* DoS connection options. */
  V(DoSConnectionEnabled,        AUTOBOOL, "auto"),
  V(DoSConnectionMaxConcurrentCount,       UINT, "0"),
  V(DoSConnectionDefenseType,    INT,      "0"),
  /* DoS single hop client options. */
  V(DoSRefuseSingleHopClientRendezvous,    AUTOBOOL, "auto"),
384
  V(DownloadExtraInfo,           BOOL,     "0"),
385
  V(TestingEnableConnBwEvent,    BOOL,     "0"),
386
  V(TestingEnableCellStatsEvent, BOOL,     "0"),
387
  OBSOLETE("TestingEnableTbEmptyEvent"),
388
  V(EnforceDistinctSubnets,      BOOL,     "1"),
389
  V(EntryNodes,                  ROUTERSET,   NULL),
390
  V(EntryStatistics,             BOOL,     "0"),
391
  V(TestingEstimatedDescriptorPropagationTime, INTERVAL, "10 minutes"),
392
393
  V(ExcludeNodes,                ROUTERSET, NULL),
  V(ExcludeExitNodes,            ROUTERSET, NULL),
394
  OBSOLETE("ExcludeSingleHopRelays"),
395
  V(ExitNodes,                   ROUTERSET, NULL),
396
397
  V(ExitPolicy,                  LINELIST, NULL),
  V(ExitPolicyRejectPrivate,     BOOL,     "1"),
398
  V(ExitPolicyRejectLocalInterfaces, BOOL, "0"),
399
  V(ExitPortStatistics,          BOOL,     "0"),
400
  V(ExtendAllowPrivateAddresses, BOOL,     "0"),
401
  V(ExitRelay,                   AUTOBOOL, "auto"),
402
  VPORT(ExtORPort),
403
  V(ExtORPortCookieAuthFile,     STRING,   NULL),
404
  V(ExtORPortCookieAuthFileGroupReadable, BOOL, "0"),
405
  V(ExtraInfoStatistics,         BOOL,     "1"),
406
  V(ExtendByEd25519ID,           AUTOBOOL, "auto"),
407
  V(FallbackDir,                 LINELIST, NULL),
408

409
  V(UseDefaultFallbackDirs,      BOOL,     "1"),
410

411
  OBSOLETE("FallbackNetworkstatusFile"),
412
413
  V(FascistFirewall,             BOOL,     "0"),
  V(FirewallPorts,               CSV,      ""),
414
  OBSOLETE("FastFirstHopPK"),
415
  V(FetchDirInfoEarly,           BOOL,     "0"),
416
  V(FetchDirInfoExtraEarly,      BOOL,     "0"),
417
418
419
  V(FetchServerDescriptors,      BOOL,     "1"),
  V(FetchHidServDescriptors,     BOOL,     "1"),
  V(FetchUselessDescriptors,     BOOL,     "0"),
420
  OBSOLETE("FetchV2Networkstatus"),
421
  V(GeoIPExcludeUnknown,         AUTOBOOL, "auto"),
422
#ifdef _WIN32
423
  V(GeoIPFile,                   FILENAME, "<default>"),
nils's avatar
nils committed
424
  V(GeoIPv6File,                 FILENAME, "<default>"),
425
#else
426
427
  V(GeoIPFile,                   FILENAME,
    SHARE_DATADIR PATH_SEPARATOR "tor" PATH_SEPARATOR "geoip"),
nils's avatar
nils committed
428
429
  V(GeoIPv6File,                 FILENAME,
    SHARE_DATADIR PATH_SEPARATOR "tor" PATH_SEPARATOR "geoip6"),
430
#endif /* defined(_WIN32) */
431
  OBSOLETE("Group"),
432
  V(GuardLifetime,               INTERVAL, "0 minutes"),
433
  V(HardwareAccel,               BOOL,     "0"),
434
  V(HeartbeatPeriod,             INTERVAL, "6 hours"),
Alexander Færøy's avatar
Alexander Færøy committed
435
  V(MainloopStats,               BOOL,     "0"),
436
437
  V(AccelName,                   STRING,   NULL),
  V(AccelDir,                    FILENAME, NULL),
438
  V(HashedControlPassword,       LINELIST, NULL),
439
  OBSOLETE("HidServDirectoryV2"),
Nick Mathewson's avatar
Nick Mathewson committed
440
  VAR("HiddenServiceDir",    LINELIST_S, RendConfigLines,    NULL),
441
  VAR("HiddenServiceDirGroupReadable",  LINELIST_S, RendConfigLines, NULL),
Nick Mathewson's avatar
Nick Mathewson committed
442
443
  VAR("HiddenServiceOptions",LINELIST_V, RendConfigLines,    NULL),
  VAR("HiddenServicePort",   LINELIST_S, RendConfigLines,    NULL),
444
  VAR("HiddenServiceVersion",LINELIST_S, RendConfigLines,    NULL),
445
  VAR("HiddenServiceAuthorizeClient",LINELIST_S,RendConfigLines, NULL),
446
  VAR("HiddenServiceAllowUnknownPorts",LINELIST_S, RendConfigLines, NULL),
447
448
  VAR("HiddenServiceMaxStreams",LINELIST_S, RendConfigLines, NULL),
  VAR("HiddenServiceMaxStreamsCloseCircuit",LINELIST_S, RendConfigLines, NULL),
449
  VAR("HiddenServiceNumIntroductionPoints", LINELIST_S, RendConfigLines, NULL),
Nick Mathewson's avatar
Nick Mathewson committed
450
  VAR("HiddenServiceStatistics", BOOL, HiddenServiceStatistics_option, "1"),
451
  V(HidServAuth,                 LINELIST, NULL),
452
  OBSOLETE("CloseHSClientCircuitsImmediatelyOnTimeout"),
453
  OBSOLETE("CloseHSServiceRendCircuitsImmediatelyOnTimeout"),
454
455
  V(HiddenServiceSingleHopMode,  BOOL,     "0"),
  V(HiddenServiceNonAnonymousMode,BOOL,    "0"),
456
457
458
459
  V(HTTPProxy,                   STRING,   NULL),
  V(HTTPProxyAuthenticator,      STRING,   NULL),
  V(HTTPSProxy,                  STRING,   NULL),
  V(HTTPSProxyAuthenticator,     STRING,   NULL),
460
  VPORT(HTTPTunnelPort),
461
  V(IPv6Exit,                    BOOL,     "0"),
462
  VAR("ServerTransportPlugin",   LINELIST, ServerTransportPlugin,  NULL),
463
  V(ServerTransportListenAddr,   LINELIST, NULL),
464
  V(ServerTransportOptions,      LINELIST, NULL),
465
  V(SigningKeyLifetime,          INTERVAL, "30 days"),
466
467
468
469
  V(Socks4Proxy,                 STRING,   NULL),
  V(Socks5Proxy,                 STRING,   NULL),
  V(Socks5ProxyUsername,         STRING,   NULL),
  V(Socks5ProxyPassword,         STRING,   NULL),
470
471
  VAR("KeyDirectory",            FILENAME, KeyDirectory_option, NULL),
  V(KeyDirectoryGroupReadable,   BOOL,     "0"),
472
473
  VAR("HSLayer2Nodes",           ROUTERSET,  HSLayer2Nodes,  NULL),
  VAR("HSLayer3Nodes",           ROUTERSET,  HSLayer3Nodes,  NULL),
474
  V(KeepalivePeriod,             INTERVAL, "5 minutes"),
475
  V(KeepBindCapabilities,            AUTOBOOL, "auto"),
476
  VAR("Log",                     LINELIST, Logs,             NULL),
477
  V(LogMessageDomains,           BOOL,     "0"),
478
  V(LogTimeGranularity,          MSEC_INTERVAL, "1 second"),
Arlo Breault's avatar
Arlo Breault committed
479
  V(TruncateLogFile,             BOOL,     "0"),
Peter Palfrader's avatar
Peter Palfrader committed
480
  V(SyslogIdentityTag,           STRING,   NULL),
481
  V(AndroidIdentityTag,          STRING,   NULL),
482
  V(LongLivedPorts,              CSV,
Nick Mathewson's avatar
Nick Mathewson committed
483
        "21,22,706,1863,5050,5190,5222,5223,6523,6667,6697,8300"),
484
485
486
  VAR("MapAddress",              LINELIST, AddressMap,           NULL),
  V(MaxAdvertisedBandwidth,      MEMUNIT,  "1 GB"),
  V(MaxCircuitDirtiness,         INTERVAL, "10 minutes"),
487
  V(MaxClientCircuitsPending,    UINT,     "32"),
488
  V(MaxConsensusAgeForDiffs,     INTERVAL, "0 seconds"),
489
  VAR("MaxMemInQueues",          MEMUNIT,   MaxMemInQueues_raw, "0"),
490
491
  OBSOLETE("MaxOnionsPending"),
  V(MaxOnionQueueDelay,          MSEC_INTERVAL, "1750 msec"),
492
  V(MaxUnparseableDescSizeToLog, MEMUNIT, "10 MB"),
493
  V(MinMeasuredBWsForAuthToIgnoreAdvertised, INT, "500"),
494
  VAR("MyFamily",                LINELIST, MyFamily_lines,       NULL),
495
  V(NewCircuitPeriod,            INTERVAL, "30 seconds"),
496
  OBSOLETE("NamingAuthoritativeDirectory"),
497
  OBSOLETE("NATDListenAddress"),
498
  VPORT(NATDPort),
499
  V(Nickname,                    STRING,   NULL),
500
  OBSOLETE("PredictedPortsRelevanceTime"),
501
  OBSOLETE("WarnUnsafeSocks"),
502
  VAR("NodeFamily",              LINELIST, NodeFamilies,         NULL),
503
  V(NoExec,                      BOOL,     "0"),
504
  V(NumCPUs,                     UINT,     "0"),
505
  V(NumDirectoryGuards,          UINT,     "0"),
506
  V(NumEntryGuards,              UINT,     "0"),
507
  V(NumPrimaryGuards,            UINT,     "0"),
Nick Mathewson's avatar
Nick Mathewson committed
508
  V(OfflineMasterKey,            BOOL,     "0"),
509
  OBSOLETE("ORListenAddress"),
510
  VPORT(ORPort),
511
  V(OutboundBindAddress,         LINELIST,   NULL),
512
513
  V(OutboundBindAddressOR,       LINELIST,   NULL),
  V(OutboundBindAddressExit,     LINELIST,   NULL),
514

515
  OBSOLETE("PathBiasDisableRate"),
516
517
  V(PathBiasCircThreshold,       INT,      "-1"),
  V(PathBiasNoticeRate,          DOUBLE,   "-1"),
518
  V(PathBiasWarnRate,            DOUBLE,   "-1"),
519
  V(PathBiasExtremeRate,         DOUBLE,   "-1"),
520
  V(PathBiasScaleThreshold,      INT,      "-1"),
521
522
  OBSOLETE("PathBiasScaleFactor"),
  OBSOLETE("PathBiasMultFactor"),
523
  V(PathBiasDropGuards,          AUTOBOOL, "0"),
524
525
526
527
528
529
  OBSOLETE("PathBiasUseCloseCounts"),

  V(PathBiasUseThreshold,       INT,      "-1"),
  V(PathBiasNoticeUseRate,          DOUBLE,   "-1"),
  V(PathBiasExtremeUseRate,         DOUBLE,   "-1"),
  V(PathBiasScaleUseThreshold,      INT,      "-1"),
530

531
  V(PathsNeededToBuildCircuits,  DOUBLE,   "-1"),
532
533
  V(PerConnBWBurst,              MEMUNIT,  "0"),
  V(PerConnBWRate,               MEMUNIT,  "0"),
534
  V(PidFile,                     STRING,   NULL),
535
  V(TestingTorNetwork,           BOOL,     "0"),
536
  V(TestingMinExitFlagThreshold, MEMUNIT,  "0"),
537
  V(TestingMinFastFlagThreshold, MEMUNIT,  "0"),
538

539
  V(TestingLinkCertLifetime,          INTERVAL, "2 days"),
540
541
542
543
544
  V(TestingAuthKeyLifetime,          INTERVAL, "2 days"),
  V(TestingLinkKeySlop,              INTERVAL, "3 hours"),
  V(TestingAuthKeySlop,              INTERVAL, "3 hours"),
  V(TestingSigningKeySlop,           INTERVAL, "1 day"),

545
  V(OptimisticData,              AUTOBOOL, "auto"),
546
547
  OBSOLETE("PortForwarding"),
  OBSOLETE("PortForwardingHelper"),
548
  OBSOLETE("PreferTunneledDirConns"),
549
  V(ProtocolWarnings,            BOOL,     "0"),
550
  V(PublishServerDescriptor,     CSV,      "1"),
551
552
553
554
555
556
557
  V(PublishHidServDescriptors,   BOOL,     "1"),
  V(ReachableAddresses,          LINELIST, NULL),
  V(ReachableDirAddresses,       LINELIST, NULL),
  V(ReachableORAddresses,        LINELIST, NULL),
  V(RecommendedVersions,         LINELIST, NULL),
  V(RecommendedClientVersions,   LINELIST, NULL),
  V(RecommendedServerVersions,   LINELIST, NULL),
558
  V(RecommendedPackages,         LINELIST, NULL),
559
560
  V(ReducedConnectionPadding,    BOOL,     "0"),
  V(ConnectionPadding,           AUTOBOOL, "auto"),
561
  V(RefuseUnknownExits,          AUTOBOOL, "auto"),
562
  V(RejectPlaintextPorts,        CSV,      ""),
563
564
565
566
567
  V(RelayBandwidthBurst,         MEMUNIT,  "0"),
  V(RelayBandwidthRate,          MEMUNIT,  "0"),
  V(RendPostPeriod,              INTERVAL, "1 hour"),
  V(RephistTrackTime,            INTERVAL, "24 hours"),
  V(RunAsDaemon,                 BOOL,     "0"),
568
  V(ReducedExitPolicy,           BOOL,     "0"),
569
  OBSOLETE("RunTesting"), // currently unused
570
  V(Sandbox,                     BOOL,     "0"),
571
  V(SafeLogging,                 STRING,   "1"),
572
  V(SafeSocks,                   BOOL,     "0"),
573
  V(ServerDNSAllowBrokenConfig,  BOOL,     "1"),
574
575
  V(ServerDNSAllowNonRFC953Hostnames, BOOL,"0"),
  V(ServerDNSDetectHijacking,    BOOL,     "1"),
576
  V(ServerDNSRandomizeCase,      BOOL,     "1"),
577
578
579
  V(ServerDNSResolvConfFile,     STRING,   NULL),
  V(ServerDNSSearchDomains,      BOOL,     "0"),
  V(ServerDNSTestAddresses,      CSV,
580
      "www.google.com,www.mit.edu,www.yahoo.com,www.slashdot.org"),
581
582
583
584
585
  OBSOLETE("SchedulerLowWaterMark__"),
  OBSOLETE("SchedulerHighWaterMark__"),
  OBSOLETE("SchedulerMaxFlushCells__"),
  V(KISTSchedRunInterval,        MSEC_INTERVAL, "0 msec"),
  V(KISTSockBufSizeFactor,       DOUBLE,   "1.0"),
586
  V(Schedulers,                  CSV,      "KIST,KISTLite,Vanilla"),
587
  V(ShutdownWaitLength,          INTERVAL, "30 seconds"),
588
  OBSOLETE("SocksListenAddress"),
589
  V(SocksPolicy,                 LINELIST, NULL),
590
  VPORT(SocksPort),
591
  V(SocksTimeout,                INTERVAL, "2 minutes"),
592
  V(SSLKeyLifetime,              INTERVAL, "0"),
593
594
  OBSOLETE("StrictEntryNodes"),
  OBSOLETE("StrictExitNodes"),
595
  V(StrictNodes,                 BOOL,     "0"),
596
  OBSOLETE("Support022HiddenServices"),
597
  V(TestSocks,                   BOOL,     "0"),
598
  V(TokenBucketRefillInterval,   MSEC_INTERVAL, "100 msec"),
David Goulet's avatar
David Goulet committed
599
600
  OBSOLETE("Tor2webMode"),
  OBSOLETE("Tor2webRendezvousPoints"),
601
  OBSOLETE("TLSECGroup"),
602
603
  V(TrackHostExits,              CSV,      NULL),
  V(TrackHostExitsExpire,        INTERVAL, "30 minutes"),
604
  OBSOLETE("TransListenAddress"),
605
  VPORT(TransPort),
606
  V(TransProxyType,              STRING,   "default"),
607
  OBSOLETE("TunnelDirConns"),
608
  V(UpdateBridgesFromAuthority,  BOOL,     "0"),
609
  V(UseBridges,                  BOOL,     "0"),
610
  VAR("UseEntryGuards",          BOOL,     UseEntryGuards_option, "1"),
Nick Mathewson's avatar
Nick Mathewson committed
611
  OBSOLETE("UseEntryGuardsAsDirGuards"),
612
  V(UseGuardFraction,            AUTOBOOL, "auto"),
613
  V(UseMicrodescriptors,         AUTOBOOL, "auto"),
614
  OBSOLETE("UseNTorHandshake"),
615
  V(User,                        STRING,   NULL),
616
  OBSOLETE("UserspaceIOCPBuffers"),
617
  V(AuthDirSharedRandomness,     BOOL,     "1"),
618
  V(AuthDirTestEd25519LinkKeys,  BOOL,     "1"),
619
  OBSOLETE("V1AuthoritativeDirectory"),
620
  OBSOLETE("V2AuthoritativeDirectory"),
621
  VAR("V3AuthoritativeDirectory",BOOL, V3AuthoritativeDir,   "0"),
622
623
624
  V(TestingV3AuthInitialVotingInterval, INTERVAL, "30 minutes"),
  V(TestingV3AuthInitialVoteDelay, INTERVAL, "5 minutes"),
  V(TestingV3AuthInitialDistDelay, INTERVAL, "5 minutes"),
625
  V(TestingV3AuthVotingStartOffset, INTERVAL, "0"),
626
627
628
629
  V(V3AuthVotingInterval,        INTERVAL, "1 hour"),
  V(V3AuthVoteDelay,             INTERVAL, "5 minutes"),
  V(V3AuthDistDelay,             INTERVAL, "5 minutes"),
  V(V3AuthNIntervalsValid,       UINT,     "3"),
630
  V(V3AuthUseLegacyKey,          BOOL,     "0"),
631
  V(V3BandwidthsFile,            FILENAME, NULL),
632
  V(GuardfractionFile,           FILENAME, NULL),
633
  VAR("VersioningAuthoritativeDirectory",BOOL,VersioningAuthoritativeDir, "0"),
634
  OBSOLETE("VoteOnHidServDirectoriesV2"),
635
636
  V(VirtualAddrNetworkIPv4,      STRING,   "127.192.0.0/10"),
  V(VirtualAddrNetworkIPv6,      STRING,   "[FE80::]/10"),
637
  V(WarnPlaintextPorts,          CSV,      "23,109,110,143"),
638
639
  OBSOLETE("UseFilteringSSLBufferevents"),
  OBSOLETE("__UseFilteringSSLBufferevents"),
640
  VAR("__ReloadTorrcOnSIGHUP",   BOOL,  ReloadTorrcOnSIGHUP,      "1"),
641
642
  VAR("__AllDirActionsPrivate",  BOOL,  AllDirActionsPrivate,     "0"),
  VAR("__DisablePredictedCircuits",BOOL,DisablePredictedCircuits, "0"),
643
  VAR("__DisableSignalHandlers", BOOL,  DisableSignalHandlers,    "0"),
644
  VAR("__LeaveStreamsUnattached",BOOL,  LeaveStreamsUnattached,   "0"),
645
646
  VAR("__HashedControlSessionPassword", LINELIST, HashedControlSessionPassword,
      NULL),
647
  VAR("__OwningControllerProcess",STRING,OwningControllerProcess, NULL),
648
  VAR("__OwningControllerFD",INT,OwningControllerFD, "-1"),
649
  V(MinUptimeHidServDirectoryV2, INTERVAL, "96 hours"),
650
651
652
653
  V(TestingServerDownloadInitialDelay, CSV_INTERVAL, "0"),
  V(TestingClientDownloadInitialDelay, CSV_INTERVAL, "0"),
  V(TestingServerConsensusDownloadInitialDelay, CSV_INTERVAL, "0"),
  V(TestingClientConsensusDownloadInitialDelay, CSV_INTERVAL, "0"),
654
  /* With the ClientBootstrapConsensus*Download* below:
655
   * Clients with only authorities will try:
656
657
   *  - at least 3 authorities over 10 seconds, then exponentially backoff,
   *    with the next attempt 3-21 seconds later,
658
   * Clients with authorities and fallbacks will try:
659
660
   *  - at least 2 authorities and 4 fallbacks over 21 seconds, then
   *    exponentially backoff, with the next attempts 4-33 seconds later,
661
   * Clients will also retry when an application request arrives.
662
   * After a number of failed requests, clients retry every 3 days + 1 hour.
663
664
665
666
667
668
   *
   * Clients used to try 2 authorities over 10 seconds, then wait for
   * 60 minutes or an application request.
   *
   * When clients have authorities and fallbacks available, they use these
   * schedules: (we stagger the times to avoid thundering herds) */
669
670
  V(ClientBootstrapConsensusAuthorityDownloadInitialDelay, CSV_INTERVAL, "6"),
  V(ClientBootstrapConsensusFallbackDownloadInitialDelay, CSV_INTERVAL, "0"),
671
  /* When clients only have authorities available, they use this schedule: */
672
  V(ClientBootstrapConsensusAuthorityOnlyDownloadInitialDelay, CSV_INTERVAL,
673
    "0"),
674
675
676
677
  /* We don't want to overwhelm slow networks (or mirrors whose replies are
   * blocked), but we also don't want to fail if only some mirrors are
   * blackholed. Clients will try 3 directories simultaneously.
   * (Relays never use simultaneous connections.) */
678
  V(ClientBootstrapConsensusMaxInProgressTries, UINT, "3"),
679
680
  /* When a client has any running bridges, check each bridge occasionally,
    * whether or not that bridge is actually up. */
681
  V(TestingBridgeDownloadInitialDelay, CSV_INTERVAL,"10800"),
682
683
684
685
  /* When a client is just starting, or has no running bridges, check each
   * bridge a few times quickly, and then try again later. These schedules
   * are much longer than the other schedules, because we try each and every
   * configured bridge with this schedule. */
686
  V(TestingBridgeBootstrapDownloadInitialDelay, CSV_INTERVAL, "0"),
687
688
  V(TestingClientMaxIntervalWithoutRequest, INTERVAL, "10 minutes"),
  V(TestingDirConnectionMaxStall, INTERVAL, "5 minutes"),
689
690
691
692
693
694
  OBSOLETE("TestingConsensusMaxDownloadTries"),
  OBSOLETE("ClientBootstrapConsensusMaxDownloadTries"),
  OBSOLETE("ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries"),
  OBSOLETE("TestingDescriptorMaxDownloadTries"),
  OBSOLETE("TestingMicrodescMaxDownloadTries"),
  OBSOLETE("TestingCertMaxDownloadTries"),
695
  V(TestingDirAuthVoteExit, ROUTERSET, NULL),
696
  V(TestingDirAuthVoteExitIsStrict,  BOOL,     "0"),
697
  V(TestingDirAuthVoteGuard, ROUTERSET, NULL),
698
  V(TestingDirAuthVoteGuardIsStrict,  BOOL,     "0"),
699
  V(TestingDirAuthVoteHSDir, ROUTERSET, NULL),
700
  V(TestingDirAuthVoteHSDirIsStrict,  BOOL,     "0"),
701
  VAR("___UsingTestNetworkDefaults", BOOL, UsingTestNetworkDefaults_, "0"),
702

703
  END_OF_CONFIG_VARS
704
};
705

706
707
/** Override default values with these if the user sets the TestingTorNetwork
 * option. */
708
static const config_var_t testing_tor_network_defaults[] = {
709
710
711
712
  V(DirAllowPrivateAddresses,    BOOL,     "1"),
  V(EnforceDistinctSubnets,      BOOL,     "0"),
  V(AssumeReachable,             BOOL,     "1"),
  V(AuthDirMaxServersPerAddr,    UINT,     "0"),
713
714
  V(ClientBootstrapConsensusAuthorityDownloadInitialDelay, CSV_INTERVAL, "0"),
  V(ClientBootstrapConsensusFallbackDownloadInitialDelay, CSV_INTERVAL, "0"),
715
  V(ClientBootstrapConsensusAuthorityOnlyDownloadInitialDelay, CSV_INTERVAL,
716
    "0"),
717
  V(ClientDNSRejectInternalAddresses, BOOL,"0"),
718
  V(ClientRejectInternalAddresses, BOOL,   "0"),
719
  V(CountPrivateBandwidth,       BOOL,     "1"),
720
  V(ExitPolicyRejectPrivate,     BOOL,     "0"),
721
  V(ExtendAllowPrivateAddresses, BOOL,     "1"),
722
723
724
  V(V3AuthVotingInterval,        INTERVAL, "5 minutes"),
  V(V3AuthVoteDelay,             INTERVAL, "20 seconds"),
  V(V3AuthDistDelay,             INTERVAL, "20 seconds"),
725
  V(TestingV3AuthInitialVotingInterval, INTERVAL, "150 seconds"),
726
727
728
729
  V(TestingV3AuthInitialVoteDelay, INTERVAL, "20 seconds"),
  V(TestingV3AuthInitialDistDelay, INTERVAL, "20 seconds"),
  V(TestingAuthDirTimeToLearnReachability, INTERVAL, "0 minutes"),
  V(TestingEstimatedDescriptorPropagationTime, INTERVAL, "0 minutes"),
730
  V(MinUptimeHidServDirectoryV2, INTERVAL, "0 minutes"),
731
732
733
734
735
736
  V(TestingServerDownloadInitialDelay, CSV_INTERVAL, "0"),
  V(TestingClientDownloadInitialDelay, CSV_INTERVAL, "0"),
  V(TestingServerConsensusDownloadInitialDelay, CSV_INTERVAL, "0"),
  V(TestingClientConsensusDownloadInitialDelay, CSV_INTERVAL, "0"),
  V(TestingBridgeDownloadInitialDelay, CSV_INTERVAL, "10"),
  V(TestingBridgeBootstrapDownloadInitialDelay, CSV_INTERVAL, "0"),
737
738
  V(TestingClientMaxIntervalWithoutRequest, INTERVAL, "5 seconds"),
  V(TestingDirConnectionMaxStall, INTERVAL, "30 seconds"),
739
  V(TestingEnableConnBwEvent,    BOOL,     "1"),
740
  V(TestingEnableCellStatsEvent, BOOL,     "1"),
741
  VAR("___UsingTestNetworkDefaults", BOOL, UsingTestNetworkDefaults_, "1"),
742
  V(RendPostPeriod,              INTERVAL, "2 minutes"),
743

744
  END_OF_CONFIG_VARS
745
};
746

747
#undef VAR
748
#undef V
749
750
#undef OBSOLETE

751
static const config_deprecation_t option_deprecation_notes_[] = {
752
  /* Deprecated since 0.3.2.0-alpha. */
753
754
755
756
  { "HTTPProxy", "It only applies to direct unencrypted HTTP connections "
    "to your directory server, which your Tor probably wasn't using." },
  { "HTTPProxyAuthenticator", "HTTPProxy is deprecated in favor of HTTPSProxy "
    "which should be used with HTTPSProxyAuthenticator." },
757
758
759
  /* End of options deprecated since 0.3.2.1-alpha */

  /* Options deprecated since 0.3.2.2-alpha */
760
761
762
763
  { "ReachableDirAddresses", "It has no effect on relays, and has had no "
    "effect on clients since 0.2.8." },
  { "ClientPreferIPv6DirPort", "It has no effect on relays, and has had no "
    "effect on clients since 0.2.8." },
764
  /* End of options deprecated since 0.3.2.2-alpha. */
765

766
767
768
  { NULL, NULL }
};

769
#ifdef _WIN32
770
771
static char *get_windows_conf_root(void);
#endif
772
773
774
static int options_act_reversible(const or_options_t *old_options, char **msg);
static int options_transition_allowed(const or_options_t *old,
                                      const or_options_t *new,
775
                                      char **msg);
776
777
778
779
static int options_transition_affects_workers(
      const or_options_t *old_options, const or_options_t *new_options);
static int options_transition_affects_descriptor(
      const or_options_t *old_options, const or_options_t *new_options);
780
781
static int options_transition_affects_dirauth_timing(
      const or_options_t *old_options, const or_options_t *new_options);
782
783
784
static int normalize_nickname_list(config_line_t **normalized_out,
                                   const config_line_t *lst, const char *name,
                                   char **msg);
785
786
static char *get_bindaddr_from_transport_listen_line(const char *line,
                                                     const char *transport);
787
static int parse_ports(or_options_t *options, int validate_only,