summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/connman.h1
-rw-r--r--src/iptables.c15
2 files changed, 16 insertions, 0 deletions
diff --git a/src/connman.h b/src/connman.h
index 19bca740..9a607fb1 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -790,6 +790,7 @@ int __connman_stats_get(struct connman_service *service,
connman_bool_t roaming,
struct connman_stats_data *data);
+int __connman_iptables_dump(const char *table_name);
int __connman_iptables_new_chain(const char *table_name,
const char *chain);
int __connman_iptables_delete_chain(const char *table_name,
diff --git a/src/iptables.c b/src/iptables.c
index ea2a52b0..3fa81406 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -2091,6 +2091,21 @@ static void cleanup_parse_context(struct parse_context *ctx)
g_free(ctx);
}
+int __connman_iptables_dump(const char *table_name)
+{
+ struct connman_iptables *table;
+
+ DBG("-t %s -L", table_name);
+
+ table = pre_load_table(table_name, NULL);
+ if (table == NULL)
+ return -EINVAL;
+
+ dump_table(table);
+
+ return 0;
+}
+
int __connman_iptables_new_chain(const char *table_name,
const char *chain)
{