diff options
author | Arturo Borrero <arturo.borrero.glez@gmail.com> | 2014-04-14 12:17:19 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-04-25 17:45:32 +0200 |
commit | 43ac0090824f5c08ea13add64ace64f9ead8ef1b (patch) | |
tree | 3367908ae6a8fa4c58c2980360d2d609ddff4c5f /src | |
parent | cc1c262073cb0936250ad63f3fb8b038dd7f75ad (diff) |
rule: generalize chain_print()
Lest generalize the chain_print() function, so we can print a plain chain
as the user typed in the basic CLI.
Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/rule.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -401,6 +401,20 @@ static void chain_print(const struct chain *chain) printf("\t}\n"); } +void chain_print_plain(const struct chain *chain) +{ + printf("chain %s %s %s", family2str(chain->handle.family), + chain->handle.table, chain->handle.chain); + + if (chain->flags & CHAIN_F_BASECHAIN) { + printf(" { type %s hook %s priority %u; }", chain->type, + hooknum2str(chain->handle.family, chain->hooknum), + chain->priority); + } + + printf("\n"); +} + struct table *table_alloc(void) { struct table *table; |