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.