Lines Matching refs:family
118 u16 family; member
176 xfrm_policy_inexact_lookup(struct net *net, u8 type, u16 family, u8 dir,
181 u8 type, u16 family, u8 dir, u32 if_id);
226 unsigned short family) in xfrm_selector_match() argument
228 switch (family) { in xfrm_selector_match()
237 static const struct xfrm_policy_afinfo *xfrm_policy_get_afinfo(unsigned short family) in xfrm_policy_get_afinfo() argument
241 if (unlikely(family >= ARRAY_SIZE(xfrm_policy_afinfo))) in xfrm_policy_get_afinfo()
244 afinfo = rcu_dereference(xfrm_policy_afinfo[family]); in xfrm_policy_get_afinfo()
259 int family, u32 mark) in __xfrm_dst_lookup() argument
264 afinfo = xfrm_policy_get_afinfo(family); in __xfrm_dst_lookup()
280 int family, u32 mark) in xfrm_dst_lookup() argument
296 dst = __xfrm_dst_lookup(net, tos, oif, saddr, daddr, family, mark); in xfrm_dst_lookup()
465 unsigned short family, int dir, in __get_hash_thresh() argument
468 switch (family) { in __get_hash_thresh()
487 unsigned short family, int dir) in policy_hash_bysel() argument
494 __get_hash_thresh(net, family, dir, &dbits, &sbits); in policy_hash_bysel()
495 hash = __sel_hash(sel, family, hmask, dbits, sbits); in policy_hash_bysel()
507 unsigned short family, int dir) in policy_hash_direct() argument
514 __get_hash_thresh(net, family, dir, &dbits, &sbits); in policy_hash_direct()
515 hash = __addr_hash(daddr, saddr, family, hmask, dbits, sbits); in policy_hash_direct()
537 __get_hash_thresh(net, pol->family, dir, &dbits, &sbits); in xfrm_dst_hash_transfer()
539 pol->family, nhashmask, dbits, sbits); in xfrm_dst_hash_transfer()
702 .family = pol->family, in xfrm_policy_inexact_alloc_bin()
741 int family, u8 prefixlen) in xfrm_pol_inexact_addr_use_any_list() argument
743 if (xfrm_addr_any(addr, family)) in xfrm_pol_inexact_addr_use_any_list()
746 if (family == AF_INET6 && prefixlen < INEXACT_PREFIXLEN_IPV6) in xfrm_pol_inexact_addr_use_any_list()
749 if (family == AF_INET && prefixlen < INEXACT_PREFIXLEN_IPV4) in xfrm_pol_inexact_addr_use_any_list()
766 policy->family, in xfrm_policy_inexact_insert_use_any_list()
771 policy->family, in xfrm_policy_inexact_insert_use_any_list()
797 u8 prefixlen, u16 family) in xfrm_policy_addr_delta() argument
803 switch (family) { in xfrm_policy_addr_delta()
843 u16 family) in xfrm_policy_inexact_list_reinsert() argument
858 WARN_ON_ONCE(policy->family != family); in xfrm_policy_inexact_list_reinsert()
887 family) == 0; in xfrm_policy_inexact_list_reinsert()
891 family) == 0; in xfrm_policy_inexact_list_reinsert()
907 u16 family) in xfrm_policy_inexact_node_reinsert() argument
927 prefixlen, family); in xfrm_policy_inexact_node_reinsert()
943 xfrm_policy_inexact_list_reinsert(net, node, family); in xfrm_policy_inexact_node_reinsert()
965 u16 family) in xfrm_policy_inexact_node_merge() argument
979 family); in xfrm_policy_inexact_node_merge()
987 xfrm_policy_inexact_list_reinsert(net, n, family); in xfrm_policy_inexact_node_merge()
994 u16 family, u8 prefixlen, u8 dir) in xfrm_policy_inexact_insert_node() argument
1009 family); in xfrm_policy_inexact_insert_node()
1023 family); in xfrm_policy_inexact_insert_node()
1044 cached, family); in xfrm_policy_inexact_insert_node()
1141 policy->family, in xfrm_policy_inexact_alloc_chain()
1147 policy->family, in xfrm_policy_inexact_alloc_chain()
1162 policy->family, in xfrm_policy_inexact_alloc_chain()
1170 policy->family, in xfrm_policy_inexact_alloc_chain()
1178 policy->family, in xfrm_policy_inexact_alloc_chain()
1265 if (policy->family == AF_INET) { in xfrm_hash_rebuild()
1273 if (policy->family == AF_INET) { in xfrm_hash_rebuild()
1337 policy->family, dir); in xfrm_hash_rebuild()
1458 u32 a = k->type << 24 | k->dir << 16 | k->family; in xfrm_pol_bin_key()
1489 ret = b->k.family ^ key->family; in xfrm_pol_bin_cmp()
1581 chain = policy_hash_bysel(net, &policy->selector, policy->family, dir); in xfrm_policy_insert()
1595 if (policy->family == AF_INET) in xfrm_policy_insert()
1654 chain = policy_hash_bysel(net, sel, sel->family, dir); in xfrm_policy_bysel_ctx()
1660 sel->family, dir, if_id); in xfrm_policy_bysel_ctx()
1894 u8 type, u16 family, int dir, u32 if_id) in xfrm_policy_match() argument
1900 if (pol->family != family || in xfrm_policy_match()
1906 match = xfrm_selector_match(sel, fl, family); in xfrm_policy_match()
1916 const xfrm_address_t *addr, u16 family) in xfrm_policy_lookup_inexact_addr() argument
1932 node->prefixlen, family); in xfrm_policy_lookup_inexact_addr()
1957 u16 family; in xfrm_policy_find_inexact_candidates() local
1962 family = b->k.family; in xfrm_policy_find_inexact_candidates()
1967 family); in xfrm_policy_find_inexact_candidates()
1971 family); in xfrm_policy_find_inexact_candidates()
1977 family); in xfrm_policy_find_inexact_candidates()
1985 xfrm_policy_inexact_lookup_rcu(struct net *net, u8 type, u16 family, in xfrm_policy_inexact_lookup_rcu() argument
1989 .family = family, in xfrm_policy_inexact_lookup_rcu()
2002 xfrm_policy_inexact_lookup(struct net *net, u8 type, u16 family, in xfrm_policy_inexact_lookup() argument
2010 bin = xfrm_policy_inexact_lookup_rcu(net, type, family, dir, if_id); in xfrm_policy_inexact_lookup()
2020 u8 type, u16 family, int dir, u32 if_id) in __xfrm_policy_eval_candidates() argument
2034 err = xfrm_policy_match(pol, fl, type, family, dir, if_id); in __xfrm_policy_eval_candidates()
2059 u8 type, u16 family, int dir, u32 if_id) in xfrm_policy_eval_candidates() argument
2067 fl, type, family, dir, in xfrm_policy_eval_candidates()
2082 u16 family, u8 dir, in xfrm_policy_lookup_bytype() argument
2093 daddr = xfrm_flowi_daddr(fl, family); in xfrm_policy_lookup_bytype()
2094 saddr = xfrm_flowi_saddr(fl, family); in xfrm_policy_lookup_bytype()
2102 chain = policy_hash_direct(net, daddr, saddr, family, dir); in xfrm_policy_lookup_bytype()
2107 err = xfrm_policy_match(pol, fl, type, family, dir, if_id); in xfrm_policy_lookup_bytype()
2120 bin = xfrm_policy_inexact_lookup_rcu(net, type, family, dir, if_id); in xfrm_policy_lookup_bytype()
2126 family, dir, if_id); in xfrm_policy_lookup_bytype()
2147 u16 family, u8 dir, u32 if_id) in xfrm_policy_lookup() argument
2152 pol = xfrm_policy_lookup_bytype(net, XFRM_POLICY_TYPE_SUB, fl, family, in xfrm_policy_lookup()
2157 return xfrm_policy_lookup_bytype(net, XFRM_POLICY_TYPE_MAIN, fl, family, in xfrm_policy_lookup()
2163 u16 family, u32 if_id) in xfrm_sk_policy_lookup() argument
2174 if (pol->family != family) { in xfrm_sk_policy_lookup()
2179 match = xfrm_selector_match(&pol->selector, fl, family); in xfrm_sk_policy_lookup()
2317 newp->family = old->family; in clone_policy()
2352 xfrm_address_t *remote, unsigned short family, u32 mark) in xfrm_get_saddr() argument
2355 const struct xfrm_policy_afinfo *afinfo = xfrm_policy_get_afinfo(family); in xfrm_get_saddr()
2368 struct xfrm_state **xfrm, unsigned short family) in xfrm_tmpl_resolve_one() argument
2373 xfrm_address_t *daddr = xfrm_flowi_daddr(fl, family); in xfrm_tmpl_resolve_one()
2374 xfrm_address_t *saddr = xfrm_flowi_saddr(fl, family); in xfrm_tmpl_resolve_one()
2398 family, policy->if_id); in xfrm_tmpl_resolve_one()
2427 struct xfrm_state **xfrm, unsigned short family) in xfrm_tmpl_resolve() argument
2442 ret = xfrm_tmpl_resolve_one(pols[i], fl, &tpp[cnx], family); in xfrm_tmpl_resolve()
2452 xfrm_state_sort(xfrm, tpp, cnx, family); in xfrm_tmpl_resolve()
2463 static int xfrm_get_tos(const struct flowi *fl, int family) in xfrm_get_tos() argument
2465 if (family == AF_INET) in xfrm_get_tos()
2471 static inline struct xfrm_dst *xfrm_alloc_dst(struct net *net, int family) in xfrm_alloc_dst() argument
2473 const struct xfrm_policy_afinfo *afinfo = xfrm_policy_get_afinfo(family); in xfrm_alloc_dst()
2480 switch (family) { in xfrm_alloc_dst()
2509 if (dst->ops->family == AF_INET6) { in xfrm_init_path()
2520 xfrm_policy_get_afinfo(xdst->u.dst.ops->family); in xfrm_fill_dst()
2558 int family = policy->selector.family; in xfrm_bundle_create() local
2561 xfrm_flowi_addr_get(fl, &saddr, &daddr, family); in xfrm_bundle_create()
2563 tos = xfrm_get_tos(fl, family); in xfrm_bundle_create()
2568 struct xfrm_dst *xdst = xfrm_alloc_dst(net, family); in xfrm_bundle_create()
2586 if (xfrm[i]->sel.family == AF_UNSPEC) { in xfrm_bundle_create()
2588 xfrm_af2proto(family)); in xfrm_bundle_create()
2606 family = xfrm[i]->props.family; in xfrm_bundle_create()
2608 &saddr, &daddr, family, mark); in xfrm_bundle_create()
2625 afinfo = xfrm_state_afinfo_get_rcu(inner_mode->family); in xfrm_bundle_create()
2675 static int xfrm_expand_policies(const struct flowi *fl, u16 family, in xfrm_expand_policies() argument
2698 fl, family, in xfrm_expand_policies()
2725 const struct flowi *fl, u16 family, in xfrm_resolve_and_create_bundle() argument
2736 err = xfrm_tmpl_resolve(pols, num_pols, fl, xfrm, family); in xfrm_resolve_and_create_bundle()
2780 xfrm_decode_session(skb, &fl, dst->ops->family); in xfrm_policy_queue_process()
2812 xfrm_decode_session(skb, &fl, skb_dst(skb)->ops->family); in xfrm_policy_queue_process()
2883 u16 family) in xfrm_create_dummy_bundle() argument
2891 xdst = xfrm_alloc_dst(net, family); in xfrm_create_dummy_bundle()
2940 u16 family, u8 dir, in xfrm_bundle_lookup() argument
2950 pols[0] = xfrm_policy_lookup(net, fl, family, dir, if_id); in xfrm_bundle_lookup()
2951 err = xfrm_expand_policies(fl, family, pols, in xfrm_bundle_lookup()
2960 xdst = xfrm_resolve_and_create_bundle(pols, num_pols, fl, family, in xfrm_bundle_lookup()
2983 xdst = xfrm_create_dummy_bundle(net, xflo, fl, num_xfrms, family); in xfrm_bundle_lookup()
3001 static struct dst_entry *make_blackhole(struct net *net, u16 family, in make_blackhole() argument
3004 const struct xfrm_policy_afinfo *afinfo = xfrm_policy_get_afinfo(family); in make_blackhole()
3035 u16 family = dst_orig->ops->family; in xfrm_lookup_with_ifid() local
3046 pols[0] = xfrm_sk_policy_lookup(sk, XFRM_POLICY_OUT, fl, family, in xfrm_lookup_with_ifid()
3048 err = xfrm_expand_policies(fl, family, pols, in xfrm_lookup_with_ifid()
3061 family, dst_orig); in xfrm_lookup_with_ifid()
3091 xdst = xfrm_bundle_lookup(net, fl, family, dir, &xflo, if_id); in xfrm_lookup_with_ifid()
3199 return make_blackhole(net, dst_orig->ops->family, dst_orig); in xfrm_lookup_route()
3230 unsigned short family, u32 if_id) in xfrm_state_ok() argument
3241 xfrm_state_addr_cmp(tmpl, x, family)) && in xfrm_state_ok()
3254 unsigned short family, u32 if_id) in xfrm_policy_ok() argument
3264 if (xfrm_state_ok(tmpl, sp->xvec[idx], family, if_id)) in xfrm_policy_ok()
3504 unsigned int family, int reverse) in __xfrm_decode_session() argument
3506 switch (family) { in __xfrm_decode_session()
3536 unsigned short family) in __xfrm_policy_check() argument
3556 xi = ifcb->decode_session(skb, family); in __xfrm_policy_check()
3567 if (__xfrm_decode_session(skb, &fl, family, reverse) < 0) { in __xfrm_policy_check()
3572 nf_nat_decode_session(skb, &fl, family); in __xfrm_policy_check()
3581 if (!xfrm_selector_match(&x->sel, &fl, family)) { in __xfrm_policy_check()
3591 pol = xfrm_sk_policy_lookup(sk, dir, &fl, family, if_id); in __xfrm_policy_check()
3599 pol = xfrm_policy_lookup(net, &fl, family, dir, if_id); in __xfrm_policy_check()
3622 &fl, family, in __xfrm_policy_check()
3663 xfrm_tmpl_sort(stp, tpp, xfrm_nr, family); in __xfrm_policy_check()
3674 k = xfrm_policy_ok(tpp[i], sp, k, family, if_id); in __xfrm_policy_check()
3702 int __xfrm_route_forward(struct sk_buff *skb, unsigned short family) in __xfrm_route_forward() argument
3709 if (xfrm_decode_session(skb, &fl, family) < 0) { in __xfrm_route_forward()
3936 int xfrm_policy_register_afinfo(const struct xfrm_policy_afinfo *afinfo, int family) in xfrm_policy_register_afinfo() argument
3940 if (WARN_ON(family >= ARRAY_SIZE(xfrm_policy_afinfo))) in xfrm_policy_register_afinfo()
3944 if (unlikely(xfrm_policy_afinfo[family] != NULL)) in xfrm_policy_register_afinfo()
3964 rcu_assign_pointer(xfrm_policy_afinfo[family], afinfo); in xfrm_policy_register_afinfo()
4206 switch (sel->family) { in xfrm_audit_common_policyinfo()
4265 if (sel_tgt->family == sel_cmp->family && in xfrm_migrate_selector_match()
4267 sel_cmp->family) && in xfrm_migrate_selector_match()
4269 sel_cmp->family) && in xfrm_migrate_selector_match()
4290 chain = policy_hash_direct(net, &sel->daddr, &sel->saddr, sel->family, dir); in xfrm_migrate_policy_find()