or_options_st.h 49 KB

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