diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2013-03-12 18:16:36 +0100 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-03-18 14:31:25 +0200 |
commit | 4f385e17ccb2f05fa1b472d173ed143447090ce2 (patch) | |
tree | dbffbb38fdf6cf21ec301d30bebfda6ebd201d6c /src/iptables.c | |
parent | a4da55c902da1c312b939cd9f6fac240559d9140 (diff) | |
download | connman-4f385e17ccb2f05fa1b472d173ed143447090ce2.tar.gz connman-4f385e17ccb2f05fa1b472d173ed143447090ce2.tar.bz2 connman-4f385e17ccb2f05fa1b472d173ed143447090ce2.zip |
iptables: Add __connman_iptables_dump()
In order to allow our test tool iptables-tests to dump a table
we need an dump function. The only user will be this tool. That allows
the linker to remove this code, so no additional code size.
Diffstat (limited to 'src/iptables.c')
-rw-r--r-- | src/iptables.c | 15 |
1 files changed, 15 insertions, 0 deletions
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) { |