Lines Matching refs:xpinfo
172 struct xfrm_userpolicy_info xpinfo;
183 req.n.nlmsg_len = NLMSG_LENGTH(sizeof(req.xpinfo));
186 req.xpinfo.sel.family = preferred_family;
188 req.xpinfo.lft.soft_byte_limit = XFRM_INF;
189 req.xpinfo.lft.hard_byte_limit = XFRM_INF;
190 req.xpinfo.lft.soft_packet_limit = XFRM_INF;
191 req.xpinfo.lft.hard_packet_limit = XFRM_INF;
200 xfrm_policy_dir_parse(&req.xpinfo.dir, &argc, &argv);
206 if (get_u32(&req.xpinfo.index, *argv, 0))
214 req.xpinfo.action = XFRM_POLICY_ALLOW;
216 req.xpinfo.action = XFRM_POLICY_BLOCK;
224 if (get_u32(&req.xpinfo.priority, *argv, 0))
231 xfrm_lifetime_cfg_parse(&req.xpinfo.lft, &argc, &argv);
255 xfrm_selector_parse(&req.xpinfo.sel, &argc, &argv);
257 preferred_family = req.xpinfo.sel.family;
276 if (req.xpinfo.sel.family == AF_UNSPEC)
277 req.xpinfo.sel.family = AF_INET;
287 static int xfrm_policy_filter_match(struct xfrm_userpolicy_info *xpinfo)
292 if ((xpinfo->dir^filter.xpinfo.dir)&filter.dir_mask)
296 if (xfrm_addr_match(&xpinfo->sel.saddr, &filter.xpinfo.sel.saddr,
302 if (xfrm_addr_match(&xpinfo->sel.daddr, &filter.xpinfo.sel.daddr,
307 if ((xpinfo->sel.ifindex^filter.xpinfo.sel.ifindex)&filter.sel_dev_mask)
310 if ((xpinfo->sel.proto^filter.xpinfo.sel.proto)&filter.upspec_proto_mask)
314 if ((xpinfo->sel.sport^filter.xpinfo.sel.sport)&filter.upspec_sport_mask)
319 if ((xpinfo->sel.dport^filter.xpinfo.sel.dport)&filter.upspec_dport_mask)
323 if ((xpinfo->index^filter.xpinfo.index)&filter.index_mask)
326 if ((xpinfo->action^filter.xpinfo.action)&filter.action_mask)
329 if ((xpinfo->priority^filter.xpinfo.priority)&filter.priority_mask)
339 struct xfrm_userpolicy_info *xpinfo;
355 xpinfo = &xpexp->pol;
360 xpinfo = NLMSG_DATA(n);
362 len -= NLMSG_LENGTH(sizeof(*xpinfo));
370 if (!xfrm_policy_filter_match(xpinfo))
376 rta = XFRMP_RTA(xpinfo);
385 xfrm_policy_info_print(xpinfo, tb, fp, NULL, NULL);
506 struct xfrm_userpolicy_info *xpinfo = NLMSG_DATA(n);
517 len -= NLMSG_LENGTH(sizeof(*xpinfo));
523 if (!xfrm_policy_filter_match(xpinfo))
538 memcpy(&xpid->sel, &xpinfo->sel, sizeof(xpid->sel));
539 xpid->dir = xpinfo->dir;
540 xpid->index = xpinfo->index;
555 filter.xpinfo.sel.family = preferred_family;
560 xfrm_policy_dir_parse(&filter.xpinfo.dir, &argc, &argv);
566 if (get_u32(&filter.xpinfo.index, *argv, 0))
574 filter.xpinfo.action = XFRM_POLICY_ALLOW;
576 filter.xpinfo.action = XFRM_POLICY_BLOCK;
584 if (get_u32(&filter.xpinfo.priority, *argv, 0))
594 xfrm_selector_parse(&filter.xpinfo.sel, &argc, &argv);
596 preferred_family = filter.xpinfo.sel.family;