summaryrefslogtreecommitdiffstats
path: root/src/expect/build.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2012-01-29 00:31:36 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2012-02-06 21:48:30 +0100
commit815805101cbc0e513cf909a77b5dfcd8d39684fd (patch)
tree3e1b202b3542863ccd495942842d6186baea43b7 /src/expect/build.c
parent9064374e7758bc4fa167d1c30ccc751ea588f5db (diff)
expect: add class support
This patch allows you to specify the expectation class. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/expect/build.c')
-rw-r--r--src/expect/build.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/expect/build.c b/src/expect/build.c
index 7fefd5f..ffc7b84 100644
--- a/src/expect/build.c
+++ b/src/expect/build.c
@@ -28,6 +28,13 @@ static void __build_flags(struct nfnlhdr *req,
nfnl_addattr32(&req->nlh, size, CTA_EXPECT_FLAGS,htonl(exp->flags));
}
+static void __build_class(struct nfnlhdr *req,
+ size_t size,
+ const struct nf_expect *exp)
+{
+ nfnl_addattr32(&req->nlh, size, CTA_EXPECT_CLASS, htonl(exp->class));
+}
+
static void __build_helper_name(struct nfnlhdr *req, size_t size,
const struct nf_expect *exp)
{
@@ -73,6 +80,8 @@ int __build_expect(struct nfnl_subsys_handle *ssh,
__build_flags(req, size, exp);
if (test_bit(ATTR_EXP_ZONE, exp->set))
__build_zone(req, size, exp);
+ if (test_bit(ATTR_EXP_CLASS, exp->set))
+ __build_class(req, size, exp);
if (test_bit(ATTR_EXP_HELPER_NAME, exp->set))
__build_helper_name(req, size, exp);