Skip to main content

VPN Status

The commands below are useful once VPN connection has been successfully established.

Get VPN Status​

Requests current VPN connection status.

Login required: Yes

CmdProc Code: OVS_CMD_GET_STATUS

Command number: 5

Input: Not required

Response: OVS_NOTIFY_GET_STATUS

OVS_NOTIFY_GET_STATUS: Successful response

OVS_ERR_OK
data : { "VPN_Status": ""}

OVS_NOTIFY_GET_STATUS Failed response

data is null

VPN_Status will contain one of the following values:

  1. VPN_NOTIFY_CONNECTING
  2. VPN_NOTIFY_CONNECTED
  3. VPN_NOTIFY_DISCONNECTED
  4. VPN_NOTIFY_CONN_FAILED
  5. VPN_NOTIFY_ABNORMALLY_DISCONNECTED
  6. VPN_NOTIFY_AUTH
  7. VPN_NOTIFY_ASSIGNIP
  8. VPN_NOTIFY_GETCONFIG

Code sample:

vpnsdk.CmdProc(.OVS_CMD_GET_STATUS, [:])

Get Active VPN Profile​

Returns the active VPN connection parameters - server, protocol and port

Login required: Yes

CmdProc Code: OVS_CMD_GET_CURRENT_PROFILE

Command number: 17

Input: Not required

Response: OVS_NOTIFY_GET_CURRENT_PROFILE

OVS_NOTIFY_GET_CURRENT_PROFILE: Successful response

OVS_ERR_OK
data will return
{
"server_ip": "104.192.3.90",
"protocol": "tcp",
"server_port": 1194
}

OVS_NOTIFY_GET_CURRENT_PROFILE Failed response

OVS_ERR_VPN_DISCONNECTED
data is null

Code sample:

vpnsdk.CmdProc(.OVS_CMD_GET_CURRENT_PROFILE, [:])

Enable IO Counter​

Enables or disables IO counter.

Login required: Yes

CmdProc Code: OVS_CMD_SET_IOCOUNT

Command number: 15

Input:

{ "status": true|false }

Status indicates whether IO counter should be enabled or not.

Response: OVS_NOTIFY_SET_IOCOUNT

OVS_NOTIFY_SET_IOCOUNT: Successful response

OVS_NOTIFY_SET_IOCOUNT Failed response

data is null

Code sample:

vpnsdk.CmdProc(.OVS_CMD_SET_IOCOUNT, [ "status": "true" ])

While IO counter is enabled then SDK keeps issuing the OVS_NOTIFY_VPN_IOCOUNT notification

Data field of OVS_NOTIFY_VPN_IOCOUNT will have the following structure:

{
"data_in": 0,
"speed_in": 0,
"data_out": 0,
"speed_out": 0
}

Where:

  • data_in - Downloaded data amount
  • speed_in - Current download speed
  • data_out - Uploaded data amount
  • speed_out - Current upload speed