lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] another pbuf question: why LINK_HLEN not reserv


From: Adam Dunkels
Subject: [lwip-users] Re: [lwip] another pbuf question: why LINK_HLEN not reserverd for PBUF_LINK?
Date: Thu, 09 Jan 2003 01:47:53 -0000

Hi Paul!

On Friday 01 March 2002 14.08, you wrote:
> Why is PBUF_LINK_HLEN not added to the offset when a PBUF_LINK
> pbuf is allocated? Seems logical:
> PBUF_LINK_HLEN is then added for PBUF_LINK and all layers above;
> PBUF_IP_HLEN for PBUF_IP and all layers above; and
> PBUF_TRANSPORT_HLEN for PBUF_TRANSPORT (and all layers above).
>
> Is there any reason for doing it this way? (apart from not breaking the
> driver
> implementations, which will probably rely on this by now...)

The reason for this is that PBUF_LINK pbufs are allocated for incoming 
packets. There is no point in adding extra header space for incoming packets 
since they already include the full header (and there will never be a need to 
add an extra header to them).

Packets allocated at the higher levels will eventually be sent out, and get a 
link level header. Therefore there is a need to save some header space in 
those buffers, but not in the PBUF_LINK buffers.

/adam
-- 
Adam Dunkels <address@hidden>
http://www.sics.se/~adam
[This message was sent through the lwip discussion list.]




reply via email to

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