or_options_st.h 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125
  1. /* Copyright (c) 2001 Matej Pfajfar.
  2. * Copyright (c) 2001-2004, Roger Dingledine.
  3. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  4. * Copyright (c) 2007-2019, The Tor Project, Inc. */
  5. /* See LICENSE for licensing information */
  6. /**
  7. * \file or_options_st.h
  8. *
  9. * \brief The or_options_t structure, which represents Tor's configuration.
  10. */
  11. #ifndef TOR_OR_OPTIONS_ST_H
  12. #define TOR_OR_OPTIONS_ST_H
  13. #include "lib/cc/torint.h"
  14. #include "lib/net/address.h"
  15. struct smartlist_t;
  16. struct config_line_t;
  17. struct config_suite_t;
  18. /** Enumeration of outbound address configuration types:
  19. * Exit-only, OR-only, or both */
  20. typedef enum {OUTBOUND_ADDR_EXIT, OUTBOUND_ADDR_OR,
  21. OUTBOUND_ADDR_EXIT_AND_OR,
  22. OUTBOUND_ADDR_MAX} outbound_addr_t;
  23. /** Configuration options for a Tor process. */
  24. struct or_options_t {
  25. uint32_t magic_;
  26. /** What should the tor process actually do? */
  27. enum {
  28. CMD_RUN_TOR=0, CMD_LIST_FINGERPRINT, CMD_HASH_PASSWORD,
  29. CMD_VERIFY_CONFIG, CMD_RUN_UNITTESTS, CMD_DUMP_CONFIG,
  30. CMD_KEYGEN,
  31. CMD_KEY_EXPIRATION,
  32. } command;
  33. char *command_arg; /**< Argument for command-line option. */
  34. struct config_line_t *Logs; /**< New-style list of configuration lines
  35. * for logs */
  36. int LogTimeGranularity; /**< Log resolution in milliseconds. */
  37. int LogMessageDomains; /**< Boolean: Should we log the domain(s) in which
  38. * each log message occurs? */
  39. int TruncateLogFile; /**< Boolean: Should we truncate the log file
  40. before we start writing? */
  41. char *SyslogIdentityTag; /**< Identity tag to add for syslog logging. */
  42. char *AndroidIdentityTag; /**< Identity tag to add for Android logging. */
  43. char *DebugLogFile; /**< Where to send verbose log messages. */
  44. char *DataDirectory_option; /**< Where to store long-term data, as
  45. * configured by the user. */
  46. char *DataDirectory; /**< Where to store long-term data, as modified. */
  47. int DataDirectoryGroupReadable; /**< Boolean: Is the DataDirectory g+r? */
  48. char *KeyDirectory_option; /**< Where to store keys, as
  49. * configured by the user. */
  50. char *KeyDirectory; /**< Where to store keys data, as modified. */
  51. int KeyDirectoryGroupReadable; /**< Boolean: Is the KeyDirectory g+r? */
  52. char *CacheDirectory_option; /**< Where to store cached data, as
  53. * configured by the user. */
  54. char *CacheDirectory; /**< Where to store cached data, as modified. */
  55. int CacheDirectoryGroupReadable; /**< Boolean: Is the CacheDirectory g+r? */
  56. char *Nickname; /**< OR only: nickname of this onion router. */
  57. char *Address; /**< OR only: configured address for this onion router. */
  58. char *PidFile; /**< Where to store PID of Tor process. */
  59. routerset_t *ExitNodes; /**< Structure containing nicknames, digests,
  60. * country codes and IP address patterns of ORs to
  61. * consider as exits. */
  62. routerset_t *MiddleNodes; /**< Structure containing nicknames, digests,
  63. * country codes and IP address patterns of ORs to
  64. * consider as middles. */
  65. routerset_t *EntryNodes;/**< Structure containing nicknames, digests,
  66. * country codes and IP address patterns of ORs to
  67. * consider as entry points. */
  68. int StrictNodes; /**< Boolean: When none of our EntryNodes or ExitNodes
  69. * are up, or we need to access a node in ExcludeNodes,
  70. * do we just fail instead? */
  71. routerset_t *ExcludeNodes;/**< Structure containing nicknames, digests,
  72. * country codes and IP address patterns of ORs
  73. * not to use in circuits. But see StrictNodes
  74. * above. */
  75. routerset_t *ExcludeExitNodes;/**< Structure containing nicknames, digests,
  76. * country codes and IP address patterns of
  77. * ORs not to consider as exits. */
  78. /** Union of ExcludeNodes and ExcludeExitNodes */
  79. routerset_t *ExcludeExitNodesUnion_;
  80. int DisableAllSwap; /**< Boolean: Attempt to call mlockall() on our
  81. * process for all current and future memory. */
  82. struct config_line_t *ExitPolicy; /**< Lists of exit policy components. */
  83. int ExitPolicyRejectPrivate; /**< Should we not exit to reserved private
  84. * addresses, and our own published addresses?
  85. */
  86. int ExitPolicyRejectLocalInterfaces; /**< Should we not exit to local
  87. * interface addresses?
  88. * Includes OutboundBindAddresses and
  89. * configured ports. */
  90. int ReducedExitPolicy; /**<Should we use the Reduced Exit Policy? */
  91. struct config_line_t *SocksPolicy; /**< Lists of socks policy components */
  92. struct config_line_t *DirPolicy; /**< Lists of dir policy components */
  93. /** Local address to bind outbound sockets */
  94. struct config_line_t *OutboundBindAddress;
  95. /** Local address to bind outbound relay sockets */
  96. struct config_line_t *OutboundBindAddressOR;
  97. /** Local address to bind outbound exit sockets */
  98. struct config_line_t *OutboundBindAddressExit;
  99. /** Addresses derived from the various OutboundBindAddress lines.
  100. * [][0] is IPv4, [][1] is IPv6
  101. */
  102. tor_addr_t OutboundBindAddresses[OUTBOUND_ADDR_MAX][2];
  103. /** Directory server only: which versions of
  104. * Tor should we tell users to run? */
  105. struct config_line_t *RecommendedVersions;
  106. struct config_line_t *RecommendedClientVersions;
  107. struct config_line_t *RecommendedServerVersions;
  108. /** Whether dirservers allow router descriptors with private IPs. */
  109. int DirAllowPrivateAddresses;
  110. /** Whether routers accept EXTEND cells to routers with private IPs. */
  111. int ExtendAllowPrivateAddresses;
  112. char *User; /**< Name of user to run Tor as. */
  113. /** Ports to listen on for OR connections. */
  114. struct config_line_t *ORPort_lines;
  115. /** Ports to listen on for extended OR connections. */
  116. struct config_line_t *ExtORPort_lines;
  117. /** Ports to listen on for SOCKS connections. */
  118. struct config_line_t *SocksPort_lines;
  119. /** Ports to listen on for transparent pf/netfilter connections. */
  120. struct config_line_t *TransPort_lines;
  121. char *TransProxyType; /**< What kind of transparent proxy
  122. * implementation are we using? */
  123. /** Parsed value of TransProxyType. */
  124. enum {
  125. TPT_DEFAULT,
  126. TPT_PF_DIVERT,
  127. TPT_IPFW,
  128. TPT_TPROXY,
  129. } TransProxyType_parsed;
  130. /** Ports to listen on for transparent natd connections. */
  131. struct config_line_t *NATDPort_lines;
  132. /** Ports to listen on for HTTP Tunnel connections. */
  133. struct config_line_t *HTTPTunnelPort_lines;
  134. struct config_line_t *ControlPort_lines; /**< Ports to listen on for control
  135. * connections. */
  136. /** List of Unix Domain Sockets to listen on for control connections. */
  137. struct config_line_t *ControlSocket;
  138. int ControlSocketsGroupWritable; /**< Boolean: Are control sockets g+rw? */
  139. int UnixSocksGroupWritable; /**< Boolean: Are SOCKS Unix sockets g+rw? */
  140. /** Ports to listen on for directory connections. */
  141. struct config_line_t *DirPort_lines;
  142. /** Ports to listen on for DNS requests. */
  143. struct config_line_t *DNSPort_lines;
  144. /* MaxMemInQueues value as input by the user. We clean this up to be
  145. * MaxMemInQueues. */
  146. uint64_t MaxMemInQueues_raw;
  147. uint64_t MaxMemInQueues;/**< If we have more memory than this allocated
  148. * for queues and buffers, run the OOM handler */
  149. /** Above this value, consider ourselves low on RAM. */
  150. uint64_t MaxMemInQueues_low_threshold;
  151. /** @name port booleans
  152. *
  153. * Derived booleans: For server ports and ControlPort, true iff there is a
  154. * non-listener port on an AF_INET or AF_INET6 address of the given type
  155. * configured in one of the _lines options above.
  156. * For client ports, also true if there is a unix socket configured.
  157. * If you are checking for client ports, you may want to use:
  158. * SocksPort_set || TransPort_set || NATDPort_set || DNSPort_set ||
  159. * HTTPTunnelPort_set
  160. * rather than SocksPort_set.
  161. *
  162. * @{
  163. */
  164. unsigned int ORPort_set : 1;
  165. unsigned int SocksPort_set : 1;
  166. unsigned int TransPort_set : 1;
  167. unsigned int NATDPort_set : 1;
  168. unsigned int ControlPort_set : 1;
  169. unsigned int DirPort_set : 1;
  170. unsigned int DNSPort_set : 1;
  171. unsigned int ExtORPort_set : 1;
  172. unsigned int HTTPTunnelPort_set : 1;
  173. /**@}*/
  174. int AssumeReachable; /**< Whether to publish our descriptor regardless. */
  175. int AuthoritativeDir; /**< Boolean: is this an authoritative directory? */
  176. int V3AuthoritativeDir; /**< Boolean: is this an authoritative directory
  177. * for version 3 directories? */
  178. int VersioningAuthoritativeDir; /**< Boolean: is this an authoritative
  179. * directory that's willing to recommend
  180. * versions? */
  181. int BridgeAuthoritativeDir; /**< Boolean: is this an authoritative directory
  182. * that aggregates bridge descriptors? */
  183. /** If set on a bridge relay, it will include this value on a new
  184. * "bridge-distribution-request" line in its bridge descriptor. */
  185. char *BridgeDistribution;
  186. /** If set on a bridge authority, it will answer requests on its dirport
  187. * for bridge statuses -- but only if the requests use this password. */
  188. char *BridgePassword;
  189. /** If BridgePassword is set, this is a SHA256 digest of the basic http
  190. * authenticator for it. Used so we can do a time-independent comparison. */
  191. char *BridgePassword_AuthDigest_;
  192. int UseBridges; /**< Boolean: should we start all circuits with a bridge? */
  193. struct config_line_t *Bridges; /**< List of bootstrap bridge addresses. */
  194. struct config_line_t *ClientTransportPlugin; /**< List of client
  195. transport plugins. */
  196. struct config_line_t *ServerTransportPlugin; /**< List of client
  197. transport plugins. */
  198. /** List of TCP/IP addresses that transports should listen at. */
  199. struct config_line_t *ServerTransportListenAddr;
  200. /** List of options that must be passed to pluggable transports. */
  201. struct config_line_t *ServerTransportOptions;
  202. int BridgeRelay; /**< Boolean: are we acting as a bridge relay? We make
  203. * this explicit so we can change how we behave in the
  204. * future. */
  205. /** Boolean: if we know the bridge's digest, should we get new
  206. * descriptors from the bridge authorities or from the bridge itself? */
  207. int UpdateBridgesFromAuthority;
  208. int AvoidDiskWrites; /**< Boolean: should we never cache things to disk?
  209. * Not used yet. */
  210. int ClientOnly; /**< Boolean: should we never evolve into a server role? */
  211. int ReducedConnectionPadding; /**< Boolean: Should we try to keep connections
  212. open shorter and pad them less against
  213. connection-level traffic analysis? */
  214. /** Autobool: if auto, then connection padding will be negotiated by client
  215. * and server. If 0, it will be fully disabled. If 1, the client will still
  216. * pad to the server regardless of server support. */
  217. int ConnectionPadding;
  218. /** Boolean: if true, then circuit padding will be negotiated by client
  219. * and server, subject to consenus limits (default). If 0, it will be fully
  220. * disabled. */
  221. int CircuitPadding;
  222. /** Boolean: if true, then this client will only use circuit padding
  223. * algorithms that are known to use a low amount of overhead. If false,
  224. * we will use all available circuit padding algorithms.
  225. */
  226. int ReducedCircuitPadding;
  227. /** To what authority types do we publish our descriptor? Choices are
  228. * "v1", "v2", "v3", "bridge", or "". */
  229. struct smartlist_t *PublishServerDescriptor;
  230. /** A bitfield of authority types, derived from PublishServerDescriptor. */
  231. dirinfo_type_t PublishServerDescriptor_;
  232. /** Boolean: do we publish hidden service descriptors to the HS auths? */
  233. int PublishHidServDescriptors;
  234. int FetchServerDescriptors; /**< Do we fetch server descriptors as normal? */
  235. int FetchHidServDescriptors; /**< and hidden service descriptors? */
  236. int MinUptimeHidServDirectoryV2; /**< As directory authority, accept hidden
  237. * service directories after what time? */
  238. int FetchUselessDescriptors; /**< Do we fetch non-running descriptors too? */
  239. int AllDirActionsPrivate; /**< Should every directory action be sent
  240. * through a Tor circuit? */
  241. /** A routerset that should be used when picking middle nodes for HS
  242. * circuits. */
  243. routerset_t *HSLayer2Nodes;
  244. /** A routerset that should be used when picking third-hop nodes for HS
  245. * circuits. */
  246. routerset_t *HSLayer3Nodes;
  247. /** Onion Services in HiddenServiceSingleHopMode make one-hop (direct)
  248. * circuits between the onion service server, and the introduction and
  249. * rendezvous points. (Onion service descriptors are still posted using
  250. * 3-hop paths, to avoid onion service directories blocking the service.)
  251. * This option makes every hidden service instance hosted by
  252. * this tor instance a Single Onion Service.
  253. * HiddenServiceSingleHopMode requires HiddenServiceNonAnonymousMode to be
  254. * set to 1.
  255. * Use rend_service_allow_non_anonymous_connection() or
  256. * rend_service_reveal_startup_time() instead of using this option directly.
  257. */
  258. int HiddenServiceSingleHopMode;
  259. /* Makes hidden service clients and servers non-anonymous on this tor
  260. * instance. Allows the non-anonymous HiddenServiceSingleHopMode. Enables
  261. * non-anonymous behaviour in the hidden service protocol.
  262. * Use rend_service_non_anonymous_mode_enabled() instead of using this option
  263. * directly.
  264. */
  265. int HiddenServiceNonAnonymousMode;
  266. int ConnLimit; /**< Demanded minimum number of simultaneous connections. */
  267. int ConnLimit_; /**< Maximum allowed number of simultaneous connections. */
  268. int ConnLimit_high_thresh; /**< start trying to lower socket usage if we
  269. * have this many. */
  270. int ConnLimit_low_thresh; /**< try to get down to here after socket
  271. * exhaustion. */
  272. int RunAsDaemon; /**< If true, run in the background. (Unix only) */
  273. int FascistFirewall; /**< Whether to prefer ORs reachable on open ports. */
  274. struct smartlist_t *FirewallPorts; /**< Which ports our firewall allows
  275. * (strings). */
  276. /** IP:ports our firewall allows. */
  277. struct config_line_t *ReachableAddresses;
  278. struct config_line_t *ReachableORAddresses; /**< IP:ports for OR conns. */
  279. struct config_line_t *ReachableDirAddresses; /**< IP:ports for Dir conns. */
  280. int ConstrainedSockets; /**< Shrink xmit and recv socket buffers. */
  281. uint64_t ConstrainedSockSize; /**< Size of constrained buffers. */
  282. /** Whether we should drop exit streams from Tors that we don't know are
  283. * relays. One of "0" (never refuse), "1" (always refuse), or "-1" (do
  284. * what the consensus says, defaulting to 'refuse' if the consensus says
  285. * nothing). */
  286. int RefuseUnknownExits;
  287. /** Application ports that require all nodes in circ to have sufficient
  288. * uptime. */
  289. struct smartlist_t *LongLivedPorts;
  290. /** Application ports that are likely to be unencrypted and
  291. * unauthenticated; we reject requests for them to prevent the
  292. * user from screwing up and leaking plaintext secrets to an
  293. * observer somewhere on the Internet. */
  294. struct smartlist_t *RejectPlaintextPorts;
  295. /** Related to RejectPlaintextPorts above, except this config option
  296. * controls whether we warn (in the log and via a controller status
  297. * event) every time a risky connection is attempted. */
  298. struct smartlist_t *WarnPlaintextPorts;
  299. /** Should we try to reuse the same exit node for a given host */
  300. struct smartlist_t *TrackHostExits;
  301. int TrackHostExitsExpire; /**< Number of seconds until we expire an
  302. * addressmap */
  303. struct config_line_t *AddressMap; /**< List of address map directives. */
  304. int AutomapHostsOnResolve; /**< If true, when we get a resolve request for a
  305. * hostname ending with one of the suffixes in
  306. * <b>AutomapHostsSuffixes</b>, map it to a
  307. * virtual address. */
  308. /** List of suffixes for <b>AutomapHostsOnResolve</b>. The special value
  309. * "." means "match everything." */
  310. struct smartlist_t *AutomapHostsSuffixes;
  311. int RendPostPeriod; /**< How often do we post each rendezvous service
  312. * descriptor? Remember to publish them independently. */
  313. int KeepalivePeriod; /**< How often do we send padding cells to keep
  314. * connections alive? */
  315. int SocksTimeout; /**< How long do we let a socks connection wait
  316. * unattached before we fail it? */
  317. int LearnCircuitBuildTimeout; /**< If non-zero, we attempt to learn a value
  318. * for CircuitBuildTimeout based on timeout
  319. * history. Use circuit_build_times_disabled()
  320. * rather than checking this value directly. */
  321. int CircuitBuildTimeout; /**< Cull non-open circuits that were born at
  322. * least this many seconds ago. Used until
  323. * adaptive algorithm learns a new value. */
  324. int CircuitsAvailableTimeout; /**< Try to have an open circuit for at
  325. least this long after last activity */
  326. int CircuitStreamTimeout; /**< If non-zero, detach streams from circuits
  327. * and try a new circuit if the stream has been
  328. * waiting for this many seconds. If zero, use
  329. * our default internal timeout schedule. */
  330. int MaxOnionQueueDelay; /*< DOCDOC */
  331. int NewCircuitPeriod; /**< How long do we use a circuit before building
  332. * a new one? */
  333. int MaxCircuitDirtiness; /**< Never use circs that were first used more than
  334. this interval ago. */
  335. uint64_t BandwidthRate; /**< How much bandwidth, on average, are we willing
  336. * to use in a second? */
  337. uint64_t BandwidthBurst; /**< How much bandwidth, at maximum, are we willing
  338. * to use in a second? */
  339. uint64_t MaxAdvertisedBandwidth; /**< How much bandwidth are we willing to
  340. * tell other nodes we have? */
  341. uint64_t RelayBandwidthRate; /**< How much bandwidth, on average, are we
  342. * willing to use for all relayed conns? */
  343. uint64_t RelayBandwidthBurst; /**< How much bandwidth, at maximum, will we
  344. * use in a second for all relayed conns? */
  345. uint64_t PerConnBWRate; /**< Long-term bw on a single TLS conn, if set. */
  346. uint64_t PerConnBWBurst; /**< Allowed burst on a single TLS conn, if set. */
  347. int NumCPUs; /**< How many CPUs should we try to use? */
  348. struct config_line_t *RendConfigLines; /**< List of configuration lines
  349. * for rendezvous services. */
  350. struct config_line_t *HidServAuth; /**< List of configuration lines for
  351. * client-side authorizations for hidden
  352. * services */
  353. char *ClientOnionAuthDir; /**< Directory to keep client
  354. * onion service authorization secret keys */
  355. char *ContactInfo; /**< Contact info to be published in the directory. */
  356. int HeartbeatPeriod; /**< Log heartbeat messages after this many seconds
  357. * have passed. */
  358. int MainloopStats; /**< Log main loop statistics as part of the
  359. * heartbeat messages. */
  360. char *HTTPProxy; /**< hostname[:port] to use as http proxy, if any. */
  361. tor_addr_t HTTPProxyAddr; /**< Parsed IPv4 addr for http proxy, if any. */
  362. uint16_t HTTPProxyPort; /**< Parsed port for http proxy, if any. */
  363. char *HTTPProxyAuthenticator; /**< username:password string, if any. */
  364. char *HTTPSProxy; /**< hostname[:port] to use as https proxy, if any. */
  365. tor_addr_t HTTPSProxyAddr; /**< Parsed addr for https proxy, if any. */
  366. uint16_t HTTPSProxyPort; /**< Parsed port for https proxy, if any. */
  367. char *HTTPSProxyAuthenticator; /**< username:password string, if any. */
  368. char *Socks4Proxy; /**< hostname:port to use as a SOCKS4 proxy, if any. */
  369. tor_addr_t Socks4ProxyAddr; /**< Derived from Socks4Proxy. */
  370. uint16_t Socks4ProxyPort; /**< Derived from Socks4Proxy. */
  371. char *Socks5Proxy; /**< hostname:port to use as a SOCKS5 proxy, if any. */
  372. tor_addr_t Socks5ProxyAddr; /**< Derived from Sock5Proxy. */
  373. uint16_t Socks5ProxyPort; /**< Derived from Socks5Proxy. */
  374. char *Socks5ProxyUsername; /**< Username for SOCKS5 authentication, if any */
  375. char *Socks5ProxyPassword; /**< Password for SOCKS5 authentication, if any */
  376. /** List of configuration lines for replacement directory authorities.
  377. * If you just want to replace one class of authority at a time,
  378. * use the "Alternate*Authority" options below instead. */
  379. struct config_line_t *DirAuthorities;
  380. /** List of fallback directory servers */
  381. struct config_line_t *FallbackDir;
  382. /** Whether to use the default hard-coded FallbackDirs */
  383. int UseDefaultFallbackDirs;
  384. /** Weight to apply to all directory authority rates if considering them
  385. * along with fallbackdirs */
  386. double DirAuthorityFallbackRate;
  387. /** If set, use these main (currently v3) directory authorities and
  388. * not the default ones. */
  389. struct config_line_t *AlternateDirAuthority;
  390. /** If set, use these bridge authorities and not the default one. */
  391. struct config_line_t *AlternateBridgeAuthority;
  392. struct config_line_t *MyFamily_lines; /**< Declared family for this OR. */
  393. struct config_line_t *MyFamily; /**< Declared family for this OR,
  394. normalized */
  395. struct config_line_t *NodeFamilies; /**< List of config lines for
  396. * node families */
  397. /** List of parsed NodeFamilies values. */
  398. struct smartlist_t *NodeFamilySets;
  399. struct config_line_t *AuthDirBadExit; /**< Address policy for descriptors to
  400. * mark as bad exits. */
  401. struct config_line_t *AuthDirReject; /**< Address policy for descriptors to
  402. * reject. */
  403. struct config_line_t *AuthDirInvalid; /**< Address policy for descriptors to
  404. * never mark as valid. */
  405. /** @name AuthDir...CC
  406. *
  407. * Lists of country codes to mark as BadExit, or Invalid, or to
  408. * reject entirely.
  409. *
  410. * @{
  411. */
  412. struct smartlist_t *AuthDirBadExitCCs;
  413. struct smartlist_t *AuthDirInvalidCCs;
  414. struct smartlist_t *AuthDirRejectCCs;
  415. /**@}*/
  416. int AuthDirListBadExits; /**< True iff we should list bad exits,
  417. * and vote for all other exits as good. */
  418. int AuthDirMaxServersPerAddr; /**< Do not permit more than this
  419. * number of servers per IP address. */
  420. int AuthDirHasIPv6Connectivity; /**< Boolean: are we on IPv6? */
  421. int AuthDirPinKeys; /**< Boolean: Do we enforce key-pinning? */
  422. /** If non-zero, always vote the Fast flag for any relay advertising
  423. * this amount of capacity or more. */
  424. uint64_t AuthDirFastGuarantee;
  425. /** If non-zero, this advertised capacity or more is always sufficient
  426. * to satisfy the bandwidth requirement for the Guard flag. */
  427. uint64_t AuthDirGuardBWGuarantee;
  428. char *AccountingStart; /**< How long is the accounting interval, and when
  429. * does it start? */
  430. uint64_t AccountingMax; /**< How many bytes do we allow per accounting
  431. * interval before hibernation? 0 for "never
  432. * hibernate." */
  433. /** How do we determine when our AccountingMax has been reached?
  434. * "max" for when in or out reaches AccountingMax
  435. * "sum" for when in plus out reaches AccountingMax
  436. * "in" for when in reaches AccountingMax
  437. * "out" for when out reaches AccountingMax */
  438. char *AccountingRule_option;
  439. enum { ACCT_MAX, ACCT_SUM, ACCT_IN, ACCT_OUT } AccountingRule;
  440. /** Base64-encoded hash of accepted passwords for the control system. */
  441. struct config_line_t *HashedControlPassword;
  442. /** As HashedControlPassword, but not saved. */
  443. struct config_line_t *HashedControlSessionPassword;
  444. int CookieAuthentication; /**< Boolean: do we enable cookie-based auth for
  445. * the control system? */
  446. char *CookieAuthFile; /**< Filesystem location of a ControlPort
  447. * authentication cookie. */
  448. char *ExtORPortCookieAuthFile; /**< Filesystem location of Extended
  449. * ORPort authentication cookie. */
  450. int CookieAuthFileGroupReadable; /**< Boolean: Is the CookieAuthFile g+r? */
  451. int ExtORPortCookieAuthFileGroupReadable; /**< Boolean: Is the
  452. * ExtORPortCookieAuthFile g+r? */
  453. int LeaveStreamsUnattached; /**< Boolean: Does Tor attach new streams to
  454. * circuits itself (0), or does it expect a controller
  455. * to cope? (1) */
  456. int DisablePredictedCircuits; /**< Boolean: does Tor preemptively
  457. * make circuits in the background (0),
  458. * or not (1)? */
  459. /** Process specifier for a controller that ‘owns’ this Tor
  460. * instance. Tor will terminate if its owning controller does. */
  461. char *OwningControllerProcess;
  462. /** FD specifier for a controller that owns this Tor instance. */
  463. uint64_t OwningControllerFD;
  464. int ShutdownWaitLength; /**< When we get a SIGINT and we're a server, how
  465. * long do we wait before exiting? */
  466. char *SafeLogging; /**< Contains "relay", "1", "0" (meaning no scrubbing). */
  467. /* Derived from SafeLogging */
  468. enum {
  469. SAFELOG_SCRUB_ALL, SAFELOG_SCRUB_RELAY, SAFELOG_SCRUB_NONE
  470. } SafeLogging_;
  471. int Sandbox; /**< Boolean: should sandboxing be enabled? */
  472. int SafeSocks; /**< Boolean: should we outright refuse application
  473. * connections that use socks4 or socks5-with-local-dns? */
  474. int ProtocolWarnings; /**< Boolean: when other parties screw up the Tor
  475. * protocol, is it a warn or an info in our logs? */
  476. int TestSocks; /**< Boolean: when we get a socks connection, do we loudly
  477. * log whether it was DNS-leaking or not? */
  478. int HardwareAccel; /**< Boolean: Should we enable OpenSSL hardware
  479. * acceleration where available? */
  480. /** Token Bucket Refill resolution in milliseconds. */
  481. int TokenBucketRefillInterval;
  482. char *AccelName; /**< Optional hardware acceleration engine name. */
  483. char *AccelDir; /**< Optional hardware acceleration engine search dir. */
  484. /** Boolean: Do we try to enter from a smallish number
  485. * of fixed nodes? */
  486. int UseEntryGuards_option;
  487. /** Internal variable to remember whether we're actually acting on
  488. * UseEntryGuards_option -- when we're a non-anonymous Single Onion Service,
  489. * it is always false, otherwise we use the value of UseEntryGuards_option.
  490. * */
  491. int UseEntryGuards;
  492. int NumEntryGuards; /**< How many entry guards do we try to establish? */
  493. /** If 1, we use any guardfraction information we see in the
  494. * consensus. If 0, we don't. If -1, let the consensus parameter
  495. * decide. */
  496. int UseGuardFraction;
  497. int NumDirectoryGuards; /**< How many dir guards do we try to establish?
  498. * If 0, use value from NumEntryGuards. */
  499. int NumPrimaryGuards; /**< How many primary guards do we want? */
  500. int RephistTrackTime; /**< How many seconds do we keep rephist info? */
  501. /** Should we always fetch our dir info on the mirror schedule (which
  502. * means directly from the authorities) no matter our other config? */
  503. int FetchDirInfoEarly;
  504. /** Should we fetch our dir info at the start of the consensus period? */
  505. int FetchDirInfoExtraEarly;
  506. int DirCache; /**< Cache all directory documents and accept requests via
  507. * tunnelled dir conns from clients. If 1, enabled (default);
  508. * If 0, disabled. */
  509. char *VirtualAddrNetworkIPv4; /**< Address and mask to hand out for virtual
  510. * MAPADDRESS requests for IPv4 addresses */
  511. char *VirtualAddrNetworkIPv6; /**< Address and mask to hand out for virtual
  512. * MAPADDRESS requests for IPv6 addresses */
  513. int ServerDNSSearchDomains; /**< Boolean: If set, we don't force exit
  514. * addresses to be FQDNs, but rather search for them in
  515. * the local domains. */
  516. int ServerDNSDetectHijacking; /**< Boolean: If true, check for DNS failure
  517. * hijacking. */
  518. int ServerDNSRandomizeCase; /**< Boolean: Use the 0x20-hack to prevent
  519. * DNS poisoning attacks. */
  520. char *ServerDNSResolvConfFile; /**< If provided, we configure our internal
  521. * resolver from the file here rather than from
  522. * /etc/resolv.conf (Unix) or the registry (Windows). */
  523. char *DirPortFrontPage; /**< This is a full path to a file with an html
  524. disclaimer. This allows a server administrator to show
  525. that they're running Tor and anyone visiting their server
  526. will know this without any specialized knowledge. */
  527. int DisableDebuggerAttachment; /**< Currently Linux only specific attempt to
  528. disable ptrace; needs BSD testing. */
  529. /** Boolean: if set, we start even if our resolv.conf file is missing
  530. * or broken. */
  531. int ServerDNSAllowBrokenConfig;
  532. /** Boolean: if set, then even connections to private addresses will get
  533. * rate-limited. */
  534. int CountPrivateBandwidth;
  535. /** A list of addresses that definitely should be resolvable. Used for
  536. * testing our DNS server. */
  537. struct smartlist_t *ServerDNSTestAddresses;
  538. int EnforceDistinctSubnets; /**< If true, don't allow multiple routers in the
  539. * same network zone in the same circuit. */
  540. int AllowNonRFC953Hostnames; /**< If true, we allow connections to hostnames
  541. * with weird characters. */
  542. /** If true, we try resolving hostnames with weird characters. */
  543. int ServerDNSAllowNonRFC953Hostnames;
  544. /** If true, we try to download extra-info documents (and we serve them,
  545. * if we are a cache). For authorities, this is always true. */
  546. int DownloadExtraInfo;
  547. /** If true, we're configured to collect statistics on clients
  548. * requesting network statuses from us as directory. */
  549. int DirReqStatistics_option;
  550. /** Internal variable to remember whether we're actually acting on
  551. * DirReqStatistics_option -- yes if it's set and we're a server, else no. */
  552. int DirReqStatistics;
  553. /** If true, the user wants us to collect statistics on port usage. */
  554. int ExitPortStatistics;
  555. /** If true, the user wants us to collect connection statistics. */
  556. int ConnDirectionStatistics;
  557. /** If true, the user wants us to collect cell statistics. */
  558. int CellStatistics;
  559. /** If true, the user wants us to collect padding statistics. */
  560. int PaddingStatistics;
  561. /** If true, the user wants us to collect statistics as entry node. */
  562. int EntryStatistics;
  563. /** If true, the user wants us to collect statistics as hidden service
  564. * directory, introduction point, or rendezvous point. */
  565. int HiddenServiceStatistics_option;
  566. /** Internal variable to remember whether we're actually acting on
  567. * HiddenServiceStatistics_option -- yes if it's set and we're a server,
  568. * else no. */
  569. int HiddenServiceStatistics;
  570. /** If true, include statistics file contents in extra-info documents. */
  571. int ExtraInfoStatistics;
  572. /** If true, do not believe anybody who tells us that a domain resolves
  573. * to an internal address, or that an internal address has a PTR mapping.
  574. * Helps avoid some cross-site attacks. */
  575. int ClientDNSRejectInternalAddresses;
  576. /** If true, do not accept any requests to connect to internal addresses
  577. * over randomly chosen exits. */
  578. int ClientRejectInternalAddresses;
  579. /** If true, clients may connect over IPv4. If false, they will avoid
  580. * connecting over IPv4. We enforce this for OR and Dir connections. */
  581. int ClientUseIPv4;
  582. /** If true, clients may connect over IPv6. If false, they will avoid
  583. * connecting over IPv4. We enforce this for OR and Dir connections.
  584. * Use fascist_firewall_use_ipv6() instead of accessing this value
  585. * directly. */
  586. int ClientUseIPv6;
  587. /** If true, prefer an IPv6 OR port over an IPv4 one for entry node
  588. * connections. If auto, bridge clients prefer IPv6, and other clients
  589. * prefer IPv4. Use node_ipv6_or_preferred() instead of accessing this value
  590. * directly. */
  591. int ClientPreferIPv6ORPort;
  592. /** If true, prefer an IPv6 directory port over an IPv4 one for direct
  593. * directory connections. If auto, bridge clients prefer IPv6, and other
  594. * clients prefer IPv4. Use fascist_firewall_prefer_ipv6_dirport() instead of
  595. * accessing this value directly. */
  596. int ClientPreferIPv6DirPort;
  597. /** If true, prefer an IPv4 or IPv6 OR port at random. */
  598. int ClientAutoIPv6ORPort;
  599. /** The length of time that we think a consensus should be fresh. */
  600. int V3AuthVotingInterval;
  601. /** The length of time we think it will take to distribute votes. */
  602. int V3AuthVoteDelay;
  603. /** The length of time we think it will take to distribute signatures. */
  604. int V3AuthDistDelay;
  605. /** The number of intervals we think a consensus should be valid. */
  606. int V3AuthNIntervalsValid;
  607. /** Should advertise and sign consensuses with a legacy key, for key
  608. * migration purposes? */
  609. int V3AuthUseLegacyKey;
  610. /** Location of bandwidth measurement file */
  611. char *V3BandwidthsFile;
  612. /** Location of guardfraction file */
  613. char *GuardfractionFile;
  614. /** Authority only: key=value pairs that we add to our networkstatus
  615. * consensus vote on the 'params' line. */
  616. char *ConsensusParams;
  617. /** Authority only: minimum number of measured bandwidths we must see
  618. * before we only believe measured bandwidths to assign flags. */
  619. int MinMeasuredBWsForAuthToIgnoreAdvertised;
  620. /** The length of time that we think an initial consensus should be fresh.
  621. * Only altered on testing networks. */
  622. int TestingV3AuthInitialVotingInterval;
  623. /** The length of time we think it will take to distribute initial votes.
  624. * Only altered on testing networks. */
  625. int TestingV3AuthInitialVoteDelay;
  626. /** The length of time we think it will take to distribute initial
  627. * signatures. Only altered on testing networks.*/
  628. int TestingV3AuthInitialDistDelay;
  629. /** Offset in seconds added to the starting time for consensus
  630. voting. Only altered on testing networks. */
  631. int TestingV3AuthVotingStartOffset;
  632. /** If an authority has been around for less than this amount of time, it
  633. * does not believe its reachability information is accurate. Only
  634. * altered on testing networks. */
  635. int TestingAuthDirTimeToLearnReachability;
  636. /** Clients don't download any descriptor this recent, since it will
  637. * probably not have propagated to enough caches. Only altered on testing
  638. * networks. */
  639. int TestingEstimatedDescriptorPropagationTime;
  640. /** Schedule for when servers should download things in general. Only
  641. * altered on testing networks. */
  642. int TestingServerDownloadInitialDelay;
  643. /** Schedule for when clients should download things in general. Only
  644. * altered on testing networks. */
  645. int TestingClientDownloadInitialDelay;
  646. /** Schedule for when servers should download consensuses. Only altered
  647. * on testing networks. */
  648. int TestingServerConsensusDownloadInitialDelay;
  649. /** Schedule for when clients should download consensuses. Only altered
  650. * on testing networks. */
  651. int TestingClientConsensusDownloadInitialDelay;
  652. /** Schedule for when clients should download consensuses from authorities
  653. * if they are bootstrapping (that is, they don't have a usable, reasonably
  654. * live consensus). Only used by clients fetching from a list of fallback
  655. * directory mirrors.
  656. *
  657. * This schedule is incremented by (potentially concurrent) connection
  658. * attempts, unlike other schedules, which are incremented by connection
  659. * failures. Only altered on testing networks. */
  660. int ClientBootstrapConsensusAuthorityDownloadInitialDelay;
  661. /** Schedule for when clients should download consensuses from fallback
  662. * directory mirrors if they are bootstrapping (that is, they don't have a
  663. * usable, reasonably live consensus). Only used by clients fetching from a
  664. * list of fallback directory mirrors.
  665. *
  666. * This schedule is incremented by (potentially concurrent) connection
  667. * attempts, unlike other schedules, which are incremented by connection
  668. * failures. Only altered on testing networks. */
  669. int ClientBootstrapConsensusFallbackDownloadInitialDelay;
  670. /** Schedule for when clients should download consensuses from authorities
  671. * if they are bootstrapping (that is, they don't have a usable, reasonably
  672. * live consensus). Only used by clients which don't have or won't fetch
  673. * from a list of fallback directory mirrors.
  674. *
  675. * This schedule is incremented by (potentially concurrent) connection
  676. * attempts, unlike other schedules, which are incremented by connection
  677. * failures. Only altered on testing networks. */
  678. int ClientBootstrapConsensusAuthorityOnlyDownloadInitialDelay;
  679. /** Schedule for when clients should download bridge descriptors. Only
  680. * altered on testing networks. */
  681. int TestingBridgeDownloadInitialDelay;
  682. /** Schedule for when clients should download bridge descriptors when they
  683. * have no running bridges. Only altered on testing networks. */
  684. int TestingBridgeBootstrapDownloadInitialDelay;
  685. /** When directory clients have only a few descriptors to request, they
  686. * batch them until they have more, or until this amount of time has
  687. * passed. Only altered on testing networks. */
  688. int TestingClientMaxIntervalWithoutRequest;
  689. /** How long do we let a directory connection stall before expiring
  690. * it? Only altered on testing networks. */
  691. int TestingDirConnectionMaxStall;
  692. /** How many simultaneous in-progress connections will we make when trying
  693. * to fetch a consensus before we wait for one to complete, timeout, or
  694. * error out? Only altered on testing networks. */
  695. int ClientBootstrapConsensusMaxInProgressTries;
  696. /** If true, we take part in a testing network. Change the defaults of a
  697. * couple of other configuration options and allow to change the values
  698. * of certain configuration options. */
  699. int TestingTorNetwork;
  700. /** Minimum value for the Exit flag threshold on testing networks. */
  701. uint64_t TestingMinExitFlagThreshold;
  702. /** Minimum value for the Fast flag threshold on testing networks. */
  703. uint64_t TestingMinFastFlagThreshold;
  704. /** Relays in a testing network which should be voted Exit
  705. * regardless of exit policy. */
  706. routerset_t *TestingDirAuthVoteExit;
  707. int TestingDirAuthVoteExitIsStrict;
  708. /** Relays in a testing network which should be voted Guard
  709. * regardless of uptime and bandwidth. */
  710. routerset_t *TestingDirAuthVoteGuard;
  711. int TestingDirAuthVoteGuardIsStrict;
  712. /** Relays in a testing network which should be voted HSDir
  713. * regardless of uptime and DirPort. */
  714. routerset_t *TestingDirAuthVoteHSDir;
  715. int TestingDirAuthVoteHSDirIsStrict;
  716. /** Enable CONN_BW events. Only altered on testing networks. */
  717. int TestingEnableConnBwEvent;
  718. /** Enable CELL_STATS events. Only altered on testing networks. */
  719. int TestingEnableCellStatsEvent;
  720. /** If true, and we have GeoIP data, and we're a bridge, keep a per-country
  721. * count of how many client addresses have contacted us so that we can help
  722. * the bridge authority guess which countries have blocked access to us. */
  723. int BridgeRecordUsageByCountry;
  724. /** Optionally, IPv4 and IPv6 GeoIP data. */
  725. char *GeoIPFile;
  726. char *GeoIPv6File;
  727. /** Autobool: if auto, then any attempt to Exclude{Exit,}Nodes a particular
  728. * country code will exclude all nodes in ?? and A1. If true, all nodes in
  729. * ?? and A1 are excluded. Has no effect if we don't know any GeoIP data. */
  730. int GeoIPExcludeUnknown;
  731. /** If true, SIGHUP should reload the torrc. Sometimes controllers want
  732. * to make this false. */
  733. int ReloadTorrcOnSIGHUP;
  734. /* The main parameter for picking circuits within a connection.
  735. *
  736. * If this value is positive, when picking a cell to relay on a connection,
  737. * we always relay from the circuit whose weighted cell count is lowest.
  738. * Cells are weighted exponentially such that if one cell is sent
  739. * 'CircuitPriorityHalflife' seconds before another, it counts for half as
  740. * much.
  741. *
  742. * If this value is zero, we're disabling the cell-EWMA algorithm.
  743. *
  744. * If this value is negative, we're using the default approach
  745. * according to either Tor or a parameter set in the consensus.
  746. */
  747. double CircuitPriorityHalflife;
  748. /** Set to true if the TestingTorNetwork configuration option is set.
  749. * This is used so that options_validate() has a chance to realize that
  750. * the defaults have changed. */
  751. int UsingTestNetworkDefaults_;
  752. /** If 1, we try to use microdescriptors to build circuits. If 0, we don't.
  753. * If -1, Tor decides. */
  754. int UseMicrodescriptors;
  755. /** File where we should write the ControlPort. */
  756. char *ControlPortWriteToFile;
  757. /** Should that file be group-readable? */
  758. int ControlPortFileGroupReadable;
  759. #define MAX_MAX_CLIENT_CIRCUITS_PENDING 1024
  760. /** Maximum number of non-open general-purpose origin circuits to allow at
  761. * once. */
  762. int MaxClientCircuitsPending;
  763. /** If 1, we always send optimistic data when it's supported. If 0, we
  764. * never use it. If -1, we do what the consensus says. */
  765. int OptimisticData;
  766. /** If 1, we accept and launch no external network connections, except on
  767. * control ports. */
  768. int DisableNetwork;
  769. /**
  770. * Parameters for path-bias detection.
  771. * @{
  772. * These options override the default behavior of Tor's (**currently
  773. * experimental**) path bias detection algorithm. To try to find broken or
  774. * misbehaving guard nodes, Tor looks for nodes where more than a certain
  775. * fraction of circuits through that guard fail to get built.
  776. *
  777. * The PathBiasCircThreshold option controls how many circuits we need to
  778. * build through a guard before we make these checks. The
  779. * PathBiasNoticeRate, PathBiasWarnRate and PathBiasExtremeRate options
  780. * control what fraction of circuits must succeed through a guard so we
  781. * won't write log messages. If less than PathBiasExtremeRate circuits
  782. * succeed *and* PathBiasDropGuards is set to 1, we disable use of that
  783. * guard.
  784. *
  785. * When we have seen more than PathBiasScaleThreshold circuits through a
  786. * guard, we scale our observations by 0.5 (governed by the consensus) so
  787. * that new observations don't get swamped by old ones.
  788. *
  789. * By default, or if a negative value is provided for one of these options,
  790. * Tor uses reasonable defaults from the networkstatus consensus document.
  791. * If no defaults are available there, these options default to 150, .70,
  792. * .50, .30, 0, and 300 respectively.
  793. */
  794. int PathBiasCircThreshold;
  795. double PathBiasNoticeRate;
  796. double PathBiasWarnRate;
  797. double PathBiasExtremeRate;
  798. int PathBiasDropGuards;
  799. int PathBiasScaleThreshold;
  800. /** @} */
  801. /**
  802. * Parameters for path-bias use detection
  803. * @{
  804. * Similar to the above options, these options override the default behavior
  805. * of Tor's (**currently experimental**) path use bias detection algorithm.
  806. *
  807. * Where as the path bias parameters govern thresholds for successfully
  808. * building circuits, these four path use bias parameters govern thresholds
  809. * only for circuit usage. Circuits which receive no stream usage are not
  810. * counted by this detection algorithm. A used circuit is considered
  811. * successful if it is capable of carrying streams or otherwise receiving
  812. * well-formed responses to RELAY cells.
  813. *
  814. * By default, or if a negative value is provided for one of these options,
  815. * Tor uses reasonable defaults from the networkstatus consensus document.
  816. * If no defaults are available there, these options default to 20, .80,
  817. * .60, and 100, respectively.
  818. */
  819. int PathBiasUseThreshold;
  820. double PathBiasNoticeUseRate;
  821. double PathBiasExtremeUseRate;
  822. int PathBiasScaleUseThreshold;
  823. /** @} */
  824. int IPv6Exit; /**< Do we support exiting to IPv6 addresses? */
  825. /** Fraction: */
  826. double PathsNeededToBuildCircuits;
  827. /** What expiry time shall we place on our SSL certs? "0" means we
  828. * should guess a suitable value. */
  829. int SSLKeyLifetime;
  830. /** How long (seconds) do we keep a guard before picking a new one? */
  831. int GuardLifetime;
  832. /** Is this an exit node? This is a tristate, where "1" means "yes, and use
  833. * the default exit policy if none is given" and "0" means "no; exit policy
  834. * is 'reject *'" and "auto" (-1) means "same as 1, but warn the user."
  835. *
  836. * XXXX Eventually, the default will be 0. */
  837. int ExitRelay;
  838. /** For how long (seconds) do we declare our signing keys to be valid? */
  839. int SigningKeyLifetime;
  840. /** For how long (seconds) do we declare our link keys to be valid? */
  841. int TestingLinkCertLifetime;
  842. /** For how long (seconds) do we declare our auth keys to be valid? */
  843. int TestingAuthKeyLifetime;
  844. /** How long before signing keys expire will we try to make a new one? */
  845. int TestingSigningKeySlop;
  846. /** How long before link keys expire will we try to make a new one? */
  847. int TestingLinkKeySlop;
  848. /** How long before auth keys expire will we try to make a new one? */
  849. int TestingAuthKeySlop;
  850. /** Force use of offline master key features: never generate a master
  851. * ed25519 identity key except from tor --keygen */
  852. int OfflineMasterKey;
  853. enum {
  854. FORCE_PASSPHRASE_AUTO=0,
  855. FORCE_PASSPHRASE_ON,
  856. FORCE_PASSPHRASE_OFF
  857. } keygen_force_passphrase;
  858. int use_keygen_passphrase_fd;
  859. int keygen_passphrase_fd;
  860. int change_key_passphrase;
  861. char *master_key_fname;
  862. /** Autobool: Do we try to retain capabilities if we can? */
  863. int KeepBindCapabilities;
  864. /** Maximum total size of unparseable descriptors to log during the
  865. * lifetime of this Tor process.
  866. */
  867. uint64_t MaxUnparseableDescSizeToLog;
  868. /** Bool (default: 1): Switch for the shared random protocol. Only
  869. * relevant to a directory authority. If off, the authority won't
  870. * participate in the protocol. If on (default), a flag is added to the
  871. * vote indicating participation. */
  872. int AuthDirSharedRandomness;
  873. /** If 1, we skip all OOS checks. */
  874. int DisableOOSCheck;
  875. /** Autobool: Should we include Ed25519 identities in extend2 cells?
  876. * If -1, we should do whatever the consensus parameter says. */
  877. int ExtendByEd25519ID;
  878. /** Bool (default: 1): When testing routerinfos as a directory authority,
  879. * do we enforce Ed25519 identity match? */
  880. /* NOTE: remove this option someday. */
  881. int AuthDirTestEd25519LinkKeys;
  882. /** Bool (default: 0): Tells if a %include was used on torrc */
  883. int IncludeUsed;
  884. /** The seconds after expiration which we as a relay should keep old
  885. * consensuses around so that we can generate diffs from them. If 0,
  886. * use the default. */
  887. int MaxConsensusAgeForDiffs;
  888. /** Bool (default: 0). Tells Tor to never try to exec another program.
  889. */
  890. int NoExec;
  891. /** Have the KIST scheduler run every X milliseconds. If less than zero, do
  892. * not use the KIST scheduler but use the old vanilla scheduler instead. If
  893. * zero, do what the consensus says and fall back to using KIST as if this is
  894. * set to "10 msec" if the consensus doesn't say anything. */
  895. int KISTSchedRunInterval;
  896. /** A multiplier for the KIST per-socket limit calculation. */
  897. double KISTSockBufSizeFactor;
  898. /** The list of scheduler type string ordered by priority that is first one
  899. * has to be tried first. Default: KIST,KISTLite,Vanilla */
  900. struct smartlist_t *Schedulers;
  901. /* An ordered list of scheduler_types mapped from Schedulers. */
  902. struct smartlist_t *SchedulerTypes_;
  903. /** List of files that were opened by %include in torrc and torrc-defaults */
  904. struct smartlist_t *FilesOpenedByIncludes;
  905. /** If true, Tor shouldn't install any posix signal handlers, since it is
  906. * running embedded inside another process.
  907. */
  908. int DisableSignalHandlers;
  909. /** Autobool: Is the circuit creation DoS mitigation subsystem enabled? */
  910. int DoSCircuitCreationEnabled;
  911. /** Minimum concurrent connection needed from one single address before any
  912. * defense is used. */
  913. int DoSCircuitCreationMinConnections;
  914. /** Circuit rate used to refill the token bucket. */
  915. int DoSCircuitCreationRate;
  916. /** Maximum allowed burst of circuits. Reaching that value, the address is
  917. * detected as malicious and a defense might be used. */
  918. int DoSCircuitCreationBurst;
  919. /** When an address is marked as malicous, what defense should be used
  920. * against it. See the dos_cc_defense_type_t enum. */
  921. int DoSCircuitCreationDefenseType;
  922. /** For how much time (in seconds) the defense is applicable for a malicious
  923. * address. A random time delta is added to the defense time of an address
  924. * which will be between 1 second and half of this value. */
  925. int DoSCircuitCreationDefenseTimePeriod;
  926. /** Autobool: Is the DoS connection mitigation subsystem enabled? */
  927. int DoSConnectionEnabled;
  928. /** Maximum concurrent connection allowed per address. */
  929. int DoSConnectionMaxConcurrentCount;
  930. /** When an address is reaches the maximum count, what defense should be
  931. * used against it. See the dos_conn_defense_type_t enum. */
  932. int DoSConnectionDefenseType;
  933. /** Autobool: Do we refuse single hop client rendezvous? */
  934. int DoSRefuseSingleHopClientRendezvous;
  935. /** Interval: how long without activity does it take for a client
  936. * to become dormant?
  937. **/
  938. int DormantClientTimeout;
  939. /** Boolean: true if having an idle stream is sufficient to prevent a client
  940. * from becoming dormant.
  941. **/
  942. int DormantTimeoutDisabledByIdleStreams;
  943. /** Boolean: true if Tor should be dormant the first time it starts with
  944. * a datadirectory; false otherwise. */
  945. int DormantOnFirstStartup;
  946. /**
  947. * Boolean: true if Tor should treat every startup event as cancelling
  948. * a possible previous dormant state.
  949. **/
  950. int DormantCanceledByStartup;
  951. int NumAdditionalEventloops;
  952. char *ThroughputLogFile;
  953. /**
  954. * Configuration objects for individual modules.
  955. *
  956. * Never access this field or its members directly: instead, use the module
  957. * in question to get its relevant configuration object.
  958. */
  959. struct config_suite_t *subconfigs_;
  960. };
  961. #endif /* !defined(TOR_OR_OPTIONS_ST_H) */