[Click] Help! - Logging packets to /proc

Beyers Cronje bcronje at gmail.com
Thu Nov 23 15:09:43 EST 2006


Hi Praveen,

You can use read_handler. The first argument of your read handler is a
pointer to the element. As an example look at IPRouteTable element:

String
IPRouteTable::table_handler(Element *e, void *)
{
    IPRouteTable *r = static_cast<IPRouteTable*>(e);
    return r->dump_routes();
}

void
IPRouteTable::add_handlers()
{
    add_write_handler("add", add_route_handler, 0);
    add_write_handler("set", add_route_handler, (void*) 1);
    add_write_handler("remove", remove_route_handler, 0);
    add_write_handler("ctrl", ctrl_handler, 0);
    add_read_handler("table", table_handler, 0);
    set_handler("lookup", Handler::OP_READ | Handler::READ_PARAM |
Handler::ONE_HOOK, lookup_handler);
}


On 11/23/06, Praveen Balasubramanian <praveen_b at mail.utexas.edu> wrote:
>
> Hi all,
>
> I am using a Click router configuration in kernel mode.
> I want to add an element that logs packets in /proc. I tried using
> read_handler function (add_read_handler), but that is static and hence
> can't be used by multiple element instances.
> Should I add /proc handling code to the element or is there any way to
> use an existing Click interface to do the same?
>
> Regards,
> Praveen
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>


More information about the click mailing list