[Click] help with click packet structure and push, pull mechanism
Eddie Kohler
kohler at cs.ucla.edu
Thu Sep 1 02:58:02 EDT 2005
Hi Gesly,
Click is really defined around the single Packet type and that's it. I think
for your application, just casting your type to a Packet* for transfer will
work OK. It's obviously not an elegant solution, but maybe good enough to
start testing. In the long run you might have fun thinking about more
principled ways to handle multiple data formats in a Click-like framework!
But for now, I would use the ELEMENT_PROVIDES() stuff, as you suggested below.
Eddie
Ges wrote:
> Hi,
>
> With reference to what I had mentioned earlier, I
> think
> I will try options 3 and then 1 below.
>
>
>>I have to find some way of making Click understand
>>these streams (could be a vector of diff data types)
>>instead of packets.
>>
>>I see 3 ways of doing this...
>>1. include in class Element push(), pull() that
>>understands a different type other than packet. and
>>define this type!
>
>
>
>>2. modify the packet class to include vector of
>>these
>>data streams (but i am not sure how i can later
>>change
>>the "packet" that includes my data stream to an
>>actual
>>packet!
>>
>>3. simply define a new type and forcefully cast it
>>into a packet so that Click does not crib.
>>
>
>
> To define a new type (similar to Packet), can I just
> follow instructions mentioned in the FAQ on compiling
> a C++ file that doesnt contain an element or do I have
> to do something more?
>
> Or can i just write a new class similar to what Packet
> class looks like and add it to click/lib?
>
> Thanks
> Gesly
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
More information about the click
mailing list