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 strncpy(exp->helper_name, value, NFCT_HELPER_NAME_MAX);
50 exp->helper_name[NFCT_HELPER_NAME_MAX-1] =
'\0';
53 static void set_exp_attr_nat_dir(
struct nf_expect *exp,
const void *value)
55 exp->nat_dir = *((uint32_t *) value);
58 static void set_exp_attr_nat_tuple(
struct nf_expect *exp,
const void *value)
60 exp->nat = *((
struct nfct_tuple_head *) value);
63 static void set_exp_attr_expectfn(
struct nf_expect *exp,
const void *value)
65 strncpy(exp->expectfn, value, __NFCT_EXPECTFN_MAX);
66 exp->expectfn[__NFCT_EXPECTFN_MAX-1] =
'\0';
69 const set_exp_attr set_exp_attr_array[ATTR_EXP_MAX] = {
70 [ATTR_EXP_MASTER] = set_exp_attr_master,
71 [ATTR_EXP_EXPECTED] = set_exp_attr_expected,
72 [ATTR_EXP_MASK] = set_exp_attr_mask,
73 [ATTR_EXP_TIMEOUT] = set_exp_attr_timeout,
74 [ATTR_EXP_ZONE] = set_exp_attr_zone,
75 [ATTR_EXP_FLAGS] = set_exp_attr_flags,
76 [ATTR_EXP_HELPER_NAME] = set_exp_attr_helper_name,
77 [ATTR_EXP_CLASS] = set_exp_attr_class,
78 [ATTR_EXP_NAT_TUPLE] = set_exp_attr_nat_tuple,
79 [ATTR_EXP_NAT_DIR] = set_exp_attr_nat_dir,
80 [ATTR_EXP_FN] = set_exp_attr_expectfn,