lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Queueing up UDP packets in RAW api


From: Michael Steinberg
Subject: Re: [lwip-users] Queueing up UDP packets in RAW api
Date: Fri, 16 Feb 2018 04:37:31 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

Hey,

thank you for the reply.
My impression was that I would be breaking the "this->tot_len = this->len + this->next ? this->next->tot_len : 0" invariant I found somewhere in the documentation by queueing up multiple packet-chains into one chain. Is the pbuf API designed to actually handle this case without my intervention (f.e. "snipping" at packet borders) before calling API functions?

Kind regards
Michael


Am 15.02.2018 um 21:52 schrieb address@hidden:
Why don't you use pbuf_cat()? This uses the next pointer of the last pbuf in a chain.

Simon

On 15.02.2018 18:55, Michael Steinberg wrote:
Hey,

right, it was silly to even ask really ;)
Would I cause considerable harm to the RAM-pool if I allocated the
necessary storage for queueing (basically a linked list node) from it
with a RAW allocation? The packet and node pbufs would be deallocated
together again later-on. The alternative would be to define a limit of
packets to queue up, since space is at premium and I can't add another
heap allocator... Maybe I'm just not seeing the easy solution today ;)

Kind regards
Michael


Am 15.02.2018 um 13:04 schrieb Simon Goldschmidt:
Steinberg Michael wrote:
I need to queue up received UDP packets inside the UDP receive callback (RAW API) for an event driven->polling transfer. I take that the passed in pbuf pointers may very
well point to pbuf chains, right?
Yes.

Abusing the pbuf next pointers for my own custom packet queue seemed like a quick answer,
but I fear that it might backfire quickly...
Not a good idea.

Simon

_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users

_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users



_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users




reply via email to

[Prev in Thread] Current Thread [Next in Thread]