or_options_st.h 49 KB

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