/illumos-gate/usr/src/uts/common/inet/ip/ |
H A D | ip_input.c | 202 ipha_t *ipha; in ip_input_common_v4() local 305 ipha = (ipha_t *)mp->b_rptr; in ip_input_common_v4() 306 if (!OK_32PTR(ipha) || MBLKL(mp) < IP_SIMPLE_HDR_LENGTH) { in ip_input_common_v4() 314 ipha = (ipha_t *)mp->b_rptr; in ip_input_common_v4() 318 if (IPH_HDR_VERSION(ipha) != IPV4_VERSION) { in ip_input_common_v4() 332 if (ipha->ipha_dst == INADDR_ANY) { in ip_input_common_v4() 365 iras.ira_pktlen = ntohs(ipha->ipha_length); in ip_input_common_v4() 368 iras.ira_ttl = ipha->ipha_ttl; in ip_input_common_v4() 376 (*ill->ill_inputfn)(mp, ipha, &ipha->ipha_dst, &iras, &rtc); in ip_input_common_v4() 430 ipha_t *ipha = (ipha_t *)iph_arg; in ill_input_full_v4() local [all …]
|
H A D | ip_output.c | 418 ipha_t *ipha = (ipha_t *)mp->b_rptr; in ip_verify_src() local 420 if (ipha->ipha_src == INADDR_ANY) in ip_verify_src() 423 return (ip_laddr_verify_v4(ipha->ipha_src, ixa->ixa_zoneid, in ip_verify_src() 536 ipha_t *ipha = NULL; in ip_verify_nce() local 540 ipha = (ipha_t *)mp->b_rptr; in ip_verify_nce() 544 nce = ire_handle_condemned_nce(ixa->ixa_nce, ire, ipha, ip6h, B_TRUE); in ip_verify_nce() 808 ipha_t *ipha; in ip_output_simple_v4() local 823 ipha = (ipha_t *)mp->b_rptr; in ip_output_simple_v4() 824 ASSERT(IPH_HDR_VERSION(ipha) == IPV4_VERSION); in ip_output_simple_v4() 836 ixa->ixa_pktlen = ntohs(ipha->ipha_length); in ip_output_simple_v4() [all …]
|
H A D | tn_ipopt.c | 131 ipha_t *ipha; in tsol_get_option_v4() local 144 ipha = (ipha_t *)mp->b_rptr; in tsol_get_option_v4() 145 totallen = ipha->ipha_version_and_hdr_length - in tsol_get_option_v4() 158 opt = (uchar_t *)&ipha[1]; in tsol_get_option_v4() 554 tsol_remove_secopt(ipha_t *ipha, int buflen) in tsol_remove_secopt() argument 560 remlen = IPH_HDR_LENGTH(ipha) - IP_SIMPLE_HDR_LENGTH; in tsol_remove_secopt() 561 fptr = tptr = (uchar_t *)(ipha + 1); in tsol_remove_secopt() 575 if (((fptr - (uchar_t *)ipha) & 3) == 0) in tsol_remove_secopt() 611 olen = (tptr - (uchar_t *)ipha) & 3; in tsol_remove_secopt() 622 ovbcopy(fptr, tptr, ((uchar_t *)ipha + buflen) - fptr); in tsol_remove_secopt() [all …]
|
H A D | ip_mroute.c | 1535 ipha_t *ipha = (ipha_t *)mp->b_rptr; in ip_mforward() local 1552 ntohl(ipha->ipha_src), ntohl(ipha->ipha_dst), in ip_mforward() 1556 dst = ipha->ipha_dst; in ip_mforward() 1566 if (CLASSD(dst) && (ipha->ipha_ttl <= 1 || in ip_mforward() 1572 ipha->ipha_ttl, ntohl(dst), ill->ill_name); in ip_mforward() 1599 } else if ((ipha->ipha_version_and_hdr_length & 0xf) < in ip_mforward() 1601 ((uchar_t *)(ipha + 1))[1] != IPOPT_LSRR) { in ip_mforward() 1618 ntohl(ipha->ipha_src)); in ip_mforward() 1624 src = ipha->ipha_src; in ip_mforward() 1648 ret = ip_mdq(mp, ipha, in ip_mforward() [all …]
|
H A D | ip.c | 1330 ipha_t *ipha; /* Outer header */ in icmp_inbound_v4() local 1343 ipha = (ipha_t *)mp->b_rptr; in icmp_inbound_v4() 1356 ipha = ip_pullup(mp, ip_hdr_length + ICMPH_SIZE, ira); in icmp_inbound_v4() 1357 if (ipha == NULL) { in icmp_inbound_v4() 1428 ipha = (ipha_t *)mp->b_rptr; in icmp_inbound_v4() 1433 icmp_send_reply_v4(mp, ipha, icmph, ira); in icmp_inbound_v4() 1467 ipha = ip_pullup(mp, len_needed, ira); in icmp_inbound_v4() 1468 if (ipha == NULL) { in icmp_inbound_v4() 1490 ipha = (ipha_t *)mp->b_rptr; in icmp_inbound_v4() 1503 icmp_send_reply_v4(mp, ipha, icmph, ira); in icmp_inbound_v4() [all …]
|
H A D | ip_sadb.c | 603 ipha_t *ipha = (ipha_t *)data_mp->b_rptr; in ipsec_outbound_sa() local 605 ASSERT(IPH_HDR_VERSION(ipha) == IPV4_VERSION); in ipsec_outbound_sa() 606 dst = ip_get_dst(ipha); in ipsec_outbound_sa() 616 src_ptr = (uint32_t *)&ipha->ipha_src; in ipsec_outbound_sa() 661 ipha_t *ipha; in ipsec_inbound_ah_sa() local 683 ipha = (ipha_t *)mp->b_rptr; in ipsec_inbound_ah_sa() 684 ASSERT(ipha->ipha_protocol == IPPROTO_AH); in ipsec_inbound_ah_sa() 685 ah_offset = ipha->ipha_version_and_hdr_length - in ipsec_inbound_ah_sa() 710 ipha = (ipha_t *)mp->b_rptr; in ipsec_inbound_ah_sa() 721 src_ptr = (uint32_t *)&ipha->ipha_src; in ipsec_inbound_ah_sa() [all …]
|
H A D | tnet.c | 686 const ipha_t *ipha; in tsol_get_pkt_label() local 704 ipha = (const ipha_t *)mp->b_rptr; in tsol_get_pkt_label() 705 src = &ipha->ipha_src; in tsol_get_pkt_label() 764 proto = ipha->ipha_protocol; in tsol_get_pkt_label() 769 (mp->b_rptr + IPH_HDR_LENGTH(ipha)); in tsol_get_pkt_label() 1043 ipha_t *ipha = (ipha_t *)mp->b_rptr; in tsol_can_accept_raw() local 1045 src_rhtp = find_tpc(&ipha->ipha_src, IPV4_VERSION, in tsol_can_accept_raw() 1049 dst_rhtp = find_tpc(&ipha->ipha_dst, IPV4_VERSION, in tsol_can_accept_raw() 1129 const ipha_t *ipha; in tsol_can_reply_error() local 1136 sizeof (*ipha) : sizeof (*ip6h))); in tsol_can_reply_error() [all …]
|
H A D | ipsecesp.c | 674 ipha_t *ipha = (ipha_t *)data_mp->b_rptr; in esp_fix_natt_checksums() local 680 switch (ipha->ipha_protocol) { in esp_fix_natt_checksums() 683 IPH_HDR_LENGTH(ipha)); in esp_fix_natt_checksums() 692 udpha = (udpha_t *)(data_mp->b_rptr + IPH_HDR_LENGTH(ipha)); in esp_fix_natt_checksums() 724 ipha_t *ipha; in esp_strip_header() local 741 ipha = (ipha_t *)data_mp->b_rptr; in esp_strip_header() 743 IPH_HDR_LENGTH(ipha)); in esp_strip_header() 744 divpoint = IPH_HDR_LENGTH(ipha); in esp_strip_header() 769 ipha->ipha_protocol = nexthdr; in esp_strip_header() 774 if (padlen >= ntohs(ipha->ipha_length) - sizeof (ipha_t) - 2 - in esp_strip_header() [all …]
|
H A D | ipsecah.c | 1988 ipha_t *ipha; in ah_icmp_error_v4() local 1996 oipha = ipha = (ipha_t *)mp->b_rptr; in ah_icmp_error_v4() 1997 iph_hdr_length = IPH_HDR_LENGTH(ipha); in ah_icmp_error_v4() 2000 ipha = (ipha_t *)&icmph[1]; in ah_icmp_error_v4() 2001 hdr_length = IPH_HDR_LENGTH(ipha); in ah_icmp_error_v4() 2006 if ((uchar_t *)ipha + hdr_length + 8 > mp->b_wptr) { in ah_icmp_error_v4() 2007 if (!pullupmsg(mp, (uchar_t *)ipha + hdr_length + 8 - in ah_icmp_error_v4() 2020 ipha = (ipha_t *)&icmph[1]; in ah_icmp_error_v4() 2023 ah = (ah_t *)((uint8_t *)ipha + hdr_length); in ah_icmp_error_v4() 2026 hptr = OUTBOUND_BUCKET_V4(&ahstack->ah_sadb.s_v4, ipha->ipha_dst); in ah_icmp_error_v4() [all …]
|
H A D | ipdrop.c | 319 ipha_t *ipha = (ipha_t *)mp->b_rptr; in ip_drop_input() local 322 ipha, __dtrace_ipsr_ill_t *, ill, ipha_t *, ipha, in ip_drop_input() 341 ipha_t *ipha = (ipha_t *)mp->b_rptr; in ip_drop_output() local 344 ipha, __dtrace_ipsr_ill_t *, ill, ipha_t *, ipha, in ip_drop_output()
|
H A D | spd.c | 104 struct ipsec_action_s *, ipha_t *ipha, ip6_t *ip6h, const char **, 1024 ipsec_log_policy_failure(int type, char *func_name, ipha_t *ipha, ip6_t *ip6h, in ipsec_log_policy_failure() argument 1033 ASSERT((ipha == NULL && ip6h != NULL) || in ipsec_log_policy_failure() 1034 (ip6h == NULL && ipha != NULL)); in ipsec_log_policy_failure() 1036 if (ipha != NULL) { in ipsec_log_policy_failure() 1037 s = inet_ntop(AF_INET, &ipha->ipha_src, sbuf, sizeof (sbuf)); in ipsec_log_policy_failure() 1038 d = inet_ntop(AF_INET, &ipha->ipha_dst, dbuf, sizeof (dbuf)); in ipsec_log_policy_failure() 1567 ipha_t *ipha, ip6_t *ip6h, const char **reason, kstat_named_t **counter, in ipsec_check_ipsecin_action() argument 1577 ASSERT((ipha == NULL && ip6h != NULL) || in ipsec_check_ipsecin_action() 1578 (ip6h == NULL && ipha != NULL)); in ipsec_check_ipsecin_action() [all …]
|
H A D | igmp.c | 73 static uint_t igmp_query_in(ipha_t *ipha, igmpa_t *igmpa, ill_t *ill); 314 ipha_t *ipha = (ipha_t *)(mp->b_rptr); in igmp_input() local 347 ipha = (ipha_t *)(mp->b_rptr); in igmp_input() 359 src = ipha->ipha_src; in igmp_input() 360 dst = ipha->ipha_dst; in igmp_input() 375 next = igmp_query_in(ipha, igmpa, ill); in igmp_input() 443 ipha->ipha_src = src; in igmp_input() 486 igmp_query_in(ipha_t *ipha, igmpa_t *igmpa, ill_t *ill) in igmp_query_in() argument 527 if (ipha->ipha_dst != htonl(INADDR_ALLHOSTS_GROUP) || in igmp_query_in() 1831 ipha_t *ipha; in igmp_sendpkt() local [all …]
|
H A D | icmp.c | 1154 ipha_t *ipha; in icmp_icmp_input() local 1160 ipha = (ipha_t *)mp->b_rptr; in icmp_icmp_input() 1164 if (IPH_HDR_VERSION(ipha) != IPV4_VERSION) { in icmp_icmp_input() 1165 ASSERT(IPH_HDR_VERSION(ipha) == IPV6_VERSION); in icmp_icmp_input() 1169 ASSERT(IPH_HDR_VERSION(ipha) == IPV4_VERSION); in icmp_icmp_input() 1172 ASSERT(IPH_HDR_LENGTH(ipha) == ira->ira_ip_hdr_length); in icmp_icmp_input() 1175 ipha = (ipha_t *)&icmph[1]; /* Inner IP header */ in icmp_icmp_input() 1177 iph_hdr_length = IPH_HDR_LENGTH(ipha); in icmp_icmp_input() 1183 ipha_t *ipha; in icmp_icmp_input() local 1205 ipha = (ipha_t *)connp->conn_ht_iphc; in icmp_icmp_input() [all …]
|
H A D | ipclassifier.c | 1535 ipha_t *ipha; in ipcl_classify_v4() local 1545 ipha = (ipha_t *)mp->b_rptr; in ipcl_classify_v4() 1546 up = (uint16_t *)((uchar_t *)ipha + hdr_len + TCP_PORTS_OFFSET); in ipcl_classify_v4() 1552 &ipst->ips_ipcl_conn_fanout[IPCL_CONN_HASH(ipha->ipha_src, in ipcl_classify_v4() 1558 ipha->ipha_src, ipha->ipha_dst, ports) && in ipcl_classify_v4() 1589 if (IPCL_BIND_MATCH(connp, protocol, ipha->ipha_dst, in ipcl_classify_v4() 1611 !tsol_receive_local(mp, &ipha->ipha_dst, IPV4_VERSION, in ipcl_classify_v4() 1636 if (IPCL_UDP_MATCH(connp, lport, ipha->ipha_dst, in ipcl_classify_v4() 1637 fport, ipha->ipha_src) && in ipcl_classify_v4() 1648 !tsol_receive_local(mp, &ipha->ipha_dst, IPV4_VERSION, in ipcl_classify_v4() [all …]
|
/illumos-gate/usr/src/uts/common/inet/ |
H A D | ip_impl.h | 81 #define IPH_TCPH_CHECKSUMP(ipha, hlen) \ argument 82 ((uint16_t *)(((uchar_t *)(ipha)) + ((hlen) + TCP_CHECKSUM_OFFSET))) 84 #define IPH_UDPH_CHECKSUMP(ipha, hlen) \ argument 85 ((uint16_t *)(((uchar_t *)(ipha)) + ((hlen) + UDP_CHECKSUM_OFFSET))) 87 #define IPH_ICMPV6_CHECKSUMP(ipha, hlen) \ argument 88 ((uint16_t *)(((uchar_t *)(ipha)) + ((hlen) + ICMPV6_CHECKSUM_OFFSET))) 134 #define IS_SIMPLE_IPH(ipha) \ argument 135 ((ipha)->ipha_version_and_hdr_length == IP_SIMPLE_HDR_VERSION) 186 #define MBLK_RX_FANOUT_SLOWPATH(mp, ipha) \ argument 189 !OK_32PTR(ipha) || \ [all …]
|
/illumos-gate/usr/src/uts/common/ipp/dscpmk/ |
H A D | dscpmk.c | 50 ipha_t *ipha; in dscpmk_process() local 82 ipha = (ipha_t *)mp->b_rptr; in dscpmk_process() 98 if (IPH_HDR_VERSION(ipha) == IPV4_VERSION) { in dscpmk_process() 99 dscp = ipha->ipha_type_of_service; in dscpmk_process() 147 ipha->ipha_type_of_service = new_dscp; in dscpmk_process() 154 ipha->ipha_hdr_checksum = 0; in dscpmk_process() 155 ipha->ipha_hdr_checksum = ip_csum_hdr(ipha); in dscpmk_process()
|
/illumos-gate/usr/src/uts/common/inet/sctp/ |
H A D | sctp_shutdown.c | 229 ipha_t *ipha = NULL; in sctp_ootb_shutdown_ack() local 278 ipha = (ipha_t *)mp->b_rptr; in sctp_ootb_shutdown_ack() 282 ipha->ipha_length = htons(ixas.ixa_pktlen); in sctp_ootb_shutdown_ack() 283 v4addr = ipha->ipha_src; in sctp_ootb_shutdown_ack() 284 ipha->ipha_src = ipha->ipha_dst; in sctp_ootb_shutdown_ack() 285 ipha->ipha_dst = v4addr; in sctp_ootb_shutdown_ack() 286 ipha->ipha_ident = 0; in sctp_ootb_shutdown_ack() 287 ipha->ipha_ttl = (uchar_t)sctps->sctps_ipv4_ttl; in sctp_ootb_shutdown_ack() 344 if (!ipsec_in_to_out(ira, &ixas, mp, ipha, ip6h)) { in sctp_ootb_shutdown_ack()
|
H A D | sctp_error.c | 328 ipha_t *ipha = NULL; in sctp_ootb_send_abort() local 368 ipha = (ipha_t *)mp->b_rptr; in sctp_ootb_send_abort() 372 ipha->ipha_length = htons(ahlen); in sctp_ootb_send_abort() 373 v4addr = ipha->ipha_src; in sctp_ootb_send_abort() 374 ipha->ipha_src = ipha->ipha_dst; in sctp_ootb_send_abort() 375 ipha->ipha_dst = v4addr; in sctp_ootb_send_abort() 376 ipha->ipha_ident = 0; in sctp_ootb_send_abort() 377 ipha->ipha_ttl = (uchar_t)sctps->sctps_ipv4_ttl; in sctp_ootb_send_abort() 427 ipha->ipha_length = htons(ixas.ixa_pktlen); in sctp_ootb_send_abort() 450 if (!ipsec_in_to_out(ira, &ixas, mp, ipha, ip6h)) { in sctp_ootb_send_abort()
|
/illumos-gate/usr/src/uts/common/inet/ilb/ |
H A D | ilb_nat.c | 443 ipha_t *ipha; in ilb_full_nat() local 445 ipha = iph; in ilb_full_nat() 448 ipha->ipha_src); in ilb_full_nat() 450 ipha->ipha_dst); in ilb_full_nat() 454 IN6_V4MAPPED_TO_IPADDR(&info->vip, ipha->ipha_src); in ilb_full_nat() 455 IN6_V4MAPPED_TO_IPADDR(&info->src, ipha->ipha_dst); in ilb_full_nat() 459 adj_cksum(&ipha->ipha_hdr_checksum, adj_ip_sum); in ilb_full_nat() 518 ipha_t *ipha; in ilb_half_nat() local 520 ipha = iph; in ilb_half_nat() 523 ipha->ipha_dst); in ilb_half_nat() [all …]
|
/illumos-gate/usr/src/uts/common/ipp/ipgpc/ |
H A D | classifier.c | 494 ipha_t *ipha = (ipha_t *)iph; in get_port_info() local 496 u2 = ntohs(ipha->ipha_fragment_offset_and_flags); in get_port_info() 501 iplen = (ipha->ipha_version_and_hdr_length & 0xF) << 2; in get_port_info() 610 ipha_t *ipha; in parse_packet() local 613 ipha = (ipha_t *)mp->b_rptr; /* get ip header */ in parse_packet() 614 V4_PART_OF_V6(packet->saddr) = (int32_t)ipha->ipha_src; in parse_packet() 615 V4_PART_OF_V6(packet->daddr) = (int32_t)ipha->ipha_dst; in parse_packet() 616 packet->dsfield = ipha->ipha_type_of_service; in parse_packet() 617 packet->proto = ipha->ipha_protocol; in parse_packet() 625 get_port_info(packet, ipha, AF_INET, mp); in parse_packet()
|
/illumos-gate/usr/src/uts/common/ipp/meters/ |
H A D | tswtcl.c | 63 ipha_t *ipha; in tswtcl_process() local 98 ipha = (ipha_t *)mp->b_rptr; in tswtcl_process() 99 if (IPH_HDR_VERSION(ipha) == IPV4_VERSION) { in tswtcl_process() 100 pkt_len = ntohs(ipha->ipha_length); in tswtcl_process()
|
H A D | tokenmt.c | 75 ipha_t *ipha; in tokenmt_process() local 108 ipha = (ipha_t *)mp->b_rptr; in tokenmt_process() 109 if (IPH_HDR_VERSION(ipha) == IPV4_VERSION) { in tokenmt_process() 111 dscp = ipha->ipha_type_of_service; in tokenmt_process() 112 pkt_len = ntohs(ipha->ipha_length); in tokenmt_process()
|
/illumos-gate/usr/src/uts/common/ipp/flowacct/ |
H A D | flowacct.c | 114 ipha_t *ipha = (ipha_t *)iph; in flowacct_port_info() local 118 u2 = ntohs(ipha->ipha_fragment_offset_and_flags); in flowacct_port_info() 123 iplen = (ipha->ipha_version_and_hdr_length & 0xF) << 2; in flowacct_port_info() 231 ipha_t *ipha; in flowacct_extract_header() local 233 #define rptr ((uchar_t *)ipha) in flowacct_extract_header() 243 ipha = (ipha_t *)mp->b_rptr; in flowacct_extract_header() 244 header->isv4 = IPH_HDR_VERSION(ipha) == IPV4_VERSION; in flowacct_extract_header() 246 ipha = (ipha_t *)mp->b_rptr; in flowacct_extract_header() 247 V4_PART_OF_V6(header->saddr) = (int32_t)ipha->ipha_src; in flowacct_extract_header() 248 V4_PART_OF_V6(header->daddr) = (int32_t)ipha->ipha_dst; in flowacct_extract_header() [all …]
|
/illumos-gate/usr/src/uts/common/inet/iptun/ |
H A D | iptun.c | 2262 is_icmp_error(mblk_t *mp, ipha_t *ipha, ip6_t *ip6h) in is_icmp_error() argument 2266 if (ipha != NULL) { in is_icmp_error() 2270 if (ipha->ipha_protocol != IPPROTO_ICMP) in is_icmp_error() 2273 hlen = IPH_HDR_LENGTH(ipha); in is_icmp_error() 2274 icmph = (icmph_t *)((uint8_t *)ipha + hlen); in is_icmp_error() 2304 ipha_t *ipha; in iptun_find_headers() local 2316 ipha = (ipha_t *)(mp->b_rptr); in iptun_find_headers() 2317 switch (IPH_HDR_VERSION(ipha)) { in iptun_find_headers() 2319 *outer4 = ipha; in iptun_find_headers() 2322 outer_hlen = IPH_HDR_LENGTH(ipha); in iptun_find_headers() [all …]
|
/illumos-gate/usr/src/uts/common/io/mac/ |
H A D | mac_sched.c | 1488 ipha_t *ipha; in mac_rx_srs_proto_fanout() local 1637 ipha = (ipha_t *)(mp->b_rptr + hdrsize); in mac_rx_srs_proto_fanout() 1638 if ((type != OTH) && MBLK_RX_FANOUT_SLOWPATH(mp, ipha)) in mac_rx_srs_proto_fanout() 1656 switch (ipha->ipha_protocol) { in mac_rx_srs_proto_fanout() 1708 ipha_t *ipha; in mac_rx_srs_long_fanout() local 1733 ipha = (ipha_t *)ip6h; in mac_rx_srs_long_fanout() 1758 ipha = (ipha_t *)ip6h; in mac_rx_srs_long_fanout() 1800 hdr_len = IPH_HDR_LENGTH(ipha); in mac_rx_srs_long_fanout() 1801 remlen = ntohs(ipha->ipha_length) - hdr_len; in mac_rx_srs_long_fanout() 1802 nexthdr = ipha->ipha_protocol; in mac_rx_srs_long_fanout() [all …]
|