8225ed11a541f2bad49fd10af293025f9937b95f
[platform/core/api/smart-traffic-control.git] / include / stc_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_INTERNAL_H__
21 #define __TIZEN_STC_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  * @addtogroup CAPI_NETWORK_STC_STATISTICS_MODULE
44  * @{
45  */
46
47 /**
48  * @brief The reset rule handle.
49  * @since_tizen 4.0
50  */
51 typedef void *stc_reset_rule_h;
52
53
54 /**
55 * @}
56 */
57
58 /**
59  * @addtogroup CAPI_NETWORK_STC_FIREWALL_MODULE
60  * @{
61  */
62
63 /**
64  * @brief The firewall chain handle.
65  * @since_tizen 5.0
66  */
67 typedef void *stc_firewall_chain_h;
68
69 /**
70  * @brief The firewall rule handle.
71  * @since_tizen 5.0
72  */
73 typedef void *stc_firewall_rule_h;
74
75 /**
76 * @}
77 */
78
79 /**
80  * @addtogroup CAPI_NETWORK_STC_RESTRICTION_MODULE
81  * @{
82  */
83
84 /**
85  * @brief The restriction rule handle.
86  * @since_tizen 4.0
87  */
88 typedef void *stc_restriction_rule_h;
89
90 /**
91 * @}
92 */
93
94 /*****************************************************************************
95  *  Enumeration
96  *****************************************************************************/
97
98 /**
99  * @addtogroup CAPI_NETWORK_STC_RESTRICTION_MODULE
100  * @{
101  */
102
103 /**
104  * @brief Enumeration for network restriction type.
105  * @since_tizen 5.0
106  */
107 typedef enum {
108         STC_RSTN_TYPE_UNKNOWN,
109         STC_RSTN_TYPE_ACCEPT,
110         STC_RSTN_TYPE_DROP,
111         STC_RSTN_TYPE_LAST_ELEM,
112 } stc_restriction_type_e;
113
114 /**
115 * @}
116 */
117
118 /**
119  * @addtogroup CAPI_NETWORK_STC_FIREWALL_MODULE
120  * @{
121  */
122
123 typedef enum {
124         STC_FIREWALL_UNKNOWN,
125         STC_FIREWALL_UNLOCKED,
126         STC_FIREWALL_LOCKED
127 } stc_firewall_lock_e;
128
129 /**
130  * @brief Enumeration for firewall direction.
131  * @since_tizen 5.0
132  */
133 typedef enum {
134         STC_FIREWALL_DIRECTION_NONE,
135         STC_FIREWALL_DIRECTION_IN,
136         STC_FIREWALL_DIRECTION_OUT
137 } stc_firewall_direction_e;
138
139 /**
140  * @brief Enumeration for firewall IP type.
141  * @since_tizen 5.0
142  */
143 typedef enum {
144         STC_FIREWALL_IP_NONE,
145         STC_FIREWALL_IP_SINGLE,
146         STC_FIREWALL_IP_MASK,
147         STC_FIREWALL_IP_RANGE
148 } stc_firewall_ip_type_e;
149
150 /**
151  * @brief Enumeration for firewall port type.
152  * @since_tizen 5.0
153  */
154 typedef enum {
155         STC_FIREWALL_PORT_NONE,
156         STC_FIREWALL_PORT_SINGLE,
157         STC_FIREWALL_PORT_RANGE
158 } stc_firewall_port_type_e;
159
160 /**
161  * @brief Enumeration for firewall protocol type.
162  * @since_tizen 5.0
163  */
164 typedef enum {
165         STC_FIREWALL_PROTOCOL_NONE,
166         STC_FIREWALL_PROTOCOL_TCP,
167         STC_FIREWALL_PROTOCOL_UDP,
168         STC_FIREWALL_PROTOCOL_ICMP,
169         STC_FIREWALL_PROTOCOL_ALL,
170 } stc_firewall_protocol_type_e;
171
172 /**
173  * @brief Enumeration for firewall family type.
174  * @since_tizen 5.0
175  */
176 typedef enum {
177         STC_FIREWALL_FAMILY_NONE,
178         STC_FIREWALL_FAMILY_V4,
179         STC_FIREWALL_FAMILY_V6
180 } stc_firewall_family_type_e;
181
182 /**
183  * @brief Enumeration for firewall chain target.
184  * @since_tizen 5.0
185  */
186 typedef enum {
187         STC_FIREWALL_CHAIN_TARGET_NONE,
188         STC_FIREWALL_CHAIN_TARGET_INPUT,
189         STC_FIREWALL_CHAIN_TARGET_OUTPUT,
190         STC_FIREWALL_CHAIN_TARGET_MAX
191 } stc_firewall_chain_target_e;
192
193 /**
194  * @brief Enumeration for firewall rule target.
195  * @since_tizen 5.0
196  */
197 typedef enum {
198         STC_FIREWALL_RULE_TARGET_NONE,
199         STC_FIREWALL_RULE_TARGET_ACCEPT,
200         STC_FIREWALL_RULE_TARGET_DROP,
201         STC_FIREWALL_RULE_TARGET_LOG,
202         STC_FIREWALL_RULE_TARGET_NFLOG,
203         STC_FIREWALL_RULE_TARGET_MAX,
204 } stc_firewall_rule_target_e;
205
206 /**
207 * @}
208 */
209
210
211 /*****************************************************************************
212  *  Callback functions
213  *****************************************************************************/
214
215 /**
216  * @addtogroup CAPI_NETWORK_STC_MANAGER_MODULE
217  * @{
218  */
219
220 /**
221  * @brief Called for enumerate restriction rule.
222  * @since_tizen 5.0
223  *
224  * @param[in] result            The result
225  * @param[in] rule                      The restriction rule handle
226  * @param[in] user_data         The user data passed from the callback registration function
227  * @return      @c STC_CALLBACK_CONTINUE to continue with the next iteration of the loop,
228  *                      otherwise @c STC_CALLBACK_CANCEL to break out of the loop
229  *
230  * @pre stc_get_restriction() will invoke this callback.
231  * @pre stc_foreach_restriction() will invoke this callback.
232  * @see stc_restriction_rule_get_app_id()
233  * @see stc_restriction_rule_get_iface_name()
234  * @see stc_restriction_rule_get_subscriber_id()
235  * @see stc_restriction_rule_get_type()
236  * @see stc_restriction_rule_get_iface_type()
237  * @see stc_restriction_rule_get_limit()
238  * @see stc_restriction_rule_get_warning_limit()
239  * @see stc_restriction_rule_get_monthly_limit()
240  * @see stc_restriction_rule_get_weekly_limit()
241  * @see stc_restriction_rule_get_daily_limit()
242  * @see stc_restriction_rule_get_month_start_date()
243  * @see stc_restriction_rule_get_roaming_type()
244  * @see stc_get_restriction()
245  * @see stc_foreach_restriction()
246  */
247 typedef stc_callback_ret_e (*stc_restriction_rule_cb)(stc_error_e result,
248                 stc_restriction_rule_h rule, void *user_data);
249
250 typedef void (*stc_threshold_crossed_cb)(stc_restriction_rule_h rule,
251                 void *user_data);
252
253 /**
254 * @}
255 */
256
257 /**
258  * @addtogroup CAPI_NETWORK_STC_FIREWALL_MODULE
259  * @{
260  */
261
262 /**
263  * @brief Called for enumerate firewall chain information.
264  * @since_tizen 5.0
265  *
266  * @param[in] info          The firewall chain handle
267  * @param[in] user_data         The user data passed from the callback firewall chain function
268  * @return      @c STC_CALLBACK_CONTINUE to continue with the next iteration of the loop,
269  *                      otherwise @c STC_CALLBACK_CANCEL to break out of the loop
270  *
271  * @pre stc_firewall_chain_foreach() will invoke this callback.
272  * @see stc_firewall_chain_get_name()
273  * @see stc_firewall_chain_get_target()
274  * @see stc_firewall_chain_get_priority()
275  * @see stc_firewall_chain_foreach()
276  */
277 typedef stc_callback_ret_e (*stc_firewall_chain_info_cb)(stc_firewall_chain_h info_h,
278                         void *user_data);
279
280 /**
281  * @brief Called for enumerate firewall rule information.
282  * @since_tizen 5.0
283  *
284  * @param[in] info          The firewall rule handle
285  * @param[in] user_data         The user data passed from the callback firewall rule function
286  * @return      @c STC_CALLBACK_CONTINUE to continue with the next iteration of the loop,
287  *                      otherwise @c STC_CALLBACK_CANCEL to break out of the loop
288  *
289  * @pre stc_firewall_rule_foreach() will invoke this callback.
290  * @see stc_firewall_rule_get_chain()
291  * @see stc_firewall_rule_get_direction()
292  * @see stc_firewall_rule_get_src_ip_type()
293  * @see stc_firewall_rule_get_dst_ip_type()
294  * @see stc_firewall_rule_get_src_port_type()
295  * @see stc_firewall_rule_get_dst_port_type()
296  * @see stc_firewall_rule_get_protocol_type()
297  * @see stc_firewall_rule_get_family_type()
298  * @see stc_firewall_rule_get_src_ip()
299  * @see stc_firewall_rule_get_dst_ip()
300  * @see stc_firewall_rule_get_src_port()
301  * @see stc_firewall_rule_get_dst_port()
302  * @see stc_firewall_rule_get_ifname()
303  * @see stc_firewall_rule_get_target()
304  * @see stc_firewall_rule_foreach()
305  */
306 typedef stc_callback_ret_e (*stc_firewall_rule_info_cb)(stc_firewall_rule_h info,
307                         void *user_data);
308
309 /**
310 * @}
311 */
312
313 /*****************************************************************************
314  *  Core API functions
315  *****************************************************************************/
316
317 /**
318  * @addtogroup CAPI_NETWORK_STC_MANAGER_MODULE
319  * @{
320  */
321
322 /**
323  * @brief Resets stats information.
324  * @since_tizen 4.0
325  * @privlevel platform
326  * @privilege %http://tizen.org/privilege/network.get
327  *
328  * @param[in] stc The stc handle
329  * @param[in] rule The reset rule handle
330  *
331  * @return 0 on success, otherwise a negative error value
332  * @retval #STC_ERROR_NONE Successful
333  * @retval #STC_ERROR_OPERATION_FAILED General error
334  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
335  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
336  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
337  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
338  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
339  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
340  *
341  * @see #stc_h
342  * @see #stc_reset_rule_h
343  * @see stc_initialize()
344  * @see stc_reset_rule_create()
345  * @see stc_reset_rule_destroy()
346  * @see stc_reset_rule_set_app_id()
347  * @see stc_reset_rule_set_subscriber_id()
348  * @see stc_reset_rule_set_iface_type()
349  * @see stc_reset_rule_set_time_interval()
350  * @see stc_reset_rule_get_app_id()
351  * @see stc_reset_rule_get_subscriber_id()
352  * @see stc_reset_rule_get_iface_type()
353  * @see stc_reset_rule_get_time_interval()
354  */
355 int stc_reset_stats(stc_h stc, stc_reset_rule_h rule);
356
357
358 /**
359  * @brief Sets the restriction for application.
360  * @details Sets and applies restriction for application.
361  *                      It will creates new restriction or modify existing.
362  * @since_tizen 4.0
363  * @privlevel platform
364  * @privilege %http://tizen.org/privilege/network.get
365  *
366  * @param[in] stc The stc handle
367  * @param[in] rule The restriction rule handle
368  *
369  * @return 0 on success, otherwise a negative error value
370  * @retval #STC_ERROR_NONE Successful
371  * @retval #STC_ERROR_OPERATION_FAILED General error
372  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
373  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
374  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
375  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
376  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
377  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
378  *
379  * @see #stc_h
380  * @see #stc_restriction_rule_h
381  * @see stc_initialize()
382  * @see stc_restriction_rule_create()
383  * @see stc_restriction_rule_destroy()
384  * @see stc_restriction_rule_set_app_id()
385  * @see stc_restriction_rule_set_iface_name()
386  * @see stc_restriction_rule_set_iface_type()
387  * @see stc_restriction_rule_set_limit()
388  * @see stc_restriction_rule_set_warning_limit()
389  * @see stc_restriction_rule_set_roaming_type()
390  * @see stc_restriction_rule_set_subscriber_id()
391  * @see stc_restriction_rule_get_app_id()
392  * @see stc_restriction_rule_get_iface_type()
393  * @see stc_restriction_rule_get_limit()
394  * @see stc_restriction_rule_get_warning_limit()
395  * @see stc_restriction_rule_get_roaming_type()
396  * @see stc_restriction_rule_get_subscriber_id()
397  * @see stc_restriction_rule_get_process_state()
398  * @see stc_get_restriction()
399  * @see stc_foreach_restriction()
400  * @see stc_get_restriction_type()
401  * @see stc_unset_restriction()
402  */
403 int stc_set_restriction(stc_h stc, stc_restriction_rule_h rule);
404
405 /**
406  * @brief Unsets the existing restriction for application.
407  * @details Unsets the existing restriction for application.
408  *                      It will delete restriction rule in kernel.
409  * @since_tizen 4.0
410  * @privlevel platform
411  * @privilege %http://tizen.org/privilege/network.get
412  *
413  * @param[in] stc The stc handle
414  * @param[in] rule The restriction rule handle
415  *
416  * @return 0 on success, otherwise a negative error value
417  * @retval #STC_ERROR_NONE Successful
418  * @retval #STC_ERROR_OPERATION_FAILED General error
419  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
420  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
421  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
422  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
423  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
424  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
425  *
426  * @see #stc_h
427  * @see #stc_restriction_rule_h
428  * @see stc_initialize()
429  * @see stc_restriction_rule_create()
430  * @see stc_restriction_rule_destroy()
431  * @see stc_restriction_rule_set_app_id()
432  * @see stc_restriction_rule_set_iface_name()
433  * @see stc_restriction_rule_set_iface_type()
434  * @see stc_restriction_rule_set_limit()
435  * @see stc_restriction_rule_set_warning_limit()
436  * @see stc_restriction_rule_set_roaming_type()
437  * @see stc_restriction_rule_set_subscriber_id()
438  * @see stc_restriction_rule_get_app_id()
439  * @see stc_restriction_rule_get_iface_type()
440  * @see stc_restriction_rule_get_limit()
441  * @see stc_restriction_rule_get_warning_limit()
442  * @see stc_restriction_rule_get_roaming_type()
443  * @see stc_restriction_rule_get_subscriber_id()
444  * @see stc_restriction_rule_get_process_state()
445  * @see stc_set_restriction()
446  * @see stc_get_restriction()
447  * @see stc_foreach_restriction()
448  * @see stc_get_restriction_type()
449  */
450 int stc_unset_restriction(stc_h stc, stc_restriction_rule_h rule);
451
452 /**
453  * @brief Gets the restriction rule per application.
454  * @details The callback is called for each application that applied restriction.
455  * @since_tizen 4.0
456  * @privlevel platform
457  * @privilege %http://tizen.org/privilege/network.get
458  *
459  * @param[in] stc The stc handle
460  * @param[in] rule The restriction rule handle
461  * @param[in] rule_cb The callback is called for each application
462  *                      that applied restriction in interface specified
463  * @param[in] user_data User data will be passed to the callback function
464  *
465  * @return 0 on success, otherwise a negative error value
466  * @retval #STC_ERROR_NONE Successful
467  * @retval #STC_ERROR_OPERATION_FAILED General error
468  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
469  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
470  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
471  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
472  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
473  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
474  *
475  * @see #stc_h
476  * @see #stc_restriction_rule_h
477  * @see stc_initialize()
478  * @see stc_restriction_rule_create()
479  * @see stc_restriction_rule_destroy()
480  * @see stc_restriction_rule_set_app_id()
481  * @see stc_restriction_rule_set_iface_name()
482  * @see stc_restriction_rule_set_iface_type()
483  * @see stc_restriction_rule_set_limit()
484  * @see stc_restriction_rule_set_warning_limit()
485  * @see stc_restriction_rule_set_roaming_type()
486  * @see stc_restriction_rule_set_subscriber_id()
487  * @see stc_restriction_rule_get_app_id()
488  * @see stc_restriction_rule_get_iface_type()
489  * @see stc_restriction_rule_get_limit()
490  * @see stc_restriction_rule_get_warning_limit()
491  * @see stc_restriction_rule_get_roaming_type()
492  * @see stc_restriction_rule_get_subscriber_id()
493  * @see stc_restriction_rule_get_process_state()
494  * @see stc_restriction_rule_cb()
495  * @see stc_set_restriction()
496  * @see stc_foreach_restriction()
497  * @see stc_get_restriction_type()
498  * @see stc_unset_restriction()
499  */
500 int stc_get_restriction(stc_h stc, stc_restriction_rule_h rule,
501                 stc_restriction_rule_cb rule_cb, void *user_data);
502
503 int stc_set_restriction_threshold_crossed_cb(stc_h stc,
504                 stc_threshold_crossed_cb crossed_cb, void *user_data);
505
506 int stc_unset_restriction_threshold_crossed_cb(stc_h stc);
507
508 int stc_set_warn_threshold_crossed_cb(stc_h stc,
509                 stc_threshold_crossed_cb crossed_cb, void *user_data);
510
511 int stc_unset_warn_threshold_crossed_cb(stc_h stc);
512
513 /**
514  * @brief Gets the restriction rule of all application.
515  * @details The callback is called for each application that applied restriction.
516  * @since_tizen 4.0
517  * @privlevel platform
518  * @privilege %http://tizen.org/privilege/network.get
519  *
520  * @param[in] stc The stc handle
521  * @param[in] rule The restriction rule handle
522  * @param[in] rule_cb The callback is called for each application
523  *                      that applied restriction in interface specified
524  * @param[in] user_data User data will be passed to the callback function
525  *
526  * @return 0 on success, otherwise a negative error value
527  * @retval #STC_ERROR_NONE Successful
528  * @retval #STC_ERROR_OPERATION_FAILED General error
529  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
530  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
531  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
532  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
533  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
534  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
535  *
536  * @see #stc_h
537  * @see #stc_restriction_rule_h
538  * @see stc_initialize()
539  * @see stc_restriction_rule_create()
540  * @see stc_restriction_rule_destroy()
541  * @see stc_restriction_rule_set_app_id()
542  * @see stc_restriction_rule_set_iface_name()
543  * @see stc_restriction_rule_set_iface_type()
544  * @see stc_restriction_rule_set_limit()
545  * @see stc_restriction_rule_set_warning_limit()
546  * @see stc_restriction_rule_set_roaming_type()
547  * @see stc_restriction_rule_set_subscriber_id()
548  * @see stc_restriction_rule_get_app_id()
549  * @see stc_restriction_rule_get_iface_type()
550  * @see stc_restriction_rule_get_limit()
551  * @see stc_restriction_rule_get_warning_limit()
552  * @see stc_restriction_rule_get_roaming_type()
553  * @see stc_restriction_rule_get_subscriber_id()
554  * @see stc_restriction_rule_get_process_state()
555  * @see stc_restriction_rule_cb()
556  * @see stc_set_restriction()
557  * @see stc_get_restriction()
558  * @see stc_get_restriction_type()
559  * @see stc_unset_restriction()
560  */
561 int stc_foreach_restriction(stc_h stc, stc_restriction_rule_h rule,
562                 stc_restriction_rule_cb rule_cb, void *user_data);
563
564 /**
565  * @brief Gets the restriction type.
566  * @since_tizen 4.0
567  * @privlevel platform
568  * @privilege %http://tizen.org/privilege/network.get
569  *
570  * @param[in] stc The stc handle
571  * @param[in] rule The restriction rule handle
572  * @param[out] type The restriction type
573  *
574  * @return 0 on success, otherwise a negative error value
575  * @retval #STC_ERROR_NONE Successful
576  * @retval #STC_ERROR_OPERATION_FAILED General error
577  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
578  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
579  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
580  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
581  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
582  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
583  *
584  * @see #stc_h
585  * @see #stc_restriction_rule_h
586  * @see #stc_restriction_type_e
587  * @see stc_initialize()
588  * @see stc_restriction_rule_create()
589  * @see stc_restriction_rule_destroy()
590  * @see stc_restriction_rule_set_app_id()
591  * @see stc_restriction_rule_set_iface_name()
592  * @see stc_restriction_rule_set_iface_type()
593  * @see stc_restriction_rule_set_limit()
594  * @see stc_restriction_rule_set_warning_limit()
595  * @see stc_restriction_rule_set_roaming_type()
596  * @see stc_restriction_rule_set_subscriber_id()
597  * @see stc_restriction_rule_get_app_id()
598  * @see stc_restriction_rule_get_iface_type()
599  * @see stc_restriction_rule_get_limit()
600  * @see stc_restriction_rule_get_warning_limit()
601  * @see stc_restriction_rule_get_roaming_type()
602  * @see stc_restriction_rule_get_subscriber_id()
603  * @see stc_restriction_rule_get_process_state()
604  * @see stc_set_restriction()
605  * @see stc_get_restriction()
606  * @see stc_foreach_restriction()
607  * @see stc_unset_restriction()
608  */
609 int stc_get_restriction_type(stc_h stc, stc_restriction_rule_h rule,
610                 stc_restriction_type_e *type);
611
612 /**
613 * @}
614 */
615
616 /**
617  * @addtogroup CAPI_NETWORK_STC_STATISTICS_MODULE
618  * @{
619  */
620
621 /**
622  * @brief Creates the reset rule handle.
623  * @since_tizen 4.0
624  * @privlevel platform
625  * @privilege %http://tizen.org/privilege/network.get
626  * @remarks You must release @a handle using stc_reset_rule_destroy().
627  *
628  * @param[in] stc The stc handle
629  * @param[out] rule The reset rule handle
630  *
631  * @return 0 on success, otherwise a negative error value
632  * @retval #STC_ERROR_NONE Successful
633  * @retval #STC_ERROR_OPERATION_FAILED General error
634  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
635  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
636  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
637  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
638  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
639  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
640  *
641  * @see #stc_h
642  * @see #stc_reset_rule_h
643  * @see stc_initialize()
644  * @see stc_reset_rule_destroy()
645  */
646 int stc_reset_rule_create(stc_h stc, stc_reset_rule_h *rule);
647
648 /**
649  * @brief Destroys the reset rule handle.
650  * @since_tizen 4.0
651  * @privlevel platform
652  * @privilege %http://tizen.org/privilege/network.get
653  *
654  * @param[in] rule The reset rule handle
655  *
656  * @return 0 on success, otherwise a negative error value
657  * @retval #STC_ERROR_NONE Successful
658  * @retval #STC_ERROR_OPERATION_FAILED General error
659  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
660  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
661  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
662  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
663  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
664  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
665  *
666  * @see #stc_reset_rule_h
667  * @see stc_reset_rule_create()
668  */
669 int stc_reset_rule_destroy(stc_reset_rule_h rule);
670
671 /**
672  * @brief Sets the application ID for reset rule.
673  * @since_tizen 4.0
674  * @privlevel platform
675  * @privilege %http://tizen.org/privilege/network.get
676  *
677  * @param[in] rule The reset rule handle
678  * @param[in] app_id The application ID
679  *
680  * @return 0 on success, otherwise a negative error value
681  * @retval #STC_ERROR_NONE Successful
682  * @retval #STC_ERROR_OPERATION_FAILED General error
683  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
684  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
685  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
686  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
687  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
688  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
689  *
690  * @see #stc_reset_rule_h
691  * @see stc_reset_rule_create()
692  * @see stc_reset_rule_destroy()
693  * @see stc_reset_rule_get_app_id()
694  */
695 int stc_reset_rule_set_app_id(stc_reset_rule_h rule, const char *app_id);
696
697 /**
698  * @brief Sets the subscriber ID for reset rule.
699  * @since_tizen 4.0
700  * @privlevel platform
701  * @privilege %http://tizen.org/privilege/network.get
702  *
703  * @param[in] rule The reset rule handle
704  * @param[in] subscriber_id The subscriber ID
705  *
706  * @return 0 on success, otherwise a negative error value
707  * @retval #STC_ERROR_NONE Successful
708  * @retval #STC_ERROR_OPERATION_FAILED General error
709  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
710  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
711  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
712  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
713  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
714  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
715  *
716  * @see #stc_reset_rule_h
717  * @see stc_reset_rule_create()
718  * @see stc_reset_rule_destroy()
719  * @see stc_reset_rule_get_subscriber_id()
720  */
721 int stc_reset_rule_set_subscriber_id(stc_reset_rule_h rule, const char *subscriber_id);
722
723 /**
724  * @brief Sets the interface type for reset rule.
725  * @since_tizen 4.0
726  * @privlevel platform
727  * @privilege %http://tizen.org/privilege/network.get
728  *
729  * @param[in] rule The reset rule handle
730  * @param[in] iface_type The interface type
731  *
732  * @return 0 on success, otherwise a negative error value
733  * @retval #STC_ERROR_NONE Successful
734  * @retval #STC_ERROR_OPERATION_FAILED General error
735  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
736  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
737  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
738  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
739  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
740  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
741  *
742  * @see #stc_reset_rule_h
743  * @see #stc_iface_type_e
744  * @see stc_reset_rule_create()
745  * @see stc_reset_rule_destroy()
746  * @see stc_reset_rule_get_iface_type()
747  */
748 int stc_reset_rule_set_iface_type(stc_reset_rule_h rule,
749                 stc_iface_type_e iface_type);
750
751 /**
752  * @brief Sets the time interval for reset rule.
753  * @since_tizen 4.0
754  * @privlevel platform
755  * @privilege %http://tizen.org/privilege/network.get
756  *
757  * @param[in] rule The reset rule handle
758  * @param[in] from The time interval from
759  * @param[in] to The time interval to
760  *
761  * @return 0 on success, otherwise a negative error value
762  * @retval #STC_ERROR_NONE Successful
763  * @retval #STC_ERROR_OPERATION_FAILED General error
764  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
765  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
766  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
767  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
768  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
769  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
770  *
771  * @see #stc_reset_rule_h
772  * @see stc_reset_rule_create()
773  * @see stc_reset_rule_destroy()
774  * @see stc_reset_rule_get_time_interval()
775  */
776 int stc_reset_rule_set_time_interval(stc_reset_rule_h rule,
777                 time_t from, time_t to);
778
779 /**
780  * @brief Gets the application ID for reset.
781  * @since_tizen 4.0
782  * @privlevel platform
783  * @privilege %http://tizen.org/privilege/network.get
784  *
785  * @param[in] rule The reset rule handle
786  * @param[out] app_id The application ID
787  *
788  * @return 0 on success, otherwise a negative error value
789  * @retval #STC_ERROR_NONE Successful
790  * @retval #STC_ERROR_OPERATION_FAILED General error
791  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
792  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
793  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
794  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
795  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
796  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
797  *
798  * @see #stc_reset_rule_h
799  * @see stc_reset_rule_create()
800  * @see stc_reset_rule_destroy()
801  * @see stc_reset_rule_set_app_id()
802  */
803 int stc_reset_rule_get_app_id(stc_reset_rule_h rule, char **app_id);
804
805 /**
806  * @brief Gets the subscriber ID for reset rule.
807  * @since_tizen 4.0
808  * @privlevel platform
809  * @privilege %http://tizen.org/privilege/network.get
810  *
811  * @param[in] rule The reset rule handle
812  * @param[out] subscriber_id The subscriber ID
813  *
814  * @return 0 on success, otherwise a negative error value
815  * @retval #STC_ERROR_NONE Successful
816  * @retval #STC_ERROR_OPERATION_FAILED General error
817  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
818  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
819  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
820  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
821  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
822  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
823  *
824  * @see #stc_reset_rule_h
825  * @see stc_reset_rule_create()
826  * @see stc_reset_rule_destroy()
827  * @see stc_reset_rule_set_subscriber_id()
828  */
829 int stc_reset_rule_get_subscriber_id(stc_reset_rule_h rule, char **subscriber_id);
830
831 /**
832  * @brief Gets the interface type for reset rule.
833  * @since_tizen 4.0
834  * @privlevel platform
835  * @privilege %http://tizen.org/privilege/network.get
836  *
837  * @param[in] rule The reset rule handle
838  * @param[out] iface_type The interface type
839  *
840  * @return 0 on success, otherwise a negative error value
841  * @retval #STC_ERROR_NONE Successful
842  * @retval #STC_ERROR_OPERATION_FAILED General error
843  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
844  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
845  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
846  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
847  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
848  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
849  *
850  * @see #stc_reset_rule_h
851  * @see #stc_iface_type_e
852  * @see stc_reset_rule_create()
853  * @see stc_reset_rule_destroy()
854  * @see stc_reset_rule_set_iface_type()
855  */
856 int stc_reset_rule_get_iface_type(stc_reset_rule_h rule,
857                 stc_iface_type_e *iface_type);
858
859 /**
860  * @brief Gets the time interval for reset rule.
861  * @since_tizen 4.0
862  * @privlevel platform
863  * @privilege %http://tizen.org/privilege/network.get
864  *
865  * @param[in] rule The reset rule handle
866  * @param[out] from The time interval from
867  * @param[out] to The time interval to
868  *
869  * @return 0 on success, otherwise a negative error value
870  * @retval #STC_ERROR_NONE Successful
871  * @retval #STC_ERROR_OPERATION_FAILED General error
872  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
873  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
874  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
875  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
876  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
877  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
878  *
879  * @see #stc_reset_rule_h
880  * @see stc_reset_rule_create()
881  * @see stc_reset_rule_destroy()
882  * @see stc_reset_rule_set_time_interval()
883  */
884 int stc_reset_rule_get_time_interval(stc_reset_rule_h rule,
885                 time_t *from, time_t *to);
886
887 /**
888 * @}
889 */
890
891 /**
892  * @addtogroup CAPI_NETWORK_STC_RESTRICTION_MODULE
893  * @{
894  */
895
896 /**
897  * @brief Creates the restriction rule handle.
898  * @since_tizen 4.0
899  * @privlevel platform
900  * @privilege %http://tizen.org/privilege/network.get
901  * @remarks You must release @a handle using stc_restriction_rule_destroy().
902  *
903  * @param[in] stc The stc handle
904  * @param[out] rule The restriction rule handle
905  *
906  * @return 0 on success, otherwise a negative error value
907  * @retval #STC_ERROR_NONE Successful
908  * @retval #STC_ERROR_OPERATION_FAILED General error
909  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
910  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
911  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
912  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
913  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
914  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
915  *
916  * @see #stc_h
917  * @see #stc_restriction_rule_h
918  * @see stc_initialize()
919  * @see stc_restriction_rule_destroy()
920  */
921 int stc_restriction_rule_create(stc_h stc, stc_restriction_rule_h *rule);
922
923 /**
924  * @brief Destroys the restriction rule handle.
925  * @since_tizen 4.0
926  * @privlevel platform
927  * @privilege %http://tizen.org/privilege/network.get
928  *
929  * @param[in] rule The restriction rule handle
930  *
931  * @return 0 on success, otherwise a negative error value
932  * @retval #STC_ERROR_NONE Successful
933  * @retval #STC_ERROR_OPERATION_FAILED General error
934  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
935  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
936  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
937  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
938  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
939  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
940  *
941  * @see #stc_restriction_rule_h
942  * @see stc_restriction_rule_create()
943  */
944 int stc_restriction_rule_destroy(stc_restriction_rule_h rule);
945
946 /**
947  * @brief Sets the application ID for restriction rule.
948  * @since_tizen 4.0
949  * @privlevel platform
950  * @privilege %http://tizen.org/privilege/network.get
951  *
952  * @param[in] rule The restriction rule handle
953  * @param[in] app_id The application ID
954  *
955  * @return 0 on success, otherwise a negative error value
956  * @retval #STC_ERROR_NONE Successful
957  * @retval #STC_ERROR_OPERATION_FAILED General error
958  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
959  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
960  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
961  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
962  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
963  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
964  *
965  * @see #stc_restriction_rule_h
966  * @see stc_restriction_rule_create()
967  * @see stc_restriction_rule_destroy()
968  * @see stc_restriction_rule_get_app_id()
969  */
970 int stc_restriction_rule_set_app_id(stc_restriction_rule_h rule,
971                 const char *app_id);
972
973 /**
974  * @brief Sets the interface name for restriction rule.
975  * @since_tizen 4.0
976  * @privlevel platform
977  * @privilege %http://tizen.org/privilege/network.get
978  *
979  * @param[in] rule The restriction rule handle
980  * @param[in] iface_name The interface name
981  *
982  * @return 0 on success, otherwise a negative error value
983  * @retval #STC_ERROR_NONE Successful
984  * @retval #STC_ERROR_OPERATION_FAILED General error
985  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
986  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
987  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
988  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
989  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
990  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
991  *
992  * @see #stc_restriction_rule_h
993  * @see #stc_iface_type_e
994  * @see stc_restriction_rule_create()
995  * @see stc_restriction_rule_destroy()
996  * @see stc_restriction_rule_get_iface_name()
997  */
998 int stc_restriction_rule_set_iface_name(        stc_restriction_rule_h rule,
999                 const char *iface_name);
1000
1001 /**
1002  * @brief Sets the interface type for restriction rule.
1003  * @since_tizen 4.0
1004  * @privlevel platform
1005  * @privilege %http://tizen.org/privilege/network.get
1006  *
1007  * @param[in] rule The restriction rule handle
1008  * @param[in] iface_type The interface type
1009  *
1010  * @return 0 on success, otherwise a negative error value
1011  * @retval #STC_ERROR_NONE Successful
1012  * @retval #STC_ERROR_OPERATION_FAILED General error
1013  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1014  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1015  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1016  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1017  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1018  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1019  *
1020  * @see #stc_restriction_rule_h
1021  * @see #stc_iface_type_e
1022  * @see stc_restriction_rule_create()
1023  * @see stc_restriction_rule_destroy()
1024  * @see stc_restriction_rule_get_iface_type()
1025  */
1026 int stc_restriction_rule_set_iface_type(stc_restriction_rule_h rule,
1027                 stc_iface_type_e iface_type);
1028
1029 /**
1030  * @brief Sets the type for restriction rule.
1031  * @since_tizen 5.0
1032  * @privlevel platform
1033  * @privilege %http://tizen.org/privilege/network.get
1034  *
1035  * @param[in] rule The restriction rule handle
1036  * @param[in] type The restriction type
1037  *
1038  * @return 0 on success, otherwise a negative error value
1039  * @retval #STC_ERROR_NONE Successful
1040  * @retval #STC_ERROR_OPERATION_FAILED General error
1041  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1042  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1043  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1044  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1045  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1046  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1047  *
1048  * @see #stc_restriction_rule_h
1049  * @see #stc_restriction_type_e
1050  * @see stc_restriction_rule_create()
1051  * @see stc_restriction_rule_destroy()
1052  * @see stc_restriction_rule_get_type()
1053  */
1054 int stc_restriction_rule_set_type(stc_restriction_rule_h rule,
1055                 stc_restriction_type_e type);
1056
1057 /**
1058  * @brief Sets the limit for restriction rule.
1059  * @since_tizen 4.0
1060  * @privlevel platform
1061  * @privilege %http://tizen.org/privilege/network.get
1062  *
1063  * @param[in] rule The restriction rule handle
1064  * @param[in] data_limit The data limit
1065  *
1066  * @return 0 on success, otherwise a negative error value
1067  * @retval #STC_ERROR_NONE Successful
1068  * @retval #STC_ERROR_OPERATION_FAILED General error
1069  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1070  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1071  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1072  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1073  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1074  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1075  *
1076  * @see #stc_restriction_rule_h
1077  * @see stc_restriction_rule_create()
1078  * @see stc_restriction_rule_destroy()
1079  * @see stc_restriction_rule_get_limit()
1080  */
1081 int stc_restriction_rule_set_limit(stc_restriction_rule_h rule,
1082                                    int64_t data_limit);
1083
1084 /**
1085  * @brief Sets the warning limit for restriction rule.
1086  * @since_tizen 4.0
1087  * @privlevel platform
1088  * @privilege %http://tizen.org/privilege/network.get
1089  *
1090  * @param[in] rule The restriction rule handle
1091  * @param[in] data_warn_limit The data warning limit
1092  *
1093  * @return 0 on success, otherwise a negative error value
1094  * @retval #STC_ERROR_NONE Successful
1095  * @retval #STC_ERROR_OPERATION_FAILED General error
1096  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1097  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1098  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1099  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1100  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1101  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1102  *
1103  * @see #stc_restriction_rule_h
1104  * @see stc_restriction_rule_create()
1105  * @see stc_restriction_rule_destroy()
1106  * @see stc_restriction_rule_get_warning_limit()
1107  */
1108 int stc_restriction_rule_set_warning_limit(stc_restriction_rule_h rule,
1109                                            int64_t data_warn_limit);
1110
1111 /**
1112  * @brief Sets the monthly data limit for restriction rule.
1113  * @since_tizen 5.0
1114  * @privlevel platform
1115  * @privilege %http://tizen.org/privilege/network.get
1116  *
1117  * @param[in] rule The restriction rule handle
1118  * @param[in] limit The data limit
1119  *
1120  * @return 0 on success, otherwise a negative error value
1121  * @retval #STC_ERROR_NONE Successful
1122  * @retval #STC_ERROR_OPERATION_FAILED General error
1123  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1124  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1125  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1126  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1127  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1128  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1129  *
1130  * @see #stc_restriction_rule_h
1131  * @see stc_restriction_rule_create()
1132  * @see stc_restriction_rule_destroy()
1133  * @see stc_restriction_rule_get_monthly_limit()
1134  */
1135 int stc_restriction_rule_set_monthly_limit(stc_restriction_rule_h rule,
1136                                            int64_t limit);
1137
1138 /**
1139  * @brief Sets the weekly data limit for restriction rule.
1140  * @since_tizen 5.0
1141  * @privlevel platform
1142  * @privilege %http://tizen.org/privilege/network.get
1143  *
1144  * @param[in] rule The restriction rule handle
1145  * @param[in] limit The data limit
1146  *
1147  * @return 0 on success, otherwise a negative error value
1148  * @retval #STC_ERROR_NONE Successful
1149  * @retval #STC_ERROR_OPERATION_FAILED General error
1150  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1151  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1152  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1153  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1154  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1155  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1156  *
1157  * @see #stc_restriction_rule_h
1158  * @see stc_restriction_rule_create()
1159  * @see stc_restriction_rule_destroy()
1160  * @see stc_restriction_rule_get_weekly_limit()
1161  */
1162 int stc_restriction_rule_set_weekly_limit(stc_restriction_rule_h rule,
1163                                           int64_t limit);
1164
1165 /**
1166  * @brief Sets the daily data limit for restriction rule.
1167  * @since_tizen 5.0
1168  * @privlevel platform
1169  * @privilege %http://tizen.org/privilege/network.get
1170  *
1171  * @param[in] rule The restriction rule handle
1172  * @param[in] limit The data limit
1173  *
1174  * @return 0 on success, otherwise a negative error value
1175  * @retval #STC_ERROR_NONE Successful
1176  * @retval #STC_ERROR_OPERATION_FAILED General error
1177  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1178  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1179  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1180  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1181  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1182  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1183  *
1184  * @see #stc_restriction_rule_h
1185  * @see stc_restriction_rule_create()
1186  * @see stc_restriction_rule_destroy()
1187  * @see stc_restriction_rule_get_daily_limit()
1188  */
1189 int stc_restriction_rule_set_daily_limit(stc_restriction_rule_h rule,
1190                                          int64_t limit);
1191
1192 /**
1193  * @brief Sets the month start date for restriction rule.
1194  * @since_tizen 5.0
1195  * @privlevel platform
1196  * @privilege %http://tizen.org/privilege/network.get
1197  *
1198  * @param[in] rule The restriction rule handle
1199  * @param[in] month_start_date The month start date
1200  *
1201  * @return 0 on success, otherwise a negative error value
1202  * @retval #STC_ERROR_NONE Successful
1203  * @retval #STC_ERROR_OPERATION_FAILED General error
1204  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1205  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1206  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1207  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1208  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1209  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1210  *
1211  * @see #stc_restriction_rule_h
1212  * @see stc_restriction_rule_create()
1213  * @see stc_restriction_rule_destroy()
1214  * @see stc_restriction_rule_get_month_start_date()
1215  */
1216 int stc_restriction_rule_set_month_start_date(stc_restriction_rule_h rule,
1217                                               int month_start_date);
1218
1219 /**
1220  * @brief Sets the roaming type for restriction rule.
1221  * @since_tizen 4.0
1222  * @privlevel platform
1223  * @privilege %http://tizen.org/privilege/network.get
1224  *
1225  * @param[in] rule The restriction rule handle
1226  * @param[in] roaming_type The roaming type
1227  *
1228  * @return 0 on success, otherwise a negative error value
1229  * @retval #STC_ERROR_NONE Successful
1230  * @retval #STC_ERROR_OPERATION_FAILED General error
1231  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1232  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1233  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1234  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1235  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1236  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1237  *
1238  * @see #stc_restriction_rule_h
1239  * @see #stc_roaming_type_e
1240  * @see stc_restriction_rule_create()
1241  * @see stc_restriction_rule_destroy()
1242  * @see stc_restriction_rule_get_roaming_type()
1243  */
1244 int stc_restriction_rule_set_roaming_type(stc_restriction_rule_h rule,
1245                 stc_roaming_type_e roaming_type);
1246
1247 /**
1248  * @brief Sets the subscriber ID for restriction rule.
1249  * @since_tizen 4.0
1250  * @privlevel platform
1251  * @privilege %http://tizen.org/privilege/network.get
1252  *
1253  * @param[in] rule The restriction rule handle
1254  * @param[in] subscriber_id The subscriber ID
1255  *
1256  * @return 0 on success, otherwise a negative error value
1257  * @retval #STC_ERROR_NONE Successful
1258  * @retval #STC_ERROR_OPERATION_FAILED General error
1259  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1260  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1261  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1262  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1263  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1264  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1265  *
1266  * @see #stc_restriction_rule_h
1267  * @see stc_restriction_rule_create()
1268  * @see stc_restriction_rule_destroy()
1269  * @see stc_restriction_rule_get_subscriber_id()
1270  */
1271 int stc_restriction_rule_set_subscriber_id(stc_restriction_rule_h rule, const char *subscriber_id);
1272
1273 /**
1274  * @brief Gets the application ID for restriction rule.
1275  * @since_tizen 4.0
1276  * @privlevel platform
1277  * @privilege %http://tizen.org/privilege/network.get
1278  *
1279  * @param[in] rule The restriction rule handle
1280  * @param[out] app_id The application ID
1281  *
1282  * @return 0 on success, otherwise a negative error value
1283  * @retval #STC_ERROR_NONE Successful
1284  * @retval #STC_ERROR_OPERATION_FAILED General error
1285  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1286  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1287  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1288  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1289  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1290  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1291  *
1292  * @see #stc_restriction_rule_h
1293  * @see stc_restriction_rule_create()
1294  * @see stc_restriction_rule_destroy()
1295  * @see stc_restriction_rule_set_app_id()
1296  */
1297 int stc_restriction_rule_get_app_id(stc_restriction_rule_h rule, char **app_id);
1298
1299 /**
1300  * @brief Gets the interface name for restriction rule.
1301  * @since_tizen 4.0
1302  * @privlevel platform
1303  * @privilege %http://tizen.org/privilege/network.get
1304  *
1305  * @param[in] rule The restriction rule handle
1306  * @param[out] iface_name The interface name
1307  *
1308  * @return 0 on success, otherwise a negative error value
1309  * @retval #STC_ERROR_NONE Successful
1310  * @retval #STC_ERROR_OPERATION_FAILED General error
1311  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1312  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1313  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1314  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1315  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1316  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1317  *
1318  * @see #stc_restriction_rule_h
1319  * @see #stc_iface_type_e
1320  * @see stc_restriction_rule_create()
1321  * @see stc_restriction_rule_destroy()
1322  * @see stc_restriction_rule_set_iface_name()
1323  */
1324 int stc_restriction_rule_get_iface_name(stc_restriction_rule_h rule,
1325                 char **iface_name);
1326
1327 /**
1328  * @brief Gets the interface type for restriction rule.
1329  * @since_tizen 4.0
1330  * @privlevel platform
1331  * @privilege %http://tizen.org/privilege/network.get
1332  *
1333  * @param[in] rule The restriction rule handle
1334  * @param[out] iface_type The interface type
1335  *
1336  * @return 0 on success, otherwise a negative error value
1337  * @retval #STC_ERROR_NONE Successful
1338  * @retval #STC_ERROR_OPERATION_FAILED General error
1339  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1340  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1341  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1342  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1343  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1344  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1345  *
1346  * @see #stc_restriction_rule_h
1347  * @see #stc_iface_type_e
1348  * @see stc_restriction_rule_create()
1349  * @see stc_restriction_rule_destroy()
1350  * @see stc_restriction_rule_set_iface_type()
1351  */
1352 int stc_restriction_rule_get_iface_type(stc_restriction_rule_h rule,
1353                 stc_iface_type_e *iface_type);
1354
1355 /**
1356  * @brief Gets the type for restriction rule.
1357  * @since_tizen 5.0
1358  * @privlevel platform
1359  * @privilege %http://tizen.org/privilege/network.get
1360  *
1361  * @param[in] rule The restriction rule handle
1362  * @param[out] type The restriction type
1363  *
1364  * @return 0 on success, otherwise a negative error value
1365  * @retval #STC_ERROR_NONE Successful
1366  * @retval #STC_ERROR_OPERATION_FAILED General error
1367  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1368  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1369  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1370  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1371  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1372  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1373  *
1374  * @see #stc_restriction_rule_h
1375  * @see #stc_restriction_type_e
1376  * @see stc_restriction_rule_create()
1377  * @see stc_restriction_rule_destroy()
1378  * @see stc_restriction_rule_set_type()
1379  */
1380 int stc_restriction_rule_get_type(stc_restriction_rule_h rule,
1381                 stc_restriction_type_e *type);
1382
1383 /**
1384  * @brief Gets the limit for restriction rule.
1385  * @since_tizen 4.0
1386  * @privlevel platform
1387  * @privilege %http://tizen.org/privilege/network.get
1388  *
1389  * @param[in] rule The restriction rule handle
1390  * @param[out] data_limit The data limit
1391  *
1392  * @return 0 on success, otherwise a negative error value
1393  * @retval #STC_ERROR_NONE Successful
1394  * @retval #STC_ERROR_OPERATION_FAILED General error
1395  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1396  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1397  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1398  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1399  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1400  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1401  *
1402  * @see #stc_restriction_rule_h
1403  * @see stc_restriction_rule_create()
1404  * @see stc_restriction_rule_destroy()
1405  * @see stc_restriction_rule_set_limit()
1406  */
1407 int stc_restriction_rule_get_limit(stc_restriction_rule_h rule,
1408                                    int64_t *data_limit);
1409
1410 /**
1411  * @brief Gets the warning limit for restriction rule.
1412  * @since_tizen 4.0
1413  * @privlevel platform
1414  * @privilege %http://tizen.org/privilege/network.get
1415  *
1416  * @param[in] rule The restriction rule handle
1417  * @param[out] data_warn_limit The data warning limit
1418  *
1419  * @return 0 on success, otherwise a negative error value
1420  * @retval #STC_ERROR_NONE Successful
1421  * @retval #STC_ERROR_OPERATION_FAILED General error
1422  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1423  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1424  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1425  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1426  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1427  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1428  *
1429  * @see #stc_restriction_rule_h
1430  * @see stc_restriction_rule_create()
1431  * @see stc_restriction_rule_destroy()
1432  * @see stc_restriction_rule_set_warning_limit()
1433  */
1434 int stc_restriction_rule_get_warning_limit(stc_restriction_rule_h rule,
1435                                            int64_t *data_warn_limit);
1436
1437 /**
1438  * @brief Gets the montlhy data limit for restriction rule.
1439  * @since_tizen 5.0
1440  * @privlevel platform
1441  * @privilege %http://tizen.org/privilege/network.get
1442  *
1443  * @param[in] rule The restriction rule handle
1444  * @param[out] limit The data limit
1445  *
1446  * @return 0 on success, otherwise a negative error value
1447  * @retval #STC_ERROR_NONE Successful
1448  * @retval #STC_ERROR_OPERATION_FAILED General error
1449  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1450  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1451  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1452  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1453  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1454  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1455  *
1456  * @see #stc_restriction_rule_h
1457  * @see stc_restriction_rule_create()
1458  * @see stc_restriction_rule_destroy()
1459  * @see stc_restriction_rule_set_monthly_limit()
1460  */
1461 int stc_restriction_rule_get_monthly_limit(stc_restriction_rule_h rule,
1462                                            int64_t *limit);
1463
1464 /**
1465  * @brief Gets the weekly data limit for restriction rule.
1466  * @since_tizen 5.0
1467  * @privlevel platform
1468  * @privilege %http://tizen.org/privilege/network.get
1469  *
1470  * @param[in] rule The restriction rule handle
1471  * @param[out] limit The data limit
1472  *
1473  * @return 0 on success, otherwise a negative error value
1474  * @retval #STC_ERROR_NONE Successful
1475  * @retval #STC_ERROR_OPERATION_FAILED General error
1476  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1477  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1478  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1479  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1480  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1481  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1482  *
1483  * @see #stc_restriction_rule_h
1484  * @see stc_restriction_rule_create()
1485  * @see stc_restriction_rule_destroy()
1486  * @see stc_restriction_rule_set_weekly_limit()
1487  */
1488 int stc_restriction_rule_get_weekly_limit(stc_restriction_rule_h rule,
1489                                           int64_t *limit);
1490
1491 /**
1492  * @brief Gets the daily data limit for restriction rule.
1493  * @since_tizen 5.0
1494  * @privlevel platform
1495  * @privilege %http://tizen.org/privilege/network.get
1496  *
1497  * @param[in] rule The restriction rule handle
1498  * @param[out] limit The data limit
1499  *
1500  * @return 0 on success, otherwise a negative error value
1501  * @retval #STC_ERROR_NONE Successful
1502  * @retval #STC_ERROR_OPERATION_FAILED General error
1503  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1504  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1505  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1506  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1507  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1508  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1509  *
1510  * @see #stc_restriction_rule_h
1511  * @see stc_restriction_rule_create()
1512  * @see stc_restriction_rule_destroy()
1513  * @see stc_restriction_rule_set_daily_limit()
1514  */
1515 int stc_restriction_rule_get_daily_limit(stc_restriction_rule_h rule,
1516                                          int64_t *limit);
1517
1518 /**
1519  * @brief Gets the month start date for restriction rule.
1520  * @since_tizen 5.0
1521  * @privlevel platform
1522  * @privilege %http://tizen.org/privilege/network.get
1523  *
1524  * @param[in] rule The restriction rule handle
1525  * @param[out] month_start_date The month start date
1526  *
1527  * @return 0 on success, otherwise a negative error value
1528  * @retval #STC_ERROR_NONE Successful
1529  * @retval #STC_ERROR_OPERATION_FAILED General error
1530  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1531  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1532  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1533  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1534  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1535  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1536  *
1537  * @see #stc_restriction_rule_h
1538  * @see stc_restriction_rule_create()
1539  * @see stc_restriction_rule_destroy()
1540  * @see stc_restriction_rule_set_month_start_date()
1541  */
1542 int stc_restriction_rule_get_month_start_date(stc_restriction_rule_h rule,
1543                                               int *month_start_date);
1544
1545 /**
1546  * @brief Gets the roaming type for restriction rule.
1547  * @since_tizen 4.0
1548  * @privlevel platform
1549  * @privilege %http://tizen.org/privilege/network.get
1550  *
1551  * @param[in] rule The restriction rule handle
1552  * @param[out] roaming The roaming type
1553  *
1554  * @return 0 on success, otherwise a negative error value
1555  * @retval #STC_ERROR_NONE Successful
1556  * @retval #STC_ERROR_OPERATION_FAILED General error
1557  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1558  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1559  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1560  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1561  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1562  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1563  *
1564  * @see #stc_restriction_rule_h
1565  * @see #stc_roaming_type_e
1566  * @see stc_restriction_rule_create()
1567  * @see stc_restriction_rule_destroy()
1568  * @see stc_restriction_rule_set_roaming_type()
1569  */
1570 int stc_restriction_rule_get_roaming_type(stc_restriction_rule_h rule,
1571                 stc_roaming_type_e *roaming_type);
1572
1573 /**
1574  * @brief Gets the subscriber ID for restriction rule.
1575  * @since_tizen 4.0
1576  * @privlevel platform
1577  * @privilege %http://tizen.org/privilege/network.get
1578  *
1579  * @param[in] rule The restriction rule handle
1580  * @param[out] subscriber_id The subscriber ID
1581  *
1582  * @return 0 on success, otherwise a negative error value
1583  * @retval #STC_ERROR_NONE Successful
1584  * @retval #STC_ERROR_OPERATION_FAILED General error
1585  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1586  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1587  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1588  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1589  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1590  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1591  *
1592  * @see #stc_restriction_rule_h
1593  * @see stc_restriction_rule_create()
1594  * @see stc_restriction_rule_destroy()
1595  * @see stc_restriction_rule_set_subscriber_id()
1596  */
1597 int stc_restriction_rule_get_subscriber_id(stc_restriction_rule_h rule, char **subscriber_id);
1598
1599 /**
1600  * @brief Gets the subscriber ID from statistics information.
1601  * @since_tizen 4.0
1602  * @remarks You must release @a subscriber ID using free().
1603  *
1604  * @param[in] info The statistics information handle
1605  * @param[out] subscriber_id The subscriber ID
1606  *
1607  * @return 0 on success, otherwise a negative error value
1608  * @retval #STC_ERROR_NONE                    Successful
1609  * @retval #STC_ERROR_OPERATION_FAILED        General error
1610  * @retval #STC_ERROR_OUT_OF_MEMORY           Out of memory
1611  * @retval #STC_ERROR_INVALID_PARAMETER       Invalid parameter
1612  * @retval #STC_ERROR_INVALID_OPERATION       Invalid operation
1613  * @retval #STC_ERROR_NOT_INITIALIZED         Not initialized
1614  * @retval #STC_ERROR_NOT_SUPPORTED           Not supported
1615  * @retval #STC_ERROR_PERMISSION_DENIED       Permission denied
1616  *
1617  * @see stc_stats_info_h
1618  * @see stc_stats_info_cb()
1619  */
1620 int stc_stats_info_get_subscriber_id(stc_stats_info_h info, char **subscriber_id);
1621
1622 /**
1623 * @}
1624 */
1625
1626 /**
1627  * @addtogroup CAPI_NETWORK_STC_FIREWALL_MODULE
1628  * @{
1629  */
1630
1631 /**
1632  * @brief Locks the firewall.
1633  * @since_tizen 5.0
1634  * @privlevel platform
1635  * @privilege %http://tizen.org/privilege/firewall.admin
1636  *
1637  * @param[in] stc        The stc handle
1638  *
1639  * @return 0 on success, otherwise a negative error value
1640  * @retval #STC_ERROR_NONE Successful
1641  * @retval #STC_ERROR_OPERATION_FAILED General error
1642  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1643  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1644  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1645  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1646  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1647  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1648  *
1649  * @see #stc_h
1650  * @see stc_initialize()
1651  * @see stc_firewall_unlock()
1652  * @see stc_firewall_get_lock()
1653  */
1654 int stc_firewall_lock(stc_h stc);
1655
1656 /**
1657  * @brief Unlocks the firewall.
1658  * @since_tizen 5.0
1659  * @privlevel platform
1660  * @privilege %http://tizen.org/privilege/firewall.admin
1661  *
1662  * @param[in] stc        The stc handle
1663  *
1664  * @return 0 on success, otherwise a negative error value
1665  * @retval #STC_ERROR_NONE Successful
1666  * @retval #STC_ERROR_OPERATION_FAILED General error
1667  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1668  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1669  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1670  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1671  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1672  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1673  *
1674  * @see #stc_h
1675  * @see stc_initialize()
1676  * @see stc_firewall_lock()
1677  * @see stc_firewall_get_lock()
1678  */
1679 int stc_firewall_unlock(stc_h stc);
1680
1681 /**
1682  * @brief Gets the firewall lock state.
1683  * @since_tizen 5.0
1684  * @privlevel platform
1685  * @privilege %http://tizen.org/privilege/firewall.admin
1686  *
1687  * @param[in] stc        The stc handle
1688  * @param[out] state     The firewall lock state
1689  *
1690  * @return 0 on success, otherwise a negative error value
1691  * @retval #STC_ERROR_NONE Successful
1692  * @retval #STC_ERROR_OPERATION_FAILED General error
1693  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1694  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1695  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1696  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1697  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1698  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1699  *
1700  * @see #stc_h
1701  * @see stc_initialize()
1702  * @see stc_firewall_lock()
1703  * @see stc_firewall_unlock()
1704  */
1705 int stc_firewall_get_lock(stc_h stc, stc_firewall_lock_e *state);
1706
1707 /**
1708  * @brief Creates the firewall chain handle.
1709  * @since_tizen 5.0
1710  * @remarks You must release @a handle using stc_firewall_chain_destroy().
1711  *
1712  * @param[in] stc        The stc handle
1713  * @param[in] name       The chain name
1714  * @param[out] chain     The firewall chain handle
1715  *
1716  * @return 0 on success, otherwise a negative error value
1717  * @retval #STC_ERROR_NONE Successful
1718  * @retval #STC_ERROR_OPERATION_FAILED General error
1719  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1720  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1721  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1722  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1723  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1724  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1725  *
1726  * @see #stc_h
1727  * @see #stc_firewall_chain_h
1728  * @see stc_initialize()
1729  * @see stc_firewall_chain_destroy()
1730  */
1731 int stc_firewall_chain_create(stc_h stc, const char *name,
1732                                 stc_firewall_chain_h *chain_h);
1733
1734 /**
1735  * @brief Clones the firewall chain handle.
1736  * @since_tizen 5.0
1737  * @remarks You must release @a handle using stc_firewall_chain_destroy().
1738  *
1739  * @param[in] origin        The origin firewall chain handle
1740  * @param[out] cloned_chain The cloned firewall chain handle
1741  *
1742  * @return 0 on success, otherwise a negative error value
1743  * @retval #STC_ERROR_NONE Successful
1744  * @retval #STC_ERROR_OPERATION_FAILED General error
1745  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1746  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1747  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1748  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1749  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1750  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1751  *
1752  * @see #stc_h
1753  * @see #stc_firewall_chain_h
1754  * @see stc_initialize()
1755  * @see stc_firewall_chain_create()
1756  * @see stc_firewall_chain_destroy()
1757  */
1758 int stc_firewall_chain_clone(stc_firewall_chain_h origin_h,
1759                         stc_firewall_chain_h *cloned_chain_h);
1760
1761 /**
1762  * @brief Destroys the firewall chain handle.
1763  * @since_tizen 5.0
1764  *
1765  * @param[in] chain      The firewall chain handle
1766  *
1767  * @return 0 on success, otherwise a negative error value
1768  * @retval #STC_ERROR_NONE Successful
1769  * @retval #STC_ERROR_OPERATION_FAILED General error
1770  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1771  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1772  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1773  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1774  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1775  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1776  *
1777  * @see #stc_firewall_chain_h
1778  * @see stc_firewall_chain_create()
1779  */
1780 int stc_firewall_chain_destroy(stc_firewall_chain_h chain_h);
1781
1782 /**
1783  * @brief Gets the name for chain.
1784  * @since_tizen 5.0
1785  *
1786  * @param[in] chain      The firewall chain handle
1787  * @param[out] name      The chain name
1788  *
1789  * @return 0 on success, otherwise a negative error value
1790  * @retval #STC_ERROR_NONE Successful
1791  * @retval #STC_ERROR_OPERATION_FAILED General error
1792  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1793  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1794  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1795  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1796  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1797  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1798  *
1799  * @see #stc_firewall_chain_h
1800  * @see stc_firewall_chain_create()
1801  * @see stc_firewall_chain_destroy()
1802  */
1803 int stc_firewall_chain_get_name(stc_firewall_chain_h chain, char **name);
1804
1805 /**
1806  * @brief Gets the target type for chain.
1807  * @since_tizen 5.0
1808  *
1809  * @param[in] chain      The firewall chain handle
1810  * @param[out] target    The target type
1811  *
1812  * @return 0 on success, otherwise a negative error value
1813  * @retval #STC_ERROR_NONE Successful
1814  * @retval #STC_ERROR_OPERATION_FAILED General error
1815  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1816  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1817  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1818  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1819  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1820  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1821  *
1822  * @see #stc_firewall_chain_h
1823  * @see stc_firewall_chain_create()
1824  * @see stc_firewall_chain_destroy()
1825  */
1826 int stc_firewall_chain_get_target(stc_firewall_chain_h chain_h,
1827                         stc_firewall_chain_target_e *target);
1828
1829 /**
1830  * @brief Gets the priority for chain.
1831  * @since_tizen 5.0
1832  *
1833  * @param[in] chain      The firewall chain handle
1834  * @param[out] priority  The priority
1835  *
1836  * @return 0 on success, otherwise a negative error value
1837  * @retval #STC_ERROR_NONE Successful
1838  * @retval #STC_ERROR_OPERATION_FAILED General error
1839  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1840  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1841  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1842  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1843  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1844  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1845  *
1846  * @see #stc_firewall_chain_h
1847  * @see stc_firewall_chain_create()
1848  * @see stc_firewall_chain_destroy()
1849  */
1850 int stc_firewall_chain_get_priority(stc_firewall_chain_h chain_h,
1851                         unsigned int *priority);
1852
1853 /**
1854  * @brief Adds the chain.
1855  * @since_tizen 5.0
1856  * @privlevel platform
1857  * @privilege %http://tizen.org/privilege/firewall.common
1858  *
1859  * @param[in] chain      The firewall chain handle
1860  *
1861  * @return 0 on success, otherwise a negative error value
1862  * @retval #STC_ERROR_NONE Successful
1863  * @retval #STC_ERROR_OPERATION_FAILED General error
1864  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1865  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1866  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1867  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1868  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1869  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1870  *
1871  * @see #stc_firewall_chain_h
1872  * @see stc_firewall_chain_create()
1873  * @see stc_firewall_chain_destroy()
1874  */
1875 int stc_firewall_chain_add(stc_firewall_chain_h chain_h);
1876
1877 /**
1878  * @brief Removes the chain.
1879  * @since_tizen 5.0
1880  * @privlevel platform
1881  * @privilege %http://tizen.org/privilege/firewall.common
1882  *
1883  * @param[in] chain      The firewall chain handle
1884  *
1885  * @return 0 on success, otherwise a negative error value
1886  * @retval #STC_ERROR_NONE Successful
1887  * @retval #STC_ERROR_OPERATION_FAILED General error
1888  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1889  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1890  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1891  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1892  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1893  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1894  *
1895  * @see #stc_firewall_chain_h
1896  * @see stc_firewall_chain_create()
1897  * @see stc_firewall_chain_destroy()
1898  */
1899 int stc_firewall_chain_remove(stc_firewall_chain_h chain_h);
1900
1901 /**
1902  * @brief Flushs the chain.
1903  * @since_tizen 5.0
1904  * @privlevel platform
1905  * @privilege %http://tizen.org/privilege/firewall.common
1906  *
1907  * @param[in] chain      The firewall chain handle
1908  *
1909  * @return 0 on success, otherwise a negative error value
1910  * @retval #STC_ERROR_NONE Successful
1911  * @retval #STC_ERROR_OPERATION_FAILED General error
1912  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1913  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1914  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1915  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1916  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1917  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1918  *
1919  * @see #stc_firewall_chain_h
1920  * @see stc_firewall_chain_create()
1921  * @see stc_firewall_chain_destroy()
1922  */
1923 int stc_firewall_chain_flush(stc_firewall_chain_h chain_h);
1924
1925 /**
1926  * @brief Gets all chains.
1927  * @since_tizen 5.0
1928  * @privlevel platform
1929  * @privilege %http://tizen.org/privilege/firewall.common
1930  *
1931  * @param[in] stc        The stc handle
1932  * @param[in] callback   The callback to be called
1933  * @param[in] user_data  The user data passed to the callback function
1934  *
1935  * @return 0 on success, otherwise a negative error value
1936  * @retval #STC_ERROR_NONE Successful
1937  * @retval #STC_ERROR_OPERATION_FAILED General error
1938  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1939  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1940  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1941  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1942  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1943  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1944  *
1945  * @see #stc_firewall_chain_h
1946  * @see stc_firewall_chain_create()
1947  * @see stc_firewall_chain_destroy()
1948  */
1949 int stc_firewall_chain_foreach(stc_h stc,
1950                         stc_firewall_chain_info_cb callback, void *user_data);
1951
1952 /**
1953  * @brief Sets the chain to target.
1954  * @since_tizen 5.0
1955  * @privlevel platform
1956  * @privilege %http://tizen.org/privilege/firewall.common
1957  * @remarks You should set only one chain.
1958  *
1959  * @param[in] chain      The firewall chain handle
1960  * @param[in] target     The target type
1961  *
1962  * @return 0 on success, otherwise a negative error value
1963  * @retval #STC_ERROR_NONE Successful
1964  * @retval #STC_ERROR_OPERATION_FAILED General error
1965  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1966  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1967  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1968  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1969  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1970  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1971  *
1972  * @see #stc_firewall_chain_h
1973  * @see stc_firewall_chain_create()
1974  * @see stc_firewall_chain_destroy()
1975  */
1976 int stc_firewall_chain_set(stc_firewall_chain_h chain_h,
1977                         stc_firewall_chain_target_e target);
1978
1979 /**
1980  * @brief Unsets the chain.
1981  * @since_tizen 5.0
1982  * @privlevel platform
1983  * @privilege %http://tizen.org/privilege/firewall.common
1984  *
1985  * @param[in] chain      The firewall chain handle
1986  *
1987  * @return 0 on success, otherwise a negative error value
1988  * @retval #STC_ERROR_NONE Successful
1989  * @retval #STC_ERROR_OPERATION_FAILED General error
1990  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
1991  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
1992  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
1993  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
1994  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
1995  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
1996  *
1997  * @see #stc_firewall_chain_h
1998  * @see stc_firewall_chain_create()
1999  * @see stc_firewall_chain_destroy()
2000  */
2001 int stc_firewall_chain_unset(stc_firewall_chain_h chain_h);
2002
2003 /**
2004  * @brief Creates the firewall rule handle.
2005  * @since_tizen 5.0
2006  * @remarks You must release @a handle using stc_firewall_rule_destroy().
2007  *
2008  * @param[in] stc        The stc handle
2009  * @param[out] rule      The firewall rule handle
2010  *
2011  * @return 0 on success, otherwise a negative error value
2012  * @retval #STC_ERROR_NONE Successful
2013  * @retval #STC_ERROR_OPERATION_FAILED General error
2014  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2015  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2016  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2017  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2018  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2019  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2020  *
2021  * @see #stc_h
2022  * @see #stc_firewall_rule_h
2023  * @see stc_initialize()
2024  * @see stc_firewall_rule_destroy()
2025  */
2026 int stc_firewall_rule_create(stc_h stc, stc_firewall_rule_h *rule_h);
2027
2028 /**
2029  * @brief Clones the firewall rule handle.
2030  * @since_tizen 5.0
2031  * @remarks You must release @a handle using stc_firewall_rule_destroy().
2032  *
2033  * @param[in] origin        The origin firewall rule handle
2034  * @param[out] cloned_rule  The cloned firewall rule handle
2035  *
2036  * @return 0 on success, otherwise a negative error value
2037  * @retval #STC_ERROR_NONE Successful
2038  * @retval #STC_ERROR_OPERATION_FAILED General error
2039  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2040  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2041  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2042  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2043  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2044  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2045  *
2046  * @see #stc_h
2047  * @see #stc_firewall_rule_h
2048  * @see stc_initialize()
2049  * @see stc_firewall_rule_create()
2050  * @see stc_firewall_rule_destroy()
2051  */
2052 int stc_firewall_rule_clone(stc_firewall_rule_h origin_h,
2053                         stc_firewall_rule_h *cloned_rule_h);
2054
2055 /**
2056  * @brief Destroys the firewall rule handle.
2057  * @since_tizen 5.0
2058  *
2059  * @param[in] rule       The firewall chain handle
2060  *
2061  * @return 0 on success, otherwise a negative error value
2062  * @retval #STC_ERROR_NONE Successful
2063  * @retval #STC_ERROR_OPERATION_FAILED General error
2064  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2065  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2066  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2067  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2068  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2069  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2070  *
2071  * @see #stc_firewall_rule_h
2072  * @see stc_firewall_rule_create()
2073  */
2074 int stc_firewall_rule_destroy(stc_firewall_rule_h rule_h);
2075
2076 /**
2077  * @brief Sets the chain name to rule.
2078  * @since_tizen 5.0
2079  *
2080  * @param[in] rule       The firewall rule handle
2081  * @param[in] chain      The chain name
2082  *
2083  * @return 0 on success, otherwise a negative error value
2084  * @retval #STC_ERROR_NONE Successful
2085  * @retval #STC_ERROR_OPERATION_FAILED General error
2086  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2087  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2088  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2089  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2090  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2091  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2092  *
2093  * @see #stc_firewall_rule_h
2094  * @see stc_firewall_rule_create()
2095  * @see stc_firewall_rule_destroy()
2096  * @see stc_firewall_rule_get_chain()
2097  */
2098 int stc_firewall_rule_set_chain(stc_firewall_rule_h rule_h, char *chain);
2099
2100 /**
2101  * @brief Sets the direction to rule.
2102  * @since_tizen 5.0
2103  *
2104  * @param[in] rule       The firewall rule handle
2105  * @param[in] direction  The direction
2106  *
2107  * @return 0 on success, otherwise a negative error value
2108  * @retval #STC_ERROR_NONE Successful
2109  * @retval #STC_ERROR_OPERATION_FAILED General error
2110  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2111  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2112  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2113  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2114  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2115  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2116  *
2117  * @see #stc_firewall_rule_h
2118  * @see stc_firewall_rule_create()
2119  * @see stc_firewall_rule_destroy()
2120  * @see stc_firewall_rule_get_direction()
2121  */
2122 int stc_firewall_rule_set_direction(stc_firewall_rule_h rule_h,
2123                                 stc_firewall_direction_e direction);
2124
2125 /**
2126  * @brief Sets the source IP type to rule.
2127  * @since_tizen 5.0
2128  *
2129  * @param[in] rule       The firewall rule handle
2130  * @param[in] type       The IP type
2131  *
2132  * @return 0 on success, otherwise a negative error value
2133  * @retval #STC_ERROR_NONE Successful
2134  * @retval #STC_ERROR_OPERATION_FAILED General error
2135  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2136  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2137  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2138  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2139  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2140  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2141  *
2142  * @see #stc_firewall_rule_h
2143  * @see stc_firewall_rule_create()
2144  * @see stc_firewall_rule_destroy()
2145  * @see stc_firewall_rule_get_src_ip_type()
2146  */
2147 int stc_firewall_rule_set_src_ip_type(stc_firewall_rule_h rule_h,
2148                                 stc_firewall_ip_type_e type);
2149
2150 /**
2151  * @brief Sets the destination IP type to rule.
2152  * @since_tizen 5.0
2153  *
2154  * @param[in] rule       The firewall rule handle
2155  * @param[in] type       The IP type
2156  *
2157  * @return 0 on success, otherwise a negative error value
2158  * @retval #STC_ERROR_NONE Successful
2159  * @retval #STC_ERROR_OPERATION_FAILED General error
2160  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2161  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2162  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2163  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2164  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2165  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2166  *
2167  * @see #stc_firewall_rule_h
2168  * @see stc_firewall_rule_create()
2169  * @see stc_firewall_rule_destroy()
2170  * @see stc_firewall_rule_get_dst_ip_type()
2171  */
2172 int stc_firewall_rule_set_dst_ip_type(stc_firewall_rule_h rule_h,
2173                                 stc_firewall_ip_type_e type);
2174
2175 /**
2176  * @brief Sets the source port type to rule.
2177  * @since_tizen 5.0
2178  *
2179  * @param[in] rule       The firewall rule handle
2180  * @param[in] type       The port type
2181  *
2182  * @return 0 on success, otherwise a negative error value
2183  * @retval #STC_ERROR_NONE Successful
2184  * @retval #STC_ERROR_OPERATION_FAILED General error
2185  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2186  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2187  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2188  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2189  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2190  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2191  *
2192  * @see #stc_firewall_rule_h
2193  * @see stc_firewall_rule_create()
2194  * @see stc_firewall_rule_destroy()
2195  * @see stc_firewall_rule_get_src_port_type()
2196  */
2197 int stc_firewall_rule_set_src_port_type(stc_firewall_rule_h rule_h,
2198                                 stc_firewall_port_type_e type);
2199
2200 /**
2201  * @brief Sets the destination port type to rule.
2202  * @since_tizen 5.0
2203  *
2204  * @param[in] rule       The firewall rule handle
2205  * @param[in] type       The port type
2206  *
2207  * @return 0 on success, otherwise a negative error value
2208  * @retval #STC_ERROR_NONE Successful
2209  * @retval #STC_ERROR_OPERATION_FAILED General error
2210  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2211  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2212  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2213  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2214  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2215  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2216  *
2217  * @see #stc_firewall_rule_h
2218  * @see stc_firewall_rule_create()
2219  * @see stc_firewall_rule_destroy()
2220  * @see stc_firewall_rule_get_dst_port_type()
2221  */
2222 int stc_firewall_rule_set_dst_port_type(stc_firewall_rule_h rule_h,
2223                                 stc_firewall_port_type_e type);
2224
2225 /**
2226  * @brief Sets the protocol type to rule.
2227  * @since_tizen 5.0
2228  *
2229  * @param[in] rule       The firewall rule handle
2230  * @param[in] type       The protocol type
2231  *
2232  * @return 0 on success, otherwise a negative error value
2233  * @retval #STC_ERROR_NONE Successful
2234  * @retval #STC_ERROR_OPERATION_FAILED General error
2235  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2236  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2237  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2238  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2239  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2240  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2241  *
2242  * @see #stc_firewall_rule_h
2243  * @see stc_firewall_rule_create()
2244  * @see stc_firewall_rule_destroy()
2245  * @see stc_firewall_rule_get_protocol_type()
2246  */
2247 int stc_firewall_rule_set_protocol_type(stc_firewall_rule_h rule_h,
2248                                 stc_firewall_protocol_type_e type);
2249
2250 /**
2251  * @brief Sets the address family type to rule.
2252  * @since_tizen 5.0
2253  *
2254  * @param[in] rule       The firewall rule handle
2255  * @param[in] type       The address family type
2256  *
2257  * @return 0 on success, otherwise a negative error value
2258  * @retval #STC_ERROR_NONE Successful
2259  * @retval #STC_ERROR_OPERATION_FAILED General error
2260  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2261  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2262  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2263  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2264  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2265  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2266  *
2267  * @see #stc_firewall_rule_h
2268  * @see stc_firewall_rule_create()
2269  * @see stc_firewall_rule_destroy()
2270  * @see stc_firewall_rule_get_family_type()
2271  */
2272 int stc_firewall_rule_set_family_type(stc_firewall_rule_h rule_h,
2273                                 stc_firewall_family_type_e type);
2274
2275 /**
2276  * @brief Sets source IP addresses to rule.
2277  * @since_tizen 5.0
2278  *
2279  * @param[in] rule       The firewall rule handle
2280  * @param[in] ip1        The address 1
2281  * @param[in] ip2        The address 2 which will be IP address or mask
2282  *
2283  * @return 0 on success, otherwise a negative error value
2284  * @retval #STC_ERROR_NONE Successful
2285  * @retval #STC_ERROR_OPERATION_FAILED General error
2286  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2287  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2288  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2289  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2290  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2291  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2292  *
2293  * @see #stc_firewall_rule_h
2294  * @see stc_firewall_rule_create()
2295  * @see stc_firewall_rule_destroy()
2296  * @see stc_firewall_rule_set_src_ip_type()
2297  * @see stc_firewall_rule_get_src_ip()
2298  */
2299 int stc_firewall_rule_set_src_ip(stc_firewall_rule_h rule_h,
2300                         char *ip1, char *ip2);
2301
2302 /**
2303  * @brief Sets destination IP addresses to rule.
2304  * @since_tizen 5.0
2305  *
2306  * @param[in] rule       The firewall rule handle
2307  * @param[in] ip1        The address 1
2308  * @param[in] ip2        The address 2 which will be IP address or mask
2309  *
2310  * @return 0 on success, otherwise a negative error value
2311  * @retval #STC_ERROR_NONE Successful
2312  * @retval #STC_ERROR_OPERATION_FAILED General error
2313  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2314  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2315  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2316  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2317  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2318  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2319  *
2320  * @see #stc_firewall_rule_h
2321  * @see stc_firewall_rule_create()
2322  * @see stc_firewall_rule_destroy()
2323  * @see stc_firewall_rule_set_dst_ip_type()
2324  * @see stc_firewall_rule_get_dst_ip()
2325  */
2326 int stc_firewall_rule_set_dst_ip(stc_firewall_rule_h rule_h,
2327                         char *ip1, char *ip2);
2328
2329 /**
2330  * @brief Sets source ports to rule.
2331  * @since_tizen 5.0
2332  *
2333  * @param[in] rule       The firewall rule handle
2334  * @param[in] port1      The port 1
2335  * @param[in] port2      The port 2
2336  *
2337  * @return 0 on success, otherwise a negative error value
2338  * @retval #STC_ERROR_NONE Successful
2339  * @retval #STC_ERROR_OPERATION_FAILED General error
2340  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2341  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2342  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2343  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2344  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2345  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2346  *
2347  * @see #stc_firewall_rule_h
2348  * @see stc_firewall_rule_create()
2349  * @see stc_firewall_rule_destroy()
2350  * @see stc_firewall_rule_set_src_port_type()
2351  * @see stc_firewall_rule_get_src_port()
2352  */
2353 int stc_firewall_rule_set_src_port(stc_firewall_rule_h rule_h,
2354                         unsigned int port1, unsigned int port2);
2355
2356 /**
2357  * @brief Sets destination ports to rule.
2358  * @since_tizen 5.0
2359  *
2360  * @param[in] rule       The firewall rule handle
2361  * @param[in] port1      The port 1
2362  * @param[in] port2      The port 2
2363  *
2364  * @return 0 on success, otherwise a negative error value
2365  * @retval #STC_ERROR_NONE Successful
2366  * @retval #STC_ERROR_OPERATION_FAILED General error
2367  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2368  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2369  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2370  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2371  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2372  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2373  *
2374  * @see #stc_firewall_rule_h
2375  * @see stc_firewall_rule_create()
2376  * @see stc_firewall_rule_destroy()
2377  * @see stc_firewall_rule_set_dst_port_type()
2378  * @see stc_firewall_rule_get_dst_port()
2379  */
2380 int stc_firewall_rule_set_dst_port(stc_firewall_rule_h rule_h,
2381                         unsigned int port1, unsigned int port2);
2382
2383 /**
2384  * @brief Sets interface name to rule.
2385  * @since_tizen 5.0
2386  *
2387  * @param[in] rule       The firewall rule handle
2388  * @param[in] ifname     The interface name
2389  *
2390  * @return 0 on success, otherwise a negative error value
2391  * @retval #STC_ERROR_NONE Successful
2392  * @retval #STC_ERROR_OPERATION_FAILED General error
2393  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2394  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2395  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2396  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2397  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2398  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2399  *
2400  * @see #stc_firewall_rule_h
2401  * @see stc_firewall_rule_create()
2402  * @see stc_firewall_rule_destroy()
2403  * @see stc_firewall_rule_get_ifname()
2404  */
2405 int stc_firewall_rule_set_ifname(stc_firewall_rule_h rule_h, char *ifname);
2406
2407 /**
2408  * @brief Sets target type to rule.
2409  * @since_tizen 5.0
2410  *
2411  * @param[in] rule       The firewall rule handle
2412  * @param[in] target     The target type
2413  *
2414  * @return 0 on success, otherwise a negative error value
2415  * @retval #STC_ERROR_NONE Successful
2416  * @retval #STC_ERROR_OPERATION_FAILED General error
2417  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2418  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2419  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2420  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2421  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2422  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2423  *
2424  * @see #stc_firewall_rule_h
2425  * @see stc_firewall_rule_create()
2426  * @see stc_firewall_rule_destroy()
2427  * @see stc_firewall_rule_get_target()
2428  */
2429 int stc_firewall_rule_set_target(stc_firewall_rule_h rule_h,
2430                         stc_firewall_rule_target_e target);
2431
2432 /**
2433  * @brief Sets log level to rule.
2434  * @since_tizen 5.0
2435  *
2436  * @param[in] rule       The firewall rule handle
2437  * @param[in] level      The level
2438  *
2439  * @return 0 on success, otherwise a negative error value
2440  * @retval #STC_ERROR_NONE Successful
2441  * @retval #STC_ERROR_OPERATION_FAILED General error
2442  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2443  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2444  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2445  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2446  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2447  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2448  *
2449  * @see #stc_firewall_rule_h
2450  * @see stc_firewall_rule_create()
2451  * @see stc_firewall_rule_destroy()
2452  * @see stc_firewall_rule_get_log_level()
2453  */
2454 int stc_firewall_rule_set_log_level(stc_firewall_rule_h rule_h,
2455                         unsigned char level);
2456
2457 /**
2458  * @brief Sets log prefix to rule.
2459  * @since_tizen 5.0
2460  *
2461  * @param[in] rule       The firewall rule handle
2462  * @param[in] prefix     The prefix
2463  *
2464  * @return 0 on success, otherwise a negative error value
2465  * @retval #STC_ERROR_NONE Successful
2466  * @retval #STC_ERROR_OPERATION_FAILED General error
2467  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2468  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2469  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2470  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2471  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2472  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2473  *
2474  * @see #stc_firewall_rule_h
2475  * @see stc_firewall_rule_create()
2476  * @see stc_firewall_rule_destroy()
2477  * @see stc_firewall_rule_get_log_prefix()
2478  */
2479 int stc_firewall_rule_set_log_prefix(stc_firewall_rule_h rule_h,
2480                         char *prefix);
2481
2482 /**
2483  * @brief Sets nflog group to rule.
2484  * @since_tizen 5.0
2485  *
2486  * @param[in] rule       The firewall rule handle
2487  * @param[in] group      The group
2488  *
2489  * @return 0 on success, otherwise a negative error value
2490  * @retval #STC_ERROR_NONE Successful
2491  * @retval #STC_ERROR_OPERATION_FAILED General error
2492  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2493  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2494  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2495  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2496  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2497  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2498  *
2499  * @see #stc_firewall_rule_h
2500  * @see stc_firewall_rule_create()
2501  * @see stc_firewall_rule_destroy()
2502  * @see stc_firewall_rule_get_nflog_group()
2503  */
2504 int stc_firewall_rule_set_nflog_group(stc_firewall_rule_h rule_h,
2505                         unsigned int group);
2506
2507 /**
2508  * @brief Sets nflog prefix to rule.
2509  * @since_tizen 5.0
2510  *
2511  * @param[in] rule       The firewall rule handle
2512  * @param[in] prefix     The prefix
2513  *
2514  * @return 0 on success, otherwise a negative error value
2515  * @retval #STC_ERROR_NONE Successful
2516  * @retval #STC_ERROR_OPERATION_FAILED General error
2517  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2518  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2519  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2520  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2521  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2522  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2523  *
2524  * @see #stc_firewall_rule_h
2525  * @see stc_firewall_rule_create()
2526  * @see stc_firewall_rule_destroy()
2527  * @see stc_firewall_rule_get_nflog_prefix()
2528  */
2529 int stc_firewall_rule_set_nflog_prefix(stc_firewall_rule_h rule_h,
2530                         char *prefix);
2531
2532 /**
2533  * @brief Sets nflog range to rule.
2534  * @since_tizen 5.0
2535  *
2536  * @param[in] rule       The firewall rule handle
2537  * @param[in] range      The range
2538  *
2539  * @return 0 on success, otherwise a negative error value
2540  * @retval #STC_ERROR_NONE Successful
2541  * @retval #STC_ERROR_OPERATION_FAILED General error
2542  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2543  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2544  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2545  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2546  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2547  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2548  *
2549  * @see #stc_firewall_rule_h
2550  * @see stc_firewall_rule_create()
2551  * @see stc_firewall_rule_destroy()
2552  * @see stc_firewall_rule_get_nflog_range()
2553  */
2554 int stc_firewall_rule_set_nflog_range(stc_firewall_rule_h rule_h,
2555                         unsigned int range);
2556
2557 /**
2558  * @brief Sets nflog threshold to rule.
2559  * @since_tizen 5.0
2560  *
2561  * @param[in] rule       The firewall rule handle
2562  * @param[in] threshold  The threshold
2563  *
2564  * @return 0 on success, otherwise a negative error value
2565  * @retval #STC_ERROR_NONE Successful
2566  * @retval #STC_ERROR_OPERATION_FAILED General error
2567  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2568  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2569  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2570  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2571  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2572  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2573  *
2574  * @see #stc_firewall_rule_h
2575  * @see stc_firewall_rule_create()
2576  * @see stc_firewall_rule_destroy()
2577  * @see stc_firewall_rule_get_nflog_threshold()
2578  */
2579 int stc_firewall_rule_set_nflog_threshold(stc_firewall_rule_h rule_h,
2580                         unsigned int threshold);
2581
2582 /**
2583  * @brief Gets the chain name from rule.
2584  * @since_tizen 5.0
2585  *
2586  * @param[in] rule       The firewall rule handle
2587  * @param[out] chain     The chain name
2588  *
2589  * @return 0 on success, otherwise a negative error value
2590  * @retval #STC_ERROR_NONE Successful
2591  * @retval #STC_ERROR_OPERATION_FAILED General error
2592  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2593  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2594  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2595  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2596  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2597  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2598  *
2599  * @see #stc_firewall_rule_h
2600  * @see stc_firewall_rule_create()
2601  * @see stc_firewall_rule_destroy()
2602  * @see stc_firewall_rule_set_chain()
2603  */
2604 int stc_firewall_rule_get_chain(stc_firewall_rule_h rule_h, char **chain);
2605
2606 /**
2607  * @brief Gets the direction from rule.
2608  * @since_tizen 5.0
2609  *
2610  * @param[in] rule       The firewall rule handle
2611  * @param[out] direction The direction
2612  *
2613  * @return 0 on success, otherwise a negative error value
2614  * @retval #STC_ERROR_NONE Successful
2615  * @retval #STC_ERROR_OPERATION_FAILED General error
2616  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2617  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2618  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2619  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2620  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2621  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2622  *
2623  * @see #stc_firewall_rule_h
2624  * @see stc_firewall_rule_create()
2625  * @see stc_firewall_rule_destroy()
2626  * @see stc_firewall_rule_set_direction()
2627  */
2628 int stc_firewall_rule_get_direction(stc_firewall_rule_h rule_h,
2629                                 stc_firewall_direction_e *direction);
2630
2631 /**
2632  * @brief Gets the source IP type from rule.
2633  * @since_tizen 5.0
2634  *
2635  * @param[in] rule       The firewall rule handle
2636  * @param[out] type      The IP type
2637  *
2638  * @return 0 on success, otherwise a negative error value
2639  * @retval #STC_ERROR_NONE Successful
2640  * @retval #STC_ERROR_OPERATION_FAILED General error
2641  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2642  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2643  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2644  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2645  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2646  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2647  *
2648  * @see #stc_firewall_rule_h
2649  * @see stc_firewall_rule_create()
2650  * @see stc_firewall_rule_destroy()
2651  * @see stc_firewall_rule_set_src_ip_type()
2652  */
2653 int stc_firewall_rule_get_src_ip_type(stc_firewall_rule_h rule_h,
2654                                 stc_firewall_ip_type_e *type);
2655
2656 /**
2657  * @brief Gets the destination IP type from rule.
2658  * @since_tizen 5.0
2659  *
2660  * @param[in] rule       The firewall rule handle
2661  * @param[out] type      The IP type
2662  *
2663  * @return 0 on success, otherwise a negative error value
2664  * @retval #STC_ERROR_NONE Successful
2665  * @retval #STC_ERROR_OPERATION_FAILED General error
2666  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2667  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2668  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2669  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2670  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2671  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2672  *
2673  * @see #stc_firewall_rule_h
2674  * @see stc_firewall_rule_create()
2675  * @see stc_firewall_rule_destroy()
2676  * @see stc_firewall_rule_set_dst_ip_type()
2677  */
2678 int stc_firewall_rule_get_dst_ip_type(stc_firewall_rule_h rule_h,
2679                                 stc_firewall_ip_type_e *type);
2680
2681 /**
2682  * @brief Gets the source port type from rule.
2683  * @since_tizen 5.0
2684  *
2685  * @param[in] rule       The firewall rule handle
2686  * @param[out] type      The port type
2687  *
2688  * @return 0 on success, otherwise a negative error value
2689  * @retval #STC_ERROR_NONE Successful
2690  * @retval #STC_ERROR_OPERATION_FAILED General error
2691  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2692  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2693  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2694  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2695  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2696  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2697  *
2698  * @see #stc_firewall_rule_h
2699  * @see stc_firewall_rule_create()
2700  * @see stc_firewall_rule_destroy()
2701  * @see stc_firewall_rule_set_src_port_type()
2702  */
2703 int stc_firewall_rule_get_src_port_type(stc_firewall_rule_h rule_h,
2704                                 stc_firewall_port_type_e *type);
2705
2706 /**
2707  * @brief Gets the destination port type from rule.
2708  * @since_tizen 5.0
2709  *
2710  * @param[in] rule       The firewall rule handle
2711  * @param[out] type      The port type
2712  *
2713  * @return 0 on success, otherwise a negative error value
2714  * @retval #STC_ERROR_NONE Successful
2715  * @retval #STC_ERROR_OPERATION_FAILED General error
2716  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2717  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2718  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2719  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2720  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2721  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2722  *
2723  * @see #stc_firewall_rule_h
2724  * @see stc_firewall_rule_create()
2725  * @see stc_firewall_rule_destroy()
2726  * @see stc_firewall_rule_set_dst_port_type()
2727  */
2728 int stc_firewall_rule_get_dst_port_type(stc_firewall_rule_h rule_h,
2729                                 stc_firewall_port_type_e *type);
2730
2731 /**
2732  * @brief Gets the protocol type from rule.
2733  * @since_tizen 5.0
2734  *
2735  * @param[in] rule       The firewall rule handle
2736  * @param[out] type      The protocol type
2737  *
2738  * @return 0 on success, otherwise a negative error value
2739  * @retval #STC_ERROR_NONE Successful
2740  * @retval #STC_ERROR_OPERATION_FAILED General error
2741  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2742  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2743  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2744  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2745  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2746  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2747  *
2748  * @see #stc_firewall_rule_h
2749  * @see stc_firewall_rule_create()
2750  * @see stc_firewall_rule_destroy()
2751  * @see stc_firewall_rule_set_protocol_type()
2752  */
2753 int stc_firewall_rule_get_protocol_type(stc_firewall_rule_h rule_h,
2754                                 stc_firewall_protocol_type_e *type);
2755
2756 /**
2757  * @brief Gets the address family type from rule.
2758  * @since_tizen 5.0
2759  *
2760  * @param[in] rule       The firewall rule handle
2761  * @param[out] type      The address family type
2762  *
2763  * @return 0 on success, otherwise a negative error value
2764  * @retval #STC_ERROR_NONE Successful
2765  * @retval #STC_ERROR_OPERATION_FAILED General error
2766  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2767  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2768  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2769  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2770  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2771  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2772  *
2773  * @see #stc_firewall_rule_h
2774  * @see stc_firewall_rule_create()
2775  * @see stc_firewall_rule_destroy()
2776  * @see stc_firewall_rule_set_family_type()
2777  */
2778 int stc_firewall_rule_get_family_type(stc_firewall_rule_h rule_h,
2779                                 stc_firewall_family_type_e *type);
2780
2781 /**
2782  * @brief Gets the source IP addresses from rule.
2783  * @since_tizen 5.0
2784  *
2785  * @param[in] rule       The firewall rule handle
2786  * @param[out] ip1       The address 1
2787  * @param[out] ip2       The address 2 which will be IP address or mask
2788  *
2789  * @return 0 on success, otherwise a negative error value
2790  * @retval #STC_ERROR_NONE Successful
2791  * @retval #STC_ERROR_OPERATION_FAILED General error
2792  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2793  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2794  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2795  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2796  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2797  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2798  *
2799  * @see #stc_firewall_rule_h
2800  * @see stc_firewall_rule_create()
2801  * @see stc_firewall_rule_destroy()
2802  * @see stc_firewall_rule_get_src_ip_type()
2803  * @see stc_firewall_rule_set_src_ip()
2804  */
2805 int stc_firewall_rule_get_src_ip(stc_firewall_rule_h rule_h,
2806                         char **ip1, char **ip2);
2807
2808 /**
2809  * @brief Gets the destination IP addresses from rule.
2810  * @since_tizen 5.0
2811  *
2812  * @param[in] rule       The firewall rule handle
2813  * @param[out] ip1       The address 1
2814  * @param[out] ip2       The address 2 which will be IP address or mask
2815  *
2816  * @return 0 on success, otherwise a negative error value
2817  * @retval #STC_ERROR_NONE Successful
2818  * @retval #STC_ERROR_OPERATION_FAILED General error
2819  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2820  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2821  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2822  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2823  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2824  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2825  *
2826  * @see #stc_firewall_rule_h
2827  * @see stc_firewall_rule_create()
2828  * @see stc_firewall_rule_destroy()
2829  * @see stc_firewall_rule_get_dst_ip_type()
2830  * @see stc_firewall_rule_set_dst_ip()
2831  */
2832 int stc_firewall_rule_get_dst_ip(stc_firewall_rule_h rule_h,
2833                         char **ip1, char **ip2);
2834
2835 /**
2836  * @brief Gets the source ports from rule.
2837  * @since_tizen 5.0
2838  *
2839  * @param[in] rule       The firewall rule handle
2840  * @param[out] port1     The port 1
2841  * @param[out] port2     The port 2
2842  *
2843  * @return 0 on success, otherwise a negative error value
2844  * @retval #STC_ERROR_NONE Successful
2845  * @retval #STC_ERROR_OPERATION_FAILED General error
2846  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2847  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2848  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2849  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2850  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2851  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2852  *
2853  * @see #stc_firewall_rule_h
2854  * @see stc_firewall_rule_create()
2855  * @see stc_firewall_rule_destroy()
2856  * @see stc_firewall_rule_get_src_port_type()
2857  * @see stc_firewall_rule_set_src_port()
2858  */
2859 int stc_firewall_rule_get_src_port(stc_firewall_rule_h rule_h,
2860                                 unsigned int *port1, unsigned int *port2);
2861
2862 /**
2863  * @brief Gets the destination ports from rule.
2864  * @since_tizen 5.0
2865  *
2866  * @param[in] rule       The firewall rule handle
2867  * @param[out] port1     The port 1
2868  * @param[out] port2     The port 2
2869  *
2870  * @return 0 on success, otherwise a negative error value
2871  * @retval #STC_ERROR_NONE Successful
2872  * @retval #STC_ERROR_OPERATION_FAILED General error
2873  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2874  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2875  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2876  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2877  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2878  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2879  *
2880  * @see #stc_firewall_rule_h
2881  * @see stc_firewall_rule_create()
2882  * @see stc_firewall_rule_destroy()
2883  * @see stc_firewall_rule_get_dst_port_type()
2884  * @see stc_firewall_rule_set_dst_port()
2885  */
2886 int stc_firewall_rule_get_dst_port(stc_firewall_rule_h rule_h,
2887                                 unsigned int *port1, unsigned int *port2);
2888
2889 /**
2890  * @brief Gets the interface name from rule.
2891  * @since_tizen 5.0
2892  *
2893  * @param[in] rule       The firewall rule handle
2894  * @param[out] ifname    The interface name
2895  *
2896  * @return 0 on success, otherwise a negative error value
2897  * @retval #STC_ERROR_NONE Successful
2898  * @retval #STC_ERROR_OPERATION_FAILED General error
2899  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2900  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2901  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2902  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2903  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2904  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2905  *
2906  * @see #stc_firewall_rule_h
2907  * @see stc_firewall_rule_create()
2908  * @see stc_firewall_rule_destroy()
2909  * @see stc_firewall_rule_set_ifname()
2910  */
2911 int stc_firewall_rule_get_ifname(stc_firewall_rule_h rule_h, char **ifname);
2912
2913 /**
2914  * @brief Gets the target type from rule.
2915  * @since_tizen 5.0
2916  *
2917  * @param[in] rule       The firewall rule handle
2918  * @param[out] target    The target type
2919  *
2920  * @return 0 on success, otherwise a negative error value
2921  * @retval #STC_ERROR_NONE Successful
2922  * @retval #STC_ERROR_OPERATION_FAILED General error
2923  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2924  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2925  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2926  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2927  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2928  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2929  *
2930  * @see #stc_firewall_rule_h
2931  * @see stc_firewall_rule_create()
2932  * @see stc_firewall_rule_destroy()
2933  * @see stc_firewall_rule_set_target()
2934  */
2935 int stc_firewall_rule_get_target(stc_firewall_rule_h rule_h,
2936                         stc_firewall_rule_target_e *target);
2937
2938 /**
2939  * @brief Gets log level from rule.
2940  * @since_tizen 5.0
2941  *
2942  * @param[in] rule       The firewall rule handle
2943  * @param[out] level     The level
2944  *
2945  * @return 0 on success, otherwise a negative error value
2946  * @retval #STC_ERROR_NONE Successful
2947  * @retval #STC_ERROR_OPERATION_FAILED General error
2948  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2949  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2950  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2951  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2952  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2953  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2954  *
2955  * @see #stc_firewall_rule_h
2956  * @see stc_firewall_rule_create()
2957  * @see stc_firewall_rule_destroy()
2958  * @see stc_firewall_rule_set_log_level()
2959  */
2960 int stc_firewall_rule_get_log_level(stc_firewall_rule_h rule_h,
2961                         unsigned char *level);
2962
2963 int stc_firewall_rule_get_log_prefix(stc_firewall_rule_h rule_h,
2964                         char **prefix);
2965
2966 /**
2967  * @brief Gets nflog group from rule.
2968  * @since_tizen 5.0
2969  *
2970  * @param[in] rule       The firewall rule handle
2971  * @param[out] group     The group
2972  *
2973  * @return 0 on success, otherwise a negative error value
2974  * @retval #STC_ERROR_NONE Successful
2975  * @retval #STC_ERROR_OPERATION_FAILED General error
2976  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
2977  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
2978  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
2979  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
2980  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
2981  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
2982  *
2983  * @see #stc_firewall_rule_h
2984  * @see stc_firewall_rule_create()
2985  * @see stc_firewall_rule_destroy()
2986  * @see stc_firewall_rule_set_nflog_group()
2987  */
2988 int stc_firewall_rule_get_nflog_group(stc_firewall_rule_h rule_h,
2989                         unsigned int *group);
2990
2991 int stc_firewall_rule_get_nflog_prefix(stc_firewall_rule_h rule_h,
2992                         char **prefix);
2993
2994 int stc_firewall_rule_get_nflog_range(stc_firewall_rule_h rule_h,
2995                         unsigned int *range);
2996
2997 int stc_firewall_rule_get_nflog_threshold(stc_firewall_rule_h rule_h,
2998                         unsigned int *threshold);
2999
3000 /**
3001  * @brief Adds the rule.
3002  * @since_tizen 5.0
3003  * @privlevel platform
3004  * @privilege %http://tizen.org/privilege/firewall.common
3005  *
3006  * @param[in] rule       The firewall rule handle
3007  *
3008  * @return 0 on success, otherwise a negative error value
3009  * @retval #STC_ERROR_NONE Successful
3010  * @retval #STC_ERROR_OPERATION_FAILED General error
3011  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
3012  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
3013  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
3014  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
3015  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
3016  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
3017  *
3018  * @see #stc_firewall_rule_h
3019  * @see stc_firewall_rule_create()
3020  * @see stc_firewall_rule_destroy()
3021  */
3022 int stc_firewall_rule_add(stc_firewall_rule_h rule_h);
3023
3024 /**
3025  * @brief Removes the rule.
3026  * @since_tizen 5.0
3027  * @privlevel platform
3028  * @privilege %http://tizen.org/privilege/firewall.common
3029  *
3030  * @param[in] rule       The firewall rule handle
3031  *
3032  * @return 0 on success, otherwise a negative error value
3033  * @retval #STC_ERROR_NONE Successful
3034  * @retval #STC_ERROR_OPERATION_FAILED General error
3035  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
3036  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
3037  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
3038  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
3039  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
3040  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
3041  *
3042  * @see #stc_firewall_rule_h
3043  * @see stc_firewall_rule_create()
3044  * @see stc_firewall_rule_destroy()
3045  */
3046 int stc_firewall_rule_remove(stc_firewall_rule_h rule_h);
3047
3048 /**
3049  * @brief Updates the rule.
3050  * @since_tizen 5.0
3051  * @privlevel platform
3052  * @privilege %http://tizen.org/privilege/firewall.common
3053  *
3054  * @param[in] rule       The firewall rule handle
3055  *
3056  * @return 0 on success, otherwise a negative error value
3057  * @retval #STC_ERROR_NONE Successful
3058  * @retval #STC_ERROR_OPERATION_FAILED General error
3059  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
3060  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
3061  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
3062  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
3063  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
3064  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
3065  *
3066  * @see #stc_firewall_rule_h
3067  * @see stc_firewall_rule_create()
3068  * @see stc_firewall_rule_destroy()
3069  */
3070 int stc_firewall_rule_update(stc_firewall_rule_h rule_h);
3071
3072 /**
3073  * @brief Gets all rules.
3074  * @since_tizen 5.0
3075  * @privlevel platform
3076  * @privilege %http://tizen.org/privilege/firewall.common
3077  *
3078  * @param[in] stc        The stc handle
3079  * @param[in] callback   The callback to be called
3080  * @param[in] user_data  The user data passed to the callback function
3081  *
3082  * @return 0 on success, otherwise a negative error value
3083  * @retval #STC_ERROR_NONE Successful
3084  * @retval #STC_ERROR_OPERATION_FAILED General error
3085  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
3086  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
3087  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
3088  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
3089  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
3090  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
3091  *
3092  * @see #stc_firewall_rule_h
3093  * @see stc_firewall_rule_create()
3094  * @see stc_firewall_rule_destroy()
3095  */
3096 int stc_firewall_rule_foreach(stc_h stc,
3097                         stc_firewall_rule_info_cb callback, void *user_data);
3098
3099 /**
3100 * @}
3101 */
3102
3103 /**
3104  * @addtogroup CAPI_NETWORK_STC_IPTABLES_MODULE
3105  * @{
3106  */
3107
3108 /**
3109  * @brief Commits iptables rule.
3110  * @since_tizen 5.0
3111  * @privlevel platform
3112  * @privilege %http://tizen.org/privilege/firewall.common
3113  * @remarks You must release @a err_str using free().
3114  *
3115  * @param[in] stc        The stc handle
3116  * @param[in] option     The option of iptables rule
3117  * @param[out] err_num   The error number
3118  * @param[out] err_str   The error string
3119  *
3120  * @return 0 on success, otherwise a negative error value
3121  * @retval #STC_ERROR_NONE Successful
3122  * @retval #STC_ERROR_OPERATION_FAILED General error
3123  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
3124  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
3125  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
3126  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
3127  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
3128  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
3129  *
3130  * @see stc_initialize()
3131  */
3132 int stc_iptables_commit(stc_h stc, const char *option,
3133                         int *err_num, char **err_str);
3134
3135 /**
3136  * @brief Commits ip6tables rule.
3137  * @since_tizen 5.0
3138  * @privlevel platform
3139  * @privilege %http://tizen.org/privilege/firewall.common
3140  * @remarks You must release @a err_str using free().
3141  *
3142  * @param[in] stc        The stc handle
3143  * @param[in] option     The option of iptables rule
3144  * @param[out] err_num   The error number
3145  * @param[out] err_str   The error string
3146  *
3147  * @return 0 on success, otherwise a negative error value
3148  * @retval #STC_ERROR_NONE Successful
3149  * @retval #STC_ERROR_OPERATION_FAILED General error
3150  * @retval #STC_ERROR_OUT_OF_MEMORY Out of memory
3151  * @retval #STC_ERROR_INVALID_PARAMETER Invalid parameter
3152  * @retval #STC_ERROR_INVALID_OPERATION Invalid operation
3153  * @retval #STC_ERROR_NOT_INITIALIZED Not initialized
3154  * @retval #STC_ERROR_NOT_SUPPORTED Not supported
3155  * @retval #STC_ERROR_PERMISSION_DENIED Permission denied
3156  *
3157  * @see stc_initialize()
3158  */
3159 int stc_ip6tables_commit(stc_h stc, const char *option,
3160                         int *err_num, char **err_str);
3161
3162 /**
3163 * @}
3164 */
3165
3166 #ifdef __cplusplus
3167 }
3168 #endif
3169
3170 #endif /* __TIZEN_STC_INTERNAL_H__ */