/illumos-gate/usr/src/uts/common/io/mac/plugins/ |
H A D | mac_ipv4.c | 143 struct ip *iphp; in mac_ipv4_header() local 157 iphp = (struct ip *)mp->b_rptr; in mac_ipv4_header() 159 bzero(iphp, hdr_len + extra_len); in mac_ipv4_header() 161 bcopy(tmpl_iphp, iphp, hdr_len); in mac_ipv4_header() 163 iphp->ip_hl = IP_SIMPLE_HDR_LENGTH_IN_WORDS; in mac_ipv4_header() 164 iphp->ip_off = htons(IP_DF); in mac_ipv4_header() 165 iphp->ip_ttl = IPTUN_DEFAULT_HOPLIMIT; in mac_ipv4_header() 168 iphp->ip_v = IPVERSION; in mac_ipv4_header() 169 iphp->ip_len = 0; in mac_ipv4_header() 170 iphp->ip_p = (uint8_t)sap; in mac_ipv4_header() [all …]
|
/illumos-gate/usr/src/cmd/ipf/lib/ |
H A D | load_hash.c | 24 int load_hash(iphp, list, iocfunc) in load_hash() argument 25 iphtable_t *iphp; in load_hash() 49 op.iplo_unit = iphp->iph_unit; 50 strncpy(op.iplo_name, iphp->iph_name, sizeof(op.iplo_name)); 55 iph.iph_unit = iphp->iph_unit; 56 iph.iph_type = iphp->iph_type; 57 strncpy(iph.iph_name, iphp->iph_name, sizeof(iph.iph_name)); 58 iph.iph_flags = iphp->iph_flags; 61 if (iphp->iph_size == 0) 64 size = iphp->iph_size; [all …]
|
H A D | remove_hash.c | 18 int remove_hash(iphp, iocfunc) in remove_hash() argument 19 iphtable_t *iphp; in remove_hash() 31 op.iplo_unit = iphp->iph_unit; 32 strncpy(op.iplo_name, iphp->iph_name, sizeof(op.iplo_name)); 39 iph.iph_unit = iphp->iph_unit; 40 iph.iph_type = iphp->iph_type; 41 strncpy(iph.iph_name, iphp->iph_name, sizeof(iph.iph_name)); 42 iph.iph_flags = iphp->iph_flags;
|
/illumos-gate/usr/src/stand/lib/inet/ |
H A D | ipv4.c | 694 struct ip *iphp; in ipv4_input() local 718 iphp = (struct ip *)igp->igm_mp->b_rptr; in ipv4_input() 719 if (iphp->ip_v != IPVERSION) { in ipv4_input() 721 index, iphp->ip_v); in ipv4_input() 725 iphlen = iphp->ip_hl << 2; in ipv4_input() 732 iplen = ntohs(iphp->ip_len); in ipv4_input() 740 bcopy((caddr_t)&(iphp->ip_dst), (caddr_t)&ipdst, in ipv4_input() 742 bcopy((caddr_t)&(iphp->ip_src), (caddr_t)&ipsrc, in ipv4_input() 746 if (ipv4cksum((uint16_t *)iphp, iphlen) != 0) { in ipv4_input() 769 if (!promiscuous && (iphp->ip_p == IPPROTO_ICMP)) { in ipv4_input() [all …]
|
H A D | icmp4.c | 57 icmp4(struct inetgram *igp, struct ip *iphp, uint16_t iphlen, in icmp4() argument 64 icmp_len = ntohs(iphp->ip_len) - iphlen; in icmp4()
|
/illumos-gate/usr/src/uts/common/io/sfxge/ |
H A D | sfxge_tcp.c | 73 struct ip *iphp; in sfxge_pkthdr_parse() local 85 iphp = NULL; in sfxge_pkthdr_parse() 125 iphp = (struct ip *)(mp->b_rptr + off); in sfxge_pkthdr_parse() 126 iphs = iphp->ip_hl * 4; in sfxge_pkthdr_parse() 128 if (iphp->ip_v != IPV4_VERSION) in sfxge_pkthdr_parse() 132 size = ntohs(iphp->ip_len); in sfxge_pkthdr_parse() 142 if (iphp->ip_p == IPPROTO_TCP) { in sfxge_pkthdr_parse() 161 } else if (iphp->ip_p == IPPROTO_UDP) { in sfxge_pkthdr_parse() 180 } else if (iphp->ip_p == IPPROTO_SCTP) { in sfxge_pkthdr_parse() 205 *iphpp = iphp; in sfxge_pkthdr_parse()
|
H A D | sfxge_tx.c | 1570 struct ip *iphp = stpp->stp_iphp; in sfxge_tx_qlso_fragment() local 1604 if (msgdsize(mp) != ehs + ntohs(iphp->ip_len)) { in sfxge_tx_qlso_fragment() 1629 if (((iphp->ip_off & ~htons(IP_DF)) != 0) || in sfxge_tx_qlso_fragment() 1636 if (size + (thp->th_off << 2) + (iphp->ip_hl << 2) != in sfxge_tx_qlso_fragment() 1637 ntohs(iphp->ip_len)) { in sfxge_tx_qlso_fragment() 1646 start_len = ntohs(iphp->ip_len); in sfxge_tx_qlso_fragment() 1647 start_id = ip_id = ntohs(iphp->ip_id); in sfxge_tx_qlso_fragment() 1654 iphp->ip_len = htons((iphp->ip_hl << 2) + (thp->th_off << 2) + mss); in sfxge_tx_qlso_fragment() 1669 iphp->ip_id = htons(ip_id); in sfxge_tx_qlso_fragment() 1677 iphp->ip_len = htons((iphp->ip_hl << 2) + in sfxge_tx_qlso_fragment() [all …]
|
H A D | sfxge_rx.c | 1325 struct ip *iphp; in sfxge_rx_qflow_complete() local 1333 iphp = srfp->srf_iphp; in sfxge_rx_qflow_complete() 1342 iphp->ip_len = htons(srfp->srf_len); in sfxge_rx_qflow_complete() 1365 struct ip *iphp = srpp->srp_iphp; in sfxge_rx_qflow_add() local 1429 srfp->srf_iphp = iphp; in sfxge_rx_qflow_add() 1436 srfp->srf_len = ntohs(iphp->ip_len); in sfxge_rx_qflow_add() 1511 struct ip *iphp; in sfxge_rx_qpacket_coalesce() local 1545 pkt_type = sfxge_pkthdr_parse(mp, ðerhp, &iphp, &thp, &off, in sfxge_rx_qpacket_coalesce() 1549 ASSERT(iphp != NULL); in sfxge_rx_qpacket_coalesce() 1553 if ((iphp->ip_off & ~htons(IP_DF)) != 0) in sfxge_rx_qpacket_coalesce() [all …]
|
/illumos-gate/usr/src/common/inet/ |
H A D | inet_hash.c | 221 ipha_t *iphp; in inet_pkt_hash() local 228 iphp = (ipha_t *)(mp->b_rptr + skip_len); in inet_pkt_hash() 229 if (((unsigned char *)iphp + sizeof (ipha_t) > mp->b_wptr) || in inet_pkt_hash() 230 !OK_32PTR((char *)iphp)) in inet_pkt_hash() 233 proto = iphp->ipha_protocol; in inet_pkt_hash() 234 skip_len += IPH_HDR_LENGTH(iphp); in inet_pkt_hash() 237 ip_fragmented = ntohs(iphp->ipha_fragment_offset_and_flags) & in inet_pkt_hash() 246 uint8_t *ip_src = (uint8_t *)&(iphp->ipha_src); in inet_pkt_hash() 247 uint8_t *ip_dst = (uint8_t *)&(iphp->ipha_dst); in inet_pkt_hash() 255 uint8_t *identp = (uint8_t *)&iphp->ipha_ident; in inet_pkt_hash()
|
/illumos-gate/usr/src/uts/common/io/mac/ |
H A D | mac_util.c | 2074 ipha_t *iphp; in mac_pkt_hash() local 2081 iphp = (ipha_t *)(mp->b_rptr + skip_len); in mac_pkt_hash() 2082 if (((unsigned char *)iphp + sizeof (ipha_t) > mp->b_wptr) || in mac_pkt_hash() 2083 !OK_32PTR((char *)iphp)) in mac_pkt_hash() 2086 proto = iphp->ipha_protocol; in mac_pkt_hash() 2087 skip_len += IPH_HDR_LENGTH(iphp); in mac_pkt_hash() 2090 ip_fragmented = ntohs(iphp->ipha_fragment_offset_and_flags) & in mac_pkt_hash() 2099 uint8_t *ip_src = (uint8_t *)&(iphp->ipha_src); in mac_pkt_hash() 2100 uint8_t *ip_dst = (uint8_t *)&(iphp->ipha_dst); in mac_pkt_hash() 2108 uint8_t *identp = (uint8_t *)&iphp->ipha_ident; in mac_pkt_hash()
|