10 #include "internal/internal.h"
13 set_filter_dump_attr_mark(
struct nfct_filter_dump *filter_dump,
18 filter_dump->mark.val = this->val;
19 filter_dump->mark.mask = this->mask;
23 set_filter_dump_attr_family(
struct nfct_filter_dump *filter_dump,
26 filter_dump->l3num = *((uint8_t *)value);
29 const set_filter_dump_attr set_filter_dump_attr_array[NFCT_FILTER_DUMP_MAX] = {
30 [NFCT_FILTER_DUMP_MARK] = set_filter_dump_attr_mark,
31 [NFCT_FILTER_DUMP_L3NUM] = set_filter_dump_attr_family,
34 void __build_filter_dump(
struct nfnlhdr *req,
size_t size,
35 const struct nfct_filter_dump *filter_dump)
37 if (filter_dump->set & (1 << NFCT_FILTER_DUMP_MARK)) {
38 nfnl_addattr32(&req->nlh, size, CTA_MARK,
39 htonl(filter_dump->mark.val));
40 nfnl_addattr32(&req->nlh, size, CTA_MARK_MASK,
41 htonl(filter_dump->mark.mask));
43 if (filter_dump->set & (1 << NFCT_FILTER_DUMP_L3NUM)) {
44 struct nfgenmsg *nfg = NLMSG_DATA(&req->nlh);
45 nfg->nfgen_family = filter_dump->l3num;