summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/proto.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/proto.h b/include/proto.h
index de58d4cc..6a280367 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -2,6 +2,7 @@
#define NFTABLES_PROTO_H
#include <nftables.h>
+#include <linux/netfilter/nf_tables.h>
/**
* enum proto_bases - protocol bases
@@ -30,12 +31,14 @@ extern const char *proto_base_tokens[];
* @dtype: data type of the header field
* @offset: offset of the header field from base
* @len: length of header field
+ * @meta_key: special case: meta expression key
*/
struct proto_hdr_template {
const char *token;
const struct datatype *dtype;
uint16_t offset;
uint16_t len;
+ enum nft_meta_keys meta_key;
};
#define PROTO_HDR_TEMPLATE(__token, __dtype, __offset, __len) \
@@ -46,6 +49,14 @@ struct proto_hdr_template {
.len = (__len), \
}
+#define PROTO_META_TEMPLATE(__token, __dtype, __key, __len) \
+ { \
+ .token = (__token), \
+ .dtype = (__dtype), \
+ .meta_key = (__key), \
+ .len = (__len), \
+ }
+
#define PROTO_UPPER_MAX 16
#define PROTO_HDRS_MAX 20