[Click] Flow-based context router broblem solved! But i have Anhother question

Eddie Kohler kohler at icir.org
Mon Sep 22 11:19:03 EDT 2003


Michele,

> I have anhother question: with the flow-based context
> router i want read the rate passed at BandwidthShapers
> that are in upstream to my element. I have follow the
> code used for the queue but i have some doubt.
> What class i have to use?(for the queue is Storage,
> but for BandwidthShaper).
> What librarys i have to include?
> For read the rate i can call ....->rate() ?

This should be pretty easy.... Instead of searching for a Storage, search
for a BandwidthShaper. #include "elements/standard/bandwidthshaper.hh". 
You'll need to change shaper.hh to provide access to 'rate()'. Either this
or call a handler to get the result, using a HandlerCall:

  String rate_str = HandlerCall::call_read(element_pointer_found_with_fbrc,
			"rate", errh);
  unsigned rate;
  (void) cp_unsigned(cp_uncomment(rate_str), &rate);

Eddie


More information about the click mailing list