lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] using LWIP_PBUF_CUSTOM_DATA together with socket api


From: address@hidden
Subject: Re: [lwip-users] using LWIP_PBUF_CUSTOM_DATA together with socket api
Date: Sat, 19 Feb 2022 21:38:29 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1

Am 19.02.2022 um 20:12 schrieb Massimiliano Cialdi:
I'm trying to port a project to lwip. This project uses BSD sockets
calls, so first, I used lwip's socket APIs.
The project I'm trying to port has to deal with packet timestamping,
that's why I used LWIP_PBUF_CUSTOM_DATA as explained here
https://savannah.nongnu.org/bugs/?55078
This way I can "enrich" the pbuf structure with metadata fields of my own.

The question is: how do I retrieve my metadata using the socket API?
For example how do I get a read pbuf? Or how do I convert the socket
to a netconn?

Since the socket standard does not know your custom data, you cannot
access it through that API. There's no predefined way to access unknown
data :-)

And I'm sorry to dissapoint you, but there's currently no way to convert
a socket to a netconn, either. It could probably implemented, but you
cannot just use the netconn behind the socket, as the socket itself has
internal state that might get confused when then underlying netconn is
accessed directly.

The easiest way probably might be to implement a socket read function
that returns netbufs instead of the standard socket read function. But
that's not implemented yet.

Regards,
Simon



reply via email to

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