Merge pull request #26 from RS7-SECIOTSRK/server
[platform/core/security/suspicious-activity-monitor.git] / device-policy-manager / libs / dpm / firewall.h
1 /*
2  *  Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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
15  */
16
17 #ifndef __CAPI_FIREWALL_POLICY_H__
18 #define __CAPI_FIREWALL_POLICY_H__
19
20 #include <dpm/device-policy-manager.h>
21
22 /**
23  * @file firewall.h
24  * @brief This file provides APIs to firewall policy applying
25  */
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 /**
32  * @addtogroup  CAPI_DPM_FIREWALL_POLICY_MODULE
33  * @{
34  */
35
36 /**
37  * @brief       Applies firewall policy rules.
38  * @details     This API is used to apply firewall policy rules.
39  * @since_tizen 3.0
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()
49  */
50 int dpm_firewall_apply_allow_rules(device_policy_manager_h handle, const char* rules);
51
52 /**
53  * @brief       Applies firewall policy rules.
54  * @details     This API is used to apply firewall policy rules.
55  * @since_tizen 3.0
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()
65  */
66 int dpm_firewall_apply_deny_rules(device_policy_manager_h handle, const char* rules);
67
68 /**
69  * @brief       Flush firewall policy rules.
70  * @details     This API is used to flush firewall policy rules.
71  * @since_tizen 3.0
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()
80  */
81 int dpm_firewall_flush_allow_rules(device_policy_manager_h handle);
82
83 /**
84  * @brief       Flush firewall policy rules.
85  * @details     This API is used to flush firewall policy rules.
86  * @since_tizen 3.0
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()
95  */
96 int dpm_firewall_flush_deny_rules(device_policy_manager_h handle);
97 #ifdef __cplusplus
98 }
99 #endif
100
101 #endif //__CAPI_FIREWALL_POLICY_H__