summaryrefslogtreecommitdiffstats
path: root/include/data_reg.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 13:04:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 13:04:34 +0000
commit371c8a8bca2b6862226bc79c13d143e07c1d8fc3 (patch)
tree06c7dc8826596690422e79d5bde2f46c90492de3 /include/data_reg.h
parentInitial commit. (diff)
downloadlibnftnl-371c8a8bca2b6862226bc79c13d143e07c1d8fc3.tar.xz
libnftnl-371c8a8bca2b6862226bc79c13d143e07c1d8fc3.zip
Adding upstream version 1.2.6.upstream/1.2.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'include/data_reg.h')
-rw-r--r--include/data_reg.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/data_reg.h b/include/data_reg.h
new file mode 100644
index 0000000..6d2dc66
--- /dev/null
+++ b/include/data_reg.h
@@ -0,0 +1,40 @@
+#ifndef _DATA_H_
+#define _DATA_H_
+
+#include <linux/netfilter/nf_tables.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <unistd.h>
+
+enum {
+ DATA_NONE,
+ DATA_VALUE,
+ DATA_VERDICT,
+ DATA_CHAIN,
+};
+
+enum {
+ DATA_F_NOPFX = 1 << 0,
+};
+
+union nftnl_data_reg {
+ struct {
+ uint32_t val[NFT_DATA_VALUE_MAXLEN / sizeof(uint32_t)];
+ uint32_t len;
+ };
+ struct {
+ uint32_t verdict;
+ const char *chain;
+ uint32_t chain_id;
+ };
+};
+
+int nftnl_data_reg_snprintf(char *buf, size_t size,
+ const union nftnl_data_reg *reg,
+ uint32_t flags, int reg_type);
+struct nlattr;
+
+int nftnl_parse_data(union nftnl_data_reg *data, struct nlattr *attr, int *type);
+void nftnl_free_verdict(const union nftnl_data_reg *data);
+
+#endif