[Click] click Digest, Vol 85, Issue 7

Beyers Cronje bcronje at gmail.com
Fri Jul 23 19:11:33 EDT 2010


Hi Panos,

You have two options:
(1) You can pass the queue element name to your element's configuration and
obtain a pointer to it. In your element's configure function you can then
use cp_va_parse's cpElement argument to gain a pointer to the Queue object,
at which point you can call any public methods exposed by Queue. See
staticthreadsched.cc or unqueue2.cc for an example on how to use (1).

(2) You can also find the queue element names via flow-based router context,
see red.cc for an example on this. This file uses both options,
see RED::initialize() for the flow-based code.

(3) Use HandlerCall

Also have a look at these mailing list posts:

http://www.mail-archive.com/click@amsterdam.lcs.mit.edu/msg03267.html
http://www.mail-archive.com/click@amsterdam.lcs.mit.edu/msg02099.html

Cheers

Beyers

2010/7/23 Panos Μatzakos <magic_pan86 at yahoo.gr>

> Hello and thanks for the answer. Well, now i know better what i need to do
> and i am not sure if handlers is what i need. I try to implement a mac
> protocol (802.11 csma/ca) and i am using the following flowgraph:
>
> Timedsource -> Queue -> mysocket -> Discard
>
> where mysocket is the main element of my router which implements the
> algorithm of the protocol and sends packets to PHY through sockets. So, i
> want to be able to view from inside of mysocket when the Queue gets empty.
> Is there a way to do that?
>
> Thank you
>
>
>
> --- Στις Δευτ., 12/07/10, ο/η click-request at pdos.csail.mit.edu <
> click-request at pdos.csail.mit.edu> έγραψε:
>
> Από: click-request at pdos.csail.mit.edu <click-request at pdos.csail.mit.edu>
> Θέμα: click Digest, Vol 85, Issue 7
> Προς: click at pdos.csail.mit.edu
> Ημερομηνία: Δευτέρα, 12 Ιούλιος 2010, 19:00
>
> Send click mailing list submissions to
>     click at amsterdam.lcs.mit.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
>     https://amsterdam.lcs.mit.edu/mailman/listinfo/click
> or, via email, send a message with subject or body 'help' to
>     click-request at amsterdam.lcs.mit.edu
>
> You can reach the person managing the list at
>     click-owner at amsterdam.lcs.mit.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of click digest..."
>
>
> Today's Topics:
>
>    1. access read handlers (Panos ?atzakos)
>    2. Re: access read handlers (Roman Chertov)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 11 Jul 2010 16:24:04 +0000 (GMT)
> From: Panos ?atzakos <magic_pan86 at yahoo.gr>
> Subject: [Click] access read handlers
> To: click at pdos.csail.mit.edu
> Message-ID: <179095.2899.qm at web27202.mail.ukl.yahoo.com>
> Content-Type: text/plain; charset=iso-8859-7
>
> Hello, i am quite confused with how to access a read handler from my
> configuration. Specifically i am using the following router:
>
> Timedsource -> Queue -> myelement -> Discard
>
> and i want to access the read handlers of Queue element by calling the
> read_handler(Element *e, void *thunk)? function. So my question is where i
> can call this function from (to be able to access the drops handler for
> example while my router is running)? and in which way.
> ??????????????????????????????????????????????????????????????????????????????????????
> Thank you
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Sun, 11 Jul 2010 09:36:49 -0700
> From: Roman Chertov <rchertov at cs.ucsb.edu>
> Subject: Re: [Click] access read handlers
> To: click at pdos.csail.mit.edu
> Message-ID: <4C39F321.2030207 at cs.ucsb.edu>
> Content-Type: text/plain; charset=ISO-8859-7; format=flowed
>
> On 07/11/2010 09:24 AM, Panos ?atzakos wrote:
> > Hello, i am quite confused with how to access a read handler from my
> > configuration. Specifically i am using the following router:
> >
> > Timedsource ->  Queue ->  myelement ->  Discard
>
> To access the handler you do something like this.
>
> Timedsource ->  q::Queue ->  myelement ->  Discard
>
> click my_config -h q.drops
>
> This has more details about this.
> http://read.cs.ucla.edu/click/docs/userdriver
>
> >
> > and i want to access the read handlers of Queue element by calling
> > the read_handler(Element *e, void *thunk)  function. So my question
>
> Are you trying to make an element or modify one to do this?  The example
> above shows the typical way one would access the handlers.
>
> Roman
>
> > is where i can call this function from (to be able to access the
> > drops handler for example while my router is running)  and in which
> > way. Thank you
> >
> >
> > _______________________________________________ click mailing list
> > click at amsterdam.lcs.mit.edu
> > https://amsterdam.lcs.mit.edu/mailman/listinfo/click
> >
>
>
>
> ------------------------------
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>
>
> End of click Digest, Vol 85, Issue 7
> ************************************
>
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>


More information about the click mailing list