diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-10-17 11:23:26 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-10-17 11:23:26 -0400 |
commit | 26946c659b5abdc38fd4dc8cd4b4659aadcf05f0 (patch) | |
tree | 9c5e5979f97991046ea5d4ba318c2dc8d3f84fd0 /src/or/channel.h | |
parent | 898bd1ae8f1eeb880eaaeba2caa1cda435a1ac5b (diff) | |
download | tor-26946c659b5abdc38fd4dc8cd4b4659aadcf05f0.tar.gz tor-26946c659b5abdc38fd4dc8cd4b4659aadcf05f0.zip |
Restore the 'address' value of tunneled connections
When we merged the channel code, we made the 'address' field of linked
directory connections created with begindir (and their associated edge
connections) contain an address:port string, when they should only
have contained the address part.
This patch also tweaks the interface to the get_descr method of
channels so that it takes a set of flags rather than a single flag.
Diffstat (limited to 'src/or/channel.h')
-rw-r--r-- | src/or/channel.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/or/channel.h b/src/or/channel.h index 33b7c8f88b..d90335c194 100644 --- a/src/or/channel.h +++ b/src/or/channel.h @@ -79,10 +79,13 @@ struct channel_s { * available. */ int (*get_remote_addr)(channel_t *, tor_addr_t *); +#define GRD_FLAG_ORIGINAL 1 +#define GRD_FLAG_ADDR_ONLY 2 /* - * Get a text description of the remote endpoint; canonicalized if the - * arg is 0, or the one we originally connected to/received from if it's - * 1. + * Get a text description of the remote endpoint; canonicalized if the flag + * GRD_FLAG_ORIGINAL is not set, or the one we originally connected + * to/received from if it is. If GRD_FLAG_ADDR_ONLY is set, we return only + * the original address. */ const char * (*get_remote_descr)(channel_t *, int); /* Check if the lower layer has queued writes */ @@ -424,6 +427,7 @@ const char * channel_describe_transport(channel_t *chan); void channel_dump_statistics(channel_t *chan, int severity); void channel_dump_transport_statistics(channel_t *chan, int severity); const char * channel_get_actual_remote_descr(channel_t *chan); +const char * channel_get_actual_remote_address(channel_t *chan); int channel_get_addr_if_possible(channel_t *chan, tor_addr_t *addr_out); const char * channel_get_canonical_remote_descr(channel_t *chan); int channel_has_queued_writes(channel_t *chan); |