[Click] Misc Click questions...

Eddie Kohler kohler at cs.ucla.edu
Wed Apr 23 13:50:22 EDT 2008


Hi Nick,

Nicholas Weaver wrote:
> a:  Is there a good example on using END_CALL on fromdump that someone  
> has?

Beyers got a:, but ask more questions if you need to.

> b:  Is there a way to trap Cntr-C on an element (interrupt)?

"Script(TYPE SIGNAL INT, instructions...)" will trap Control-C.  If you want 
an element to trap Control-C (and Script won't work), take a look at how 
Script itself is implemented; you will use Master methods like 
Master::add_signal_handler.

User-level Click by default changes SIGINT into 
"Rounter::set_runcount(-infinity)", which means that DriverManager 
instructions will execute too.  For example, "DriverManager(pause, write 
this_handler_will_be_called_after_sigint.go, write this_one_too.go)".  But the 
-infinity part means that the router WILL NOT continue to run; the write 
handlers execute and then the router dies.  If you want different behavior 
catch SIGINT with a Script.

Ipsumdump catches SIGINT with a Script.  "ipsumdump --config"

> I want to have a queue that buffers ~100K packets or so (yes, thats  
> not a typo), but which will drain itself completely on a fromdump  
> END_CALL or Cntr-C, and then when drained completely, calls

This should be pretty easy to make work.

Eddie


> 
> Thanks.
> 
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click



More information about the click mailing list