lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Sending raw IP packets


From: address@hidden
Subject: Re: [lwip-users] Sending raw IP packets
Date: Mon, 8 Mar 2021 20:30:48 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0

Am 07.03.2021 um 12:50 schrieb JonathonS:
> Hello, I am attempting to implement an Android VPN service which
> provides me raw IP packets on the TUN interface.  What I'd like to do is
> simply send the whole IP packet (including IP header) to its
> destination.  I know I can parse the IP packet to pull out only the
> TCP/UDP transport layer data and then send it over a TCP/UDP socket
> myself but if this is already done by lwip, then I'd prefer to use it
> instead.

I'm afraid I don't really underdstand what you mean. You should be able
to get a whole packet out of the stack by implementing a non-ethernet
netif. For this, set netif->output to your own function instead of
etharp_output and don't set the flags NETIF_FLAG_ETHARP and
NETIF_FLAG_ETHERNET. This way, your netif->output functions should get
pbufs starting with the IP header. If that's what you wanted (as I said,
I'm not sure).

>
> I found the raw APIs
> (https://www.nongnu.org/lwip/2_1_x/group__raw__raw.html
> <https://www.nongnu.org/lwip/2_1_x/group__raw__raw.html>), but wasn't
> sure if this is what I needed to use.  Since I am running in user-space
> as a regular Android application, I am unable to run as root so not sure
> if the raw APIs require that I create a raw socket (which requires root).

This question doesn't seem to have anything to do with lwIP or does it?
There's no such thing as 'root' in lwIP.

Regards,
Simon

>
> Also, if you can provide any sample code, this would be greatly
> appreciated. Thanks!
>
>
> _______________________________________________
> lwip-users mailing list
> lwip-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>




reply via email to

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