Thanks Ian and Eddie, I have already solved the problem and now I am able to create a source element which can send packets based on exponential random time interval.
J. On Wed, Mar 24, 2010 at 12:36 PM, Eddie Kohler <[email protected]> wrote: > Hey, > > I agree with everything that Ian said, with one exception. If you are > compiling code for the user-level driver, <math.h> should work just fine > with no extra FLAGS settings. But if you are compiling code destined for > the kernel, <math.h> WILL NEVER WORK. Functions from <math.h> are simply > not available in the kernel. > > Eddie > > > Ian Rose wrote: >> >> 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. >>> >> _______________________________________________ >> click mailing list >> [email protected] >> https://amsterdam.lcs.mit.edu/mailman/listinfo/click > -- Best Regards, Jimmy _______________________________________________ click mailing list [email protected] https://amsterdam.lcs.mit.edu/mailman/listinfo/click
