[Click] How to write the actions on the incoming packets

sam barker sam.barker0 at gmail.com
Tue Jan 1 22:21:14 EST 2008


Hi Bart,

I was trying out the example[on how to write read handler] on the manual on
the link
<http://www.pats.ua.ac.be/software/click>.

Basically I wanted to write an element having a read handler.The read
handler just returns a string.
But when I compile the read element[.cc and .hh file] I am getting some
errors which I am having problems in debugging.



In file included from ../elements/local/readelement.cc:4:
../elements/local/readelement.hh:10: error: stray '\342' in program
../elements/local/readelement.hh:10: error: stray '\200' in program
../elements/local/readelement.hh:10: error: stray '\234' in program
../elements/local/readelement.hh:10: error: stray '\342' in program
../elements/local/readelement.hh:10: error: stray '\200' in program
../elements/local/readelement.hh:10: error: stray '\235' in program
../elements/local/readelement.hh:19: error: 'string' does not name a type
../elements/local/readelement.hh: In member function 'virtual const char*
readelement::port_count() const':
../elements/local/readelement.hh:10: warning: division by zero in '1 / 0'
../elements/local/readelement.hh:10: error: invalid conversion from 'int' to
'const char*'
../elements/local/readelement.cc: At global scope:
../elements/local/readelement.cc:16: error: prototype for 'String
readelement::handle(Element*, void*)' does not match any in class
'readelement'
../elements/local/readelement.hh:16: error: candidate is: String
readelement::handle(const String&, Element*, void*, ErrorHandler*)
../elements/local/readelement.cc: In member function 'String
readelement::handle(Element*, void*)':
../elements/local/readelement.cc:18: error: 'class readelement' has no
member named 'my_func'
../elements/local/readelement.cc: At global scope:
../elements/local/readelement.cc:16: warning: unused parameter 'thunk'
../elements/local/readelement.cc: In member function 'virtual void
readelement::add_handlers()':
../elements/local/readelement.cc:21: error: no matching function for call to
'readelement::add_read_handler(const char [9], <unresolved overloaded
function type>, void*)'
../include/click/element.hh:147: note: candidates are: void
Element::add_read_handler(const String&, String (*)(Element*, void*), void*)
../elements/local/readelement.cc: At global scope:
../elements/local/readelement.cc:24: error: no 'String
readelement::my_func()' member function declared in class 'readelement'
make[1]: *** [readelement.o] Error 1


It will be of great help if you could tell me what I am doing wrong?

Cheers,
Sam

On Dec 19, 2007 8:03 PM, Bart Braem <bart.braem at ua.ac.be> wrote:

> On Wednesday 19 December 2007 02:44:07 sam barker wrote:
> > I understand the how the configuration file connects two or more
> elements
> > but I dont understand how to specify the actions that should take place
> > when the packet it being transfered from the ip port and to the output
> port
> > with in an element.
>
> Call the right functions in push.cc.
> For more information, take a look at our concepts and coding tutorial at
> <http://www.pats.ua.ac.be/software/click>.
>
> Regards,
> Bart
> --
> Bart Braem
> PATS research group - IBBT
> Dept. of Mathematics and Computer Sciences
> University of Antwerp
> Campus Middelheim, G3.30
> Middelheimlaan 1
> B-2020 Antwerpen, Belgium
> Phone: +32 (0)3 265.32.91
> Fax: +32 (0)3 265.37.77
> Web: www.pats.ua.ac.be/bart.braem
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: readelement.cc
Type: text/x-c++src
Size: 765 bytes
Desc: not available
Url : https://pdos.csail.mit.edu/pipermail/click/attachments/20080101/abe117f6/readelement.cc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: readelement.hh
Type: text/x-c++hdr
Size: 735 bytes
Desc: not available
Url : https://pdos.csail.mit.edu/pipermail/click/attachments/20080101/abe117f6/readelement.hh


More information about the click mailing list