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/compare.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/expect/compare.c') diff --git a/src/expect/compare.c b/src/expect/compare.c index 65ec9c2..c1bb50f 100644 --- a/src/expect/compare.c +++ b/src/expect/compare.c @@ -36,6 +36,13 @@ cmp_exp_flags(const struct nf_expect *exp1, const struct nf_expect *exp, return (exp->flags == exp->flags); } +static int +cmp_exp_class(const struct nf_expect *exp1, const struct nf_expect *exp, + unsigned int flags) +{ + return (exp->class == exp->class); +} + int __cmp_expect(const struct nf_expect *exp1, const struct nf_expect *exp2, unsigned int flags) @@ -54,6 +61,8 @@ int __cmp_expect(const struct nf_expect *exp1, } if (!exp_cmp(ATTR_EXP_FLAGS, exp1, exp2, flags, cmp_exp_flags)) return 0; + if (!exp_cmp(ATTR_EXP_CLASS, exp1, exp2, flags, cmp_exp_class)) + return 0; return 1; } -- cgit v1.2.3