Skip to main content

Device and Internet Status

Device and Internet Connection related commands.

Get Device ID

Returns a unique device ID.

Login required: No

CmdProc Code: OVS_CMD_GET_DEVICEID

Command number: 7

Input: Not required

Response: OVS_NOTIFY_GET_DEVICEID

OVS_NOTIFY_GET_DEVICEID Successful response
    OVS_ERR_OK

data will contain
{
"device_id" : "unique_device_id"
}

Code sample:

macOS Code Sample
    void GetDeviceID()
{
json_object *j_obj;
char szCmd[1024];
j_obj = json_object_new_object();
json_object_object_add(j_obj, "cmd", json_object_new_int(OVS_CMD_GET_DEVICEID));
snprintf(szCmd, sizeof(szCmd), "%s", json_object_get_string(j_obj));
json_object_put(j_obj);
CmdProc(szCmd);
}

Check AES Support

Checks whether the device's CPU natively supports AES encryption

Login required: No

CmdProc Code: OVS_CMD_CHECK_AES

Command number: 12

Input: Not required

Response: OVS_NOTIFY_CHECK_AES

OVS_NOTIFY_GET_DEVICEID Successful response
    OVS_ERR_OK

data will contain
{
"AES_Support" : true|false
}

Code sample:

macOS Code Sample
    void CheckAESSupport()
{
json_object *j_obj;
char szCmd[1024];
j_obj = json_object_new_object();
json_object_object_add(j_obj, "cmd", json_object_new_int(OVS_CMD_CHECK_AES));
snprintf(szCmd, sizeof(szCmd), "%s", json_object_get_string(j_obj));
json_object_put(j_obj);
CmdProc(szCmd);
}

Check TAP Adapter Status

Check the status of the TAP driver.

Login required: No

CmdProc Code: OVS_CMD_CHECK_TAP_ADAPTER

Command number:

Input: Not required

Response: OVS_NOTIFY_CHECK_TAP_ADAPTER

OVS_NOTIFY_CHECK_TAP_ADAPTER Successful response
    TAP_ADAPTER_STATUS_OK
TAP_ADAPTER_STATUS_NOT_INSTALLED
TAP_ADAPTER_STATUS_DISABLE

data is null

Code sample:

Windows Code Sample
    void checkTapAdapterStatus()
{
json_object *j_obj;
char szCmd[1024];
j_obj = json_object_new_object();
json_object_object_add(j_obj, "cmd", json_object_new_int(OVS_CMD_CHECK_TAP_ADAPTER));
snprintf(szCmd, sizeof(szCmd), "%s", json_object_get_string(j_obj));
json_object_put(j_obj);
CmdProc(szCmd);
}

Check Internet Connection

Attempts to establish a connection to the back-end server. If connection fails, returns OVS_ERR_INTERNET_DISCONNECTED error.

Login required: No

CmdProc Code: OVS_CMD_CHECK_AES

Command number: 6

Input: Not required

Response: OVS_NOTIFY_CHECK_INTERNET

OVS_NOTIFY_CHECK_INTERNET Successful response
    OVS_ERR_OK

data is null

Code sample:

macOS Code Sample
    void CheckInternetConnection()
{
json_object *j_obj;
char szCmd[1024];
j_obj = json_object_new_object();
json_object_object_add(j_obj, "cmd", json_object_new_int(OVS_CMD_CHECK_INTERNET));
snprintf(szCmd, sizeof(szCmd), "%s", json_object_get_string(j_obj));
json_object_put(j_obj);
CmdProc(szCmd);
}

Check Open Port

Attempts to establish a connection to a specified host and port. Returns OVS_ERR_PORT_CLOSED error if connection fails.

Login required: No

CmdProc Code: OVS_CMD_CHECK_PORT

Command number: 8

Input:

{
"ip_addr": "178.79.183.206",
"proto": "tcp",
"port": 1194
}

Response: OVS_NOTIFY_CHECK_PORT

OVS_NOTIFY_CHECK_PORT Successful response
    OVS_ERR_OK

data is null

Code sample:

macOS Code Sample
void CheckOpenPort(const char *ip_addr, const char *proto, int port)
{
json_object *j_obj, *j_data_obj;
char szCmd[1024];
j_obj = json_object_new_object();
json_object_object_add(j_obj, "cmd", json_object_new_int(OVS_CMD_CHECK_PORT));
j_data_obj = json_object_new_object();
json_object_object_add(j_data_obj, "ip_addr", json_object_new_string(ip_addr));
json_object_object_add(j_data_obj, "proto", json_object_new_string(proto));
json_object_object_add(j_data_obj, "port", json_object_new_int(port));
json_object_object_add(j_obj, "data", j_data_obj);
snprintf(szCmd, sizeof(szCmd), "%s", json_object_get_string(j_obj));
json_object_put(j_obj);
CmdProc(szCmd);
}

Get Ping

Attempts to establish a connection to a given VPN server and, if connection could be established, measures ping time.

Login required: No

CmdProc Code: OVS_CMD_GET_PING_RESULT

Command number: 11

Input:

{
"ip_addr": "104.192.3.90"
}

Response: OVS_NOTIFY_GET_PING_RESULT

OVS_NOTIFY_GET_PING_RESULT Successful response
    OVS_ERR_OK

data will contain the IP address and the response time in ms

{
"ip_addr": "104.192.3.90",
"time": 30
}

Code sample:

macOS Code Sample
void GetPingResult(const char *ip_addr)
{
json_object *j_obj, *j_data_obj;
char szCmd[1024];
j_obj = json_object_new_object();
json_object_object_add(j_obj, "cmd", json_object_new_int(OVS_CMD_GET_PING_RESULT));
j_data_obj = json_object_new_object();
json_object_object_add(j_data_obj, "ip_addr", json_object_new_string(ip_addr));
json_object_object_add(j_obj, "data", j_data_obj);
snprintf(szCmd, sizeof(szCmd), "%s", json_object_get_string(j_obj));
json_object_put(j_obj);
CmdProc(szCmd);
}

Disable IPv6

Disable the device IPv6 connection. Useful to avoid IPv6 leaks.

Login required: Yes

CmdProc Code: OVS_CMD_DISABLE_IPV6

Command number:

Input: Not required

Response: OVS_NOTIFY_DISABLE_IPV6

OVS_NOTIFY_DISABLE_IPV6 Successful response
    OVS_ERR_OK

Code sample:

Windows Code Sample
    void disableIPv6()
{
json_object *j_obj;
char szCmd[1024];
j_obj = json_object_new_object();
json_object_object_add(j_obj, "cmd", json_object_new_int(OVS_CMD_DISABLE_IPV6));
snprintf(szCmd, sizeof(szCmd), "%s", json_object_get_string(j_obj));
json_object_put(j_obj);
CmdProc(szCmd);
}