Lines Matching refs:ipha
743 ipha_t *ipha = (ipha_t *)data_mp->b_rptr; in esp_fix_natt_checksums() local
749 switch (ipha->ipha_protocol) { in esp_fix_natt_checksums()
752 IPH_HDR_LENGTH(ipha)); in esp_fix_natt_checksums()
761 udpha = (udpha_t *)(data_mp->b_rptr + IPH_HDR_LENGTH(ipha)); in esp_fix_natt_checksums()
793 ipha_t *ipha; in esp_strip_header() local
810 ipha = (ipha_t *)data_mp->b_rptr; in esp_strip_header()
812 IPH_HDR_LENGTH(ipha)); in esp_strip_header()
813 divpoint = IPH_HDR_LENGTH(ipha); in esp_strip_header()
838 ipha->ipha_protocol = nexthdr; in esp_strip_header()
843 if (padlen >= ntohs(ipha->ipha_length) - sizeof (ipha_t) - 2 - in esp_strip_header()
854 ntohs(ipha->ipha_length), ivlen, in esp_strip_header()
855 (int)(ntohs(ipha->ipha_length) - sizeof (ipha_t) - in esp_strip_header()
865 ipha->ipha_length = htons(ntohs(ipha->ipha_length) - padlen - in esp_strip_header()
867 ipha->ipha_hdr_checksum = 0; in esp_strip_header()
868 ipha->ipha_hdr_checksum = (uint16_t)ip_csum_hdr(ipha); in esp_strip_header()
1174 ipha_t *ipha = (ipha_t *)data_mp->b_rptr; in esp_inbound() local
1175 ipha->ipha_length = htons(ntohs(ipha->ipha_length) - in esp_inbound()
1905 ipha_t *ipha = (ipha_t *)data_mp->b_rptr; in esp_kcf_callback_outbound() local
1909 if (IPH_HDR_VERSION(ipha) == IP_VERSION && in esp_kcf_callback_outbound()
1910 ipha->ipha_protocol == IPPROTO_UDP) in esp_kcf_callback_outbound()
1911 esp_prepare_udp(ns, data_mp, ipha); in esp_kcf_callback_outbound()
2260 esp_prepare_udp(netstack_t *ns, mblk_t *mp, ipha_t *ipha) in esp_prepare_udp() argument
2266 uint_t hlen = IPH_HDR_LENGTH(ipha); in esp_prepare_udp()
2270 ipha->ipha_hdr_checksum = 0; in esp_prepare_udp()
2271 ipha->ipha_hdr_checksum = ip_csum_hdr(ipha); in esp_prepare_udp()
2276 arr = (uint16_t *)ipha; in esp_prepare_udp()
2279 ntohs(htons(ipha->ipha_length) - hlen)); in esp_prepare_udp()
2282 ntohs(htons(ipha->ipha_length) - hlen); in esp_prepare_udp()
2337 ipha_t *ipha; in ipsecesp_send_keepalive() local
2346 ipha = (ipha_t *)mp->b_rptr; in ipsecesp_send_keepalive()
2347 ipha->ipha_version_and_hdr_length = IP_SIMPLE_HDR_VERSION; in ipsecesp_send_keepalive()
2348 ipha->ipha_type_of_service = 0; in ipsecesp_send_keepalive()
2349 ipha->ipha_length = htons(sizeof (ipha_t) + sizeof (udpha_t) + 1); in ipsecesp_send_keepalive()
2351 ipha->ipha_ident = *(((uint16_t *)(&assoc->ipsa_spi)) + 1); in ipsecesp_send_keepalive()
2352 ipha->ipha_fragment_offset_and_flags = 0; /* Too small to fragment! */ in ipsecesp_send_keepalive()
2353 ipha->ipha_ttl = 0xFF; in ipsecesp_send_keepalive()
2354 ipha->ipha_protocol = IPPROTO_UDP; in ipsecesp_send_keepalive()
2355 ipha->ipha_hdr_checksum = 0; in ipsecesp_send_keepalive()
2356 ipha->ipha_src = assoc->ipsa_srcaddr[0]; in ipsecesp_send_keepalive()
2357 ipha->ipha_dst = assoc->ipsa_dstaddr[0]; in ipsecesp_send_keepalive()
2358 udpha = (udpha_t *)(ipha + 1); in ipsecesp_send_keepalive()
2368 esp_prepare_udp(ns, mp, ipha); in ipsecesp_send_keepalive()
2609 ipha_t *ipha; in esp_outbound() local
2687 ipha = (ipha_t *)data_mp->b_rptr; /* So we can call esp_acquire(). */ in esp_outbound()
2690 ASSERT(IPH_HDR_VERSION(ipha) == IPV4_VERSION); in esp_outbound()
2693 divpoint = IPH_HDR_LENGTH(ipha); in esp_outbound()
2694 datalen = ntohs(ipha->ipha_length) - divpoint; in esp_outbound()
2695 nhp = (uint8_t *)&ipha->ipha_protocol; in esp_outbound()
2699 ASSERT(IPH_HDR_VERSION(ipha) == IPV6_VERSION); in esp_outbound()
2702 ip6h = (ip6_t *)ipha; in esp_outbound()
2882 ipha->ipha_length = htons(ntohs(ipha->ipha_length) + adj); in esp_outbound()
2885 udpha->uha_length = htons(ntohs(ipha->ipha_length) - in esp_outbound()
2886 IPH_HDR_LENGTH(ipha)); in esp_outbound()
2890 ipha->ipha_hdr_checksum = 0; in esp_outbound()
2891 ipha->ipha_hdr_checksum = (uint16_t)ip_csum_hdr(ipha); in esp_outbound()