Why there are no API exposed to connect or disconnect the network interface

Vivekvardhan Jilkara jilkara.vivekvardhan35 at gmail.com
Sat May 1 04:19:58 UTC 2021

Hi team,

I have been going through the wireguard-windows module to understand
its usage for one of my requirements.

My requirement is as follows.
1. Create the virtual network interface/ network tunnel. This I can
achieve by calling, CreateTun
2. Eventually, based on some trigger points, I want to open this
created tunnel and then do the

Following are my queries.

1. Like the CreatTun method, I expected a method called
GetTun(string), which would simply call the OpenAdapter method(in the
wintun package) and return the instance of the device.
Is there any reason for not providing this?

2. In the device interface(in tun package), the APIs that are provided
are operating on the adapter against the tunnel.
I thought, if this interface would have had APIs, something called
StartSession and EndSession, using those APIs I could have connected
or disconnected the connection for that tunnel.
Is there any reason for not providing these?

Also, I am doubting whether the expectations that I set are incorrect. If YES,
I request you to help me to understand the reason AND
please guide me if there is any way to achieve the above requirements
without these APIs being expected.

Thanks in advance.


More information about the WireGuard mailing list