Lines Matching full:family
43 2. Hash table by (daddr,family,reqid) to find what SAs exist for given
63 unsigned short family) in xfrm_dst_hash() argument
65 return __xfrm_dst_hash(daddr, saddr, reqid, family, net->xfrm.state_hmask); in xfrm_dst_hash()
71 unsigned short family) in xfrm_src_hash() argument
73 return __xfrm_src_hash(daddr, saddr, family, net->xfrm.state_hmask); in xfrm_src_hash()
78 __be32 spi, u8 proto, unsigned short family) in xfrm_spi_hash() argument
80 return __xfrm_spi_hash(daddr, spi, proto, family, net->xfrm.state_hmask); in xfrm_spi_hash()
121 x->props.reqid, x->props.family, in xfrm_hash_transfer()
126 x->props.family, in xfrm_hash_transfer()
132 x->id.proto, x->props.family, in xfrm_hash_transfer()
226 int xfrm_register_type(const struct xfrm_type *type, unsigned short family) in xfrm_register_type() argument
228 struct xfrm_state_afinfo *afinfo = xfrm_state_get_afinfo(family); in xfrm_register_type()
272 void xfrm_unregister_type(const struct xfrm_type *type, unsigned short family) in xfrm_unregister_type() argument
274 struct xfrm_state_afinfo *afinfo = xfrm_state_get_afinfo(family); in xfrm_unregister_type()
315 static const struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family) in xfrm_get_type() argument
322 afinfo = xfrm_state_get_afinfo(family); in xfrm_get_type()
358 request_module("xfrm-type-%d-%d", family, proto); in xfrm_get_type()
372 unsigned short family) in xfrm_register_type_offload() argument
374 struct xfrm_state_afinfo *afinfo = xfrm_state_get_afinfo(family); in xfrm_register_type_offload()
397 unsigned short family) in xfrm_unregister_type_offload() argument
399 struct xfrm_state_afinfo *afinfo = xfrm_state_get_afinfo(family); in xfrm_unregister_type_offload()
418 xfrm_get_type_offload(u8 proto, unsigned short family, bool try_load) in xfrm_get_type_offload() argument
424 afinfo = xfrm_state_get_afinfo(family); in xfrm_get_type_offload()
442 request_module("xfrm-offload-%d-%d", family, proto); in xfrm_get_type_offload()
459 .family = AF_INET,
463 .family = AF_INET,
468 .family = AF_INET,
476 .family = AF_INET6,
480 .family = AF_INET6,
484 .family = AF_INET6,
489 .family = AF_INET6,
493 static const struct xfrm_mode *xfrm_get_mode(unsigned int encap, int family) in xfrm_get_mode() argument
500 switch (family) { in xfrm_get_mode()
503 if (mode->family == family) in xfrm_get_mode()
508 if (mode->family == family) in xfrm_get_mode()
971 sel->family = AF_INET; in __xfrm4_init_tempsel()
990 sel->family = AF_INET6; in __xfrm6_init_tempsel()
1001 unsigned short family) in xfrm_init_tempstate() argument
1003 switch (family) { in xfrm_init_tempstate()
1033 x->props.family = tmpl->encap_family; in xfrm_init_tempstate()
1039 unsigned short family, in __xfrm_state_lookup_all() argument
1042 unsigned int h = xfrm_spi_hash(net, daddr, spi, proto, family); in __xfrm_state_lookup_all()
1063 if (x->props.family != family || in __xfrm_state_lookup_all()
1066 !xfrm_addr_equal(&x->id.daddr, daddr, family)) in __xfrm_state_lookup_all()
1082 unsigned short family) in __xfrm_state_lookup() argument
1084 unsigned int h = xfrm_spi_hash(net, daddr, spi, proto, family); in __xfrm_state_lookup()
1088 if (x->props.family != family || in __xfrm_state_lookup()
1091 !xfrm_addr_equal(&x->id.daddr, daddr, family)) in __xfrm_state_lookup()
1107 u8 proto, unsigned short family) in __xfrm_state_lookup_byaddr() argument
1109 unsigned int h = xfrm_src_hash(net, daddr, saddr, family); in __xfrm_state_lookup_byaddr()
1113 if (x->props.family != family || in __xfrm_state_lookup_byaddr()
1115 !xfrm_addr_equal(&x->id.daddr, daddr, family) || in __xfrm_state_lookup_byaddr()
1116 !xfrm_addr_equal(&x->props.saddr, saddr, family)) in __xfrm_state_lookup_byaddr()
1130 __xfrm_state_locate(struct xfrm_state *x, int use_spi, int family) in __xfrm_state_locate() argument
1137 x->id.spi, x->id.proto, family); in __xfrm_state_locate()
1142 x->id.proto, family); in __xfrm_state_locate()
1154 const struct flowi *fl, unsigned short family, in xfrm_state_look_at() argument
1170 if ((x->sel.family && in xfrm_state_look_at()
1171 (x->sel.family != family || in xfrm_state_look_at()
1172 !xfrm_selector_match(&x->sel, fl, family))) || in xfrm_state_look_at()
1186 if ((!x->sel.family || in xfrm_state_look_at()
1187 (x->sel.family == family && in xfrm_state_look_at()
1188 xfrm_selector_match(&x->sel, fl, family))) && in xfrm_state_look_at()
1199 unsigned short family, u32 if_id) in xfrm_state_find() argument
1237 if (x->props.family == encap_family && in xfrm_state_find()
1246 xfrm_state_look_at(pol, x, fl, family, in xfrm_state_find()
1271 if (x->props.family == encap_family && in xfrm_state_find()
1280 xfrm_state_look_at(pol, x, fl, family, in xfrm_state_find()
1314 xfrm_init_tempstate(x, fl, tmpl, daddr, saddr, family); in xfrm_state_find()
1423 unsigned short family, u8 mode, u8 proto, u32 reqid) in xfrm_stateonly_find() argument
1429 h = xfrm_dst_hash(net, daddr, saddr, reqid, family); in xfrm_stateonly_find()
1431 if (x->props.family == family && in xfrm_stateonly_find()
1436 xfrm_state_addr_check(x, daddr, saddr, family) && in xfrm_stateonly_find()
1455 unsigned short family) in xfrm_state_lookup_byspi() argument
1463 if (x->props.family != family || in xfrm_state_lookup_byspi()
1484 x->props.reqid, x->props.family); in __xfrm_state_insert()
1488 h = xfrm_src_hash(net, &x->id.daddr, &x->props.saddr, x->props.family); in __xfrm_state_insert()
1494 x->props.family); in __xfrm_state_insert()
1521 unsigned short family = xnew->props.family; in __xfrm_state_bump_genids() local
1528 h = xfrm_dst_hash(net, &xnew->id.daddr, &xnew->props.saddr, reqid, family); in __xfrm_state_bump_genids()
1530 if (x->props.family == family && in __xfrm_state_bump_genids()
1534 xfrm_addr_equal(&x->id.daddr, &xnew->id.daddr, family) && in __xfrm_state_bump_genids()
1535 xfrm_addr_equal(&x->props.saddr, &xnew->props.saddr, family)) in __xfrm_state_bump_genids()
1554 unsigned short family, u8 mode, in __find_acq_core() argument
1560 unsigned int h = xfrm_dst_hash(net, daddr, saddr, reqid, family); in __find_acq_core()
1567 x->props.family != family || in __find_acq_core()
1572 !xfrm_addr_equal(&x->id.daddr, daddr, family) || in __find_acq_core()
1573 !xfrm_addr_equal(&x->props.saddr, saddr, family)) in __find_acq_core()
1585 switch (family) { in __find_acq_core()
1607 x->props.family = family; in __find_acq_core()
1621 h = xfrm_src_hash(net, daddr, saddr, family); in __find_acq_core()
1639 int family; in xfrm_state_add() local
1644 family = x->props.family; in xfrm_state_add()
1650 x1 = __xfrm_state_locate(x, use_spi, family); in xfrm_state_add()
1661 !xfrm_addr_equal(&x1->id.daddr, &x->id.daddr, family))) { in xfrm_state_add()
1668 x1 = __find_acq_core(net, &x->mark, family, x->props.mode, in xfrm_state_add()
1730 x->props.family = orig->props.family; in xfrm_state_clone()
1879 xc->props.family = m->new_family; in xfrm_state_migrate()
1915 x1 = __xfrm_state_locate(x, use_spi, x->props.family); in xfrm_state_update()
2042 u8 proto, unsigned short family) in xfrm_state_lookup() argument
2047 x = __xfrm_state_lookup(net, mark, daddr, spi, proto, family); in xfrm_state_lookup()
2056 u8 proto, unsigned short family) in xfrm_state_lookup_byaddr() argument
2061 x = __xfrm_state_lookup_byaddr(net, mark, daddr, saddr, proto, family); in xfrm_state_lookup_byaddr()
2070 const xfrm_address_t *saddr, int create, unsigned short family) in xfrm_find_acq() argument
2075 x = __find_acq_core(net, mark, family, mode, reqid, if_id, proto, daddr, saddr, create); in xfrm_find_acq()
2181 unsigned short family) in xfrm_tmpl_sort() argument
2185 if (family == AF_INET6) in xfrm_tmpl_sort()
2195 unsigned short family) in xfrm_state_sort() argument
2199 if (family == AF_INET6) in xfrm_state_sort()
2305 x0 = xfrm_state_lookup(net, mark, &x->id.daddr, minspi, x->id.proto, x->props.family); in xfrm_alloc_spi()
2316 x0 = xfrm_state_lookup(net, mark, &x->id.daddr, htonl(spi), x->id.proto, x->props.family); in xfrm_alloc_spi()
2327 h = xfrm_spi_hash(net, &x->id.daddr, x->id.spi, x->id.proto, x->props.family); in xfrm_alloc_spi()
2348 if ((filter->family == AF_INET || in __xfrm_state_filter_match()
2349 filter->family == AF_INET6) && in __xfrm_state_filter_match()
2350 x->props.family != filter->family) in __xfrm_state_filter_match()
2749 if (WARN_ON(afinfo->family >= NPROTO)) in xfrm_state_register_afinfo()
2753 if (unlikely(xfrm_state_afinfo[afinfo->family] != NULL)) in xfrm_state_register_afinfo()
2756 rcu_assign_pointer(xfrm_state_afinfo[afinfo->family], afinfo); in xfrm_state_register_afinfo()
2764 int err = 0, family = afinfo->family; in xfrm_state_unregister_afinfo() local
2766 if (WARN_ON(family >= NPROTO)) in xfrm_state_unregister_afinfo()
2770 if (likely(xfrm_state_afinfo[afinfo->family] != NULL)) { in xfrm_state_unregister_afinfo()
2771 if (rcu_access_pointer(xfrm_state_afinfo[family]) != afinfo) in xfrm_state_unregister_afinfo()
2774 RCU_INIT_POINTER(xfrm_state_afinfo[afinfo->family], NULL); in xfrm_state_unregister_afinfo()
2782 struct xfrm_state_afinfo *xfrm_state_afinfo_get_rcu(unsigned int family) in xfrm_state_afinfo_get_rcu() argument
2784 if (unlikely(family >= NPROTO)) in xfrm_state_afinfo_get_rcu()
2787 return rcu_dereference(xfrm_state_afinfo[family]); in xfrm_state_afinfo_get_rcu()
2791 struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned int family) in xfrm_state_get_afinfo() argument
2794 if (unlikely(family >= NPROTO)) in xfrm_state_get_afinfo()
2797 afinfo = rcu_dereference(xfrm_state_afinfo[family]); in xfrm_state_get_afinfo()
2840 if (x->props.family == AF_INET) in xfrm_state_mtu()
2842 else if (x->props.family == AF_INET6) in xfrm_state_mtu()
2862 int family = x->props.family; in __xfrm_init_state() local
2865 if (family == AF_INET && in __xfrm_init_state()
2871 if (x->sel.family != AF_UNSPEC) { in __xfrm_init_state()
2872 inner_mode = xfrm_get_mode(x->props.mode, x->sel.family); in __xfrm_init_state()
2879 family != x->sel.family) { in __xfrm_init_state()
2880 NL_SET_ERR_MSG(extack, "Only tunnel modes can accommodate a change of family"); in __xfrm_init_state()
2889 inner_mode = xfrm_get_mode(x->props.mode, x->props.family); in __xfrm_init_state()
2897 if (x->props.family == AF_INET) in __xfrm_init_state()
2907 x->type = xfrm_get_type(x->id.proto, family); in __xfrm_init_state()
2913 x->type_offload = xfrm_get_type_offload(x->id.proto, family, offload); in __xfrm_init_state()
2919 outer_mode = xfrm_get_mode(x->props.mode, family); in __xfrm_init_state()
3042 switch (x->props.family) { in xfrm_audit_helper_sainfo()
3056 static void xfrm_audit_helper_pktinfo(struct sk_buff *skb, u16 family, in xfrm_audit_helper_pktinfo() argument
3062 switch (family) { in xfrm_audit_helper_pktinfo()
3117 xfrm_audit_helper_pktinfo(skb, x->props.family, audit_buf); in xfrm_audit_state_replay_overflow()
3135 xfrm_audit_helper_pktinfo(skb, x->props.family, audit_buf); in xfrm_audit_state_replay()
3143 void xfrm_audit_state_notfound_simple(struct sk_buff *skb, u16 family) in xfrm_audit_state_notfound_simple() argument
3150 xfrm_audit_helper_pktinfo(skb, family, audit_buf); in xfrm_audit_state_notfound_simple()
3155 void xfrm_audit_state_notfound(struct sk_buff *skb, u16 family, in xfrm_audit_state_notfound() argument
3164 xfrm_audit_helper_pktinfo(skb, family, audit_buf); in xfrm_audit_state_notfound()
3182 xfrm_audit_helper_pktinfo(skb, x->props.family, audit_buf); in xfrm_audit_state_icvfail()