STREAM_PORT Controller Event

Robert Hogan robert at roberthogan.net
Sun Jun 17 13:14:21 UTC 2007


On Saturday 16 June 2007 21:18:13 Nick Mathewson wrote:
> On Sat, Jun 16, 2007 at 06:22:01PM +0100, Robert Hogan wrote:
> > This patch implements a controller event that tells interested contollers
> > the remote address's port for every new stream.
> >
> > This information allows controllers to look up and report the program
> > using that stream. On Linux, this is done by searching /proc/$PID/fd/*
> > for the inode reported in /proc/net/tcp.
>
> Hi, Robert!  I like the idea; just a few suggestions:
>
> 1) why not change this from a new event type to an an extra value
> given for STREAM NEW events when the EXTENDED_EVENTS flag is set?
> That's what it's for: adding new information to existing events[*].
> The syntax could be:
>
>       "650" SP "STREAM" SP StreamID SP StreamStatus SP CircID SP Target
>           [SP "REASON=" Reason [ SP "REMOTE_REASON=" Reason ]]
>           [SP "SOURCE=" Source] [ SP "SOURCE_ADDR=" Addr:Port ] CRLF
>
> 2) I'd suggest having the whole address, not just the port.  Usually
> the address will just be 127.0.0.1, but if people are running Tor as a
> socks proxy for their LAN, they'll want to see which host is using it.
>
> [*]  This could be explained better in control-spec.txt.  The idea is
> that if you specify EXTENDED_EVENTS, you're telling Tor that it is
> allowed to send you any number of unexpected Key=Value pairs after any
> event it sends you.  This is how we try to make events extensible
> without breaking backward compatibility.
>
> yrs,

Hi Nick,

That's a much better idea. Patch attached. The extension format in the 
control-spec hasn't been implemented yet (so far as I can tell) so I've gone 
along with the current method. Am I right on this? If so, would you like 
someone to do it?

At the moment, extended events get displayed regardless of the controller 
directive. There's a one-liner in the patch to fix that.

Regards
Robert


-- 

Browse Anonymously Anywhere	- http://anonymityanywhere.com
TorK	- KDE Anonymity Manager	- http://tork.sf.net
KlamAV	- KDE Anti-Virus 	- http://www.klamav.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: addrport.diff
Type: text/x-diff
Size: 1795 bytes
Desc: not available
URL: <http://lists.torproject.org/pipermail/tor-dev/attachments/20070617/3eff561d/attachment.diff>


More information about the tor-dev mailing list