summaryrefslogtreecommitdiffstats
path: root/src/libnetfilter_cthelper.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2012-02-02 00:25:02 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2012-02-02 00:25:02 +0100
commit0fca9b95fed33823b6b9443d0afd18d1bf9e5dc7 (patch)
treecd4acbe50571a114d655c7bbf11581aa3d78353a /src/libnetfilter_cthelper.c
parent14c32751713acad00c3ad01017e3464244ef709d (diff)
cthelper: add NFCTH_ATTR_PRIV_DATA_LEN
New attribute that is mandatory to set the size of the private data. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/libnetfilter_cthelper.c')
-rw-r--r--src/libnetfilter_cthelper.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libnetfilter_cthelper.c b/src/libnetfilter_cthelper.c
index c70a5eb..51f6cea 100644
--- a/src/libnetfilter_cthelper.c
+++ b/src/libnetfilter_cthelper.c
@@ -66,6 +66,7 @@
struct nfct_helper {
char name[NF_CT_HELPER_NAME_MAX];
+ uint32_t priv_data_len;
uint32_t queue_num;
uint32_t policy_num;
struct {
@@ -152,6 +153,10 @@ nfct_helper_attr_set(struct nfct_helper *nfct_helper,
nfct_helper->expect_policy[0].expect_max = *((uint32_t *) data);
nfct_helper->bitset |= (1 << NFCTH_ATTR_EXP_POLICY_MAX);
break;
+ case NFCTH_ATTR_PRIV_DATA_LEN:
+ nfct_helper->priv_data_len = *((uint32_t *) data);
+ nfct_helper->bitset |= (1 << NFCTH_ATTR_PRIV_DATA_LEN);
+ break;
}
}
EXPORT_SYMBOL(nfct_helper_attr_set);
@@ -402,6 +407,8 @@ void nfct_helper_nlmsg_build_payload(struct nlmsghdr *nlh,
mnl_attr_put_strz(nlh, NFCTH_NAME, nfct_helper->name);
mnl_attr_put_u32(nlh, NFCTH_QUEUE_NUM, htonl(nfct_helper->queue_num));
+ mnl_attr_put_u32(nlh, NFCTH_PRIV_DATA_LEN,
+ htonl(nfct_helper->priv_data_len));
nest = mnl_attr_nest_start(nlh, NFCTH_TUPLE);
mnl_attr_put_u16(nlh, NFCTH_TUPLE_L3PROTONUM, nfct_helper->tuple.l3num);