[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Try to manipulate the pbuf payload
From: |
Sergio R. Caprile |
Subject: |
Re: [lwip-users] Try to manipulate the pbuf payload |
Date: |
Fri, 1 Sep 2017 12:50:15 -0300 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
Well...
You do know that p->payload is a void*, that is, a pointer to some
bytes, do you ?
http://www.nongnu.org/lwip/2_0_x/structpbuf.html#a8d32dc3e964369d4eec638fc37fbc460
Then, why do you want to peek at data between your driver and lwip ? You
are not using the RAW API, you are looking at raw frame payload contents
before being passed on to lwIP. You either use UDP or TCP (unless you
really need to use raw IP, but then you will not probably do what you
are doing now, or raw frames, but I can't help you there)
Anyway, incoming pbufs are of type PBUF_RAM, that means they can
actually a chain of pbufs, any action on them must be through the
pbuf_...() functions:
http://www.nongnu.org/lwip/2_0_x/group__pbuf.html#ggab7e0e32fcc292c0d7107721766ed92fbae969347127387b9b59a23ccd24b76d21
You should see what the examples do and study them.
Also, there is a nice wiki covering whatever the official docs might not
be verbose at, you could start by understanding the RAW API here:
http://lwip.wikia.com/wiki/Raw/native_API