[Top][All Lists]

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

Re: [lwip-users] Add new header & tail

From: Sergio R. Caprile
Subject: Re: [lwip-users] Add new header & tail
Date: Wed, 12 Sep 2018 11:17:36 -0300
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Perhaps if you could think your actions in terms of OSI layers it would
be easier to understand.
You say "before IP" but you draw "after IP" (well, sort of...), so I
don't really get what you need.

What is it that you are trying to accomplish, do you want to encapsulate
TCP/IP into an "ESP" (whatever it is) datagram/frame or do you want to
run that "ESP" protocol over IP ?
In any way, you just call your protocol function from the correct layer
function and it should take care of header and footer stuff.

If "ESP" runs over Ethernet, you handle this at the netif level, outside
lwIP. Instead of lwIP calling and being called by the netif, you add a
netif layer that is
outbound: called by lwIP and calls the netif output function. Basically
you replace netif->output by your output function, which after adding
header and footer calls what was in there.
inbound: called by the netif and calls the lwIP input function, which
depends on whether you are actually using an OS or not (baremetal).
Basically, conversely, you replace netif->input by your function, which
after removing header and footer calls what was in there.

Running "ESP" over IP requires you use the "raw IP" access functions.
Having other TCP/IP stack protocols over this is a bit trickier, since
you need to sit "in the middle" inside lwIP. I personally don't know how
to do this.

Again, please clarify your scenario.

reply via email to

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