or_options_st.h 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075
  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-2018, 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 *ContactInfo; /**< Contact info to be published in the directory. */
  342. int HeartbeatPeriod; /**< Log heartbeat messages after this many seconds
  343. * have passed. */
  344. int MainloopStats; /**< Log main loop statistics as part of the
  345. * heartbeat messages. */
  346. char *HTTPProxy; /**< hostname[:port] to use as http proxy, if any. */
  347. tor_addr_t HTTPProxyAddr; /**< Parsed IPv4 addr for http proxy, if any. */
  348. uint16_t HTTPProxyPort; /**< Parsed port for http proxy, if any. */
  349. char *HTTPProxyAuthenticator; /**< username:password string, if any. */
  350. char *HTTPSProxy; /**< hostname[:port] to use as https proxy, if any. */
  351. tor_addr_t HTTPSProxyAddr; /**< Parsed addr for https proxy, if any. */
  352. uint16_t HTTPSProxyPort; /**< Parsed port for https proxy, if any. */
  353. char *HTTPSProxyAuthenticator; /**< username:password string, if any. */
  354. char *Socks4Proxy; /**< hostname:port to use as a SOCKS4 proxy, if any. */
  355. tor_addr_t Socks4ProxyAddr; /**< Derived from Socks4Proxy. */
  356. uint16_t Socks4ProxyPort; /**< Derived from Socks4Proxy. */
  357. char *Socks5Proxy; /**< hostname:port to use as a SOCKS5 proxy, if any. */
  358. tor_addr_t Socks5ProxyAddr; /**< Derived from Sock5Proxy. */
  359. uint16_t Socks5ProxyPort; /**< Derived from Socks5Proxy. */
  360. char *Socks5ProxyUsername; /**< Username for SOCKS5 authentication, if any */
  361. char *Socks5ProxyPassword; /**< Password for SOCKS5 authentication, if any */
  362. /** List of configuration lines for replacement directory authorities.
  363. * If you just want to replace one class of authority at a time,
  364. * use the "Alternate*Authority" options below instead. */
  365. struct config_line_t *DirAuthorities;
  366. /** List of fallback directory servers */
  367. struct config_line_t *FallbackDir;
  368. /** Whether to use the default hard-coded FallbackDirs */
  369. int UseDefaultFallbackDirs;
  370. /** Weight to apply to all directory authority rates if considering them
  371. * along with fallbackdirs */
  372. double DirAuthorityFallbackRate;
  373. /** If set, use these main (currently v3) directory authorities and
  374. * not the default ones. */
  375. struct config_line_t *AlternateDirAuthority;
  376. /** If set, use these bridge authorities and not the default one. */
  377. struct config_line_t *AlternateBridgeAuthority;
  378. struct config_line_t *MyFamily_lines; /**< Declared family for this OR. */
  379. struct config_line_t *MyFamily; /**< Declared family for this OR,
  380. normalized */
  381. struct config_line_t *NodeFamilies; /**< List of config lines for
  382. * node families */
  383. /** List of parsed NodeFamilies values. */
  384. struct smartlist_t *NodeFamilySets;
  385. struct config_line_t *AuthDirBadExit; /**< Address policy for descriptors to
  386. * mark as bad exits. */
  387. struct config_line_t *AuthDirReject; /**< Address policy for descriptors to
  388. * reject. */
  389. struct config_line_t *AuthDirInvalid; /**< Address policy for descriptors to
  390. * never mark as valid. */
  391. /** @name AuthDir...CC
  392. *
  393. * Lists of country codes to mark as BadExit, or Invalid, or to
  394. * reject entirely.
  395. *
  396. * @{
  397. */
  398. struct smartlist_t *AuthDirBadExitCCs;
  399. struct smartlist_t *AuthDirInvalidCCs;
  400. struct smartlist_t *AuthDirRejectCCs;
  401. /**@}*/
  402. int AuthDirListBadExits; /**< True iff we should list bad exits,
  403. * and vote for all other exits as good. */
  404. int AuthDirMaxServersPerAddr; /**< Do not permit more than this
  405. * number of servers per IP address. */
  406. int AuthDirHasIPv6Connectivity; /**< Boolean: are we on IPv6? */
  407. int AuthDirPinKeys; /**< Boolean: Do we enforce key-pinning? */
  408. /** If non-zero, always vote the Fast flag for any relay advertising
  409. * this amount of capacity or more. */
  410. uint64_t AuthDirFastGuarantee;
  411. /** If non-zero, this advertised capacity or more is always sufficient
  412. * to satisfy the bandwidth requirement for the Guard flag. */
  413. uint64_t AuthDirGuardBWGuarantee;
  414. char *AccountingStart; /**< How long is the accounting interval, and when
  415. * does it start? */
  416. uint64_t AccountingMax; /**< How many bytes do we allow per accounting
  417. * interval before hibernation? 0 for "never
  418. * hibernate." */
  419. /** How do we determine when our AccountingMax has been reached?
  420. * "max" for when in or out reaches AccountingMax
  421. * "sum" for when in plus out reaches AccountingMax
  422. * "in" for when in reaches AccountingMax
  423. * "out" for when out reaches AccountingMax */
  424. char *AccountingRule_option;
  425. enum { ACCT_MAX, ACCT_SUM, ACCT_IN, ACCT_OUT } AccountingRule;
  426. /** Base64-encoded hash of accepted passwords for the control system. */
  427. struct config_line_t *HashedControlPassword;
  428. /** As HashedControlPassword, but not saved. */
  429. struct config_line_t *HashedControlSessionPassword;
  430. int CookieAuthentication; /**< Boolean: do we enable cookie-based auth for
  431. * the control system? */
  432. char *CookieAuthFile; /**< Filesystem location of a ControlPort
  433. * authentication cookie. */
  434. char *ExtORPortCookieAuthFile; /**< Filesystem location of Extended
  435. * ORPort authentication cookie. */
  436. int CookieAuthFileGroupReadable; /**< Boolean: Is the CookieAuthFile g+r? */
  437. int ExtORPortCookieAuthFileGroupReadable; /**< Boolean: Is the
  438. * ExtORPortCookieAuthFile g+r? */
  439. int LeaveStreamsUnattached; /**< Boolean: Does Tor attach new streams to
  440. * circuits itself (0), or does it expect a controller
  441. * to cope? (1) */
  442. int DisablePredictedCircuits; /**< Boolean: does Tor preemptively
  443. * make circuits in the background (0),
  444. * or not (1)? */
  445. /** Process specifier for a controller that ‘owns’ this Tor
  446. * instance. Tor will terminate if its owning controller does. */
  447. char *OwningControllerProcess;
  448. /** FD specifier for a controller that owns this Tor instance. */
  449. int OwningControllerFD;
  450. int ShutdownWaitLength; /**< When we get a SIGINT and we're a server, how
  451. * long do we wait before exiting? */
  452. char *SafeLogging; /**< Contains "relay", "1", "0" (meaning no scrubbing). */
  453. /* Derived from SafeLogging */
  454. enum {
  455. SAFELOG_SCRUB_ALL, SAFELOG_SCRUB_RELAY, SAFELOG_SCRUB_NONE
  456. } SafeLogging_;
  457. int Sandbox; /**< Boolean: should sandboxing be enabled? */
  458. int SafeSocks; /**< Boolean: should we outright refuse application
  459. * connections that use socks4 or socks5-with-local-dns? */
  460. int ProtocolWarnings; /**< Boolean: when other parties screw up the Tor
  461. * protocol, is it a warn or an info in our logs? */
  462. int TestSocks; /**< Boolean: when we get a socks connection, do we loudly
  463. * log whether it was DNS-leaking or not? */
  464. int HardwareAccel; /**< Boolean: Should we enable OpenSSL hardware
  465. * acceleration where available? */
  466. /** Token Bucket Refill resolution in milliseconds. */
  467. int TokenBucketRefillInterval;
  468. char *AccelName; /**< Optional hardware acceleration engine name. */
  469. char *AccelDir; /**< Optional hardware acceleration engine search dir. */
  470. /** Boolean: Do we try to enter from a smallish number
  471. * of fixed nodes? */
  472. int UseEntryGuards_option;
  473. /** Internal variable to remember whether we're actually acting on
  474. * UseEntryGuards_option -- when we're a non-anonymous Single Onion Service,
  475. * it is always false, otherwise we use the value of UseEntryGuards_option.
  476. * */
  477. int UseEntryGuards;
  478. int NumEntryGuards; /**< How many entry guards do we try to establish? */
  479. /** If 1, we use any guardfraction information we see in the
  480. * consensus. If 0, we don't. If -1, let the consensus parameter
  481. * decide. */
  482. int UseGuardFraction;
  483. int NumDirectoryGuards; /**< How many dir guards do we try to establish?
  484. * If 0, use value from NumEntryGuards. */
  485. int NumPrimaryGuards; /**< How many primary guards do we want? */
  486. int RephistTrackTime; /**< How many seconds do we keep rephist info? */
  487. /** Should we always fetch our dir info on the mirror schedule (which
  488. * means directly from the authorities) no matter our other config? */
  489. int FetchDirInfoEarly;
  490. /** Should we fetch our dir info at the start of the consensus period? */
  491. int FetchDirInfoExtraEarly;
  492. int DirCache; /**< Cache all directory documents and accept requests via
  493. * tunnelled dir conns from clients. If 1, enabled (default);
  494. * If 0, disabled. */
  495. char *VirtualAddrNetworkIPv4; /**< Address and mask to hand out for virtual
  496. * MAPADDRESS requests for IPv4 addresses */
  497. char *VirtualAddrNetworkIPv6; /**< Address and mask to hand out for virtual
  498. * MAPADDRESS requests for IPv6 addresses */
  499. int ServerDNSSearchDomains; /**< Boolean: If set, we don't force exit
  500. * addresses to be FQDNs, but rather search for them in
  501. * the local domains. */
  502. int ServerDNSDetectHijacking; /**< Boolean: If true, check for DNS failure
  503. * hijacking. */
  504. int ServerDNSRandomizeCase; /**< Boolean: Use the 0x20-hack to prevent
  505. * DNS poisoning attacks. */
  506. char *ServerDNSResolvConfFile; /**< If provided, we configure our internal
  507. * resolver from the file here rather than from
  508. * /etc/resolv.conf (Unix) or the registry (Windows). */
  509. char *DirPortFrontPage; /**< This is a full path to a file with an html
  510. disclaimer. This allows a server administrator to show
  511. that they're running Tor and anyone visiting their server
  512. will know this without any specialized knowledge. */
  513. int DisableDebuggerAttachment; /**< Currently Linux only specific attempt to
  514. disable ptrace; needs BSD testing. */
  515. /** Boolean: if set, we start even if our resolv.conf file is missing
  516. * or broken. */
  517. int ServerDNSAllowBrokenConfig;
  518. /** Boolean: if set, then even connections to private addresses will get
  519. * rate-limited. */
  520. int CountPrivateBandwidth;
  521. /** A list of addresses that definitely should be resolvable. Used for
  522. * testing our DNS server. */
  523. struct smartlist_t *ServerDNSTestAddresses;
  524. int EnforceDistinctSubnets; /**< If true, don't allow multiple routers in the
  525. * same network zone in the same circuit. */
  526. int AllowNonRFC953Hostnames; /**< If true, we allow connections to hostnames
  527. * with weird characters. */
  528. /** If true, we try resolving hostnames with weird characters. */
  529. int ServerDNSAllowNonRFC953Hostnames;
  530. /** If true, we try to download extra-info documents (and we serve them,
  531. * if we are a cache). For authorities, this is always true. */
  532. int DownloadExtraInfo;
  533. /** If true, we're configured to collect statistics on clients
  534. * requesting network statuses from us as directory. */
  535. int DirReqStatistics_option;
  536. /** Internal variable to remember whether we're actually acting on
  537. * DirReqStatistics_option -- yes if it's set and we're a server, else no. */
  538. int DirReqStatistics;
  539. /** If true, the user wants us to collect statistics on port usage. */
  540. int ExitPortStatistics;
  541. /** If true, the user wants us to collect connection statistics. */
  542. int ConnDirectionStatistics;
  543. /** If true, the user wants us to collect cell statistics. */
  544. int CellStatistics;
  545. /** If true, the user wants us to collect padding statistics. */
  546. int PaddingStatistics;
  547. /** If true, the user wants us to collect statistics as entry node. */
  548. int EntryStatistics;
  549. /** If true, the user wants us to collect statistics as hidden service
  550. * directory, introduction point, or rendezvous point. */
  551. int HiddenServiceStatistics_option;
  552. /** Internal variable to remember whether we're actually acting on
  553. * HiddenServiceStatistics_option -- yes if it's set and we're a server,
  554. * else no. */
  555. int HiddenServiceStatistics;
  556. /** If true, include statistics file contents in extra-info documents. */
  557. int ExtraInfoStatistics;
  558. /** If true, do not believe anybody who tells us that a domain resolves
  559. * to an internal address, or that an internal address has a PTR mapping.
  560. * Helps avoid some cross-site attacks. */
  561. int ClientDNSRejectInternalAddresses;
  562. /** If true, do not accept any requests to connect to internal addresses
  563. * over randomly chosen exits. */
  564. int ClientRejectInternalAddresses;
  565. /** If true, clients may connect over IPv4. If false, they will avoid
  566. * connecting over IPv4. We enforce this for OR and Dir connections. */
  567. int ClientUseIPv4;
  568. /** If true, clients may connect over IPv6. If false, they will avoid
  569. * connecting over IPv4. We enforce this for OR and Dir connections.
  570. * Use fascist_firewall_use_ipv6() instead of accessing this value
  571. * directly. */
  572. int ClientUseIPv6;
  573. /** If true, prefer an IPv6 OR port over an IPv4 one for entry node
  574. * connections. If auto, bridge clients prefer IPv6, and other clients
  575. * prefer IPv4. Use node_ipv6_or_preferred() instead of accessing this value
  576. * directly. */
  577. int ClientPreferIPv6ORPort;
  578. /** If true, prefer an IPv6 directory port over an IPv4 one for direct
  579. * directory connections. If auto, bridge clients prefer IPv6, and other
  580. * clients prefer IPv4. Use fascist_firewall_prefer_ipv6_dirport() instead of
  581. * accessing this value directly. */
  582. int ClientPreferIPv6DirPort;
  583. /** The length of time that we think a consensus should be fresh. */
  584. int V3AuthVotingInterval;
  585. /** The length of time we think it will take to distribute votes. */
  586. int V3AuthVoteDelay;
  587. /** The length of time we think it will take to distribute signatures. */
  588. int V3AuthDistDelay;
  589. /** The number of intervals we think a consensus should be valid. */
  590. int V3AuthNIntervalsValid;
  591. /** Should advertise and sign consensuses with a legacy key, for key
  592. * migration purposes? */
  593. int V3AuthUseLegacyKey;
  594. /** Location of bandwidth measurement file */
  595. char *V3BandwidthsFile;
  596. /** Location of guardfraction file */
  597. char *GuardfractionFile;
  598. /** Authority only: key=value pairs that we add to our networkstatus
  599. * consensus vote on the 'params' line. */
  600. char *ConsensusParams;
  601. /** Authority only: minimum number of measured bandwidths we must see
  602. * before we only believe measured bandwidths to assign flags. */
  603. int MinMeasuredBWsForAuthToIgnoreAdvertised;
  604. /** The length of time that we think an initial consensus should be fresh.
  605. * Only altered on testing networks. */
  606. int TestingV3AuthInitialVotingInterval;
  607. /** The length of time we think it will take to distribute initial votes.
  608. * Only altered on testing networks. */
  609. int TestingV3AuthInitialVoteDelay;
  610. /** The length of time we think it will take to distribute initial
  611. * signatures. Only altered on testing networks.*/
  612. int TestingV3AuthInitialDistDelay;
  613. /** Offset in seconds added to the starting time for consensus
  614. voting. Only altered on testing networks. */
  615. int TestingV3AuthVotingStartOffset;
  616. /** If an authority has been around for less than this amount of time, it
  617. * does not believe its reachability information is accurate. Only
  618. * altered on testing networks. */
  619. int TestingAuthDirTimeToLearnReachability;
  620. /** Clients don't download any descriptor this recent, since it will
  621. * probably not have propagated to enough caches. Only altered on testing
  622. * networks. */
  623. int TestingEstimatedDescriptorPropagationTime;
  624. /** Schedule for when servers should download things in general. Only
  625. * altered on testing networks. */
  626. int TestingServerDownloadInitialDelay;
  627. /** Schedule for when clients should download things in general. Only
  628. * altered on testing networks. */
  629. int TestingClientDownloadInitialDelay;
  630. /** Schedule for when servers should download consensuses. Only altered
  631. * on testing networks. */
  632. int TestingServerConsensusDownloadInitialDelay;
  633. /** Schedule for when clients should download consensuses. Only altered
  634. * on testing networks. */
  635. int TestingClientConsensusDownloadInitialDelay;
  636. /** Schedule for when clients should download consensuses from authorities
  637. * if they are bootstrapping (that is, they don't have a usable, reasonably
  638. * live consensus). Only used by clients fetching from a list of fallback
  639. * directory mirrors.
  640. *
  641. * This schedule is incremented by (potentially concurrent) connection
  642. * attempts, unlike other schedules, which are incremented by connection
  643. * failures. Only altered on testing networks. */
  644. int ClientBootstrapConsensusAuthorityDownloadInitialDelay;
  645. /** Schedule for when clients should download consensuses from fallback
  646. * directory mirrors if they are bootstrapping (that is, they don't have a
  647. * usable, reasonably live consensus). Only used by clients fetching from a
  648. * list of fallback directory mirrors.
  649. *
  650. * This schedule is incremented by (potentially concurrent) connection
  651. * attempts, unlike other schedules, which are incremented by connection
  652. * failures. Only altered on testing networks. */
  653. int ClientBootstrapConsensusFallbackDownloadInitialDelay;
  654. /** Schedule for when clients should download consensuses from authorities
  655. * if they are bootstrapping (that is, they don't have a usable, reasonably
  656. * live consensus). Only used by clients which don't have or won't fetch
  657. * from a list of fallback directory mirrors.
  658. *
  659. * This schedule is incremented by (potentially concurrent) connection
  660. * attempts, unlike other schedules, which are incremented by connection
  661. * failures. Only altered on testing networks. */
  662. int ClientBootstrapConsensusAuthorityOnlyDownloadInitialDelay;
  663. /** Schedule for when clients should download bridge descriptors. Only
  664. * altered on testing networks. */
  665. int TestingBridgeDownloadInitialDelay;
  666. /** Schedule for when clients should download bridge descriptors when they
  667. * have no running bridges. Only altered on testing networks. */
  668. int TestingBridgeBootstrapDownloadInitialDelay;
  669. /** When directory clients have only a few descriptors to request, they
  670. * batch them until they have more, or until this amount of time has
  671. * passed. Only altered on testing networks. */
  672. int TestingClientMaxIntervalWithoutRequest;
  673. /** How long do we let a directory connection stall before expiring
  674. * it? Only altered on testing networks. */
  675. int TestingDirConnectionMaxStall;
  676. /** How many simultaneous in-progress connections will we make when trying
  677. * to fetch a consensus before we wait for one to complete, timeout, or
  678. * error out? Only altered on testing networks. */
  679. int ClientBootstrapConsensusMaxInProgressTries;
  680. /** If true, we take part in a testing network. Change the defaults of a
  681. * couple of other configuration options and allow to change the values
  682. * of certain configuration options. */
  683. int TestingTorNetwork;
  684. /** Minimum value for the Exit flag threshold on testing networks. */
  685. uint64_t TestingMinExitFlagThreshold;
  686. /** Minimum value for the Fast flag threshold on testing networks. */
  687. uint64_t TestingMinFastFlagThreshold;
  688. /** Relays in a testing network which should be voted Exit
  689. * regardless of exit policy. */
  690. routerset_t *TestingDirAuthVoteExit;
  691. int TestingDirAuthVoteExitIsStrict;
  692. /** Relays in a testing network which should be voted Guard
  693. * regardless of uptime and bandwidth. */
  694. routerset_t *TestingDirAuthVoteGuard;
  695. int TestingDirAuthVoteGuardIsStrict;
  696. /** Relays in a testing network which should be voted HSDir
  697. * regardless of uptime and DirPort. */
  698. routerset_t *TestingDirAuthVoteHSDir;
  699. int TestingDirAuthVoteHSDirIsStrict;
  700. /** Enable CONN_BW events. Only altered on testing networks. */
  701. int TestingEnableConnBwEvent;
  702. /** Enable CELL_STATS events. Only altered on testing networks. */
  703. int TestingEnableCellStatsEvent;
  704. /** If true, and we have GeoIP data, and we're a bridge, keep a per-country
  705. * count of how many client addresses have contacted us so that we can help
  706. * the bridge authority guess which countries have blocked access to us. */
  707. int BridgeRecordUsageByCountry;
  708. /** Optionally, IPv4 and IPv6 GeoIP data. */
  709. char *GeoIPFile;
  710. char *GeoIPv6File;
  711. /** Autobool: if auto, then any attempt to Exclude{Exit,}Nodes a particular
  712. * country code will exclude all nodes in ?? and A1. If true, all nodes in
  713. * ?? and A1 are excluded. Has no effect if we don't know any GeoIP data. */
  714. int GeoIPExcludeUnknown;
  715. /** If true, SIGHUP should reload the torrc. Sometimes controllers want
  716. * to make this false. */
  717. int ReloadTorrcOnSIGHUP;
  718. /* The main parameter for picking circuits within a connection.
  719. *
  720. * If this value is positive, when picking a cell to relay on a connection,
  721. * we always relay from the circuit whose weighted cell count is lowest.
  722. * Cells are weighted exponentially such that if one cell is sent
  723. * 'CircuitPriorityHalflife' seconds before another, it counts for half as
  724. * much.
  725. *
  726. * If this value is zero, we're disabling the cell-EWMA algorithm.
  727. *
  728. * If this value is negative, we're using the default approach
  729. * according to either Tor or a parameter set in the consensus.
  730. */
  731. double CircuitPriorityHalflife;
  732. /** Set to true if the TestingTorNetwork configuration option is set.
  733. * This is used so that options_validate() has a chance to realize that
  734. * the defaults have changed. */
  735. int UsingTestNetworkDefaults_;
  736. /** If 1, we try to use microdescriptors to build circuits. If 0, we don't.
  737. * If -1, Tor decides. */
  738. int UseMicrodescriptors;
  739. /** File where we should write the ControlPort. */
  740. char *ControlPortWriteToFile;
  741. /** Should that file be group-readable? */
  742. int ControlPortFileGroupReadable;
  743. #define MAX_MAX_CLIENT_CIRCUITS_PENDING 1024
  744. /** Maximum number of non-open general-purpose origin circuits to allow at
  745. * once. */
  746. int MaxClientCircuitsPending;
  747. /** If 1, we always send optimistic data when it's supported. If 0, we
  748. * never use it. If -1, we do what the consensus says. */
  749. int OptimisticData;
  750. /** If 1, we accept and launch no external network connections, except on
  751. * control ports. */
  752. int DisableNetwork;
  753. /**
  754. * Parameters for path-bias detection.
  755. * @{
  756. * These options override the default behavior of Tor's (**currently
  757. * experimental**) path bias detection algorithm. To try to find broken or
  758. * misbehaving guard nodes, Tor looks for nodes where more than a certain
  759. * fraction of circuits through that guard fail to get built.
  760. *
  761. * The PathBiasCircThreshold option controls how many circuits we need to
  762. * build through a guard before we make these checks. The
  763. * PathBiasNoticeRate, PathBiasWarnRate and PathBiasExtremeRate options
  764. * control what fraction of circuits must succeed through a guard so we
  765. * won't write log messages. If less than PathBiasExtremeRate circuits
  766. * succeed *and* PathBiasDropGuards is set to 1, we disable use of that
  767. * guard.
  768. *
  769. * When we have seen more than PathBiasScaleThreshold circuits through a
  770. * guard, we scale our observations by 0.5 (governed by the consensus) so
  771. * that new observations don't get swamped by old ones.
  772. *
  773. * By default, or if a negative value is provided for one of these options,
  774. * Tor uses reasonable defaults from the networkstatus consensus document.
  775. * If no defaults are available there, these options default to 150, .70,
  776. * .50, .30, 0, and 300 respectively.
  777. */
  778. int PathBiasCircThreshold;
  779. double PathBiasNoticeRate;
  780. double PathBiasWarnRate;
  781. double PathBiasExtremeRate;
  782. int PathBiasDropGuards;
  783. int PathBiasScaleThreshold;
  784. /** @} */
  785. /**
  786. * Parameters for path-bias use detection
  787. * @{
  788. * Similar to the above options, these options override the default behavior
  789. * of Tor's (**currently experimental**) path use bias detection algorithm.
  790. *
  791. * Where as the path bias parameters govern thresholds for successfully
  792. * building circuits, these four path use bias parameters govern thresholds
  793. * only for circuit usage. Circuits which receive no stream usage are not
  794. * counted by this detection algorithm. A used circuit is considered
  795. * successful if it is capable of carrying streams or otherwise receiving
  796. * well-formed responses to RELAY cells.
  797. *
  798. * By default, or if a negative value is provided for one of these options,
  799. * Tor uses reasonable defaults from the networkstatus consensus document.
  800. * If no defaults are available there, these options default to 20, .80,
  801. * .60, and 100, respectively.
  802. */
  803. int PathBiasUseThreshold;
  804. double PathBiasNoticeUseRate;
  805. double PathBiasExtremeUseRate;
  806. int PathBiasScaleUseThreshold;
  807. /** @} */
  808. int IPv6Exit; /**< Do we support exiting to IPv6 addresses? */
  809. /** Fraction: */
  810. double PathsNeededToBuildCircuits;
  811. /** What expiry time shall we place on our SSL certs? "0" means we
  812. * should guess a suitable value. */
  813. int SSLKeyLifetime;
  814. /** How long (seconds) do we keep a guard before picking a new one? */
  815. int GuardLifetime;
  816. /** Is this an exit node? This is a tristate, where "1" means "yes, and use
  817. * the default exit policy if none is given" and "0" means "no; exit policy
  818. * is 'reject *'" and "auto" (-1) means "same as 1, but warn the user."
  819. *
  820. * XXXX Eventually, the default will be 0. */
  821. int ExitRelay;
  822. /** For how long (seconds) do we declare our signing keys to be valid? */
  823. int SigningKeyLifetime;
  824. /** For how long (seconds) do we declare our link keys to be valid? */
  825. int TestingLinkCertLifetime;
  826. /** For how long (seconds) do we declare our auth keys to be valid? */
  827. int TestingAuthKeyLifetime;
  828. /** How long before signing keys expire will we try to make a new one? */
  829. int TestingSigningKeySlop;
  830. /** How long before link keys expire will we try to make a new one? */
  831. int TestingLinkKeySlop;
  832. /** How long before auth keys expire will we try to make a new one? */
  833. int TestingAuthKeySlop;
  834. /** Force use of offline master key features: never generate a master
  835. * ed25519 identity key except from tor --keygen */
  836. int OfflineMasterKey;
  837. enum {
  838. FORCE_PASSPHRASE_AUTO=0,
  839. FORCE_PASSPHRASE_ON,
  840. FORCE_PASSPHRASE_OFF
  841. } keygen_force_passphrase;
  842. int use_keygen_passphrase_fd;
  843. int keygen_passphrase_fd;
  844. int change_key_passphrase;
  845. char *master_key_fname;
  846. /** Autobool: Do we try to retain capabilities if we can? */
  847. int KeepBindCapabilities;
  848. /** Maximum total size of unparseable descriptors to log during the
  849. * lifetime of this Tor process.
  850. */
  851. uint64_t MaxUnparseableDescSizeToLog;
  852. /** Bool (default: 1): Switch for the shared random protocol. Only
  853. * relevant to a directory authority. If off, the authority won't
  854. * participate in the protocol. If on (default), a flag is added to the
  855. * vote indicating participation. */
  856. int AuthDirSharedRandomness;
  857. /** If 1, we skip all OOS checks. */
  858. int DisableOOSCheck;
  859. /** Autobool: Should we include Ed25519 identities in extend2 cells?
  860. * If -1, we should do whatever the consensus parameter says. */
  861. int ExtendByEd25519ID;
  862. /** Bool (default: 1): When testing routerinfos as a directory authority,
  863. * do we enforce Ed25519 identity match? */
  864. /* NOTE: remove this option someday. */
  865. int AuthDirTestEd25519LinkKeys;
  866. /** Bool (default: 0): Tells if a %include was used on torrc */
  867. int IncludeUsed;
  868. /** The seconds after expiration which we as a relay should keep old
  869. * consensuses around so that we can generate diffs from them. If 0,
  870. * use the default. */
  871. int MaxConsensusAgeForDiffs;
  872. /** Bool (default: 0). Tells Tor to never try to exec another program.
  873. */
  874. int NoExec;
  875. /** Have the KIST scheduler run every X milliseconds. If less than zero, do
  876. * not use the KIST scheduler but use the old vanilla scheduler instead. If
  877. * zero, do what the consensus says and fall back to using KIST as if this is
  878. * set to "10 msec" if the consensus doesn't say anything. */
  879. int KISTSchedRunInterval;
  880. /** A multiplier for the KIST per-socket limit calculation. */
  881. double KISTSockBufSizeFactor;
  882. /** The list of scheduler type string ordered by priority that is first one
  883. * has to be tried first. Default: KIST,KISTLite,Vanilla */
  884. struct smartlist_t *Schedulers;
  885. /* An ordered list of scheduler_types mapped from Schedulers. */
  886. struct smartlist_t *SchedulerTypes_;
  887. /** List of files that were opened by %include in torrc and torrc-defaults */
  888. struct smartlist_t *FilesOpenedByIncludes;
  889. /** If true, Tor shouldn't install any posix signal handlers, since it is
  890. * running embedded inside another process.
  891. */
  892. int DisableSignalHandlers;
  893. /** Autobool: Is the circuit creation DoS mitigation subsystem enabled? */
  894. int DoSCircuitCreationEnabled;
  895. /** Minimum concurrent connection needed from one single address before any
  896. * defense is used. */
  897. int DoSCircuitCreationMinConnections;
  898. /** Circuit rate used to refill the token bucket. */
  899. int DoSCircuitCreationRate;
  900. /** Maximum allowed burst of circuits. Reaching that value, the address is
  901. * detected as malicious and a defense might be used. */
  902. int DoSCircuitCreationBurst;
  903. /** When an address is marked as malicous, what defense should be used
  904. * against it. See the dos_cc_defense_type_t enum. */
  905. int DoSCircuitCreationDefenseType;
  906. /** For how much time (in seconds) the defense is applicable for a malicious
  907. * address. A random time delta is added to the defense time of an address
  908. * which will be between 1 second and half of this value. */
  909. int DoSCircuitCreationDefenseTimePeriod;
  910. /** Autobool: Is the DoS connection mitigation subsystem enabled? */
  911. int DoSConnectionEnabled;
  912. /** Maximum concurrent connection allowed per address. */
  913. int DoSConnectionMaxConcurrentCount;
  914. /** When an address is reaches the maximum count, what defense should be
  915. * used against it. See the dos_conn_defense_type_t enum. */
  916. int DoSConnectionDefenseType;
  917. /** Autobool: Do we refuse single hop client rendezvous? */
  918. int DoSRefuseSingleHopClientRendezvous;
  919. };
  920. #endif