tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

or_options_st.h (51115B)


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