[Click] read handler with parameters

Beyers Cronje bcronje at gmail.com
Tue Jan 15 05:01:51 EST 2008


Hi Sam,

I've never passed a parameter to a read handler before, so this might be
wrong....

Your telnet command should be:

read readelement_name.a_handle 1

Also I believe the prototype of add_handlers is onle 'virtual void
add_handlers();'

Beyers

On Jan 15, 2008 4:11 AM, sam barker <sam.barker0 at gmail.com> wrote:

> Hi All,
> I was trying out the read handler with a parameter and I seem to be stuck.
>
> Basically I wan t to  pass an int parameter to my_func().
>
> After I telnet into the localhost how do I call the function?.
> I had used  read readelement_name.a_handle(1);
>
> The the partial code of my .cc file is below
>
>
> String readelement::handle(Element *e, void *thunk){
>    readelement * me = (readelement *) e;
>
>    int *i;
>    i=(int *)thunk;
>    return me->my_func(i);
> }
> void readelement::add_handlers(void * thunk){
>    add_read_handler("a_handle", &handle, (void *)thunk);
> }
>
> Regards,
> Sam
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>


More information about the click mailing list