ToDevice Problem

Eddie Kohler kohler at aciri.org
Wed Dec 12 17:54:52 EST 2001


Hi Roopesh,

> I need to query the ToDevice element to get the number of packets that
> have left or are in the final stage of leaving the machine. But as soon as
> I add the "/elements/linuxmodule/todevice.hh" header file to my code, I
> start getting errors(mainly in the "/elements/linuxmodule/anydevice.hh"
> such as the one shown below) :

You are trying to include a Linux-specific header file in userlevel code.
This is not going to work!

> -DHAVE_CONFIG_H -I../include -I../include -I. -I..  -MD -DCLICK_USERLEVEL
> -g -O2 -c ../elements/local/I-handlepkt.cc

(The -DCLICK_USERLEVEL is the problem.)

Two possible solutions.

1. If your element doesn't need to run at userlevel, then add
ELEMENT_REQUIRES(linuxmodule) to the end of the .cc file. Then it will run
in the kernel only, and you should have no problem compiling it.

2. If it DOES need to run at userlevel, you need to use a handler to get
the information, or an llrpc.

Hope this helps!
Eddie



More information about the click mailing list