2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
17 #ifndef __CAPI_FIREWALL_POLICY_H__
18 #define __CAPI_FIREWALL_POLICY_H__
20 #include <dpm/device-policy-manager.h>
24 * @brief This file provides APIs to firewall policy applying
32 * @addtogroup CAPI_DPM_FIREWALL_POLICY_MODULE
37 * @brief Applies firewall policy rules.
38 * @details This API is used to apply firewall policy rules.
40 * @param[in] handle The device policy manager handle
41 * @param[in] rules Rules for the firewall to be applied, pointer to null-terminated string array.
42 * @return #DPM_ERROR_NONE on success, otherwise a negative value
43 * @retval #DPM_ERROR_NONE Successful
44 * @retval #DPM_ERROR_TIMEOUT Time out
45 * @retval #DPM_ERROR_INVALID_PARAMETER Null pointer or invalid JSON format.
46 * @retval #DPM_ERROR_PERMISSION_DENIED The application does not have
47 * the privilege to call this API
48 * @pre handle must be created by dpm_manager_create()
50 int dpm_firewall_apply_allow_rules(device_policy_manager_h handle, const char* rules);
53 * @brief Applies firewall policy rules.
54 * @details This API is used to apply firewall policy rules.
56 * @param[in] handle The device policy manager handle
57 * @param[in] rules Rules for the firewall to be applied, pointer to null-terminated string array.
58 * @return #DPM_ERROR_NONE on success, otherwise a negative value
59 * @retval #DPM_ERROR_NONE Successful
60 * @retval #DPM_ERROR_TIMEOUT Time out
61 * @retval #DPM_ERROR_INVALID_PARAMETER Null pointer or invalid JSON format.
62 * @retval #DPM_ERROR_PERMISSION_DENIED The application does not have
63 * the privilege to call this API
64 * @pre handle must be created by dpm_manager_create()
66 int dpm_firewall_apply_deny_rules(device_policy_manager_h handle, const char* rules);
69 * @brief Flush firewall policy rules.
70 * @details This API is used to flush firewall policy rules.
72 * @param[in] handle The device policy manager handle
73 * @return #DPM_ERROR_NONE on success, otherwise a negative value
74 * @retval #DPM_ERROR_NONE Successful
75 * @retval #DPM_ERROR_TIMEOUT Time out
76 * @retval #DPM_ERROR_INVALID_PARAMETER Null pointer or invalid JSON format.
77 * @retval #DPM_ERROR_PERMISSION_DENIED The application does not have
78 * the privilege to call this API
79 * @pre handle must be created by dpm_manager_create()
81 int dpm_firewall_flush_allow_rules(device_policy_manager_h handle);
84 * @brief Flush firewall policy rules.
85 * @details This API is used to flush firewall policy rules.
87 * @param[in] handle The device policy manager handle
88 * @return #DPM_ERROR_NONE on success, otherwise a negative value
89 * @retval #DPM_ERROR_NONE Successful
90 * @retval #DPM_ERROR_TIMEOUT Time out
91 * @retval #DPM_ERROR_INVALID_PARAMETER Null pointer or invalid JSON format.
92 * @retval #DPM_ERROR_PERMISSION_DENIED The application does not have
93 * the privilege to call this API
94 * @pre handle must be created by dpm_manager_create()
96 int dpm_firewall_flush_deny_rules(device_policy_manager_h handle);
101 #endif //__CAPI_FIREWALL_POLICY_H__