1

I am trying to implement kind of android firewall via vpnService. So far I managed to get all the incoming packets to my VPN service. I need help to parse the packets and get destination IP address and source IP address with their ports! in order to open new socket connection and forward the packet to it's destination.

In addition, Is it enough to forward only the data of the packet to the destination or I need to forward it as is with the headers?

Any

You help is much appreciated.

Amir
  • 129
  • 8

1 Answers1

0

Always try to post your current code if you want better answers.

As for your question, I understand so far you only have all the traffic routed into your application but you haven't been able to read it. You will need to decode the headers of TCP, UDP and even IP to get that info. Read a bit about the protocols. Wireshark is a good tool.

Have a look at this question: "Android firewall with VpnService"

Your application will essentially need to be able to interpret and construct IPv4 and IPv6 headers and options, and as the IP payload, the UDP headers and TCP headers and options.

Community
  • 1
  • 1
brunorey
  • 2,135
  • 1
  • 18
  • 26
  • The first sentence would be better as a comment. Answer here are considered permanent and important where comments are more like throwaway things that can be reordered or removed and it wouldn't change the meaning of the post. – Wesley Bland Feb 04 '14 at 16:08