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
- Success
- Failure
OVS_ERR_OK
data will contain
{
"device_id" : "unique_device_id"
}
data is null
Code sample:
- macOS
- Android
- Android (JSON)
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);
}
VPNSDK.CommandNotifyCB callback = new VPNSDK.CommandNotifyCB() {
@Override
public void onNotify(int notification, int error, Object data) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
};
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_GET_DEVICEID, callback);
VPNSDK.CmdProc("{\"cmd\": 7 }");
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
- Success
- Failure
OVS_ERR_OK
data will contain
{
"AES_Support" : true|false
}
data is null
Code sample:
- macOS
- Android
- Android (JSON)
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);
}
VPNSDK.CommandNotifyCB callback = new VPNSDK.CommandNotifyCB() {
@Override
public void onNotify(int notification, int error, Object data) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
};
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_CHECK_AES, callback);
VPNSDK.CmdProc("{\"cmd\": 12 }");
Check TAP Adapter Status​
Check the status of the TAP driver.
Login required: No
CmdProc Code: OVS_CMD_CHECK_TAP_ADAPTER
Command number: 34
Input: Not required
Response: OVS_NOTIFY_CHECK_TAP_ADAPTER
- Success
- Failure
OVS_ERR_OK
data is null
OVS_ERR_TAP_ADAPTER_IS_NOT_INSTALLED
data is null
Code sample:
- Windows
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
- Success
- Failure
OVS_ERR_OK
data is null
OVS_ERR_INTERNET_DISCONNECTED
data is null
Code sample:
- macOS
- Android
- Android (JSON)
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);
}
VPNSDK.CommandNotifyCB callback = new VPNSDK.CommandNotifyCB() {
@Override
public void onNotify(int notification, int error, Object data) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
};
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_CHECK_INTERNET, callback);
VPNSDK.CmdProc("{\"cmd\": 6 }");
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
- Success
- Failure
OVS_ERR_OK
data is null
OVS_ERR_PORT_CLOSED
data is null
Code sample:
- macOS
- Android
- Android (JSON)
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);
}
VPNSDK.CommandNotifyCB callback = new VPNSDK.CommandNotifyCB() {
@Override
public void onNotify(int notification, int error, Object data) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
};
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_CHECK_PORT, callback, "178.79.183.206", "tcp", "1194");
VPNSDK.CmdProc("{ \"cmd\": 8, \"data\": { \"ip_addr\": \"178.79.183.206\", \"proto\": \"tcp\", \"port\": 1194}}");
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
- Success
- Failure
OVS_ERR_OK
data will contain the IP address and the response time in ms
{
"ip_addr": "104.192.3.90",
"time": 30
}
OVS_ERR_MISSING_PARAMS
OVS_ERR_WEB_API
data is null
Code sample:
- macOS
- Android
- Android (JSON)
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);
}
VPNSDK.CommandNotifyCB callback = new VPNSDK.CommandNotifyCB() {
@Override
public void onNotify(int notification, int error, Object data) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
};
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_GET_PING_RESULT, callback, "104.192.3.90");
VPNSDK.CmdProc("{\"cmd\": 11, \"data\" : { \"ip_addr\" : \"104.192.3.90\"}}");
Disable IPv6​
Disable the device IPv6 connection. Useful to avoid IPv6 leaks.
Login required: Yes
CmdProc Code: OVS_CMD_DISABLE_IPV6
Command number: 36
Input: Not required
Response: OVS_NOTIFY_DISABLE_IPV6
- Success
- Failure
OVS_ERR_OK
data is null
Code sample:
- Windows
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);
}