summaryrefslogtreecommitdiffstats
path: root/include/ct.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 13:08:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 13:08:37 +0000
commit971e619d8602fa52b1bfcb3ea65b7ab96be85318 (patch)
tree26feb2498c72b796e07b86349d17f544046de279 /include/ct.h
parentInitial commit. (diff)
downloadnftables-971e619d8602fa52b1bfcb3ea65b7ab96be85318.tar.xz
nftables-971e619d8602fa52b1bfcb3ea65b7ab96be85318.zip
Adding upstream version 1.0.9.upstream/1.0.9upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'include/ct.h')
-rw-r--r--include/ct.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/include/ct.h b/include/ct.h
new file mode 100644
index 0000000..0a705fd
--- /dev/null
+++ b/include/ct.h
@@ -0,0 +1,45 @@
+#ifndef NFTABLES_CT_H
+#define NFTABLES_CT_H
+
+/**
+ * struct ct_template
+ *
+ * @token: parser token for the expression
+ * @dtype: data type of the expression
+ * @len: length of the expression
+ * @byteorder: byteorder
+ */
+struct ct_template {
+ const char *token;
+ const struct datatype *dtype;
+ enum byteorder byteorder;
+ unsigned int len;
+};
+
+extern const struct ct_template ct_templates[__NFT_CT_MAX];
+
+#define CT_TEMPLATE(__token, __dtype, __byteorder, __len) { \
+ .token = (__token), \
+ .dtype = (__dtype), \
+ .byteorder = (__byteorder), \
+ .len = (__len), \
+}
+
+extern struct expr *ct_expr_alloc(const struct location *loc,
+ enum nft_ct_keys key, int8_t direction);
+extern void ct_expr_update_type(struct proto_ctx *ctx, struct expr *expr);
+
+extern struct stmt *notrack_stmt_alloc(const struct location *loc);
+extern struct stmt *flow_offload_stmt_alloc(const struct location *loc,
+ const char *table_name);
+extern const char *ct_dir2str(int dir);
+extern const char *ct_label2str(const struct symbol_table *tbl,
+ unsigned long value);
+
+extern const struct datatype ct_dir_type;
+extern const struct datatype ct_state_type;
+extern const struct datatype ct_status_type;
+extern const struct datatype ct_label_type;
+extern const struct datatype ct_event_type;
+
+#endif /* NFTABLES_CT_H */