Reputation: 4585
I use this Tutorial to Make PPTP VPN Connection Programmatically And Capture Packets But Some thing is wrong, i think problem is when i want cature pockets in while loop
when i Connect to vpn by app and try to open site in browser it shows : You are offline
...
Send
And received
always is 0 bytes / 0 pockets
also i need to disconnect connection in app
how i can fix them ?
Upvotes: 4
Views: 3861
Reputation: 1208
The tutorial you used is not about PPTP or another specific VPN kind, it's about packet capturing. You should implement PPTP client side by yourself and after that interconnect you packet capture code (while loop) and PPTP client code.
If you can show your source code it would be easier to show what's wrong.
UPD1:
so how i can use PPTP connection, connect and disconnect it ?
This is a big and complex task. There is no fast solution. When I did the same I've spent about a year for it. You can do something like the following:
UPD2:
I saw two applications which implement VpnService.
The first one is StrongSwan. VpnService extended here, native part (real vpn service implementation) starts here.
The second is OpenVpn port ics-openvpn. It starts standalone openvpn process here, and manages it via standard openvpn management interface (unix socket) here.
Upvotes: 3