On 18-6-2021 13:49, Bo Berglund via fpc-pascal wrote:
I would like to know how I can check if a remote network is available, i.e. if
the VPN system has succeeded to connect the remote network.

I need this in a class that connects an OpenVPN tunnel on demand and takes it
down after use. Unfortunately openvpn-gui does not have an API call to do
this...
It provides an API for connect, disconnect, reconnect etc but not for returning
the state of a connection for example.
https://github.com/OpenVPN/openvpn-gui#send-commands-to-a-running-instance-of-openvpn-gui

Any suggestions for Windows?
I just want to know if a call to connect succeeded.

You can use the management interface
 https://openvpn.net/community-resources/management-interface/

But since we are developers you can lookup this info with the windows function GetIpAddrTable


https://docs.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getipaddrtable

Marc
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to