Lines Matching defs:xpinfo
231 struct xfrm_userpolicy_info xpinfo;
246 req.n.nlmsg_len = NLMSG_LENGTH(sizeof(req.xpinfo));
249 req.xpinfo.sel.family = preferred_family;
251 req.xpinfo.lft.soft_byte_limit = XFRM_INF;
252 req.xpinfo.lft.hard_byte_limit = XFRM_INF;
253 req.xpinfo.lft.soft_packet_limit = XFRM_INF;
254 req.xpinfo.lft.hard_packet_limit = XFRM_INF;
263 xfrm_policy_dir_parse(&req.xpinfo.dir, &argc, &argv);
268 if (get_u32(&req.xpinfo.index, *argv, 0))
280 req.xpinfo.action = XFRM_POLICY_ALLOW;
282 req.xpinfo.action = XFRM_POLICY_BLOCK;
287 if (get_u32(&req.xpinfo.priority, *argv, 0))
291 xfrm_policy_flag_parse(&req.xpinfo.flags, &argc,
295 xfrm_lifetime_cfg_parse(&req.xpinfo.lft, &argc, &argv);
319 xfrm_selector_parse(&req.xpinfo.sel, &argc, &argv);
321 preferred_family = req.xpinfo.sel.family;
355 if (req.xpinfo.sel.family == AF_UNSPEC)
356 req.xpinfo.sel.family = AF_INET;
366 static int xfrm_policy_filter_match(struct xfrm_userpolicy_info *xpinfo,
372 if ((xpinfo->dir^filter.xpinfo.dir)&filter.dir_mask)
379 if (xfrm_addr_match(&xpinfo->sel.saddr, &filter.xpinfo.sel.saddr,
385 if (xfrm_addr_match(&xpinfo->sel.daddr, &filter.xpinfo.sel.daddr,
390 if ((xpinfo->sel.ifindex^filter.xpinfo.sel.ifindex)&filter.sel_dev_mask)
393 if ((xpinfo->sel.proto^filter.xpinfo.sel.proto)&filter.upspec_proto_mask)
397 if ((xpinfo->sel.sport^filter.xpinfo.sel.sport)&filter.upspec_sport_mask)
402 if ((xpinfo->sel.dport^filter.xpinfo.sel.dport)&filter.upspec_dport_mask)
406 if ((xpinfo->index^filter.xpinfo.index)&filter.index_mask)
409 if ((xpinfo->action^filter.xpinfo.action)&filter.action_mask)
412 if ((xpinfo->priority^filter.xpinfo.priority)&filter.priority_mask)
416 if ((xpinfo->flags & filter.xpinfo.flags) == 0)
427 struct xfrm_userpolicy_info *xpinfo = NULL;
448 xpinfo = &xpexp->pol;
452 xpinfo = NLMSG_DATA(n);
453 len -= NLMSG_SPACE(sizeof(*xpinfo));
466 rta = XFRMP_RTA(xpinfo);
481 if (xpinfo && !xfrm_policy_filter_match(xpinfo, ptype))
497 if (RTA_PAYLOAD(tb[XFRMA_POLICY]) < sizeof(*xpinfo)) {
501 xpinfo = (struct xfrm_userpolicy_info *)RTA_DATA(tb[XFRMA_POLICY]);
504 xfrm_policy_info_print(xpinfo, tb, fp, NULL, NULL);
654 struct xfrm_userpolicy_info *xpinfo = NLMSG_DATA(n);
667 len -= NLMSG_LENGTH(sizeof(*xpinfo));
673 parse_rtattr(tb, XFRMA_MAX, XFRMP_RTA(xpinfo), len);
686 if (!xfrm_policy_filter_match(xpinfo, ptype))
701 memcpy(&xpid->sel, &xpinfo->sel, sizeof(xpid->sel));
702 xpid->dir = xpinfo->dir;
703 xpid->index = xpinfo->index;
718 filter.xpinfo.sel.family = preferred_family;
723 xfrm_policy_dir_parse(&filter.xpinfo.dir, &argc, &argv);
729 if (get_u32(&filter.xpinfo.index, *argv, 0))
743 filter.xpinfo.action = XFRM_POLICY_ALLOW;
745 filter.xpinfo.action = XFRM_POLICY_BLOCK;
753 if (get_u32(&filter.xpinfo.priority, *argv, 0))
760 xfrm_policy_flag_parse(&filter.xpinfo.flags, &argc,
770 xfrm_selector_parse(&filter.xpinfo.sel, &argc, &argv);
772 preferred_family = filter.xpinfo.sel.family;