[Click] generate random interval source packets

Ian Rose ianrose at eecs.harvard.edu
Tue Mar 23 08:22:13 EDT 2010


click_random is defined in glue.hh (which is where most of the click_xxx 
utility-type methods are found).

As far as your app requirements go, I don't see any existing elements 
that do exactly what you want, but you could maybe create the general 
behavior with a combination of TimedSource and RandomSample?  It would 
be a little inefficient (since many of the packets that TimedSource 
creates would just be immediately destroyed by RandomSample) but as long 
as your data rates are not too high this probably wouldn't be a big problem.

Is click cannot find math.h then that header file is not in the default 
search path for include files.  When you run configure to initially set 
up click you can tell it about additional directories to search in.  For 
example, when I configure click I include the following argument:
> CXXFLAGS="-I/usr/local/include -I$(HOME)/include"

This ensures that each time I compile click it also looks for header 
files in /usr/local/include/ and $(HOME)/include/.

- Ian


Jimmy wrote:
> Hi all,
> 
> I have checked randomsource element, which can generate random length
> packets. So what is the interval if using this element. In this code,
> click_random() is used to generate a random number, which document
> includes this function?
> 
> I am considering generate packets whose time interval is random. I
> checked timedsource element's original codes, it seems very hard to
> change since the _interval is specified by INTERVAL.
> 
> Can anybody give me some clue on how to implement random interval source?
> 
> Also, I include math.h in the element codes. It has some problems when
> compiling, so how to fix this?
> 
> Thanks.
> 


More information about the click mailing list