2 * Smart Traffic Control (STC)
4 * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #ifndef __TIZEN_STC_INTERNAL_H__
21 #define __TIZEN_STC_INTERNAL_H__
28 * @file stc_internal.h
31 /*****************************************************************************
33 *****************************************************************************/
38 /*****************************************************************************
40 *****************************************************************************/
43 * @addtogroup CAPI_NETWORK_STC_STATISTICS_MODULE
48 * @brief The reset rule handle.
51 typedef void *stc_reset_rule_h;
59 * @addtogroup CAPI_NETWORK_STC_FIREWALL_MODULE
64 * @brief The firewall chain handle.
67 typedef void *stc_firewall_chain_h;
70 * @brief The firewall rule handle.
73 typedef void *stc_firewall_rule_h;
80 * @addtogroup CAPI_NETWORK_STC_RESTRICTION_MODULE
85 * @brief The restriction rule handle.
88 typedef void *stc_restriction_rule_h;
94 /*****************************************************************************
96 *****************************************************************************/
99 * @addtogroup CAPI_NETWORK_STC_RESTRICTION_MODULE
104 * @brief Enumeration for network restriction type.
108 STC_RSTN_TYPE_UNKNOWN,
109 STC_RSTN_TYPE_ACCEPT,
111 STC_RSTN_TYPE_LAST_ELEM,
112 } stc_restriction_type_e;
119 * @addtogroup CAPI_NETWORK_STC_FIREWALL_MODULE
124 STC_FIREWALL_UNKNOWN,
125 STC_FIREWALL_UNLOCKED,
127 } stc_firewall_lock_e;
130 * @brief Enumeration for firewall direction.
134 STC_FIREWALL_DIRECTION_NONE,
135 STC_FIREWALL_DIRECTION_IN,
136 STC_FIREWALL_DIRECTION_OUT
137 } stc_firewall_direction_e;
140 * @brief Enumeration for firewall IP type.
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;
151 * @brief Enumeration for firewall port type.
155 STC_FIREWALL_PORT_NONE,
156 STC_FIREWALL_PORT_SINGLE,
157 STC_FIREWALL_PORT_RANGE
158 } stc_firewall_port_type_e;
161 * @brief Enumeration for firewall protocol type.
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;
173 * @brief Enumeration for firewall family type.
177 STC_FIREWALL_FAMILY_NONE,
178 STC_FIREWALL_FAMILY_V4,
179 STC_FIREWALL_FAMILY_V6
180 } stc_firewall_family_type_e;
183 * @brief Enumeration for firewall chain target.
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;
194 * @brief Enumeration for firewall rule target.
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;
211 /*****************************************************************************
213 *****************************************************************************/
216 * @addtogroup CAPI_NETWORK_STC_MANAGER_MODULE
221 * @brief Called for enumerate restriction rule.
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
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()
247 typedef stc_callback_ret_e (*stc_restriction_rule_cb)(stc_error_e result,
248 stc_restriction_rule_h rule, void *user_data);
250 typedef void (*stc_threshold_crossed_cb)(stc_restriction_rule_h rule,
258 * @addtogroup CAPI_NETWORK_STC_FIREWALL_MODULE
263 * @brief Called for enumerate firewall chain information.
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
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()
277 typedef stc_callback_ret_e (*stc_firewall_chain_info_cb)(stc_firewall_chain_h info_h,
281 * @brief Called for enumerate firewall rule information.
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
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()
306 typedef stc_callback_ret_e (*stc_firewall_rule_info_cb)(stc_firewall_rule_h info,
313 /*****************************************************************************
315 *****************************************************************************/
318 * @addtogroup CAPI_NETWORK_STC_MANAGER_MODULE
323 * @brief Resets stats information.
325 * @privlevel platform
326 * @privilege %http://tizen.org/privilege/network.get
328 * @param[in] stc The stc handle
329 * @param[in] rule The reset rule handle
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
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()
355 int stc_reset_stats(stc_h stc, stc_reset_rule_h rule);
359 * @brief Sets the restriction for application.
360 * @details Sets and applies restriction for application.
361 * It will creates new restriction or modify existing.
363 * @privlevel platform
364 * @privilege %http://tizen.org/privilege/network.get
366 * @param[in] stc The stc handle
367 * @param[in] rule The restriction rule handle
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
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()
403 int stc_set_restriction(stc_h stc, stc_restriction_rule_h rule);
406 * @brief Unsets the existing restriction for application.
407 * @details Unsets the existing restriction for application.
408 * It will delete restriction rule in kernel.
410 * @privlevel platform
411 * @privilege %http://tizen.org/privilege/network.get
413 * @param[in] stc The stc handle
414 * @param[in] rule The restriction rule handle
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
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()
450 int stc_unset_restriction(stc_h stc, stc_restriction_rule_h rule);
453 * @brief Gets the restriction rule per application.
454 * @details The callback is called for each application that applied restriction.
456 * @privlevel platform
457 * @privilege %http://tizen.org/privilege/network.get
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
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
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()
500 int stc_get_restriction(stc_h stc, stc_restriction_rule_h rule,
501 stc_restriction_rule_cb rule_cb, void *user_data);
503 int stc_set_restriction_threshold_crossed_cb(stc_h stc,
504 stc_threshold_crossed_cb crossed_cb, void *user_data);
506 int stc_unset_restriction_threshold_crossed_cb(stc_h stc);
508 int stc_set_warn_threshold_crossed_cb(stc_h stc,
509 stc_threshold_crossed_cb crossed_cb, void *user_data);
511 int stc_unset_warn_threshold_crossed_cb(stc_h stc);
514 * @brief Gets the restriction rule of all application.
515 * @details The callback is called for each application that applied restriction.
517 * @privlevel platform
518 * @privilege %http://tizen.org/privilege/network.get
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
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
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()
561 int stc_foreach_restriction(stc_h stc, stc_restriction_rule_h rule,
562 stc_restriction_rule_cb rule_cb, void *user_data);
565 * @brief Gets the restriction type.
567 * @privlevel platform
568 * @privilege %http://tizen.org/privilege/network.get
570 * @param[in] stc The stc handle
571 * @param[in] rule The restriction rule handle
572 * @param[out] type The restriction type
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
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()
609 int stc_get_restriction_type(stc_h stc, stc_restriction_rule_h rule,
610 stc_restriction_type_e *type);
617 * @addtogroup CAPI_NETWORK_STC_STATISTICS_MODULE
622 * @brief Creates the reset rule handle.
624 * @privlevel platform
625 * @privilege %http://tizen.org/privilege/network.get
626 * @remarks You must release @a handle using stc_reset_rule_destroy().
628 * @param[in] stc The stc handle
629 * @param[out] rule The reset rule handle
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
642 * @see #stc_reset_rule_h
643 * @see stc_initialize()
644 * @see stc_reset_rule_destroy()
646 int stc_reset_rule_create(stc_h stc, stc_reset_rule_h *rule);
649 * @brief Destroys the reset rule handle.
651 * @privlevel platform
652 * @privilege %http://tizen.org/privilege/network.get
654 * @param[in] rule The reset rule handle
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
666 * @see #stc_reset_rule_h
667 * @see stc_reset_rule_create()
669 int stc_reset_rule_destroy(stc_reset_rule_h rule);
672 * @brief Sets the application ID for reset rule.
674 * @privlevel platform
675 * @privilege %http://tizen.org/privilege/network.get
677 * @param[in] rule The reset rule handle
678 * @param[in] app_id The application ID
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
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()
695 int stc_reset_rule_set_app_id(stc_reset_rule_h rule, const char *app_id);
698 * @brief Sets the subscriber ID for reset rule.
700 * @privlevel platform
701 * @privilege %http://tizen.org/privilege/network.get
703 * @param[in] rule The reset rule handle
704 * @param[in] subscriber_id The subscriber ID
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
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()
721 int stc_reset_rule_set_subscriber_id(stc_reset_rule_h rule, const char *subscriber_id);
724 * @brief Sets the interface type for reset rule.
726 * @privlevel platform
727 * @privilege %http://tizen.org/privilege/network.get
729 * @param[in] rule The reset rule handle
730 * @param[in] iface_type The interface type
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
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()
748 int stc_reset_rule_set_iface_type(stc_reset_rule_h rule,
749 stc_iface_type_e iface_type);
752 * @brief Sets the time interval for reset rule.
754 * @privlevel platform
755 * @privilege %http://tizen.org/privilege/network.get
757 * @param[in] rule The reset rule handle
758 * @param[in] from The time interval from
759 * @param[in] to The time interval to
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
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()
776 int stc_reset_rule_set_time_interval(stc_reset_rule_h rule,
777 time_t from, time_t to);
780 * @brief Gets the application ID for reset.
782 * @privlevel platform
783 * @privilege %http://tizen.org/privilege/network.get
785 * @param[in] rule The reset rule handle
786 * @param[out] app_id The application ID
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
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()
803 int stc_reset_rule_get_app_id(stc_reset_rule_h rule, char **app_id);
806 * @brief Gets the subscriber ID for reset rule.
808 * @privlevel platform
809 * @privilege %http://tizen.org/privilege/network.get
811 * @param[in] rule The reset rule handle
812 * @param[out] subscriber_id The subscriber ID
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
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()
829 int stc_reset_rule_get_subscriber_id(stc_reset_rule_h rule, char **subscriber_id);
832 * @brief Gets the interface type for reset rule.
834 * @privlevel platform
835 * @privilege %http://tizen.org/privilege/network.get
837 * @param[in] rule The reset rule handle
838 * @param[out] iface_type The interface type
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
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()
856 int stc_reset_rule_get_iface_type(stc_reset_rule_h rule,
857 stc_iface_type_e *iface_type);
860 * @brief Gets the time interval for reset rule.
862 * @privlevel platform
863 * @privilege %http://tizen.org/privilege/network.get
865 * @param[in] rule The reset rule handle
866 * @param[out] from The time interval from
867 * @param[out] to The time interval to
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
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()
884 int stc_reset_rule_get_time_interval(stc_reset_rule_h rule,
885 time_t *from, time_t *to);
892 * @addtogroup CAPI_NETWORK_STC_RESTRICTION_MODULE
897 * @brief Creates the restriction rule handle.
899 * @privlevel platform
900 * @privilege %http://tizen.org/privilege/network.get
901 * @remarks You must release @a handle using stc_restriction_rule_destroy().
903 * @param[in] stc The stc handle
904 * @param[out] rule The restriction rule handle
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
917 * @see #stc_restriction_rule_h
918 * @see stc_initialize()
919 * @see stc_restriction_rule_destroy()
921 int stc_restriction_rule_create(stc_h stc, stc_restriction_rule_h *rule);
924 * @brief Destroys the restriction rule handle.
926 * @privlevel platform
927 * @privilege %http://tizen.org/privilege/network.get
929 * @param[in] rule The restriction rule handle
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
941 * @see #stc_restriction_rule_h
942 * @see stc_restriction_rule_create()
944 int stc_restriction_rule_destroy(stc_restriction_rule_h rule);
947 * @brief Sets the application ID for restriction rule.
949 * @privlevel platform
950 * @privilege %http://tizen.org/privilege/network.get
952 * @param[in] rule The restriction rule handle
953 * @param[in] app_id The application ID
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
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()
970 int stc_restriction_rule_set_app_id(stc_restriction_rule_h rule,
974 * @brief Sets the interface name for restriction rule.
976 * @privlevel platform
977 * @privilege %http://tizen.org/privilege/network.get
979 * @param[in] rule The restriction rule handle
980 * @param[in] iface_name The interface name
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
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()
998 int stc_restriction_rule_set_iface_name( stc_restriction_rule_h rule,
999 const char *iface_name);
1002 * @brief Sets the interface type for restriction rule.
1004 * @privlevel platform
1005 * @privilege %http://tizen.org/privilege/network.get
1007 * @param[in] rule The restriction rule handle
1008 * @param[in] iface_type The interface type
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
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()
1026 int stc_restriction_rule_set_iface_type(stc_restriction_rule_h rule,
1027 stc_iface_type_e iface_type);
1030 * @brief Sets the type for restriction rule.
1032 * @privlevel platform
1033 * @privilege %http://tizen.org/privilege/network.get
1035 * @param[in] rule The restriction rule handle
1036 * @param[in] type The restriction type
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
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()
1054 int stc_restriction_rule_set_type(stc_restriction_rule_h rule,
1055 stc_restriction_type_e type);
1058 * @brief Sets the limit for restriction rule.
1060 * @privlevel platform
1061 * @privilege %http://tizen.org/privilege/network.get
1063 * @param[in] rule The restriction rule handle
1064 * @param[in] data_limit The data limit
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
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()
1081 int stc_restriction_rule_set_limit(stc_restriction_rule_h rule,
1082 int64_t data_limit);
1085 * @brief Sets the warning limit for restriction rule.
1087 * @privlevel platform
1088 * @privilege %http://tizen.org/privilege/network.get
1090 * @param[in] rule The restriction rule handle
1091 * @param[in] data_warn_limit The data warning limit
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
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()
1108 int stc_restriction_rule_set_warning_limit(stc_restriction_rule_h rule,
1109 int64_t data_warn_limit);
1112 * @brief Sets the monthly data limit for restriction rule.
1114 * @privlevel platform
1115 * @privilege %http://tizen.org/privilege/network.get
1117 * @param[in] rule The restriction rule handle
1118 * @param[in] limit The data limit
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
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()
1135 int stc_restriction_rule_set_monthly_limit(stc_restriction_rule_h rule,
1139 * @brief Sets the weekly data limit for restriction rule.
1141 * @privlevel platform
1142 * @privilege %http://tizen.org/privilege/network.get
1144 * @param[in] rule The restriction rule handle
1145 * @param[in] limit The data limit
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
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()
1162 int stc_restriction_rule_set_weekly_limit(stc_restriction_rule_h rule,
1166 * @brief Sets the daily data limit for restriction rule.
1168 * @privlevel platform
1169 * @privilege %http://tizen.org/privilege/network.get
1171 * @param[in] rule The restriction rule handle
1172 * @param[in] limit The data limit
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
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()
1189 int stc_restriction_rule_set_daily_limit(stc_restriction_rule_h rule,
1193 * @brief Sets the month start date for restriction rule.
1195 * @privlevel platform
1196 * @privilege %http://tizen.org/privilege/network.get
1198 * @param[in] rule The restriction rule handle
1199 * @param[in] month_start_date The month start date
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
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()
1216 int stc_restriction_rule_set_month_start_date(stc_restriction_rule_h rule,
1217 int month_start_date);
1220 * @brief Sets the roaming type for restriction rule.
1222 * @privlevel platform
1223 * @privilege %http://tizen.org/privilege/network.get
1225 * @param[in] rule The restriction rule handle
1226 * @param[in] roaming_type The roaming type
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
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()
1244 int stc_restriction_rule_set_roaming_type(stc_restriction_rule_h rule,
1245 stc_roaming_type_e roaming_type);
1248 * @brief Sets the subscriber ID for restriction rule.
1250 * @privlevel platform
1251 * @privilege %http://tizen.org/privilege/network.get
1253 * @param[in] rule The restriction rule handle
1254 * @param[in] subscriber_id The subscriber ID
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
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()
1271 int stc_restriction_rule_set_subscriber_id(stc_restriction_rule_h rule, const char *subscriber_id);
1274 * @brief Gets the application ID for restriction rule.
1276 * @privlevel platform
1277 * @privilege %http://tizen.org/privilege/network.get
1279 * @param[in] rule The restriction rule handle
1280 * @param[out] app_id The application ID
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
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()
1297 int stc_restriction_rule_get_app_id(stc_restriction_rule_h rule, char **app_id);
1300 * @brief Gets the interface name for restriction rule.
1302 * @privlevel platform
1303 * @privilege %http://tizen.org/privilege/network.get
1305 * @param[in] rule The restriction rule handle
1306 * @param[out] iface_name The interface name
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
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()
1324 int stc_restriction_rule_get_iface_name(stc_restriction_rule_h rule,
1328 * @brief Gets the interface type for restriction rule.
1330 * @privlevel platform
1331 * @privilege %http://tizen.org/privilege/network.get
1333 * @param[in] rule The restriction rule handle
1334 * @param[out] iface_type The interface type
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
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()
1352 int stc_restriction_rule_get_iface_type(stc_restriction_rule_h rule,
1353 stc_iface_type_e *iface_type);
1356 * @brief Gets the type for restriction rule.
1358 * @privlevel platform
1359 * @privilege %http://tizen.org/privilege/network.get
1361 * @param[in] rule The restriction rule handle
1362 * @param[out] type The restriction type
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
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()
1380 int stc_restriction_rule_get_type(stc_restriction_rule_h rule,
1381 stc_restriction_type_e *type);
1384 * @brief Gets the limit for restriction rule.
1386 * @privlevel platform
1387 * @privilege %http://tizen.org/privilege/network.get
1389 * @param[in] rule The restriction rule handle
1390 * @param[out] data_limit The data limit
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
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()
1407 int stc_restriction_rule_get_limit(stc_restriction_rule_h rule,
1408 int64_t *data_limit);
1411 * @brief Gets the warning limit for restriction rule.
1413 * @privlevel platform
1414 * @privilege %http://tizen.org/privilege/network.get
1416 * @param[in] rule The restriction rule handle
1417 * @param[out] data_warn_limit The data warning limit
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
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()
1434 int stc_restriction_rule_get_warning_limit(stc_restriction_rule_h rule,
1435 int64_t *data_warn_limit);
1438 * @brief Gets the montlhy data limit for restriction rule.
1440 * @privlevel platform
1441 * @privilege %http://tizen.org/privilege/network.get
1443 * @param[in] rule The restriction rule handle
1444 * @param[out] limit The data limit
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
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()
1461 int stc_restriction_rule_get_monthly_limit(stc_restriction_rule_h rule,
1465 * @brief Gets the weekly data limit for restriction rule.
1467 * @privlevel platform
1468 * @privilege %http://tizen.org/privilege/network.get
1470 * @param[in] rule The restriction rule handle
1471 * @param[out] limit The data limit
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
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()
1488 int stc_restriction_rule_get_weekly_limit(stc_restriction_rule_h rule,
1492 * @brief Gets the daily data limit for restriction rule.
1494 * @privlevel platform
1495 * @privilege %http://tizen.org/privilege/network.get
1497 * @param[in] rule The restriction rule handle
1498 * @param[out] limit The data limit
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
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()
1515 int stc_restriction_rule_get_daily_limit(stc_restriction_rule_h rule,
1519 * @brief Gets the month start date for restriction rule.
1521 * @privlevel platform
1522 * @privilege %http://tizen.org/privilege/network.get
1524 * @param[in] rule The restriction rule handle
1525 * @param[out] month_start_date The month start date
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
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()
1542 int stc_restriction_rule_get_month_start_date(stc_restriction_rule_h rule,
1543 int *month_start_date);
1546 * @brief Gets the roaming type for restriction rule.
1548 * @privlevel platform
1549 * @privilege %http://tizen.org/privilege/network.get
1551 * @param[in] rule The restriction rule handle
1552 * @param[out] roaming The roaming type
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
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()
1570 int stc_restriction_rule_get_roaming_type(stc_restriction_rule_h rule,
1571 stc_roaming_type_e *roaming_type);
1574 * @brief Gets the subscriber ID for restriction rule.
1576 * @privlevel platform
1577 * @privilege %http://tizen.org/privilege/network.get
1579 * @param[in] rule The restriction rule handle
1580 * @param[out] subscriber_id The subscriber ID
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
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()
1597 int stc_restriction_rule_get_subscriber_id(stc_restriction_rule_h rule, char **subscriber_id);
1600 * @brief Gets the subscriber ID from statistics information.
1602 * @remarks You must release @a subscriber ID using free().
1604 * @param[in] info The statistics information handle
1605 * @param[out] subscriber_id The subscriber ID
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
1617 * @see stc_stats_info_h
1618 * @see stc_stats_info_cb()
1620 int stc_stats_info_get_subscriber_id(stc_stats_info_h info, char **subscriber_id);
1627 * @addtogroup CAPI_NETWORK_STC_FIREWALL_MODULE
1632 * @brief Locks the firewall.
1634 * @privlevel platform
1635 * @privilege %http://tizen.org/privilege/firewall.admin
1637 * @param[in] stc The stc handle
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
1650 * @see stc_initialize()
1651 * @see stc_firewall_unlock()
1652 * @see stc_firewall_get_lock()
1654 int stc_firewall_lock(stc_h stc);
1657 * @brief Unlocks the firewall.
1659 * @privlevel platform
1660 * @privilege %http://tizen.org/privilege/firewall.admin
1662 * @param[in] stc The stc handle
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
1675 * @see stc_initialize()
1676 * @see stc_firewall_lock()
1677 * @see stc_firewall_get_lock()
1679 int stc_firewall_unlock(stc_h stc);
1682 * @brief Gets the firewall lock state.
1684 * @privlevel platform
1685 * @privilege %http://tizen.org/privilege/firewall.admin
1687 * @param[in] stc The stc handle
1688 * @param[out] state The firewall lock state
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
1701 * @see stc_initialize()
1702 * @see stc_firewall_lock()
1703 * @see stc_firewall_unlock()
1705 int stc_firewall_get_lock(stc_h stc, stc_firewall_lock_e *state);
1708 * @brief Creates the firewall chain handle.
1710 * @remarks You must release @a handle using stc_firewall_chain_destroy().
1712 * @param[in] stc The stc handle
1713 * @param[in] name The chain name
1714 * @param[out] chain The firewall chain handle
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
1727 * @see #stc_firewall_chain_h
1728 * @see stc_initialize()
1729 * @see stc_firewall_chain_destroy()
1731 int stc_firewall_chain_create(stc_h stc, const char *name,
1732 stc_firewall_chain_h *chain_h);
1735 * @brief Clones the firewall chain handle.
1737 * @remarks You must release @a handle using stc_firewall_chain_destroy().
1739 * @param[in] origin The origin firewall chain handle
1740 * @param[out] cloned_chain The cloned firewall chain handle
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
1753 * @see #stc_firewall_chain_h
1754 * @see stc_initialize()
1755 * @see stc_firewall_chain_create()
1756 * @see stc_firewall_chain_destroy()
1758 int stc_firewall_chain_clone(stc_firewall_chain_h origin_h,
1759 stc_firewall_chain_h *cloned_chain_h);
1762 * @brief Destroys the firewall chain handle.
1765 * @param[in] chain The firewall chain handle
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
1777 * @see #stc_firewall_chain_h
1778 * @see stc_firewall_chain_create()
1780 int stc_firewall_chain_destroy(stc_firewall_chain_h chain_h);
1783 * @brief Gets the name for chain.
1786 * @param[in] chain The firewall chain handle
1787 * @param[out] name The chain name
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
1799 * @see #stc_firewall_chain_h
1800 * @see stc_firewall_chain_create()
1801 * @see stc_firewall_chain_destroy()
1803 int stc_firewall_chain_get_name(stc_firewall_chain_h chain, char **name);
1806 * @brief Gets the target type for chain.
1809 * @param[in] chain The firewall chain handle
1810 * @param[out] target The target type
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
1822 * @see #stc_firewall_chain_h
1823 * @see stc_firewall_chain_create()
1824 * @see stc_firewall_chain_destroy()
1826 int stc_firewall_chain_get_target(stc_firewall_chain_h chain_h,
1827 stc_firewall_chain_target_e *target);
1830 * @brief Gets the priority for chain.
1833 * @param[in] chain The firewall chain handle
1834 * @param[out] priority The priority
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
1846 * @see #stc_firewall_chain_h
1847 * @see stc_firewall_chain_create()
1848 * @see stc_firewall_chain_destroy()
1850 int stc_firewall_chain_get_priority(stc_firewall_chain_h chain_h,
1851 unsigned int *priority);
1854 * @brief Adds the chain.
1856 * @privlevel platform
1857 * @privilege %http://tizen.org/privilege/firewall.common
1859 * @param[in] chain The firewall chain handle
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
1871 * @see #stc_firewall_chain_h
1872 * @see stc_firewall_chain_create()
1873 * @see stc_firewall_chain_destroy()
1875 int stc_firewall_chain_add(stc_firewall_chain_h chain_h);
1878 * @brief Removes the chain.
1880 * @privlevel platform
1881 * @privilege %http://tizen.org/privilege/firewall.common
1883 * @param[in] chain The firewall chain handle
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
1895 * @see #stc_firewall_chain_h
1896 * @see stc_firewall_chain_create()
1897 * @see stc_firewall_chain_destroy()
1899 int stc_firewall_chain_remove(stc_firewall_chain_h chain_h);
1902 * @brief Flushs the chain.
1904 * @privlevel platform
1905 * @privilege %http://tizen.org/privilege/firewall.common
1907 * @param[in] chain The firewall chain handle
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
1919 * @see #stc_firewall_chain_h
1920 * @see stc_firewall_chain_create()
1921 * @see stc_firewall_chain_destroy()
1923 int stc_firewall_chain_flush(stc_firewall_chain_h chain_h);
1926 * @brief Gets all chains.
1928 * @privlevel platform
1929 * @privilege %http://tizen.org/privilege/firewall.common
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
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
1945 * @see #stc_firewall_chain_h
1946 * @see stc_firewall_chain_create()
1947 * @see stc_firewall_chain_destroy()
1949 int stc_firewall_chain_foreach(stc_h stc,
1950 stc_firewall_chain_info_cb callback, void *user_data);
1953 * @brief Sets the chain to target.
1955 * @privlevel platform
1956 * @privilege %http://tizen.org/privilege/firewall.common
1957 * @remarks You should set only one chain.
1959 * @param[in] chain The firewall chain handle
1960 * @param[in] target The target type
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
1972 * @see #stc_firewall_chain_h
1973 * @see stc_firewall_chain_create()
1974 * @see stc_firewall_chain_destroy()
1976 int stc_firewall_chain_set(stc_firewall_chain_h chain_h,
1977 stc_firewall_chain_target_e target);
1980 * @brief Unsets the chain.
1982 * @privlevel platform
1983 * @privilege %http://tizen.org/privilege/firewall.common
1985 * @param[in] chain The firewall chain handle
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
1997 * @see #stc_firewall_chain_h
1998 * @see stc_firewall_chain_create()
1999 * @see stc_firewall_chain_destroy()
2001 int stc_firewall_chain_unset(stc_firewall_chain_h chain_h);
2004 * @brief Creates the firewall rule handle.
2006 * @remarks You must release @a handle using stc_firewall_rule_destroy().
2008 * @param[in] stc The stc handle
2009 * @param[out] rule The firewall rule handle
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
2022 * @see #stc_firewall_rule_h
2023 * @see stc_initialize()
2024 * @see stc_firewall_rule_destroy()
2026 int stc_firewall_rule_create(stc_h stc, stc_firewall_rule_h *rule_h);
2029 * @brief Clones the firewall rule handle.
2031 * @remarks You must release @a handle using stc_firewall_rule_destroy().
2033 * @param[in] origin The origin firewall rule handle
2034 * @param[out] cloned_rule The cloned firewall rule handle
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
2047 * @see #stc_firewall_rule_h
2048 * @see stc_initialize()
2049 * @see stc_firewall_rule_create()
2050 * @see stc_firewall_rule_destroy()
2052 int stc_firewall_rule_clone(stc_firewall_rule_h origin_h,
2053 stc_firewall_rule_h *cloned_rule_h);
2056 * @brief Destroys the firewall rule handle.
2059 * @param[in] rule The firewall chain handle
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
2071 * @see #stc_firewall_rule_h
2072 * @see stc_firewall_rule_create()
2074 int stc_firewall_rule_destroy(stc_firewall_rule_h rule_h);
2077 * @brief Sets the chain name to rule.
2080 * @param[in] rule The firewall rule handle
2081 * @param[in] chain The chain name
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
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()
2098 int stc_firewall_rule_set_chain(stc_firewall_rule_h rule_h, char *chain);
2101 * @brief Sets the direction to rule.
2104 * @param[in] rule The firewall rule handle
2105 * @param[in] direction The direction
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
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()
2122 int stc_firewall_rule_set_direction(stc_firewall_rule_h rule_h,
2123 stc_firewall_direction_e direction);
2126 * @brief Sets the source IP type to rule.
2129 * @param[in] rule The firewall rule handle
2130 * @param[in] type The IP type
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
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()
2147 int stc_firewall_rule_set_src_ip_type(stc_firewall_rule_h rule_h,
2148 stc_firewall_ip_type_e type);
2151 * @brief Sets the destination IP type to rule.
2154 * @param[in] rule The firewall rule handle
2155 * @param[in] type The IP type
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
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()
2172 int stc_firewall_rule_set_dst_ip_type(stc_firewall_rule_h rule_h,
2173 stc_firewall_ip_type_e type);
2176 * @brief Sets the source port type to rule.
2179 * @param[in] rule The firewall rule handle
2180 * @param[in] type The port type
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
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()
2197 int stc_firewall_rule_set_src_port_type(stc_firewall_rule_h rule_h,
2198 stc_firewall_port_type_e type);
2201 * @brief Sets the destination port type to rule.
2204 * @param[in] rule The firewall rule handle
2205 * @param[in] type The port type
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
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()
2222 int stc_firewall_rule_set_dst_port_type(stc_firewall_rule_h rule_h,
2223 stc_firewall_port_type_e type);
2226 * @brief Sets the protocol type to rule.
2229 * @param[in] rule The firewall rule handle
2230 * @param[in] type The protocol type
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
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()
2247 int stc_firewall_rule_set_protocol_type(stc_firewall_rule_h rule_h,
2248 stc_firewall_protocol_type_e type);
2251 * @brief Sets the address family type to rule.
2254 * @param[in] rule The firewall rule handle
2255 * @param[in] type The address family type
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
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()
2272 int stc_firewall_rule_set_family_type(stc_firewall_rule_h rule_h,
2273 stc_firewall_family_type_e type);
2276 * @brief Sets source IP addresses to rule.
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
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
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()
2299 int stc_firewall_rule_set_src_ip(stc_firewall_rule_h rule_h,
2300 char *ip1, char *ip2);
2303 * @brief Sets destination IP addresses to rule.
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
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
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()
2326 int stc_firewall_rule_set_dst_ip(stc_firewall_rule_h rule_h,
2327 char *ip1, char *ip2);
2330 * @brief Sets source ports to rule.
2333 * @param[in] rule The firewall rule handle
2334 * @param[in] port1 The port 1
2335 * @param[in] port2 The port 2
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
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()
2353 int stc_firewall_rule_set_src_port(stc_firewall_rule_h rule_h,
2354 unsigned int port1, unsigned int port2);
2357 * @brief Sets destination ports to rule.
2360 * @param[in] rule The firewall rule handle
2361 * @param[in] port1 The port 1
2362 * @param[in] port2 The port 2
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
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()
2380 int stc_firewall_rule_set_dst_port(stc_firewall_rule_h rule_h,
2381 unsigned int port1, unsigned int port2);
2384 * @brief Sets interface name to rule.
2387 * @param[in] rule The firewall rule handle
2388 * @param[in] ifname The interface name
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
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()
2405 int stc_firewall_rule_set_ifname(stc_firewall_rule_h rule_h, char *ifname);
2408 * @brief Sets target type to rule.
2411 * @param[in] rule The firewall rule handle
2412 * @param[in] target The target type
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
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()
2429 int stc_firewall_rule_set_target(stc_firewall_rule_h rule_h,
2430 stc_firewall_rule_target_e target);
2433 * @brief Sets log level to rule.
2436 * @param[in] rule The firewall rule handle
2437 * @param[in] level The level
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
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()
2454 int stc_firewall_rule_set_log_level(stc_firewall_rule_h rule_h,
2455 unsigned char level);
2458 * @brief Sets log prefix to rule.
2461 * @param[in] rule The firewall rule handle
2462 * @param[in] prefix The prefix
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
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()
2479 int stc_firewall_rule_set_log_prefix(stc_firewall_rule_h rule_h,
2483 * @brief Sets nflog group to rule.
2486 * @param[in] rule The firewall rule handle
2487 * @param[in] group The group
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
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()
2504 int stc_firewall_rule_set_nflog_group(stc_firewall_rule_h rule_h,
2505 unsigned int group);
2508 * @brief Sets nflog prefix to rule.
2511 * @param[in] rule The firewall rule handle
2512 * @param[in] prefix The prefix
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
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()
2529 int stc_firewall_rule_set_nflog_prefix(stc_firewall_rule_h rule_h,
2533 * @brief Sets nflog range to rule.
2536 * @param[in] rule The firewall rule handle
2537 * @param[in] range The range
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
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()
2554 int stc_firewall_rule_set_nflog_range(stc_firewall_rule_h rule_h,
2555 unsigned int range);
2558 * @brief Sets nflog threshold to rule.
2561 * @param[in] rule The firewall rule handle
2562 * @param[in] threshold The threshold
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
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()
2579 int stc_firewall_rule_set_nflog_threshold(stc_firewall_rule_h rule_h,
2580 unsigned int threshold);
2583 * @brief Gets the chain name from rule.
2586 * @param[in] rule The firewall rule handle
2587 * @param[out] chain The chain name
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
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()
2604 int stc_firewall_rule_get_chain(stc_firewall_rule_h rule_h, char **chain);
2607 * @brief Gets the direction from rule.
2610 * @param[in] rule The firewall rule handle
2611 * @param[out] direction The direction
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
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()
2628 int stc_firewall_rule_get_direction(stc_firewall_rule_h rule_h,
2629 stc_firewall_direction_e *direction);
2632 * @brief Gets the source IP type from rule.
2635 * @param[in] rule The firewall rule handle
2636 * @param[out] type The IP type
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
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()
2653 int stc_firewall_rule_get_src_ip_type(stc_firewall_rule_h rule_h,
2654 stc_firewall_ip_type_e *type);
2657 * @brief Gets the destination IP type from rule.
2660 * @param[in] rule The firewall rule handle
2661 * @param[out] type The IP type
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
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()
2678 int stc_firewall_rule_get_dst_ip_type(stc_firewall_rule_h rule_h,
2679 stc_firewall_ip_type_e *type);
2682 * @brief Gets the source port type from rule.
2685 * @param[in] rule The firewall rule handle
2686 * @param[out] type The port type
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
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()
2703 int stc_firewall_rule_get_src_port_type(stc_firewall_rule_h rule_h,
2704 stc_firewall_port_type_e *type);
2707 * @brief Gets the destination port type from rule.
2710 * @param[in] rule The firewall rule handle
2711 * @param[out] type The port type
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
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()
2728 int stc_firewall_rule_get_dst_port_type(stc_firewall_rule_h rule_h,
2729 stc_firewall_port_type_e *type);
2732 * @brief Gets the protocol type from rule.
2735 * @param[in] rule The firewall rule handle
2736 * @param[out] type The protocol type
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
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()
2753 int stc_firewall_rule_get_protocol_type(stc_firewall_rule_h rule_h,
2754 stc_firewall_protocol_type_e *type);
2757 * @brief Gets the address family type from rule.
2760 * @param[in] rule The firewall rule handle
2761 * @param[out] type The address family type
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
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()
2778 int stc_firewall_rule_get_family_type(stc_firewall_rule_h rule_h,
2779 stc_firewall_family_type_e *type);
2782 * @brief Gets the source IP addresses from rule.
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
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
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()
2805 int stc_firewall_rule_get_src_ip(stc_firewall_rule_h rule_h,
2806 char **ip1, char **ip2);
2809 * @brief Gets the destination IP addresses from rule.
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
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
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()
2832 int stc_firewall_rule_get_dst_ip(stc_firewall_rule_h rule_h,
2833 char **ip1, char **ip2);
2836 * @brief Gets the source ports from rule.
2839 * @param[in] rule The firewall rule handle
2840 * @param[out] port1 The port 1
2841 * @param[out] port2 The port 2
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
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()
2859 int stc_firewall_rule_get_src_port(stc_firewall_rule_h rule_h,
2860 unsigned int *port1, unsigned int *port2);
2863 * @brief Gets the destination ports from rule.
2866 * @param[in] rule The firewall rule handle
2867 * @param[out] port1 The port 1
2868 * @param[out] port2 The port 2
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
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()
2886 int stc_firewall_rule_get_dst_port(stc_firewall_rule_h rule_h,
2887 unsigned int *port1, unsigned int *port2);
2890 * @brief Gets the interface name from rule.
2893 * @param[in] rule The firewall rule handle
2894 * @param[out] ifname The interface name
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
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()
2911 int stc_firewall_rule_get_ifname(stc_firewall_rule_h rule_h, char **ifname);
2914 * @brief Gets the target type from rule.
2917 * @param[in] rule The firewall rule handle
2918 * @param[out] target The target type
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
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()
2935 int stc_firewall_rule_get_target(stc_firewall_rule_h rule_h,
2936 stc_firewall_rule_target_e *target);
2939 * @brief Gets log level from rule.
2942 * @param[in] rule The firewall rule handle
2943 * @param[out] level The level
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
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()
2960 int stc_firewall_rule_get_log_level(stc_firewall_rule_h rule_h,
2961 unsigned char *level);
2963 int stc_firewall_rule_get_log_prefix(stc_firewall_rule_h rule_h,
2967 * @brief Gets nflog group from rule.
2970 * @param[in] rule The firewall rule handle
2971 * @param[out] group The group
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
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()
2988 int stc_firewall_rule_get_nflog_group(stc_firewall_rule_h rule_h,
2989 unsigned int *group);
2991 int stc_firewall_rule_get_nflog_prefix(stc_firewall_rule_h rule_h,
2994 int stc_firewall_rule_get_nflog_range(stc_firewall_rule_h rule_h,
2995 unsigned int *range);
2997 int stc_firewall_rule_get_nflog_threshold(stc_firewall_rule_h rule_h,
2998 unsigned int *threshold);
3001 * @brief Adds the rule.
3003 * @privlevel platform
3004 * @privilege %http://tizen.org/privilege/firewall.common
3006 * @param[in] rule The firewall rule handle
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
3018 * @see #stc_firewall_rule_h
3019 * @see stc_firewall_rule_create()
3020 * @see stc_firewall_rule_destroy()
3022 int stc_firewall_rule_add(stc_firewall_rule_h rule_h);
3025 * @brief Removes the rule.
3027 * @privlevel platform
3028 * @privilege %http://tizen.org/privilege/firewall.common
3030 * @param[in] rule The firewall rule handle
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
3042 * @see #stc_firewall_rule_h
3043 * @see stc_firewall_rule_create()
3044 * @see stc_firewall_rule_destroy()
3046 int stc_firewall_rule_remove(stc_firewall_rule_h rule_h);
3049 * @brief Updates the rule.
3051 * @privlevel platform
3052 * @privilege %http://tizen.org/privilege/firewall.common
3054 * @param[in] rule The firewall rule handle
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
3066 * @see #stc_firewall_rule_h
3067 * @see stc_firewall_rule_create()
3068 * @see stc_firewall_rule_destroy()
3070 int stc_firewall_rule_update(stc_firewall_rule_h rule_h);
3073 * @brief Gets all rules.
3075 * @privlevel platform
3076 * @privilege %http://tizen.org/privilege/firewall.common
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
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
3092 * @see #stc_firewall_rule_h
3093 * @see stc_firewall_rule_create()
3094 * @see stc_firewall_rule_destroy()
3096 int stc_firewall_rule_foreach(stc_h stc,
3097 stc_firewall_rule_info_cb callback, void *user_data);
3104 * @addtogroup CAPI_NETWORK_STC_IPTABLES_MODULE
3109 * @brief Commits iptables rule.
3111 * @privlevel platform
3112 * @privilege %http://tizen.org/privilege/firewall.common
3113 * @remarks You must release @a err_str using free().
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
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
3130 * @see stc_initialize()
3132 int stc_iptables_commit(stc_h stc, const char *option,
3133 int *err_num, char **err_str);
3136 * @brief Commits ip6tables rule.
3138 * @privlevel platform
3139 * @privilege %http://tizen.org/privilege/firewall.common
3140 * @remarks You must release @a err_str using free().
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
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
3157 * @see stc_initialize()
3159 int stc_ip6tables_commit(stc_h stc, const char *option,
3160 int *err_num, char **err_str);
3170 #endif /* __TIZEN_STC_INTERNAL_H__ */