diff options
author | /C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org> | 2007-05-01 18:30:03 +0000 |
---|---|---|
committer | /C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org> | 2007-05-01 18:30:03 +0000 |
commit | 4db878d6f81fd64029c48003f4e1ae57069a7c65 (patch) | |
tree | b15b1aa433fdd9284fed8db9a02a19b8d1aa46a0 /src/expect/setter.c | |
parent | 7736631fef63efde9c0fd68af89c3e2900286428 (diff) |
introduce the new expectation API
Diffstat (limited to 'src/expect/setter.c')
-rw-r--r-- | src/expect/setter.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/expect/setter.c b/src/expect/setter.c new file mode 100644 index 0000000..ae80ca8 --- /dev/null +++ b/src/expect/setter.c @@ -0,0 +1,35 @@ +/* + * (C) 2006-2007 by Pablo Neira Ayuso <pablo@netfilter.org> + * + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. + */ + +#include "internal.h" + +static void set_exp_attr_master(struct nf_expect *exp, const void *value) +{ + exp->master = *((struct nf_conntrack *) value); +} + +static void set_exp_attr_expected(struct nf_expect *exp, const void *value) +{ + exp->expected = *((struct nf_conntrack *) value); +} + +static void set_exp_attr_mask(struct nf_expect *exp, const void *value) +{ + exp->mask = *((struct nf_conntrack *) value); +} + +static void set_exp_attr_timeout(struct nf_expect *exp, const void *value) +{ + exp->timeout = *((u_int32_t *) value); +} + +set_exp_attr set_exp_attr_array[] = { + [ATTR_EXP_MASTER] = set_exp_attr_master, + [ATTR_EXP_EXPECTED] = set_exp_attr_expected, + [ATTR_EXP_MASK] = set_exp_attr_mask, + [ATTR_EXP_TIMEOUT] = set_exp_attr_timeout, +}; |