Dynamic Change of LINEARIPLOOKUP information at Runtime in User L evel

Eddie Kohler kohler at icir.org
Mon Jul 8 11:24:57 EDT 2002


Hi Filip,

Just to confirm what Brecht said:

> Is it possible the change parameters in any element of a Click Router while
> the router is running on User Level?

Some elements allow you to change and/or examine their parameters, via
_handlers_. In kernel Click, handlers appear as access points in the file
system. Element handlers are listed in the ELEMENT HANDLERS section of the
relevant element's manual page.

In user-level Click, you can access handlers from within the configuration,
via a PokeHandlers element (man PokeHandlers). Alternatively, the
ControlSocket element opens a TCP port or Unix-domain socket, and speaks a
simple protocol that allows access to handlers. You open that port, or
socket, and send handler commands to it. "man ControlSocket" to find out
more about the protocol.

For example, this "click" invocation starts a simple router with a
ControlSocket on TCP port 7000:

   % click -e 'Idle -> r::RED(5,10,.1) -> q::Queue -> Idle; ControlSocket(TCP, 7000);'

Here's an example telnet session to that port. Lines printed by
ControlSocket are indented for clarity; they wouldn't be in a real session.

   % telnet localhost 7000
   Trying 127.0.0.1...
   Connected to localhost.
   Escape character is '^]'.
	Click::ControlSocket/1.1
   checkread r.max_p
	200 Read handler `r.max_p' OK
   read r.max_p
	200 Read handler `r.max_p' OK
	DATA 4
	0.1
   write r.max_p 0.5
	200 Write handler `r.max_p' OK
   read r.max_p
	200 Read handler `r.max_p' OK
	DATA 4
	0.5
   quit
	200 Goodbye!
   Connection closed by foreign host.
   %

The ClickController Java applet, provided in the apps/ClickController
directory, connects to a ControlSocket and gives a nice interface for
checking and setting handlers.

> Is it possible to change the information in e.g. a LINEARIPLOOKUP element
> while the router is running on User Level?

LinearIPLookup has a bunch of handlers, as seen on its man page, so yes,
you can.

Eddie




More information about the click mailing list