[Click] How to reference Method Interfaces?

Javier Sánchez Recacha javier.recacha at gmail.com
Wed Jun 4 15:15:28 EDT 2008


Hi,

Basically, as far as i know, you have 3 options

1) use packet annotations to put data into the packet.
you have to program new queue element to put this data, and read
this annotation at your MyPrint element.

new queue element.cc:

...
//get the capacity and store it in usserspace annotation

#include <click/packet_anno.hh>

...
 uint32_t a = (uint32_t) capacity();
 p->set_user_anno_u32(1,a);
...
 
MyPrint.cc:

#include <click/packet_anno.hh>

...
  uint32_t a = p->user_anno_s32(1);
  int capacity = (int) a;
....

I didn't tried this code so... something may be wrong
I don't like this method because you have limited data capacity,
and you need the elements conected in the same chain.



More information about the click mailing list