-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to integrate into Android VPNService? #326
Comments
There are two things in smoltcp that need to change for this to be possible. First, the raw socket code here should be changed to have a Second, Android gives you an IP raw socket, and smoltcp currently only works with Ethernet raw sockets. Adding IP interface support has been discussed before (e.g. for SLIP) but it isn't yet done, and unfortunately it's somewhat invasive because the Ethernet and IP layers aren't cleanly separated; likely large parts of (@astro @jordens Looks like the "smoltcp maintainers" team doesn't have access to the repository? I can't seem to be able to label this issue.) |
@whitequark Is it possible to encapsulate IP packet to Ethernet frame and send to smoltcp? |
Yes, you could certainly do that. You would also need to fake ARP responses in that case. |
Thank you. Will have a try. |
Hello! As part of issue cleanup I'm closing inactive or already-answered "question" issues, since they're not actionable. Note this doesn't mean questions aren't welcome. They still are! It's just that they shouldn't stay open forever. |
I have succesfully used smoltcp on windows, android, ios and linux - common code running on all these platforms. And everywhere I use Medium::Ip #[cfg(feature = "medium-ip")] And as for the from_raw_fd, yes thats a seperate layer I have - for my use case I keep it seperate from smoltcp, because I create the sockets myself - I look at the packets myself and filter out what is of interest to me (or not) and then just create a smoltcp packet for that myself, and feed that socket packets using a Device implementation with Medium::Ip in it. |
Hi,
I don't know where to ask this question, so I paste it here. When integrated into android, VPNService will provide a fd which represents an interface I assume. How should I do to integrate into smoltcp with it?
The text was updated successfully, but these errors were encountered: