
On Thu, Jul 24, 2014 at 12:20:52PM +0100, Gareth Owen wrote:
Hi all
Quick question, how does one turn channel_t into an IP address, e.g. given a circuit_t how do I get the IP address of the previous and next hop (noting that they might not be in the consensus so I cant use the identity hash). I can see the information is in the connection_t struct but I don't know how to get that from the channel/circuit.
The IP address (and the fact that the channel_t even is over IP) are specific to particular transport; you'll have to downcast it to a channel_tls_t using the BASE_CHAN_TO_TLS macro and then look at the or_connection_t pointer in that structure. -- Andrea Shepard <andrea@torproject.org> PGP fingerprint (ECC): BDF5 F867 8A52 4E4A BECF DE79 A4FF BC34 F01D D536 PGP fingerprint (RSA): 3611 95A4 0740 ED1B 7EA5 DF7E 4191 13D9 D0CF BDA5