path: root/src/connman.h
diff options
authorDaniel Wagner <>2013-02-12 10:19:46 +0100
committerPatrik Flykt <>2013-02-12 12:34:30 +0200
commitba052f1fa25d330b188027f41b4c88a23cc02431 (patch)
treead3e655f0d8721d7b2a22c2ece8d92991a3c0f49 /src/connman.h
parent4cf7b8f2c0f4202b9e76dcfd439cf857ff71de91 (diff)
iptables: Add split out iptables commands
Instead of having a pure string based API, we add two new main functions, __connman_iptables_append() and __connman_iptables_remove(). The missing commands will be added later. To simplify the whole code, the __connman_iptables_command() code is refactored into smaller pieces: parse_rule_spec() calls a few functions such as clear_tables_flags() and parse_xt_modules() which should make the reading of the main parser loop simpler. Also added a few comments on the parser which is really tricky.
Diffstat (limited to 'src/connman.h')
1 files changed, 16 insertions, 0 deletions
diff --git a/src/connman.h b/src/connman.h
index 95e5c8a3..96c3ed66 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -778,6 +778,22 @@ int __connman_stats_get(struct connman_service *service,
connman_bool_t roaming,
struct connman_stats_data *data);
+int __connman_iptables_new_chain(const char *table_name,
+ const char *chain);
+int __connman_iptables_delete_chain(const char *table_name,
+ const char *chain);
+int __connman_iptables_flush_chain(const char *table_name,
+ const char *chain);
+int __connman_iptables_change_policy(const char *table_name,
+ const char *chain,
+ const char *policy);
+int __connman_iptables_append(const char *table_name,
+ const char *chain,
+ const char *rule_spec);
+int __connman_iptables_delete(const char *table_name,
+ const char *chain,
+ const char *rule_spec);
int __connman_iptables_init(void);
void __connman_iptables_cleanup(void);
int __connman_iptables_command(const char *format, ...)