I have a feeling that I started the wrong way. I used the dotNet example from the source code.
From that, I took the packet filter and I make filters based on source and destination IP:port of what the application has opened. For example:
My internal IP for the normal adapter would be: 192.168.1.6
My internal IP for the VPN adapter would be: 10.128.19.222
And I have an application that has a connection as following:
Local address: 10.128.32.222:50449 -> Remote address: 54.210.0.167:443
I would listen to the VPN adapter for all the packets that are sent from 10.128.32.222:50449 to 54.210.0.167:443.
Then take the packets and parse with PacketDotNet and change the source address to my normal adapter address so the new packet has the following network data:
Source 192.168.1.6:50449 ; Destination: 54.210.0.167:443
The new packet is then sent downwards the network stack thru the normal adapter.
In a separate thread, I listen to the normal adapter for all packets that are received from Source: 54.210.0.167:443 ; Destination: 192.168.1.6:50449
Then take the packets and parse with PacketDotNet and change the source address to my VPN adapter address so the new packet has the following network data:
Source: 54.210.0.167:443 ; Destination: 10.128.32.222:50449
The new packet is then sent upwards to the network stack thru the VPN adapter.
I have little network knowledge and most probably my terminology is disappointing for what I am sorry.