Unified in-app VPN SDK's for Microsoft Windows Vista+, Android 4.4+ and Mac OS 10.7+. Earlier OS versions can be supported as well by request. Please contact [email protected] to receive your own API key.

Copyright © 2019 VPNWholesaler.com. All rights reserved.

Back

3.23 getVPNStatus OS X Example

GetVPNStatus() function could be written in the following way:

void GetVPNStatus()
{
    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_STATUS));
    snprintf(szCmd, sizeof(szCmd), "%s", json_object_get_string(j_obj));
    json_object_put(j_obj);
    CmdProc(szCmd); 
}

Result will be returned via callback as a JSON:

code will be OVS_NOTIFY_GET_STATUS

err will be OVS_ERR_OK in case of success

data will be an object with the following structure:

{
    VPN_Status": 1 
}

Where VPN_Status is 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