diff options
author | Phil Sutter <phil@nwl.cc> | 2022-11-24 14:17:17 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2022-12-13 14:59:55 +0100 |
commit | 79195a8cc9e9d9cf2d17165bf07ac4cc9d55539f (patch) | |
tree | e339339c6b37040ccd5603dddc55fe7fb32c38c0 /src/xt.c | |
parent | e432477f5c013d0ca56f9fc5f9ac7cf35301b0b9 (diff) |
xt: Rewrite unsupported compat expression dumping
Choose a format which provides more information and is easily parseable.
Then teach parsers about it and make it explicitly reject the ruleset
giving a meaningful explanation. Also update the man pages with some
more details.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'src/xt.c')
-rw-r--r-- | src/xt.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -115,7 +115,13 @@ void xt_stmt_xlate(const struct stmt *stmt, struct output_ctx *octx) xt_xlate_free(xl); xfree(entry); #else - nft_print(octx, "# xt_%s", stmt->xt.name); + static const char *typename[NFT_XT_MAX] = { + [NFT_XT_MATCH] = "match", + [NFT_XT_TARGET] = "target", + [NFT_XT_WATCHER] = "watcher", + }; + + nft_print(octx, "xt %s %s", typename[stmt->xt.type], stmt->xt.name); #endif } |