From 815805101cbc0e513cf909a77b5dfcd8d39684fd Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sun, 29 Jan 2012 00:31:36 +0100 Subject: expect: add class support This patch allows you to specify the expectation class. Signed-off-by: Pablo Neira Ayuso --- src/expect/build.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/expect/build.c') 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); -- cgit v1.2.3