Back to product page

SetAdapter method

Assigns existing adapter for network forwarding.




  • C++
int SetAdapter(CVPNInterface *adapter);
The SetAdapter(adapter) syntax has these parts:
adapterReference to CVPNAdapter, received from VPNAdapter function.
Return value0 (ErrorNone) if success, otherwise negative value from Errors enumeration.


SetAdapter specifies one or local adapters to be monitored by devP2P, in order to capture network packets and forwards them to remote peer. It is used in combination with PeerAdapterIP and PeerAdapterMAC which are provided by remote, if it also supports network packet forwarding features.

When this method is used, devP2P will capture all network packets for destination IP address and route it to remote peer, who will then give it to the system - just as it has been received from the network card. This way you get real VPN between your two devP2P peers. In order for VPN to work, make sure selected IP addresses of local adapter and remote peer's adapter are in same network range, and MAC addresses are setup correctly (different, unique on the network, never changed).

You can test if network packet forwarding works after you are Linkeda> with your peer with simple command prompt 'ping' command. It does not matter what OS is running on remote.