Lines Matching refs:iph
315 ipsec_polhead_free_table(ipsec_policy_head_t *iph) in ipsec_polhead_free_table() argument
321 ipsec_policy_root_t *ipr = &iph->iph_root[dir]; in ipsec_polhead_free_table()
336 ipsec_polhead_destroy(ipsec_policy_head_t *iph) in ipsec_polhead_destroy() argument
340 avl_destroy(&iph->iph_rulebyid); in ipsec_polhead_destroy()
341 rw_destroy(&iph->iph_lock); in ipsec_polhead_destroy()
344 ipsec_policy_root_t *ipr = &iph->iph_root[dir]; in ipsec_polhead_destroy()
351 ipsec_polhead_free_table(iph); in ipsec_polhead_destroy()
476 ipsec_alloc_table(ipsec_policy_head_t *iph, int nchains, int kmflag, in ipsec_alloc_table() argument
482 ipsec_policy_root_t *ipr = &iph->iph_root[dir]; in ipsec_alloc_table()
528 ipsec_polhead_init(ipsec_policy_head_t *iph, int nchains) in ipsec_polhead_init() argument
532 rw_init(&iph->iph_lock, NULL, RW_DEFAULT, NULL); in ipsec_polhead_init()
533 avl_create(&iph->iph_rulebyid, ipsec_policy_cmpbyid, in ipsec_polhead_init()
537 ipsec_policy_root_t *ipr = &iph->iph_root[dir]; in ipsec_polhead_init()
5268 ipha_t *iph = NULL; in ipsec_tun_outbound() local
5292 iph = (ipha_t *)(mp->b_rptr + hdr_len); in ipsec_tun_outbound()
5309 if (iph == NULL) { in ipsec_tun_outbound()
5311 iph = (ipha_t *)(mp->b_rptr + hdr_len); in ipsec_tun_outbound()
5313 inner_ipv4 = iph; in ipsec_tun_outbound()
6009 tunnel_polhead_init(ipsec_policy_head_t *iph, netstack_t *ns) in tunnel_polhead_init() argument
6013 rw_init(&iph->iph_lock, NULL, RW_DEFAULT, NULL); in tunnel_polhead_init()
6014 iph->iph_refs = 1; in tunnel_polhead_init()
6015 iph->iph_gen = 0; in tunnel_polhead_init()
6016 if (ipsec_alloc_table(iph, ipss->ipsec_tun_spd_hashsize, in tunnel_polhead_init()
6018 ipsec_polhead_free_table(iph); in tunnel_polhead_init()
6021 ipsec_polhead_init(iph, ipss->ipsec_tun_spd_hashsize); in tunnel_polhead_init()
6260 ipha_t *iph; in ipsec_fragcache_add() local
6300 iph = (ipha_t *)(mp->b_rptr + outer_hdr_len); in ipsec_fragcache_add()
6302 if (IPH_HDR_VERSION(iph) == IPV4_VERSION) { in ipsec_fragcache_add()
6305 ASSERT(IPH_HDR_VERSION(iph) == IPV6_VERSION); in ipsec_fragcache_add()
6362 i = IPSEC_FRAG_HASH_FUNC(iph->ipha_ident); in ipsec_fragcache_add()
6368 ASSERT(iph != NULL); in ipsec_fragcache_add()
6369 if ((fep->itpfe_id == iph->ipha_ident) && in ipsec_fragcache_add()
6370 (fep->itpfe_src == iph->ipha_src) && in ipsec_fragcache_add()
6371 (fep->itpfe_dst == iph->ipha_dst) && in ipsec_fragcache_add()
6372 (fep->itpfe_proto == iph->ipha_protocol)) in ipsec_fragcache_add()
6387 firstbyte = V4_FRAG_OFFSET(iph); in ipsec_fragcache_add()
6388 lastbyte = firstbyte + ntohs(iph->ipha_length) - in ipsec_fragcache_add()
6389 IPH_HDR_LENGTH(iph); in ipsec_fragcache_add()
6390 last = (V4_MORE_FRAGS(iph) == 0); in ipsec_fragcache_add()
6394 lastbyte, last, iph->ipha_ident, mp); in ipsec_fragcache_add()
6442 bcopy((caddr_t)&iph->ipha_src, (caddr_t)&fep->itpfe_src, in ipsec_fragcache_add()
6444 bcopy((caddr_t)&iph->ipha_dst, (caddr_t)&fep->itpfe_dst, in ipsec_fragcache_add()
6446 fep->itpfe_id = iph->ipha_ident; in ipsec_fragcache_add()
6447 fep->itpfe_proto = iph->ipha_protocol; in ipsec_fragcache_add()
6561 data = (char *)iph + IPH_HDR_LENGTH(iph) + in ipsec_fragcache_add()
6618 data = (char *)iph + IPH_HDR_LENGTH(iph) + in ipsec_fragcache_add()
6622 data = (char *)iph + in ipsec_fragcache_add()
6623 IPH_HDR_LENGTH(iph) + firstbyte - in ipsec_fragcache_add()
6707 iph = NULL; in ipsec_fragcache_add()
6712 iph = (ipha_t *)(data_mp->b_rptr + hdr_len); in ipsec_fragcache_add()
6724 if (iph == NULL) { in ipsec_fragcache_add()
6726 iph = (ipha_t *)(data_mp->b_rptr + hdr_len); in ipsec_fragcache_add()
6728 firstbyte = V4_FRAG_OFFSET(iph); in ipsec_fragcache_add()
6729 lastbyte = firstbyte + ntohs(iph->ipha_length) - in ipsec_fragcache_add()
6730 IPH_HDR_LENGTH(iph); in ipsec_fragcache_add()
6784 if ((is_v4 && !V4_MORE_FRAGS(iph)) || in ipsec_fragcache_add()
6791 if ((is_v4 && (firstbyte + ntohs(iph->ipha_length) > in ipsec_fragcache_add()