Hello everyone,
I want to have a layered packet that contains some other packets and a header that mentions the number of packets that are inside.
So : | Header (2pkts) | Pkt1 | Pkt2
However, it might be that there are NO pakets to be sent, then I still have to write a header with value 0 : | Header (0pkts) |
Let us call the inner pakets type A and the encapsulating paket type B.
So type B can encapsulate 0 or more type A pkts.
Another thing is :the inner type A pkts can only be generated at the moment a type B pkt is requested (depends on some time aware settings). And also it is the type A pkt generator that decides how many pkts will be in the type B pkt.
Now, I was thinking on how to do this with layered sequencers/sequences.
The driver does get_next_item() to a type B sequencer and this one will fetch type A pkts and make the type B paket.
My problem however is : how can I make the type A sequence? Because it has to generate pkts only when the type B sequencer calls get_next_item(), but sometimes it will generate multiple type A pkts (this is easily implemented) but sometimes it has to generate NO type A pkt at all. The latter case puzzles me… After a first call I want to “skip” a call and then again answer a call of the type B sequencer…
Another option is that I always generate a type A sequence item but add a bit that says it is valid or not…
A similar problem occurs for giving the last type A pkt… somehow I want to stop generating requests for 1 call, but the next call again generate requests… So the “timing” is controlled by the type B sequence, the payload by the type A sequencer.
Again I could add a bit that says “last pkt for this type B pkt” to the type A seq_item…
But I was wondering if there are more convenient ways to do this? If anyone would have any ideas?
Best regards,
Stefaan Maeyaert