summaryrefslogtreecommitdiffstats
path: root/include/statement.h
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2022-11-10 18:44:43 +0100
committerPhil Sutter <phil@nwl.cc>2022-12-13 14:59:55 +0100
commit5c30feeee5cfee74840444b63329fa5a13b471d2 (patch)
tree71289ea4f0033b4b4787183890e6d4989788d484 /include/statement.h
parentb8e1940aa190773b23b3ee9349beb20c31f42bdb (diff)
xt: Delay libxtables access until translation
There is no point in spending efforts setting up the xt match/target when it is not printed afterwards. So just store the statement data from libnftnl in struct xt_stmt and perform the extension lookup from xt_stmt_xlate() instead. This means some data structures are only temporarily allocated for the sake of passing to libxtables callbacks, no need to drag them around. Also no need to clone the looked up extension, it is needed only to call the functions it provides. While being at it, select numeric output in xt_xlate_*_params - otherwise there will be reverse DNS lookups which should not happen by default. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'include/statement.h')
-rw-r--r--include/statement.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/statement.h b/include/statement.h
index 2a2d3001..8651fc78 100644
--- a/include/statement.h
+++ b/include/statement.h
@@ -264,12 +264,11 @@ struct xtables_target;
struct xt_stmt {
const char *name;
enum nft_xt_type type;
+ uint32_t rev;
+ uint32_t family;
+ size_t infolen;
+ void *info;
uint32_t proto;
- union {
- struct xtables_match *match;
- struct xtables_target *target;
- };
- void *entry;
};
extern struct stmt *xt_stmt_alloc(const struct location *loc);