[Click] Use " Element Handlers"

Eddie Kohler kohler at icir.org
Fri Nov 14 08:21:38 EST 2003


Hi Wadji,

> The element LinearIPLookup has some dynamic routing possibilities via Element Handlers.
> 
> How can we use "Element Handlers" to update routing tables ? how can we do this?

The LinearIPLookup man page describes the handlers that element supports.
In kernel Click, handlers show up as files in the /click filesystem; so for
example, to add a route to LinearIPLookup, you might say 

	echo 10.0.0.0/8 10.0.0.1 1 > /click/route_table/add

man 8 click.o  for more information on handlers in the filesystem.
Userlevel Click also supports handler access via the ControlSocket element;
see that manual page.

> Is it possible to access these handlers by other elements ? In case it's possible, how can we do this?

Yes it is possible.  The <click/handlercall.hh> class will help you. For
example, to call element name "e"'s read handler "h", you might call

	String s = HandlerCall::call_read("e.h", router, errh);

To call "e"'s write handler "h" with value "v",

	int success = HandlerCall::call_write("e.h", "v", router, errh);

Eddie


More information about the click mailing list