Lines Matching full:family
43 2. Hash table by (daddr,family,reqid) to find what SAs exist for given
62 unsigned short family) in xfrm_dst_hash() argument
64 return __xfrm_dst_hash(daddr, saddr, reqid, family, net->xfrm.state_hmask); in xfrm_dst_hash()
70 unsigned short family) in xfrm_src_hash() argument
72 return __xfrm_src_hash(daddr, saddr, family, net->xfrm.state_hmask); in xfrm_src_hash()
77 __be32 spi, u8 proto, unsigned short family) in xfrm_spi_hash() argument
79 return __xfrm_spi_hash(daddr, spi, proto, family, net->xfrm.state_hmask); in xfrm_spi_hash()
101 x->props.reqid, x->props.family, in xfrm_hash_transfer()
106 x->props.family, in xfrm_hash_transfer()
112 x->id.proto, x->props.family, in xfrm_hash_transfer()
203 int xfrm_register_type(const struct xfrm_type *type, unsigned short family) in xfrm_register_type() argument
205 struct xfrm_state_afinfo *afinfo = xfrm_state_get_afinfo(family); in xfrm_register_type()
249 void xfrm_unregister_type(const struct xfrm_type *type, unsigned short family) in xfrm_unregister_type() argument
251 struct xfrm_state_afinfo *afinfo = xfrm_state_get_afinfo(family); in xfrm_unregister_type()
292 static const struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family) in xfrm_get_type() argument
299 afinfo = xfrm_state_get_afinfo(family); in xfrm_get_type()
335 request_module("xfrm-type-%d-%d", family, proto); in xfrm_get_type()
349 unsigned short family) in xfrm_register_type_offload() argument
351 struct xfrm_state_afinfo *afinfo = xfrm_state_get_afinfo(family); in xfrm_register_type_offload()
374 unsigned short family) in xfrm_unregister_type_offload() argument
376 struct xfrm_state_afinfo *afinfo = xfrm_state_get_afinfo(family); in xfrm_unregister_type_offload()
395 xfrm_get_type_offload(u8 proto, unsigned short family, bool try_load) in xfrm_get_type_offload() argument
401 afinfo = xfrm_state_get_afinfo(family); in xfrm_get_type_offload()
419 request_module("xfrm-offload-%d-%d", family, proto); in xfrm_get_type_offload()
436 .family = AF_INET,
440 .family = AF_INET,
445 .family = AF_INET,
453 .family = AF_INET6,
457 .family = AF_INET6,
461 .family = AF_INET6,
466 .family = AF_INET6,
470 static const struct xfrm_mode *xfrm_get_mode(unsigned int encap, int family) in xfrm_get_mode() argument
477 switch (family) { in xfrm_get_mode()
480 if (mode->family == family) in xfrm_get_mode()
485 if (mode->family == family) in xfrm_get_mode()
889 sel->family = AF_INET; in __xfrm4_init_tempsel()
908 sel->family = AF_INET6; in __xfrm6_init_tempsel()
919 unsigned short family) in xfrm_init_tempstate() argument
921 switch (family) { in xfrm_init_tempstate()
951 x->props.family = tmpl->encap_family; in xfrm_init_tempstate()
957 unsigned short family) in __xfrm_state_lookup() argument
959 unsigned int h = xfrm_spi_hash(net, daddr, spi, proto, family); in __xfrm_state_lookup()
963 if (x->props.family != family || in __xfrm_state_lookup()
966 !xfrm_addr_equal(&x->id.daddr, daddr, family)) in __xfrm_state_lookup()
982 u8 proto, unsigned short family) in __xfrm_state_lookup_byaddr() argument
984 unsigned int h = xfrm_src_hash(net, daddr, saddr, family); in __xfrm_state_lookup_byaddr()
988 if (x->props.family != family || in __xfrm_state_lookup_byaddr()
990 !xfrm_addr_equal(&x->id.daddr, daddr, family) || in __xfrm_state_lookup_byaddr()
991 !xfrm_addr_equal(&x->props.saddr, saddr, family)) in __xfrm_state_lookup_byaddr()
1005 __xfrm_state_locate(struct xfrm_state *x, int use_spi, int family) in __xfrm_state_locate() argument
1012 x->id.spi, x->id.proto, family); in __xfrm_state_locate()
1017 x->id.proto, family); in __xfrm_state_locate()
1029 const struct flowi *fl, unsigned short family, in xfrm_state_look_at() argument
1045 if ((x->sel.family && in xfrm_state_look_at()
1046 (x->sel.family != family || in xfrm_state_look_at()
1047 !xfrm_selector_match(&x->sel, fl, family))) || in xfrm_state_look_at()
1061 if ((!x->sel.family || in xfrm_state_look_at()
1062 (x->sel.family == family && in xfrm_state_look_at()
1063 xfrm_selector_match(&x->sel, fl, family))) && in xfrm_state_look_at()
1074 unsigned short family, u32 if_id) in xfrm_state_find() argument
1095 if (x->props.family == encap_family && in xfrm_state_find()
1104 xfrm_state_look_at(pol, x, fl, family, in xfrm_state_find()
1112 if (x->props.family == encap_family && in xfrm_state_find()
1121 xfrm_state_look_at(pol, x, fl, family, in xfrm_state_find()
1153 xfrm_init_tempstate(x, fl, tmpl, daddr, saddr, family); in xfrm_state_find()
1221 unsigned short family, u8 mode, u8 proto, u32 reqid) in xfrm_stateonly_find() argument
1227 h = xfrm_dst_hash(net, daddr, saddr, reqid, family); in xfrm_stateonly_find()
1229 if (x->props.family == family && in xfrm_stateonly_find()
1234 xfrm_state_addr_check(x, daddr, saddr, family) && in xfrm_stateonly_find()
1253 unsigned short family) in xfrm_state_lookup_byspi() argument
1261 if (x->props.family != family || in xfrm_state_lookup_byspi()
1282 x->props.reqid, x->props.family); in __xfrm_state_insert()
1285 h = xfrm_src_hash(net, &x->id.daddr, &x->props.saddr, x->props.family); in __xfrm_state_insert()
1290 x->props.family); in __xfrm_state_insert()
1314 unsigned short family = xnew->props.family; in __xfrm_state_bump_genids() local
1321 h = xfrm_dst_hash(net, &xnew->id.daddr, &xnew->props.saddr, reqid, family); in __xfrm_state_bump_genids()
1323 if (x->props.family == family && in __xfrm_state_bump_genids()
1327 xfrm_addr_equal(&x->id.daddr, &xnew->id.daddr, family) && in __xfrm_state_bump_genids()
1328 xfrm_addr_equal(&x->props.saddr, &xnew->props.saddr, family)) in __xfrm_state_bump_genids()
1347 unsigned short family, u8 mode, in __find_acq_core() argument
1353 unsigned int h = xfrm_dst_hash(net, daddr, saddr, reqid, family); in __find_acq_core()
1360 x->props.family != family || in __find_acq_core()
1365 !xfrm_addr_equal(&x->id.daddr, daddr, family) || in __find_acq_core()
1366 !xfrm_addr_equal(&x->props.saddr, saddr, family)) in __find_acq_core()
1378 switch (family) { in __find_acq_core()
1400 x->props.family = family; in __find_acq_core()
1413 h = xfrm_src_hash(net, daddr, saddr, family); in __find_acq_core()
1430 int family; in xfrm_state_add() local
1435 family = x->props.family; in xfrm_state_add()
1441 x1 = __xfrm_state_locate(x, use_spi, family); in xfrm_state_add()
1452 !xfrm_addr_equal(&x1->id.daddr, &x->id.daddr, family))) { in xfrm_state_add()
1459 x1 = __find_acq_core(net, &x->mark, family, x->props.mode, in xfrm_state_add()
1521 x->props.family = orig->props.family; in xfrm_state_clone()
1669 xc->props.family = m->new_family; in xfrm_state_migrate()
1705 x1 = __xfrm_state_locate(x, use_spi, x->props.family); in xfrm_state_update()
1811 u8 proto, unsigned short family) in xfrm_state_lookup() argument
1816 x = __xfrm_state_lookup(net, mark, daddr, spi, proto, family); in xfrm_state_lookup()
1825 u8 proto, unsigned short family) in xfrm_state_lookup_byaddr() argument
1830 x = __xfrm_state_lookup_byaddr(net, mark, daddr, saddr, proto, family); in xfrm_state_lookup_byaddr()
1839 const xfrm_address_t *saddr, int create, unsigned short family) in xfrm_find_acq() argument
1844 x = __find_acq_core(net, mark, family, mode, reqid, if_id, proto, daddr, saddr, create); in xfrm_find_acq()
1950 unsigned short family) in xfrm_tmpl_sort() argument
1954 if (family == AF_INET6) in xfrm_tmpl_sort()
1964 unsigned short family) in xfrm_state_sort() argument
1968 if (family == AF_INET6) in xfrm_state_sort()
2066 x0 = xfrm_state_lookup(net, mark, &x->id.daddr, minspi, x->id.proto, x->props.family); in xfrm_alloc_spi()
2076 x0 = xfrm_state_lookup(net, mark, &x->id.daddr, htonl(spi), x->id.proto, x->props.family); in xfrm_alloc_spi()
2087 h = xfrm_spi_hash(net, &x->id.daddr, x->id.spi, x->id.proto, x->props.family); in xfrm_alloc_spi()
2105 if ((filter->family == AF_INET || in __xfrm_state_filter_match()
2106 filter->family == AF_INET6) && in __xfrm_state_filter_match()
2107 x->props.family != filter->family) in __xfrm_state_filter_match()
2506 if (WARN_ON(afinfo->family >= NPROTO)) in xfrm_state_register_afinfo()
2510 if (unlikely(xfrm_state_afinfo[afinfo->family] != NULL)) in xfrm_state_register_afinfo()
2513 rcu_assign_pointer(xfrm_state_afinfo[afinfo->family], afinfo); in xfrm_state_register_afinfo()
2521 int err = 0, family = afinfo->family; in xfrm_state_unregister_afinfo() local
2523 if (WARN_ON(family >= NPROTO)) in xfrm_state_unregister_afinfo()
2527 if (likely(xfrm_state_afinfo[afinfo->family] != NULL)) { in xfrm_state_unregister_afinfo()
2528 if (rcu_access_pointer(xfrm_state_afinfo[family]) != afinfo) in xfrm_state_unregister_afinfo()
2531 RCU_INIT_POINTER(xfrm_state_afinfo[afinfo->family], NULL); in xfrm_state_unregister_afinfo()
2539 struct xfrm_state_afinfo *xfrm_state_afinfo_get_rcu(unsigned int family) in xfrm_state_afinfo_get_rcu() argument
2541 if (unlikely(family >= NPROTO)) in xfrm_state_afinfo_get_rcu()
2544 return rcu_dereference(xfrm_state_afinfo[family]); in xfrm_state_afinfo_get_rcu()
2548 struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned int family) in xfrm_state_get_afinfo() argument
2551 if (unlikely(family >= NPROTO)) in xfrm_state_get_afinfo()
2554 afinfo = rcu_dereference(xfrm_state_afinfo[family]); in xfrm_state_get_afinfo()
2597 if (x->props.family == AF_INET) in xfrm_state_mtu()
2599 else if (x->props.family == AF_INET6) in xfrm_state_mtu()
2619 int family = x->props.family; in __xfrm_init_state() local
2622 if (family == AF_INET && in __xfrm_init_state()
2628 if (x->sel.family != AF_UNSPEC) { in __xfrm_init_state()
2629 inner_mode = xfrm_get_mode(x->props.mode, x->sel.family); in __xfrm_init_state()
2636 family != x->sel.family) { in __xfrm_init_state()
2637 NL_SET_ERR_MSG(extack, "Only tunnel modes can accommodate a change of family"); in __xfrm_init_state()
2646 inner_mode = xfrm_get_mode(x->props.mode, x->props.family); in __xfrm_init_state()
2659 if (x->props.family == AF_INET) in __xfrm_init_state()
2669 x->type = xfrm_get_type(x->id.proto, family); in __xfrm_init_state()
2675 x->type_offload = xfrm_get_type_offload(x->id.proto, family, offload); in __xfrm_init_state()
2681 outer_mode = xfrm_get_mode(x->props.mode, family); in __xfrm_init_state()
2789 switch (x->props.family) { in xfrm_audit_helper_sainfo()
2803 static void xfrm_audit_helper_pktinfo(struct sk_buff *skb, u16 family, in xfrm_audit_helper_pktinfo() argument
2809 switch (family) { in xfrm_audit_helper_pktinfo()
2864 xfrm_audit_helper_pktinfo(skb, x->props.family, audit_buf); in xfrm_audit_state_replay_overflow()
2882 xfrm_audit_helper_pktinfo(skb, x->props.family, audit_buf); in xfrm_audit_state_replay()
2890 void xfrm_audit_state_notfound_simple(struct sk_buff *skb, u16 family) in xfrm_audit_state_notfound_simple() argument
2897 xfrm_audit_helper_pktinfo(skb, family, audit_buf); in xfrm_audit_state_notfound_simple()
2902 void xfrm_audit_state_notfound(struct sk_buff *skb, u16 family, in xfrm_audit_state_notfound() argument
2911 xfrm_audit_helper_pktinfo(skb, family, audit_buf); in xfrm_audit_state_notfound()
2929 xfrm_audit_helper_pktinfo(skb, x->props.family, audit_buf); in xfrm_audit_state_icvfail()