/freebsd/sys/netinet/libalias/ |
H A D | alias.c | 273 struct ip *pip, u_char ip_p, u_short *ip_sum); 275 struct in_addr ip_dst, u_char ip_p, u_short *ip_sum, 318 DifferentialChecksum(&pip->ip_sum, in IcmpAliasIn1() 380 accumulate2 += ip->ip_sum; in IcmpAliasIn2() 381 ADJUST_CHECKSUM(accumulate, ip->ip_sum); in IcmpAliasIn2() 382 accumulate2 -= ip->ip_sum; in IcmpAliasIn2() 386 DifferentialChecksum(&pip->ip_sum, in IcmpAliasIn2() 409 accumulate2 += ip->ip_sum; in IcmpAliasIn2() 410 ADJUST_CHECKSUM(accumulate, ip->ip_sum); in IcmpAliasIn2() 411 accumulate2 -= ip->ip_sum; in IcmpAliasIn2() [all …]
|
H A D | alias_pptp.c | 482 DifferentialChecksum(&pip->ip_sum, in AliasHandlePptpGreOut() 509 DifferentialChecksum(&pip->ip_sum, in AliasHandlePptpGreIn()
|
/freebsd/contrib/tcpdump/ |
H A D | print-ip.c | 327 uint16_t sum, ip_sum; in ip_print() local 432 ip_sum = GET_BE_U_2(ip->ip_sum); in ip_print() 433 ND_PRINT(", bad cksum %x (->%x)!", ip_sum, in ip_print() 434 in_cksum_shouldbe(ip_sum, sum)); in ip_print()
|
H A D | ip.h | 65 nd_uint16_t ip_sum; /* checksum */ member
|
/freebsd/tools/tools/netmap/ |
H A D | pkt-gen.c | 810 new_ip_sum(uint16_t ip_sum, uint32_t oaddr, uint32_t naddr) in new_ip_sum() argument 812 ip_sum = cksum_add(ip_sum, ~oaddr >> 16); in new_ip_sum() 813 ip_sum = cksum_add(ip_sum, ~oaddr & 0xffff); in new_ip_sum() 814 ip_sum = cksum_add(ip_sum, naddr >> 16); in new_ip_sum() 815 ip_sum = cksum_add(ip_sum, naddr & 0xffff); in new_ip_sum() 816 return ip_sum; in new_ip_sum() 836 uint16_t ip_sum = 0, udp_sum = 0; in update_ip() local 841 ip_sum = udp_sum = 0; in update_ip() 849 ip_sum = new_ip_sum(ip_sum, oaddr, naddr); in update_ip() 863 ip_sum = new_ip_sum(ip_sum, oaddr, naddr); in update_ip() [all …]
|
/freebsd/sbin/ipf/ipsend/ |
H A D | iptests.c | 110 ip->ip_sum = 0; in ip_test1() 198 ip->ip_sum = 0; in ip_test1() 199 ip->ip_sum = chksum((u_short *)ip, IP_HL(ip) << 2); in ip_test1() 210 ip->ip_sum = 0; in ip_test1() 211 ip->ip_sum = chksum((u_short *)ip, IP_HL(ip) << 2); in ip_test1() 229 ip->ip_sum = 0; in ip_test1() 230 ip->ip_sum = chksum((u_short *)ip, IP_HL(ip) << 2); in ip_test1() 241 ip->ip_sum = 0; in ip_test1() 242 ip->ip_sum = chksum((u_short *)ip, IP_HL(ip) << 2); in ip_test1() 555 ip->ip_sum = 0; in ip_test3() [all …]
|
H A D | ip.c | 134 ip->ip_sum = 0; in send_ip() 135 ip->ip_sum = chksum((u_short *)ip, IP_HL(ip) << 2); in send_ip() 207 ip->ip_sum = 0; in send_ip() 208 ip->ip_sum = chksum((u_short *)ip, hlen); in send_ip()
|
H A D | resend.c | 113 if (!ip->ip_sum) in ip_resend() 114 ip->ip_sum = chksum((u_short *)ip, in ip_resend()
|
/freebsd/sys/netpfil/pf/ |
H A D | pf_norm.c | 796 ip->ip_sum = pf_cksum_fixup(ip->ip_sum, ip->ip_len, in pf_reassemble() 799 ip->ip_sum = pf_cksum_fixup(ip->ip_sum, ip->ip_off, in pf_reassemble() 1137 h->ip_sum = pf_cksum_fixup(h->ip_sum, ip_off, h->ip_off, 0); in pf_normalize_ip() 1194 h->ip_sum = pf_cksum_fixup(h->ip_sum, ip_off, h->ip_off, 0); in pf_normalize_ip() 2187 h->ip_sum = pf_cksum_fixup(h->ip_sum, ip_off, h->ip_off, 0); in pf_scrub() 2196 h->ip_sum = pf_cksum_fixup(h->ip_sum, ip_ttl, h->ip_ttl, 0); in pf_scrub() 2214 h->ip_sum = pf_cksum_fixup(h->ip_sum, ov, nv, 0); in pf_scrub() 2233 h->ip_sum = pf_cksum_fixup(h->ip_sum, ip_id, h->ip_id, 0); in pf_scrub()
|
H A D | pf.c | 608 pf_change_ap(m, pd->src, &th->th_sport, pd->ip_sum, in pf_packet_rework_nat() 612 pf_change_ap(m, pd->dst, &th->th_dport, pd->ip_sum, in pf_packet_rework_nat() 622 pf_change_ap(m, pd->src, &uh->uh_sport, pd->ip_sum, in pf_packet_rework_nat() 626 pf_change_ap(m, pd->dst, &uh->uh_dport, pd->ip_sum, in pf_packet_rework_nat() 637 pf_change_ap(m, pd->src, &sh->src_port, pd->ip_sum, in pf_packet_rework_nat() 642 pf_change_ap(m, pd->dst, &sh->dest_port, pd->ip_sum, in pf_packet_rework_nat() 668 pd->ip_sum, nk->addr[pd->sidx].v4.s_addr, in pf_packet_rework_nat() 680 pd->ip_sum, nk->addr[pd->didx].v4.s_addr, in pf_packet_rework_nat() 3486 h->ip_sum = 0; in pf_build_tcp() 3676 if (pd->ip_sum) in pf_return() [all …]
|
H A D | if_pflog.c | 269 ip->ip_sum = 0; in pflog_packet() 270 ip->ip_sum = in_cksum(pd->m, ip->ip_hl << 2); in pflog_packet()
|
/freebsd/sys/netpfil/ipfilter/netinet/ |
H A D | ip_fil_freebsd.c | 426 ip->ip_sum = 0; in ipf_send_ip() 772 ip->ip_sum = 0; in ipf_fastroute() 783 ip->ip_sum = 0; in ipf_fastroute() 788 if (!ip->ip_sum) in ipf_fastroute() 789 ip->ip_sum = in_cksum(m, hlen); in ipf_fastroute() 852 mhip->ip_sum = 0; in ipf_fastroute() 853 mhip->ip_sum = in_cksum(m, mhlen); in ipf_fastroute() 863 ip->ip_sum = 0; in ipf_fastroute() 864 ip->ip_sum = in_cksum(m0, hlen); in ipf_fastroute()
|
/freebsd/sbin/ipf/libipf/ |
H A D | printiphdr.c | 17 ntohs(ip->ip_off), ntohs(ip->ip_sum), ntohl(ip->ip_src.s_addr), in printiphdr()
|
/freebsd/tests/sys/netinet/ |
H A D | ip_reass_test.c | 65 ip->ip_sum = 0; in update_cksum() 71 ip->ip_sum = htons((uint16_t)cksum); in update_cksum() 97 ip->ip_sum = 0; in alloc_lopacket()
|
/freebsd/sys/netinet/ |
H A D | ip_fastfwd.c | 365 if (ip->ip_sum >= (u_int16_t) ~htons(IPTTLDEC << 8)) in ip_tryforward() 366 ip->ip_sum -= ~htons(IPTTLDEC << 8); in ip_tryforward() 368 ip->ip_sum += htons(IPTTLDEC << 8); in ip_tryforward()
|
H A D | ip_output.c | 764 ip->ip_sum = 0; in ip_output() 766 ip->ip_sum = in_cksum(m, hlen); in ip_output() 999 mhip->ip_sum = 0; in ip_fragment() 1001 mhip->ip_sum = in_cksum(m, mhlen); in ip_fragment() 1017 ip->ip_sum = 0; in ip_fragment() 1019 ip->ip_sum = in_cksum(m0, hlen); in ip_fragment() 1547 ip->ip_sum = 0; in ip_mloopback() 1548 ip->ip_sum = in_cksum(copym, hlen); in ip_mloopback()
|
H A D | ip.h | 67 u_short ip_sum; /* checksum */ member
|
/freebsd/sbin/dhclient/ |
H A D | packet.c | 125 ip.ip_sum = 0; in assemble_udp_ip_header() 129 ip.ip_sum = wrapsum(checksum((unsigned char *)&ip, sizeof(ip), 0)); in assemble_udp_ip_header()
|
/freebsd/stand/libsa/ |
H A D | ip.c | 116 ip->ip_sum = in_cksum(ip, sizeof(*ip)); /* short, but special */ in sendip() 372 ipr->ip_hdr->ip_sum = 0; in readipv4() 373 ipr->ip_hdr->ip_sum = in_cksum(ipr->ip_hdr, sizeof (*ipr->ip_hdr)); in readipv4()
|
/freebsd/sys/net/ |
H A D | debugnet_inet.c | 481 ip->ip_sum = udp->uh_ulen; in debugnet_ip_output() 497 ip->ip_sum = 0; in debugnet_ip_output() 498 ip->ip_sum = in_cksum(m, sizeof(struct ip)); in debugnet_ip_output()
|
/freebsd/sys/netpfil/ipfw/ |
H A D | ip_fw_pfil.c | 529 ip->ip_sum = 0; in ipfw_divert() 531 ip->ip_sum = in_cksum_hdr(ip); in ipfw_divert() 533 ip->ip_sum = in_cksum(reass, hlen); in ipfw_divert()
|
/freebsd/sys/netgraph/ |
H A D | ng_checksum.c | 327 ip4->ip_sum = 0; in checksum_ipv4() 331 ip4->ip_sum = in_cksum_hdr(ip4); in checksum_ipv4() 333 ip4->ip_sum = in_cksum_skip(m, l3_offset + hlen, l3_offset); in checksum_ipv4()
|
/freebsd/tools/tools/net80211/wesside/dics/ |
H A D | dics.c | 244 iph->ip_sum = 0; in send_stuff() 254 iph->ip_sum = in_cksum((unsigned short*)iph, 20); in send_stuff()
|
/freebsd/sys/net/altq/ |
H A D | altq_red.c | 486 sum = ~ntohs(ip->ip_sum) & 0xffff; in mark_ecn() 490 ip->ip_sum = htons(~sum & 0xffff); in mark_ecn()
|
/freebsd/contrib/ofed/libibverbs/ |
H A D | verbs.c | 791 ip4h_checked.ip_sum = 0; in get_grh_header_version() 792 ip4h_checked.ip_sum = ipv4_calc_hdr_csum((uint16_t *)&ip4h_checked, 10); in get_grh_header_version() 794 if (ip4h->ip_sum == ip4h_checked.ip_sum) in get_grh_header_version()
|