or_options_st.h 50 KB

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