Table of Contents

Class VpnPluginBridge

Namespace
VpnHood.Core.Client.VpnServices.Host.WindowsVpnPlugin
Assembly
VpnHood.Core.Client.VpnServices.Host.WindowsVpnPlugin.dll

Represents the VPN plug-in Windows calls, authored here for its callable wrapper; the VPN service does the work.

public sealed class VpnPluginBridge : IVpnPlugIn
Inheritance
VpnPluginBridge
Implements
Inherited Members

Remarks

The process has one, which the VPN task's runs and the app's connections share.

Methods

Connect(VpnChannel)

This method instructs the VPN plug-in to connect to the VPN server and establish the VPN channel.

public void Connect(VpnChannel channel)

Parameters

channel VpnChannel

The VPN channel object representing the instance VPN connection of the VPN plug-in to the VPN server.

Remarks

It connects with the options the app saved, and returns once the adapter has started on the channel; a failure ends the channel's connection, with the failure's message.

Decapsulate(VpnChannel, VpnPacketBuffer, VpnPacketBufferList, VpnPacketBufferList)

This method instructs the VPN plug-in to prepare receive a buffer from the VPN server outerTunnelTransport, extract any number of IP packets encapsulated in the buffer, and return the IP packets together with any other reply buffers that are needed to be sent back through the outerTunnelTransport to the VPN server.

public void Decapsulate(VpnChannel channel, VpnPacketBuffer encapsulatedBuffer, VpnPacketBufferList decapsulatedPackets, VpnPacketBufferList controlPacketsToSend)

Parameters

channel VpnChannel

The VPN channel object representing the instance VPN connection of the VPN plug-in to the VPN server.

encapsulatedBuffer VpnPacketBuffer

The buffer that came on the channel's own transport, which it ignores.

decapsulatedPackets VpnPacketBufferList

An IVpnPacketBuffer chain representing any L3 IP packets extracted and decapsulated from the buffer and which need to be injected through the VPN interface to be received by the client machine's TCP/IP stack.

controlPacketsToSend VpnPacketBufferList

An IVpnPacketBuffer chain representing any control messages that VPN plug-in is required by its protocol specification to reply back to the VPN server.

Remarks

It does nothing: the channel's own transport carries no VPN traffic, as the packets from the VPN reach the device through the channel's receive buffers.

Disconnect(VpnChannel)

This method instructs the VPN plug-in to disconnect from the VPN server and destroy the VPN channel.

public void Disconnect(VpnChannel channel)

Parameters

channel VpnChannel

The VPN channel object representing the instance VPN connection of the VPN plug-in to the VPN server.

Remarks

The adapter and the channel stop at once; the session's close goes on after it returns, and the VPN task's run waits up to 15 seconds for it.

Encapsulate(VpnChannel, VpnPacketBufferList, VpnPacketBufferList)

This method instructs the VPN plug-in to prepare the indicated L3 IP packet for transmission to the VPN server. The process might include any encapsulation specific to the VPN protocol.

public void Encapsulate(VpnChannel channel, VpnPacketBufferList packets, VpnPacketBufferList encapsulatedPackets)

Parameters

channel VpnChannel

The VPN channel object representing the instance VPN connection of the VPN plug-in to the VPN server.

packets VpnPacketBufferList

An L3 IP packets originated by the client machine TCP/IP stack and that needs to be processed to be sent to the corporate network.

encapsulatedPackets VpnPacketBufferList

The list of packets for Windows to send on the channel's own transport, to which it adds none.

Remarks

The adapter takes the packets into the VPN; without one, they stay where Windows takes them back. A failure is not thrown, as it would end the VPN host: the first one tries to end the channel's connection instead.

GetKeepAlivePayload(VpnChannel, out VpnPacketBuffer)

This method instructs the VPN plug-in to compute and return a Keep alive payload ready to be sent to the VPN server.

public void GetKeepAlivePayload(VpnChannel channel, out VpnPacketBuffer keepAlivePacket)

Parameters

channel VpnChannel

The VPN channel object representing the instance VPN connection of the VPN plug-in to the VPN server.

keepAlivePacket VpnPacketBuffer

An VPN protocol specific message payload used by the VPN Plug-in to indicate to the server that the client and its VPN connection are still alive.

Remarks

It gives no keep-alive packet: it sets keepAlivePacket to null, which the projection's out parameter cannot declare.