[Click] FromHost initialization(uselevel)

Mark Huang mlhuang at CS.Princeton.EDU
Mon Feb 13 10:38:16 EST 2006


Lesedi wrote:
> 1.I tried using FromSocket for the code to listen to the FTP port so that
> everytime the port is active all packets go through the code.Using this
> seems not to work,and now i thinnnnkk I understand that FromSocket does not
> listen to the port but tries to connect,so i tried using another way.But it
> would have been desirable to work it this way because connect to FTP client
> would have been easy.

FromSocket (deprecated in the current CVS release, replaced by Socket) 
does indeed listen to ports. Try this configuration:

FromSocket(TCP, 0.0.0.0, 21, FRAME false) -> Print -> Discard;

Then

% telnet localhost 21

The reason for the "FRAME false" keyword is that the FromSocket and 
ToSocket elements in the stable release insert framing marks to 
delineate packets. This may or may not be what you want; I removed this 
feature from the CVS release sometime last year because it was confusing 
and unexpected, caused problems, and wasn't necessary for UDP.

> I think both problems are because of the FromHost initialization.I tried
> searching for how to initialize FromHost in userlevel,but then I couldn't.So
> if you could help   me with how to initialize FromHost mayb my problem wil
> be solved.

FromHost and ToHost are probably not what you want to use; these 
elements are used for accessing the virtual TUN/TAP devices on Linux. If 
you don't know what TUN/TAP is, then you probably don't want to use 
them. I think you have the right idea with FromDevice and ToDevice; 
alternatively, you could try and do this all with FromSocket and ToSocket.

I'm not sure I understand your configuration well enough to answer 
further. If you post the relevant IPRewriter parts of your 
configuration, we may be able to help.

--Mark


More information about the click mailing list