[Click] Question about push and pull packet processing
Eddie Kohler
kohler at cs.ucla.edu
Mon Jun 16 12:44:36 EDT 2008
Massimiliano,
An agnostic element doesn't need to use simple_action(). It can provide both
push() and pull() methods. The relevant method will get called, and you can
see the port that way. Check out the Suppressor element, which has pretty
much exactly this high-level spec. elements/standard/suppressor.{cc,hh}
Eddie
amaxis99 at yahoo.it wrote:
> Hi,
>
> I have written an element with N inputs and M outputs: actually, it
> manages packets using push method and I would like to make it
> agnostic, essentially to check if push/pull processing has some
> relevant impact on performance. Anyway, this element sends packets on
> a predefined output in conjunction with the input on which the packet
> is received: the code is something like
>
> void push(int port, Packet* p) {
> int k;
> <...>
> if (port == 0) {
> <some stuff>
> output(1).push(p);
> return;
> }
> if (port == 1) {
> <other stuff>
> output(k).push(p);
> return;
> }
> <...>
> output(0).push(p);
> }
>
> My question: is it possible to achive the same behavior using an
> agnostic processing, since the simple_action doesn't include the
> input/output port number in its arguments?
>
> Thanks
>
> --
>
> Massimiliano
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
More information about the click
mailing list