Commit Graph

637 Commits

Author SHA1 Message Date
Nick Mathewson
5cf9167f91 Use the standard _WIN32, not the Torism MS_WINDOWS or deprecated WIN32
This commit is completely mechanical; I used this perl script to make it:

 #!/usr/bin/perl -w -i.bak -p

 if (/^\s*\#/) {
     s/MS_WINDOWS/_WIN32/g;
     s/\bWIN32\b/_WIN32/g;
 }
2012-01-31 15:48:47 -05:00
Nick Mathewson
26e789fbfd Rename nonconformant identifiers.
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;
2012-01-18 15:53:30 -05:00
Nick Mathewson
5579bc0eaf whitespace fixes 2012-01-16 15:07:47 -05:00
Nick Mathewson
9c29369a04 Convert instances of tor_malloc+tor_snprintf into tor_asprintf
These were found by looking for tor_snprintf() instances that were
preceeded closely by tor_malloc(), though I probably converted some
more snprintfs as well.

(In every case, make sure that the length variable (if any) is
removed, renamed, or lowered, so that anything else that might have
assumed a longer buffer doesn't exist.)
2012-01-16 15:03:44 -05:00
Nick Mathewson
cc02823d7f Convert instances of tor_snprintf+strdup into tor_asprintf
These were found by looking for tor_snprintf() instances that were
followed closely by tor_strdup(), though I probably converted some
other snprintfs as well.
2012-01-16 15:03:13 -05:00
Nick Mathewson
edcc9981d8 Try to use smartlist_add_asprintf consistently
(To ensure correctness, in every case, make sure that the temporary
variable is deleted, renamed, or lowered in scope, so we can't have
any bugs related to accidentally relying on the no-longer-filled
variable.)
2012-01-16 15:02:51 -05:00
Nick Mathewson
9c6d913b9e Rename smartlist_{v,}asprintf_add to smartlist_add_{v,}asprintf 2012-01-16 15:01:54 -05:00
Sebastian Hahn
88698993a9 check-spaces fix 2012-01-16 14:50:13 -05:00
Nick Mathewson
fa83397ecd Fix a missing iso_time_nospace_usec
Apparently I missed a case when converting sec,usec to
yyyy-mm-ddThh:mm:ss.uuuuuu .
2012-01-11 12:23:43 -05:00
Nick Mathewson
f729e1e984 Merge branch 'feature3457-v4-nm-squashed'
Conflicts:
	src/or/rendclient.c
2012-01-11 12:10:14 -05:00
Nick Mathewson
b5af456685 Use spaceless ISO8601 time format, not sec,usec. 2012-01-11 12:08:01 -05:00
Nick Mathewson
c5b58df775 Add clarity/typesafety wrappers for control_event_circuit_status_minor 2012-01-11 10:28:20 -05:00
Nick Mathewson
0e911abf27 Rename CIRC2 to CIRC_MINOR
Also give the arguments to control_event_circuit_status_minor real
names.
2012-01-11 10:19:24 -05:00
Nick Mathewson
4e14ce4dba Report cookie file location as absolute in protocolinfo message 2012-01-09 13:20:48 -05:00
Nick Mathewson
7cb804343b Merge remote-tracking branch 'rransom/feature2411-v4' 2011-12-22 10:51:39 -05:00
Nick Mathewson
3b88b63826 Merge branch 'bug933_nm_rebased_v2'
Conflicts:
	src/test/test.c
2011-11-30 14:10:22 -05:00
Nick Mathewson
04c622d720 Add some post-comma spaces to please arma
Incidentally, we've got 30969 lines in master with a comma
in them, of which 1995 have a comma followed by a non-newline,
non-space character.  So about 93% of our commas are right,
but we have a substantial number of "crowded" lines.
2011-11-30 14:08:11 -05:00
Nick Mathewson
69d16900aa Refactor addressmap_match_superdomains and representation of wildcards
In this new representation for wildcarded addresses, there are no
longer any 'magic addresses': rather, "a.b c.d", "*.a.b c.d" and
"*.a.b *.c.d" are all represented by a mapping from "a.b" to "c.d". we
now distinguish them by setting bits in the addressmap_entry_t
structure, where src_wildcard is set if the source address had a
wildcard, and dst_wildcard is set if the target address had a
wildcard.

This lets the case where "*.a.b *.c.d" or "*.a.b c.d" remap the
address "a.b" get handled trivially, and lets us simplify and improve
the addressmap_match_superdomains implementation: we can now have it
run in O(parts of address) rather than O(entries in addressmap).
2011-11-30 14:08:11 -05:00
Linus Nordberg
f786307ab7 First chunk of support for bridges on IPv6
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.
2011-11-30 11:55:45 -05:00
Robert Ransom
e70610878a Add 'config-defaults-file' to getinfo_items table
Bugfix on commit 230422b955, not yet in any
release; fixes bug #4605.
2011-11-29 17:13:39 -08:00
Nick Mathewson
230422b955 Support for a defaults torrc file.
This will mainly help distributors by giving a way to set system or package
defaults that a user can override, and that a later package can replace.

No promises about the particular future location or semantics for this:
we will probably want to tweak it some before 0.2.3.x-rc

The file is searched for in CONFDIR/torrc-defaults , which can be
overridden with the "--defaults-torrc" option on the command line.
2011-11-27 22:25:52 -05:00
Nick Mathewson
73436a1d6f Add the ability to append and clear linelist options from cmdline
This will be important for getting stuff to work right across zones.
2011-11-27 21:32:51 -05:00
Robert Ransom
17113448d2 Include circ creation time in CIRC events, etc. 2011-11-24 06:55:16 -08:00
Robert Ransom
88e0026d2f Send CIRC2 event when a circuit is cannibalized 2011-11-24 06:55:06 -08:00
Robert Ransom
296b8d0b10 Add CIRC2 control-port event, and send it when a circ's purpose changes 2011-11-24 06:54:55 -08:00
Robert Ransom
104c50fedb Log whenever a circuit's purpose is changed 2011-11-24 06:52:38 -08:00
Robert Ransom
d0ed7cbf8b List service address in CIRC events for HS-related circs 2011-11-24 06:32:55 -08:00
Robert Ransom
c7d01b0541 Report HS circ states stored in circ purpose field in CIRC events 2011-11-24 06:32:55 -08:00
Robert Ransom
8d5200c6b5 Use fewer TO_ORIGIN_CIRCUIT casts in getinfo_helper_events 2011-11-24 06:32:55 -08:00
Robert Ransom
c818f1f25d Use the new circ-description function for GETINFO circuit-status 2011-11-24 06:32:54 -08:00
Robert Ransom
b7c765b1b1 Report circuit build_state flags in CIRC events 2011-11-24 06:32:54 -08:00
Robert Ransom
9ce76adfe8 Split circuit-description code into a separate function 2011-11-24 06:32:54 -08:00
Robert Ransom
b149ab00d7 Separate circuit-close reasons from circ description 2011-11-24 06:32:54 -08:00
Sebastian Hahn
7bd46344df Eat all whitespace after a control command 2011-11-16 18:14:06 +01:00
Roger Dingledine
67650a869d allow manual control port authenticate via netcat 2011-11-16 18:14:03 +01:00
Robert Ransom
bfb900e426 Add some XXXes 2011-11-07 15:32:43 -08:00
Robert Ransom
ef2b0bd528 Add GETINFO md/id/* and md/name/* items for relay microdescs 2011-11-07 15:32:33 -08:00
Nick Mathewson
a41f1fc612 Merge remote-tracking branch 'origin/maint-0.2.2'
Conflicts:
	configure.in
	src/or/circuitbuild.c
2011-09-09 12:58:12 -04:00
Nick Mathewson
0cb01f5c97 Merge remote-tracking branch 'public/split_entry_conn'
Conflicts:
	src/or/connection.c
	src/or/connection_edge.c
	src/or/connection_edge.h
	src/or/dnsserv.c

Some of these were a little tricky, since they touched code that
changed because of the prop171 fixes.
2011-09-07 14:13:57 -04:00
Robert Ransom
8aad677bb7 Die if tor_vasprintf fails in connection_printf_to_buf
tor_asprintf already asserts if it fails.
2011-09-07 12:14:58 -04:00
Nick Mathewson
393e4fb5b5 Use %f with printf-style formatting, not %lf
For printf, %f and %lf are synonymous, since floats are promoted to
doubles when passed as varargs.  It's only for scanf that we need to
say "%lf" for doubles and "%f" for floats.

Apparenly, some older compilers think it's naughty to say %lf and like
to spew warnings about it.

Found by grarpamp.
2011-08-30 20:44:42 -04:00
Nick Mathewson
aeb27526f8 Merge remote-tracking branch 'origin/maint-0.2.2' 2011-08-15 10:54:55 -04:00
Robert Ransom
03f6ee8c5f Remove extra quotation marks around the result of esc_for_log 2011-08-15 10:54:19 -04:00
Nick Mathewson
5da9f722f2 Whitespace tweaks 2011-08-10 15:06:45 -04:00
Kamran Riaz Khan
02a735dfa8 Fix condition reported by nickm. 2011-08-10 15:03:25 -04:00
Kamran Riaz Khan
73f07c558b Return if CONF_CHANGED isn't interesting. 2011-08-10 15:03:25 -04:00
Kamran Riaz Khan
86f68ed695 Use smartlist_asprintf_add() to improve readability. 2011-08-10 15:03:24 -04:00
Kamran Riaz Khan
5f624805e7 Minor code readability fix. 2011-08-09 03:17:21 +05:00
Kamran Riaz Khan
23ef12462a Minor comment fix. 2011-08-08 19:58:43 +05:00
Kamran Riaz Khan
02c62b2966 Refactor to do CONF_CHANGED event formatting inside control.c 2011-08-08 19:19:06 +05:00