summaryrefslogtreecommitdiffstats
path: root/src/xt.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2022-11-24 14:17:17 +0100
committerPhil Sutter <phil@nwl.cc>2022-12-13 14:59:55 +0100
commit79195a8cc9e9d9cf2d17165bf07ac4cc9d55539f (patch)
treee339339c6b37040ccd5603dddc55fe7fb32c38c0 /src/xt.c
parente432477f5c013d0ca56f9fc5f9ac7cf35301b0b9 (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.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/xt.c b/src/xt.c
index 300416a1..12b52aa3 100644
--- a/src/xt.c
+++ b/src/xt.c
@@ -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
}