"Simon Goldschmidt" <goldsi...@gmx.de> wrote:
"Marco Jakobs" m...@piciorgros.com wrote:
I'm just wondering how the PPP of LWIP is handling the pbuf's, maybe
someone can drop a line about this ...

I don't know that by heart but I think I remember the PPP code (as it is ported from sources that don't know pbufs) needs the input packets in contigouous memory and copies from PBUF_POOL to PBUF_RAM if the input packet is a linked list of pbufs (i.e. p->len != p->tot_len).

I can't see any evidence of that.

The code appears to be correctly dealing with pbufs that are smaller than the MTU.

On the transmit side, the IP packet supplied by LWIP is processed by pppifOutput(). It steps through each pbuf in the supplied chain (relying on pb->next = NULL to detect the end of the packet). The IP packet is copied into a new chain of pbufs (of type PBUF_RAW), adding the PPP framing and control character escaping. The expanded PPP frame could be up to twice as big as the MTU in the worst case. The transmit code then steps through the pbufs holding the PPP frame and writes each of them in turn.

The receive side is reading one byte at a time and state machine allocates new pbufs as required to hold the data, allocating a new pbuf each time it has accumulated PBUF_POOL_BUFSIZE bytes. pbuf_cat() is used to attach each pbuf to the existing chain.



_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to