[Click] Parsing an element within an element

Ian Rose ianrose at eecs.harvard.edu
Wed Mar 30 09:43:00 EDT 2011


You call to cp_va_kparse in configure() is wrong:

>     if (cp_va_kparse(conf, this, errh,
>       cpElement, "ADMControl", &adm,
>       cpElement, "SLAConfig", &sla,
>              cpEnd) < 0)
>         return -1;

After the first 3 arguments (conf, this, errh), the remaining of 
arguments should be a repeating sequence of:
(parameter-name
  flags
  type
  storage-variable)

followed by cpEnd at the end.

Here is an example from settimestamp.cc:
>      if (cp_va_kparse(conf, this, errh,
>                       "TIMESTAMP", cpkP, cpTimestamp, &_tv,
>                       "FIRST", 0, cpBool, &first,
>                       "DELTA", 0, cpBool, &delta,
>                       cpEnd) < 0)


(Note: there are a few exceptions to this (e.g. paint.cc) but I am 
unable to find a listing of these and they are unlikely to impact you.)


You appear to be doing:
flags
parameter-name
storage-variable


- Ian


On 03/30/2011 03:15 AM, milos rovcanin wrote:
> Well, i guess i didn't actually know what the problem was! The same
> error again:
>
> line 44: while configuring SLAEnforcer/track_BWS/
> TCSLAControl::TCSLAControl: unknown argument type ' ' !
>
> What am I missing here?
>
>
>
>
> On Tue, Mar 29, 2011 at 6:03 PM, milos rovcanin <ro1208984 at gmail.com
> <mailto:ro1208984 at gmail.com>> wrote:
>
>     I think I know what the problem was... Thanks!
>
>
>     On Tue, Mar 29, 2011 at 8:56 AM, Ian Rose <ianrose at eecs.harvard.edu
>     <mailto:ianrose at eecs.harvard.edu>> wrote:
>
>         Can you paste your complete configuration as well as the actual
>         compiler
>         error?  Also, can you run a config using these 2 elements (but not
>         passing them as arguments)?  That will test if they are actually
>         being
>         compiled at all.  If not, try `make elemlist`.
>
>         - Ian
>
>
>
>         On 03/29/2011 11:29 AM, milos rovcanin wrote:
>          > Hello,
>          >
>          > I am trying to pass two elements as an arguments of a third
>         one. Two
>          > elements that I am trying to pass are also written by me and
>         they are in
>          > elements/local. When I try to run a configuration it won't
>         compile because
>          > compiler cannot recognize the types of those two elements
>         that I ma trying
>          > to pass as arguments.
>          >
>          > input[0] ->  first_element(second_elelement, third element);
>         What am I
>          > missing here?
>          >
>         _______________________________________________
>         click mailing list
>         click at amsterdam.lcs.mit.edu <mailto:click at amsterdam.lcs.mit.edu>
>         https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>
>
>
>
>     --
>     Best regards,
>     Milos Rovcanin
>
>
>
>
> --
> Best regards,
> Milos Rovcanin


More information about the click mailing list