summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/network.h1
-rw-r--r--src/build.c2
-rw-r--r--src/parse.c5
3 files changed, 8 insertions, 0 deletions
diff --git a/include/network.h b/include/network.h
index ab95499..f3ee9ed 100644
--- a/include/network.h
+++ b/include/network.h
@@ -269,6 +269,7 @@ enum nta_exp_attr {
NTA_EXP_MASK_PORT, /* struct nfct_attr_grp_port */
NTA_EXP_TIMEOUT, /* uint32_t */
NTA_EXP_FLAGS, /* uint32_t */
+ NTA_EXP_CLASS, /* uint32_t */
NTA_EXP_MAX
};
diff --git a/src/build.c b/src/build.c
index 3193884..b845e0b 100644
--- a/src/build.c
+++ b/src/build.c
@@ -322,4 +322,6 @@ void exp2msg(const struct nf_expect *exp, struct nethdr *n)
exp_build_u32(exp, ATTR_EXP_TIMEOUT, n, NTA_EXP_TIMEOUT);
exp_build_u32(exp, ATTR_EXP_FLAGS, n, NTA_EXP_FLAGS);
+ if (nfexp_attr_is_set(exp, ATTR_EXP_CLASS))
+ exp_build_u32(exp, ATTR_EXP_CLASS, n, NTA_EXP_CLASS);
}
diff --git a/src/parse.c b/src/parse.c
index 81e9c6b..f1fd628 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -341,6 +341,11 @@ static struct exp_parser {
.exp_attr = ATTR_EXP_FLAGS,
.size = NTA_SIZE(sizeof(uint32_t)),
},
+ [NTA_EXP_CLASS] = {
+ .parse = exp_parse_u32,
+ .exp_attr = ATTR_EXP_CLASS,
+ .size = NTA_SIZE(sizeof(uint32_t)),
+ },
};
static void exp_parse_ct_group(void *ct, int attr, void *data)