10 #include "internal/internal.h"
12 static void set_exp_attr_master(
struct nf_expect *exp,
const void *value)
14 exp->master = *((
struct nfct_tuple_head *) value);
17 static void set_exp_attr_expected(
struct nf_expect *exp,
const void *value)
19 exp->expected = *((
struct nfct_tuple_head *) value);
22 static void set_exp_attr_mask(
struct nf_expect *exp,
const void *value)
24 exp->mask = *((
struct nfct_tuple_head *) value);
27 static void set_exp_attr_timeout(
struct nf_expect *exp,
const void *value)
29 exp->timeout = *((uint32_t *) value);
32 static void set_exp_attr_zone(
struct nf_expect *exp,
const void *value)
34 exp->zone = *((uint16_t *) value);
37 static void set_exp_attr_flags(
struct nf_expect *exp,
const void *value)
39 exp->flags = *((uint32_t *) value);
42 static void set_exp_attr_class(
struct nf_expect *exp,
const void *value)
44 exp->class = *((uint32_t *) value);
47 static void set_exp_attr_helper_name(
struct nf_expect *exp,
const void *value)
49 snprintf(exp->helper_name, NFCT_HELPER_NAME_MAX,
"%s", (
char *)value);
52 static void set_exp_attr_nat_dir(
struct nf_expect *exp,
const void *value)
54 exp->nat_dir = *((uint32_t *) value);
57 static void set_exp_attr_nat_tuple(
struct nf_expect *exp,
const void *value)
59 exp->nat = *((
struct nfct_tuple_head *) value);
62 static void set_exp_attr_expectfn(
struct nf_expect *exp,
const void *value)
64 snprintf(exp->expectfn, __NFCT_EXPECTFN_MAX,
"%s", (
char *)value);
67 const set_exp_attr set_exp_attr_array[ATTR_EXP_MAX] = {
68 [ATTR_EXP_MASTER] = set_exp_attr_master,
69 [ATTR_EXP_EXPECTED] = set_exp_attr_expected,
70 [ATTR_EXP_MASK] = set_exp_attr_mask,
71 [ATTR_EXP_TIMEOUT] = set_exp_attr_timeout,
72 [ATTR_EXP_ZONE] = set_exp_attr_zone,
73 [ATTR_EXP_FLAGS] = set_exp_attr_flags,
74 [ATTR_EXP_HELPER_NAME] = set_exp_attr_helper_name,
75 [ATTR_EXP_CLASS] = set_exp_attr_class,
76 [ATTR_EXP_NAT_TUPLE] = set_exp_attr_nat_tuple,
77 [ATTR_EXP_NAT_DIR] = set_exp_attr_nat_dir,
78 [ATTR_EXP_FN] = set_exp_attr_expectfn,