summaryrefslogtreecommitdiffstats
path: root/include/nftables.h
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-04-10 19:00:23 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2018-04-11 09:57:28 +0200
commit4885331de84cbb895d31b83696a9b6d6542f2a81 (patch)
tree615ada138977eddfc5e48e5b852d1fc5b122b562 /include/nftables.h
parent40d94ca1dcd8ee0c6df4a33707e224dbe6a684b3 (diff)
libnftables: Simplify cookie integration
This increases the size of struct output_ctx quite a bit, but allows to simplify internal functions dealing with the cookies mainly because output_fp becomes accessible from struct cookie. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/nftables.h')
-rw-r--r--include/nftables.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/nftables.h b/include/nftables.h
index 5c181be5..75134def 100644
--- a/include/nftables.h
+++ b/include/nftables.h
@@ -8,10 +8,11 @@
#include <nftables/nftables.h>
struct cookie {
+ FILE *fp;
+ FILE *orig_fp;
char *buf;
size_t buflen;
size_t pos;
- FILE *orig_fp;
};
struct output_ctx {
@@ -20,10 +21,14 @@ struct output_ctx {
unsigned int ip2name;
unsigned int handle;
unsigned int echo;
- FILE *output_fp;
- FILE *error_fp;
- struct cookie *output_cookie;
- struct cookie *error_cookie;
+ union {
+ FILE *output_fp;
+ struct cookie output_cookie;
+ };
+ union {
+ FILE *error_fp;
+ struct cookie error_cookie;
+ };
};
struct nft_cache {