or_options_st.h 49 KB

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