Separate source code from internal header
[platform/core/api/smart-traffic-control.git] / include / stc_ipt_internal.h
1 /*
2  * Smart Traffic Control (STC)
3  *
4  * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #ifndef __TIZEN_STC_IPT_INTERNAL_H__
21 #define __TIZEN_STC_IPT_INTERNAL_H__
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /**
28  * @file stc_internal.h
29  */
30
31 /*****************************************************************************
32  *  Standard headers
33  *****************************************************************************/
34 #include <tizen.h>
35 #include <time.h>
36 #include <inttypes.h>
37
38 /*****************************************************************************
39  *  Macros and Typedefs
40  *****************************************************************************/
41
42 /*****************************************************************************
43  *  Enumeration
44  *****************************************************************************/
45
46 /*****************************************************************************
47  *  Callback functions
48  *****************************************************************************/
49
50 /*****************************************************************************
51  *  Core API functions
52  *****************************************************************************/
53
54 /**
55  * @addtogroup CAPI_NETWORK_STC_IPTABLES_MODULE
56  * @{
57  */
58
59 /**
60  * @brief Commits iptables rule.
61  * @since_tizen 5.0
62  * @privlevel platform
63  * @privilege %http://tizen.org/privilege/firewall.common
64  * @remarks You must release @a err_str using free().
65  *
66  * @param[in] stc        The stc handle
67  * @param[in] option     The option of iptables rule
68  * @param[out] err_num   The error number
69  * @param[out] err_str   The error string
70  *
71  * @return 0 on success, otherwise a negative error value
72  * @retval #STC_ERROR_NONE Successful
73  * @retval #STC_ERROR_OPERATION_FAILED General error
74  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
75  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
76  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
77  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
78  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
79  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
80  *
81  * @see stc_initialize()
82  */
83 int stc_iptables_commit(stc_h stc, const char *option,
84                         int *err_num, char **err_str);
85
86 /**
87  * @brief Commits ip6tables rule.
88  * @since_tizen 5.0
89  * @privlevel platform
90  * @privilege %http://tizen.org/privilege/firewall.common
91  * @remarks You must release @a err_str using free().
92  *
93  * @param[in] stc        The stc handle
94  * @param[in] option     The option of iptables rule
95  * @param[out] err_num   The error number
96  * @param[out] err_str   The error string
97  *
98  * @return 0 on success, otherwise a negative error value
99  * @retval #STC_ERROR_NONE Successful
100  * @retval #STC_ERROR_OPERATION_FAILED General error
101  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
102  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
103  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
104  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
105  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
106  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
107  *
108  * @see stc_initialize()
109  */
110 int stc_ip6tables_commit(stc_h stc, const char *option,
111                         int *err_num, char **err_str);
112
113 /**
114 * @}
115 */
116
117 #ifdef __cplusplus
118 }
119 #endif
120
121 #endif /* __TIZEN_STC_IPT_INTERNAL_H__ */