or_options_st.h 49 KB

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