#include "generated-code.h"
-typedef enum _net_vpn_service_privilege_e
-{
+typedef enum _net_vpn_service_privilege_e {
PRIVILEGE_VPN_SERVICE = 0x00,
PRIVILEGE_VPN_SERVICE_ADMIN,
PRIVILEGE_INTERNET,
return FALSE;
}
- switch (_privilege)
- {
+ switch (_privilege) {
case PRIVILEGE_VPN_SERVICE:
privilege = "http://tizen.org/privilege/vpnservice";
break;
- case PRIVILEGE_VPN_SERVICE_ADMIN :
+ case PRIVILEGE_VPN_SERVICE_ADMIN:
privilege = "http://tizen.org/privilege/vpnservice.admin";
break;
- case PRIVILEGE_INTERNET :
+ case PRIVILEGE_INTERNET:
privilege = "http://tizen.org/privilege/internet";
break;
- default :
+ default:
LOGD("Undifined privilege");
return FALSE;
break;
int feature_rv = _vpnsvc_check_feature_supported(feature_name); \
if (feature_rv != VPNSVC_ERROR_NONE) \
return feature_rv; \
- } while(0)
+ } while (0)
/**
* @brief This data structure has a fido data and its length.
if (reply == NULL) {
if (error != NULL) {
- if (error->code == G_DBUS_ERROR_ACCESS_DENIED){
+ if (error->code == G_DBUS_ERROR_ACCESS_DENIED) {
LOGE("g_dbus_connection_call_sync() failed"
"error [%d: %s]", error->code, error->message);//LCOV_EXCL_LINE
*dbus_error = VPNSVC_ERROR_PERMISSION_DENIED;//LCOV_EXCL_LINE
g_variant_new("(su)", VPNSVC_DBUS_SERVICE_NAME, 0),
&dbus_result);
- if (dbus_result == VPNSVC_ERROR_PERMISSION_DENIED){
+ if (dbus_result == VPNSVC_ERROR_PERMISSION_DENIED)
return VPNSVC_ERROR_PERMISSION_DENIED;
- }
if (op == NULL) {
_vpnsvc_deinit_vpnsvc_tun_s(tmp_s); //LCOV_EXCL_LINE
g_variant_new("(s)", tun_s->name),
&dbus_result);
- if (dbus_result == VPNSVC_ERROR_PERMISSION_DENIED){
+ if (dbus_result == VPNSVC_ERROR_PERMISSION_DENIED)
return VPNSVC_ERROR_PERMISSION_DENIED;
- }
if (op == NULL) {
return VPNSVC_ERROR_IPC_FAILED; //LCOV_EXCL_LINE
socket_fd,
&dbus_result);
- if (dbus_result == VPNSVC_ERROR_PERMISSION_DENIED){
+ if (dbus_result == VPNSVC_ERROR_PERMISSION_DENIED)
return VPNSVC_ERROR_PERMISSION_DENIED;
- }
if (op == NULL) {
return VPNSVC_ERROR_IPC_FAILED; //LCOV_EXCL_LINE
nets_param_orig, num_allow_routes_orig),
&dbus_result);
- if (dbus_result == VPNSVC_ERROR_PERMISSION_DENIED){
+ if (dbus_result == VPNSVC_ERROR_PERMISSION_DENIED)
return VPNSVC_ERROR_PERMISSION_DENIED;
- }
if (op == NULL) {
return VPNSVC_ERROR_IPC_FAILED; //LCOV_EXCL_LINE
g_variant_new("()"),
&dbus_result);
- if (dbus_result == VPNSVC_ERROR_PERMISSION_DENIED){
+ if (dbus_result == VPNSVC_ERROR_PERMISSION_DENIED)
return VPNSVC_ERROR_PERMISSION_DENIED;
- }
if (op == NULL) {
return VPNSVC_ERROR_IPC_FAILED; //LCOV_EXCL_LINE
* @brief Enumeration for VPN service error types.
* @details Indicate formats of error type field
*/
-typedef enum
-{
- VPNSVC_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
- VPNSVC_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
- VPNSVC_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
- VPNSVC_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
- VPNSVC_ERROR_NO_SUCH_FILE = TIZEN_ERROR_NO_SUCH_FILE, /**< No such file or directory */
- VPNSVC_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< IO error */
- VPNSVC_ERROR_TIMEOUT = TIZEN_ERROR_TIMED_OUT, /**< Time out error or no answer */
- VPNSVC_ERROR_IPC_FAILED = TIZEN_ERROR_VPNSVC | 0x02, /**< Failed to communicate with server */
- VPNSVC_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED /**< Not Supported */
+typedef enum {
+ VPNSVC_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+ VPNSVC_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+ VPNSVC_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
+ VPNSVC_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
+ VPNSVC_ERROR_NO_SUCH_FILE = TIZEN_ERROR_NO_SUCH_FILE, /**< No such file or directory */
+ VPNSVC_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< IO error */
+ VPNSVC_ERROR_TIMEOUT = TIZEN_ERROR_TIMED_OUT, /**< Time out error or no answer */
+ VPNSVC_ERROR_IPC_FAILED = TIZEN_ERROR_VPNSVC | 0x02, /**< Failed to communicate with server */
+ VPNSVC_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED /**< Not Supported */
} vpnsvc_error_e;
#ifdef __cplusplus
}
-#endif // __cplusplus
+#endif // __cplusplus
#endif /* __TIZEN_CAPI_VPN_SERVICE_H__ */
* @param[in] num_routes The number of routes, Unlimitation
* @param[in] dns_servers The list of DNS server names - Optional
* @param[in] num_dns_servers The number of DNS server names - Optionl, Unlimitation
- * @param[in] dns_suffix The DNS suffix - Optional (e.g. tizen.org)
+ * @param[in] dns_suffix The DNS suffix - Optional (e.g. tizen.org)
* @return 0 on success. otherwise, a negative error value.
* @retval #VPNSVC_ERROR_NONE Success
* @retval #VPNSVC_ERROR_INVALID_PARAMETER Invalid parameter