1. 19 Jan, 2013 1 commit
    • Mike Perry's avatar
      Implement Path use bias accounting. · e13e3022
      Mike Perry authored
      Path use bias measures how often we can actually succeed using the circuits we
      actually try to use. It is a subset of path bias accounting, but it is
      computed as a separate statistic because the rate of client circuit use may
      vary depending on use case.
      e13e3022
  2. 16 Jan, 2013 1 commit
  3. 09 Jan, 2013 2 commits
  4. 03 Jan, 2013 4 commits
  5. 10 Dec, 2012 1 commit
  6. 08 Dec, 2012 1 commit
  7. 07 Dec, 2012 4 commits
  8. 22 Oct, 2012 1 commit
  9. 15 Oct, 2012 1 commit
  10. 12 Oct, 2012 1 commit
    • Nick Mathewson's avatar
      Convert all include-guard macros to avoid reserved identifiers. · 0cb921f3
      Nick Mathewson authored
      In C, we technically aren't supposed to define our own things that
      start with an underscore.
      
      This is a purely machine-generated commit.  First, I ran this script
      on all the headers in src/{common,or,test,tools/*}/*.h :
      ==============================
      
      use strict;
      
      my %macros = ();
      my %skipped = ();
      FILE: for my $fn (@ARGV) {
          my $f = $fn;
          if ($fn !~ /^\.\//) {
      	$f = "./$fn";
          }
          $skipped{$fn} = 0;
          open(F, $fn);
          while (<F>) {
      	if (/^#ifndef ([A-Za-z0-9_]+)/) {
      	    $macros{$fn} = $1;
      	    next FILE;
      	}
          }
      }
      
      print "#!/usr/bin/perl -w -i -p\n\n";
      for my $fn (@ARGV) {
          if (! exists $macros{$fn}) {
      	print "# No macro known for $fn!\n" if (!$skipped{$fn});
      	next;
          }
          if ($macros{$fn} !~ /_H_?$/) {
      	print "# Weird macro for $fn...\n";
          }
          my $goodmacro = uc $fn;
          $goodmacro =~ s#.*/##;
          $goodmacro =~ s#[\/\-\.]#_#g;
          print "s/(?<![A-Za-z0-9_])$macros{$fn}(?![A-Za-z0-9_])/TOR_${goodmacro}/g;\n"
      }
      ==============================
      
      It produced the following output, which I then re-ran on those same files:
      
      ==============================
      
      s/(?<![A-Za-z0-9_])_TOR_ADDRESS_H(?![A-Za-z0-9_])/TOR_ADDRESS_H/g;
      s/(?<![A-Za-z0-9_])_TOR_AES_H(?![A-Za-z0-9_])/TOR_AES_H/g;
      s/(?<![A-Za-z0-9_])_TOR_COMPAT_H(?![A-Za-z0-9_])/TOR_COMPAT_H/g;
      s/(?<![A-Za-z0-9_])_TOR_COMPAT_LIBEVENT_H(?![A-Za-z0-9_])/TOR_COMPAT_LIBEVENT_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CONTAINER_H(?![A-Za-z0-9_])/TOR_CONTAINER_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CRYPTO_H(?![A-Za-z0-9_])/TOR_CRYPTO_H/g;
      s/(?<![A-Za-z0-9_])TOR_DI_OPS_H(?![A-Za-z0-9_])/TOR_DI_OPS_H/g;
      s/(?<![A-Za-z0-9_])_TOR_MEMAREA_H(?![A-Za-z0-9_])/TOR_MEMAREA_H/g;
      s/(?<![A-Za-z0-9_])_TOR_MEMPOOL_H(?![A-Za-z0-9_])/TOR_MEMPOOL_H/g;
      s/(?<![A-Za-z0-9_])TOR_PROCMON_H(?![A-Za-z0-9_])/TOR_PROCMON_H/g;
      s/(?<![A-Za-z0-9_])_TOR_TORGZIP_H(?![A-Za-z0-9_])/TOR_TORGZIP_H/g;
      s/(?<![A-Za-z0-9_])_TOR_TORINT_H(?![A-Za-z0-9_])/TOR_TORINT_H/g;
      s/(?<![A-Za-z0-9_])_TOR_LOG_H(?![A-Za-z0-9_])/TOR_TORLOG_H/g;
      s/(?<![A-Za-z0-9_])_TOR_TORTLS_H(?![A-Za-z0-9_])/TOR_TORTLS_H/g;
      s/(?<![A-Za-z0-9_])_TOR_UTIL_H(?![A-Za-z0-9_])/TOR_UTIL_H/g;
      s/(?<![A-Za-z0-9_])_TOR_BUFFERS_H(?![A-Za-z0-9_])/TOR_BUFFERS_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CHANNEL_H(?![A-Za-z0-9_])/TOR_CHANNEL_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CHANNEL_TLS_H(?![A-Za-z0-9_])/TOR_CHANNELTLS_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CIRCUITBUILD_H(?![A-Za-z0-9_])/TOR_CIRCUITBUILD_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CIRCUITLIST_H(?![A-Za-z0-9_])/TOR_CIRCUITLIST_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CIRCUITMUX_EWMA_H(?![A-Za-z0-9_])/TOR_CIRCUITMUX_EWMA_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CIRCUITMUX_H(?![A-Za-z0-9_])/TOR_CIRCUITMUX_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CIRCUITUSE_H(?![A-Za-z0-9_])/TOR_CIRCUITUSE_H/g;
      s/(?<![A-Za-z0-9_])_TOR_COMMAND_H(?![A-Za-z0-9_])/TOR_COMMAND_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CONFIG_H(?![A-Za-z0-9_])/TOR_CONFIG_H/g;
      s/(?<![A-Za-z0-9_])TOR_CONFPARSE_H(?![A-Za-z0-9_])/TOR_CONFPARSE_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CONNECTION_EDGE_H(?![A-Za-z0-9_])/TOR_CONNECTION_EDGE_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CONNECTION_H(?![A-Za-z0-9_])/TOR_CONNECTION_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CONNECTION_OR_H(?![A-Za-z0-9_])/TOR_CONNECTION_OR_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CONTROL_H(?![A-Za-z0-9_])/TOR_CONTROL_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CPUWORKER_H(?![A-Za-z0-9_])/TOR_CPUWORKER_H/g;
      s/(?<![A-Za-z0-9_])_TOR_DIRECTORY_H(?![A-Za-z0-9_])/TOR_DIRECTORY_H/g;
      s/(?<![A-Za-z0-9_])_TOR_DIRSERV_H(?![A-Za-z0-9_])/TOR_DIRSERV_H/g;
      s/(?<![A-Za-z0-9_])_TOR_DIRVOTE_H(?![A-Za-z0-9_])/TOR_DIRVOTE_H/g;
      s/(?<![A-Za-z0-9_])_TOR_DNS_H(?![A-Za-z0-9_])/TOR_DNS_H/g;
      s/(?<![A-Za-z0-9_])_TOR_DNSSERV_H(?![A-Za-z0-9_])/TOR_DNSSERV_H/g;
      s/(?<![A-Za-z0-9_])TOR_EVENTDNS_TOR_H(?![A-Za-z0-9_])/TOR_EVENTDNS_TOR_H/g;
      s/(?<![A-Za-z0-9_])_TOR_GEOIP_H(?![A-Za-z0-9_])/TOR_GEOIP_H/g;
      s/(?<![A-Za-z0-9_])_TOR_HIBERNATE_H(?![A-Za-z0-9_])/TOR_HIBERNATE_H/g;
      s/(?<![A-Za-z0-9_])_TOR_MAIN_H(?![A-Za-z0-9_])/TOR_MAIN_H/g;
      s/(?<![A-Za-z0-9_])_TOR_MICRODESC_H(?![A-Za-z0-9_])/TOR_MICRODESC_H/g;
      s/(?<![A-Za-z0-9_])_TOR_NETWORKSTATUS_H(?![A-Za-z0-9_])/TOR_NETWORKSTATUS_H/g;
      s/(?<![A-Za-z0-9_])_TOR_NODELIST_H(?![A-Za-z0-9_])/TOR_NODELIST_H/g;
      s/(?<![A-Za-z0-9_])_TOR_NTMAIN_H(?![A-Za-z0-9_])/TOR_NTMAIN_H/g;
      s/(?<![A-Za-z0-9_])_TOR_ONION_H(?![A-Za-z0-9_])/TOR_ONION_H/g;
      s/(?<![A-Za-z0-9_])_TOR_OR_H(?![A-Za-z0-9_])/TOR_OR_H/g;
      s/(?<![A-Za-z0-9_])_TOR_POLICIES_H(?![A-Za-z0-9_])/TOR_POLICIES_H/g;
      s/(?<![A-Za-z0-9_])_TOR_REASONS_H(?![A-Za-z0-9_])/TOR_REASONS_H/g;
      s/(?<![A-Za-z0-9_])_TOR_RELAY_H(?![A-Za-z0-9_])/TOR_RELAY_H/g;
      s/(?<![A-Za-z0-9_])_TOR_RENDCLIENT_H(?![A-Za-z0-9_])/TOR_RENDCLIENT_H/g;
      s/(?<![A-Za-z0-9_])_TOR_RENDCOMMON_H(?![A-Za-z0-9_])/TOR_RENDCOMMON_H/g;
      s/(?<![A-Za-z0-9_])_TOR_RENDMID_H(?![A-Za-z0-9_])/TOR_RENDMID_H/g;
      s/(?<![A-Za-z0-9_])_TOR_RENDSERVICE_H(?![A-Za-z0-9_])/TOR_RENDSERVICE_H/g;
      s/(?<![A-Za-z0-9_])_TOR_REPHIST_H(?![A-Za-z0-9_])/TOR_REPHIST_H/g;
      s/(?<![A-Za-z0-9_])_TOR_REPLAYCACHE_H(?![A-Za-z0-9_])/TOR_REPLAYCACHE_H/g;
      s/(?<![A-Za-z0-9_])_TOR_ROUTER_H(?![A-Za-z0-9_])/TOR_ROUTER_H/g;
      s/(?<![A-Za-z0-9_])_TOR_ROUTERLIST_H(?![A-Za-z0-9_])/TOR_ROUTERLIST_H/g;
      s/(?<![A-Za-z0-9_])_TOR_ROUTERPARSE_H(?![A-Za-z0-9_])/TOR_ROUTERPARSE_H/g;
      s/(?<![A-Za-z0-9_])TOR_ROUTERSET_H(?![A-Za-z0-9_])/TOR_ROUTERSET_H/g;
      s/(?<![A-Za-z0-9_])TOR_STATEFILE_H(?![A-Za-z0-9_])/TOR_STATEFILE_H/g;
      s/(?<![A-Za-z0-9_])_TOR_STATUS_H(?![A-Za-z0-9_])/TOR_STATUS_H/g;
      s/(?<![A-Za-z0-9_])TOR_TRANSPORTS_H(?![A-Za-z0-9_])/TOR_TRANSPORTS_H/g;
      s/(?<![A-Za-z0-9_])_TOR_TEST_H(?![A-Za-z0-9_])/TOR_TEST_H/g;
      s/(?<![A-Za-z0-9_])_TOR_FW_HELPER_H(?![A-Za-z0-9_])/TOR_TOR_FW_HELPER_H/g;
      s/(?<![A-Za-z0-9_])_TOR_FW_HELPER_NATPMP_H(?![A-Za-z0-9_])/TOR_TOR_FW_HELPER_NATPMP_H/g;
      s/(?<![A-Za-z0-9_])_TOR_FW_HELPER_UPNP_H(?![A-Za-z0-9_])/TOR_TOR_FW_HELPER_UPNP_H/g;
      ==============================
      0cb921f3
  11. 08 Oct, 2012 1 commit
  12. 04 Oct, 2012 1 commit
  13. 07 Sep, 2012 1 commit
  14. 06 Sep, 2012 1 commit
  15. 05 Sep, 2012 1 commit
  16. 23 Aug, 2012 1 commit
    • Linus Nordberg's avatar
      Move ipv6_preferred from routerinfo_t to node_t. · 3410a46e
      Linus Nordberg authored
      Move extend_info_from_router() from circuitbuild.c to router.c and
      make it static.
      
      Add get_configured_bridge_by_orports_digest() and have
      get_configured_bridge_by_routerinfo() and
      node_is_a_configured_bridge() use it. We now consider all OR ports of
      a bridge when looking for it.
      
      Move node_get_*_orport to nodelist.c.
      
      Fix a cut'n'paste error in header of nodelist.h.
      
      Add node_assert_ok().
      
      Add router_get_all_orports(). It's duplicating code from
      node_get_all_orports(). Worth fixing at the cost of complicating the
      API slightly?
      3410a46e
  17. 19 Jul, 2012 1 commit
    • Nick Mathewson's avatar
      Avoid double-typedef of transport_t. · 24451e6f
      Nick Mathewson authored
      You can say "struct foo_t" as much as you want, but you'd better not
      have "typedef struct foo_t foo_t" more than once.
      
      Fix for bug 6416.  Bug not in any released version of Tor.
      24451e6f
  18. 12 Jul, 2012 1 commit
    • George Kadianakis's avatar
      Address Nick's comments. · 8b9f4d75
      George Kadianakis authored
      - Add a changes/ file.
      - Make it compile under --enable-gcc-warnings.
      - Update the file-level documentation of src/or/transports.c.
      - Only update descriptor if at least a managed proxy was configured.
      - Add our external IP address to the extra-info descriptor instead of 0.0.0.0.
      8b9f4d75
  19. 03 Jul, 2012 1 commit
  20. 14 Jun, 2012 1 commit
  21. 13 Jun, 2012 1 commit
  22. 05 Jun, 2012 1 commit
  23. 04 Jun, 2012 1 commit
    • Nick Mathewson's avatar
      Add about 60 more DOCDOC comments to 0.2.3 · 173b18c7
      Nick Mathewson authored
      Also, try to resolve some doxygen issues.  First, define a magic
      "This is doxygen!" macro so that we take the correct branch in
      various #if/#else/#endifs in order to get the right documentation.
      Second, add in a few grouping @{ and @} entries in order to get some
      variables and fields to get grouped together.
      173b18c7
  24. 18 May, 2012 1 commit
  25. 25 Jan, 2012 1 commit
    • Roger Dingledine's avatar
      Allow 0.2.3.x clients to use 0.2.2.x bridges. · a0f08977
      Roger Dingledine authored
      Previously the client would ask the bridge for microdescriptors, which are
      only supported in 0.2.3.x and later, and then fail to bootstrap when it
      didn't get the answers it wanted. Fixes bug 4013; bugfix on 0.2.3.2-alpha.
      
      The fix here is to revert to using normal descriptors if any of our
      bridges are known to not support microdescs. This is not ideal, a) because
      we'll start downloading a microdesc consensus as soon as we get a bridge
      descriptor, and that will waste time if we later get a bridge descriptor
      that tells us we don't like microdescriptors; and b) by changing our mind
      we're leaking to our other bridges that we have an old-version bridge.
      
      The alternate fix would have been to change
      we_use_microdescriptors_for_circuits() to ask if *any* of our bridges
      can support microdescriptors, and then change the directory logic that
      picks a bridge to only select from those that do. For people living in
      the future, where 0.2.2.x is obsolete, there won't be a difference.
      
      Note that in either of these potential fixes, we have risk of oscillation
      if our one funny-looking bridges goes away / comes back.
      a0f08977
  26. 18 Jan, 2012 1 commit
    • Nick Mathewson's avatar
      Rename nonconformant identifiers. · 26e789fb
      Nick Mathewson authored
      Fixes bug 4893.
      
      These changes are pure mechanical, and were generated with this
      perl script:
      
        /usr/bin/perl -w -i.bak -p
      
        s/crypto_pk_env_t/crypto_pk_t/g;
        s/crypto_dh_env_t/crypto_dh_t/g;
        s/crypto_cipher_env_t/crypto_cipher_t/g;
        s/crypto_digest_env_t/crypto_digest_t/g;
      
        s/aes_free_cipher/aes_cipher_free/g;
        s/crypto_free_cipher_env/crypto_cipher_free/g;
        s/crypto_free_digest_env/crypto_digest_free/g;
        s/crypto_free_pk_env/crypto_pk_free/g;
      
        s/_crypto_dh_env_get_dh/_crypto_dh_get_dh/g;
        s/_crypto_new_pk_env_rsa/_crypto_new_pk_from_rsa/g;
        s/_crypto_pk_env_get_evp_pkey/_crypto_pk_get_evp_pkey/g;
        s/_crypto_pk_env_get_rsa/_crypto_pk_get_rsa/g;
      
        s/crypto_new_cipher_env/crypto_cipher_new/g;
        s/crypto_new_digest_env/crypto_digest_new/g;
        s/crypto_new_digest256_env/crypto_digest256_new/g;
        s/crypto_new_pk_env/crypto_pk_new/g;
      
        s/crypto_create_crypto_env/crypto_cipher_new/g;
      
        s/connection_create_listener/connection_listener_new/g;
        s/smartlist_create/smartlist_new/g;
        s/transport_create/transport_new/g;
      26e789fb
  27. 30 Nov, 2011 1 commit
    • Linus Nordberg's avatar
      First chunk of support for bridges on IPv6 · f786307a
      Linus Nordberg authored and Nick Mathewson's avatar Nick Mathewson committed
      Comments below focus on changes, see diff for added code.
      
      New type tor_addr_port_t holding an IP address and a TCP/UDP port.
      
      New flag in routerinfo_t, ipv6_preferred.  This should go in the
      node_t instead but not now.
      
      Replace node_get_addr() with
      - node_get_prim_addr() for primary address, i.e. IPv4 for now
      - node_get_pref_addr() for preferred address, IPv4 or IPv6.
      
      Rename node_get_addr_ipv4h() node_get_prim_addr_ipv4h() for
      consistency.  The primary address will not allways be an IPv4 address.
      Same for node_get_orport() -> node_get_prim_orport().
      
      Rewrite node_is_a_configured_bridge() to take all OR ports into account.
      
      Extend argument list to extend_info_from_node and
      extend_info_from_router with a flag indicating if we want to use the
      routers primary address or the preferred address.  Use the preferred
      address in as few situtations as possible for allowing clients to
      connect to bridges over IPv6.
      f786307a
  28. 11 Sep, 2011 2 commits
    • George Kadianakis's avatar
      Don't warn of stray Bridges if managed proxies are still unconfigured. · d0416ce3
      George Kadianakis authored
      With managed proxies you would always get the error message:
      
      "You have a Bridge line using the X pluggable transport, but there
      doesn't seem to be a corresponding ClientTransportPlugin line."
      
      because the check happened directly after parse_client_transport_line()
      when managed proxies were not fully configured and their transports
      were not registered.
      
      The fix is to move the validation to run_scheduled_events() and make
      sure that all managed proxies are configured first.
      d0416ce3
    • George Kadianakis's avatar
      Prepare circuitbuild.[ch] and config.[ch] for SIGHUPs. · fa514fb2
      George Kadianakis authored
      * Create mark/sweep functions for transports.
      * Create a transport_resolve_conflicts() function that tries to
        resolve conflicts when registering transports.
      fa514fb2
  29. 13 Jul, 2011 1 commit
    • George Kadianakis's avatar
      Put some last missing pieces together. · 5492de76
      George Kadianakis authored
      * Add some utility transport functions in circuitbuild.[ch] so that we
        can use them from pt.c.
      * Make the accounting system consider traffic coming from proxies.
      * Make sure that we only fetch bridge descriptors when all the
        transports are configured.
      5492de76
  30. 03 Jul, 2011 2 commits
  31. 22 Jun, 2011 1 commit
    • George Kadianakis's avatar
      Revised how we handle ClientTransportPlugin and Bridge lines. · 1fe8bee6
      George Kadianakis authored
      Multiple Bridge lines can point to the same one ClientTransportPlugin
      line, and we can have multiple ClientTransportPlugin lines in our
      configuration file that don't match with a bridge. We also issue a
      warning when we have a Bridge line with a pluggable transport but we
      can't match it to a ClientTransportPlugin line.
      1fe8bee6