[Click] method interface problems.

Eddie Kohler kohler at cs.ucla.edu
Mon Oct 29 12:06:46 EDT 2007


Hi Kurtis,

Yes, there are ways to let other elements use these handlers.  Take a look at 
the HandlerCall class, which is defined in

#include <click/handlercall.hh>

and has online documentation too.  For uses of HandlerCall, see elements such 
as Counter, ICMPSendPings, and FromDump.

Also take a look at the Script element's documentation.

BTW Click allows two types of "method interface".  The handler interface is 
usually best, but for performance sensitive applications, it is possible to 
hook up to another element and use C++ functions directly.  Check out RED and 
IPRewriter/IPMapper/RoundRobinIPMapper for examples.

Eddie


Kurtis Heimerl wrote:
> Awesome, this works perfectly. I was hoping to dynamically reduce the size
> of the outbound queues, and this is exactly what I needed for that.
> 
> Is there any way to allow other elements to use the method interfaces?
> 
> Thanks.
> 
> On 10/24/07, Beyers Cronje <bcronje at gmail.com> wrote:
>> Hi Kurtis,
>>
>> In the element documentation has confused me as far as more generic
>>> handlers. It says that the elements will be controlled from a file.
>>> However,
>>> the locations it suggests are not right on my box. I'm assuming that's
>>> because i'm in user mode.
>>
>> Yes, the 'file' you're talking about is only available when running Click
>> as a kernel module. However you can still access the handlers when running
>> userlevel Click through the ControlSocket feature.
>> http://read.cs.ucla.edu/click/elements/controlsocket
>> You can either manually add a ControlSocket element or start Click with
>> the '-p' argument to automatically enable a ControlSocket.
>>
>> In example the following Click config.
>>
>> fd::FromDevice(eth0) -> q::Queue -> ToDevice(eth1);
>>
>> So now you start Click with 'click <yourconfig_file> -p 777'
>>
>> Then you can telnet to port 777 i.e. 'telnet 127.0.0.1 777' and issue any
>> of the ControlSocket command, like 'read q.highwater_length' or whatever.
>>
>>
>> I've switched to SimpleQueue from Queue, as I think that simple queue
>>> should be outputting to a file somewhere. Is that right?
>>
>> Nope, see above.
>>
>> Beyers
>>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click



More information about the click mailing list