or_options_st.h 50 KB

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