| /netbsd-src/sys/net/ |
| H A D | slcompress.c | 178 u_int hlen = ip->ip_hl; in sl_compress_tcp() local 195 th = (struct tcphdr *)&((int32_t *)ip)[hlen]; in sl_compress_tcp() 243 hlen += th->th_off; in sl_compress_tcp() 244 hlen <<= 2; in sl_compress_tcp() 245 if (hlen > m->m_len) in sl_compress_tcp() 271 oth = (struct tcphdr *)&((int32_t *)&cs->cs_ip)[hlen]; in sl_compress_tcp() 272 deltaS = hlen; in sl_compress_tcp() 273 hlen += th->th_off; in sl_compress_tcp() 274 hlen <<= 2; in sl_compress_tcp() 275 if (hlen > in sl_compress_tcp() 432 u_int hlen; sl_uncompress_tcp() local 476 u_int hlen, changes; sl_uncompress_tcp_core() local [all...] |
| H A D | rss_config.c | 95 int hlen; in rss_toeplitz_hash_from_mbuf_ipv4() local 104 hlen = ip->ip_hl << 2; in rss_toeplitz_hash_from_mbuf_ipv4() 105 if (hlen < sizeof(struct ip)) in rss_toeplitz_hash_from_mbuf_ipv4() 114 if (m->m_len >= hlen + sizeof(struct tcphdr)) { in rss_toeplitz_hash_from_mbuf_ipv4() 117 th = (struct tcphdr *)(mtod(m, char *) + hlen); in rss_toeplitz_hash_from_mbuf_ipv4() 124 } else if (m->m_pkthdr.len >= hlen + sizeof(struct tcphdr)) { in rss_toeplitz_hash_from_mbuf_ipv4() 128 m_copydata(__UNCONST(m), hlen + offsetof(struct tcphdr, th_sport), in rss_toeplitz_hash_from_mbuf_ipv4() 147 if (m->m_len >= hlen + sizeof(struct udphdr)) { in rss_toeplitz_hash_from_mbuf_ipv4() 150 uh = (struct udphdr *)(mtod(m, char *) + hlen); in rss_toeplitz_hash_from_mbuf_ipv4() 157 } else if (m->m_pkthdr.len >= hlen + sizeof(struct udphdr)) { in rss_toeplitz_hash_from_mbuf_ipv4() [all …]
|
| /netbsd-src/external/bsd/ipf/dist/ipsend/ |
| H A D | ip.c | 166 int i, sent = 0, ts, hlen, olen; local 168 hlen = IP_HL(ip) << 2; 169 if (mtu < (hlen + 8)) { 171 mtu, hlen); 206 s = (char *)ip + hlen; 207 iplen = ntohs(ip->ip_len) - hlen; 212 if ((sent + (mtu - hlen)) >= iplen) 218 ts = (mtu - hlen); 221 ts += hlen; 224 ip->ip_sum = chksum((u_short *)ip, hlen); [all …]
|
| /netbsd-src/sys/netipsec/ |
| H A D | ipsec_mbuf.c | 188 m_makespace(struct mbuf *m0, int skip, int hlen, int *off) in m_makespace() argument 195 KASSERTMSG(hlen < MHLEN, "hlen too big: %u", hlen); in m_makespace() 211 if (hlen > M_TRAILINGSPACE(m)) { in m_makespace() 242 if (hlen <= M_TRAILINGSPACE(m) + remain) { in m_makespace() 243 m->m_len = skip + hlen; in m_makespace() 264 n->m_len = hlen; in m_makespace() 278 memmove(mtod(m, char *) + skip + hlen, in m_makespace() 280 m->m_len += hlen; in m_makespace() 284 m0->m_pkthdr.len += hlen; /* adjust packet length */ in m_makespace() 365 m_striphdr(struct mbuf *m, int skip, int hlen) in m_striphdr() argument [all …]
|
| H A D | xform_esp.c | 306 int plen, alen, hlen, error, stat = ESP_STAT_CRYPTO; in esp_input() local 334 hlen = sizeof(struct esp) + sav->ivlen; in esp_input() 336 hlen = sizeof(struct newesp) + sav->ivlen; in esp_input() 347 plen = m->m_pkthdr.len - (skip + hlen + alen); in esp_input() 410 crda->crd_len = hlen - sav->ivlen; in esp_input() 468 crde->crd_skip = skip + hlen; in esp_input() 472 crde->crd_len = m->m_pkthdr.len - (skip + hlen + alen); in esp_input() 473 crde->crd_inject = skip + hlen - sav->ivlen; in esp_input() 513 int hlen, skip, protoff; in esp_input_cb() local 611 hlen = sizeof(struct esp) + sav->ivlen; in esp_input_cb() [all …]
|
| H A D | xform_ipcomp.c | 144 int error, hlen = IPCOMP_HLENGTH, stat = IPCOMP_STAT_CRYPTO; in ipcomp_input() local 146 KASSERT(skip + hlen <= m->m_pkthdr.len); in ipcomp_input() 187 crdc->crd_skip = skip + hlen; in ipcomp_input() 188 crdc->crd_len = m->m_pkthdr.len - (skip + hlen); in ipcomp_input() 195 crp->crp_ilen = m->m_pkthdr.len - (skip + hlen); in ipcomp_input() 249 int hlen = IPCOMP_HLENGTH, clen; in ipcomp_input_cb() local 282 IPCOMP_STATADD(IPCOMP_STAT_IBYTES, m->m_pkthdr.len - skip - hlen); in ipcomp_input_cb() 294 m->m_pkthdr.len = clen + hlen + skip; in ipcomp_input_cb() 301 if (m->m_len < skip + hlen && (m = m_pullup(m, skip + hlen)) == 0) { in ipcomp_input_cb() 323 if (m_striphdr(m, skip, hlen) != 0) { in ipcomp_input_cb() [all …]
|
| H A D | xform_ipip.c | 132 int hlen; in _ipip_input() local 141 hlen = sizeof(struct ip); in _ipip_input() 146 hlen = sizeof(struct ip6_hdr); in _ipip_input() 158 if (m->m_len < hlen) { in _ipip_input() 159 if ((m = m_pullup(m, hlen)) == NULL) { in _ipip_input() 197 hlen = sizeof(struct ip); in _ipip_input() 203 hlen = sizeof(struct ip6_hdr); in _ipip_input() 218 if (m->m_len < hlen) { in _ipip_input() 219 if ((m = m_pullup(m, hlen)) == NULL) { in _ipip_input()
|
| /netbsd-src/sys/netinet6/ |
| H A D | in6_offload.c | 56 int hlen; in tcp6_segment() local 76 hlen = off + sizeof(*iph); in tcp6_segment() 77 if (m->m_len < hlen) { in tcp6_segment() 78 m = m_pullup(m, hlen); in tcp6_segment() 87 hlen = off + iphlen + sizeof(*th); in tcp6_segment() 88 if (m->m_len < hlen) { in tcp6_segment() 89 m = m_pullup(m, hlen); in tcp6_segment() 96 hlen = off + iphlen + thlen; in tcp6_segment() 100 KASSERT(len > hlen); in tcp6_segment() 102 t = m_split(m, hlen, M_NOWAIT); in tcp6_segment() [all …]
|
| /netbsd-src/sys/netinet/ |
| H A D | in_offload.c | 53 int hlen, len; in tcp4_segment() local 72 hlen = off + sizeof(*ip); in tcp4_segment() 73 if (m->m_len < hlen) { in tcp4_segment() 74 m = m_pullup(m, hlen); in tcp4_segment() 85 hlen = off + iphlen + sizeof(*th); in tcp4_segment() 86 if (m->m_len < hlen) { in tcp4_segment() 87 m = m_pullup(m, hlen); in tcp4_segment() 94 hlen = off + iphlen + thlen; in tcp4_segment() 98 KASSERT(len > hlen); in tcp4_segment() 100 t = m_split(m, hlen, M_NOWAIT); in tcp4_segment() [all …]
|
| H A D | tcp_subr.c | 418 unsigned hlen = basehlen + sizeof(struct tcphdr); in tcp_init_common() local 421 if (max_linkhdr + hlen > MHLEN) in tcp_init_common() 423 while ((oldhlen = max_protohdr) < hlen) in tcp_init_common() 424 atomic_cas_uint(&max_protohdr, oldhlen, hlen); in tcp_init_common() 453 int hlen; in tcp_template() local 457 hlen = sizeof(struct ip); in tcp_template() 471 hlen = sizeof(struct ip6_hdr); in tcp_template() 482 KASSERT(hlen + sizeof(struct tcphdr) <= MCLBYTES); in tcp_template() 485 if (m && m->m_len == hlen + sizeof(struct tcphdr)) { in tcp_template() 491 if (m && hlen + sizeof(struct tcphdr) > MHLEN) { in tcp_template() [all …]
|
| H A D | ip_icmp.c | 408 _icmp_input(struct mbuf *m, int hlen, int proto) in _icmp_input() argument 431 icmplen = ntohs(ip->ip_len) - hlen; in _icmp_input() 436 i = hlen + uimin(icmplen, ICMP_ADVLENMIN); in _icmp_input() 442 m->m_len -= hlen; in _icmp_input() 443 m->m_data += hlen; in _icmp_input() 450 m->m_len += hlen; in _icmp_input() 451 m->m_data -= hlen; in _icmp_input() 527 if (m->m_len < hlen + ICMP_ADVLEN(icp)) { in _icmp_input() 528 m = m_pullup(m, hlen + ICMP_ADVLEN(icp)); in _icmp_input() 533 icp = (struct icmp *)(mtod(m, uint8_t *) + hlen); in _icmp_input() [all …]
|
| /netbsd-src/usr.bin/systat/ |
| H A D | swap.c | 78 void showspace(char *header, int hlen, long blocksize); 81 static int hlen, nswap, rnswap; variable 153 header = getbsize(&hlen, &blocksize); in labelswap() 155 "Disk", hlen, header, "Used", in labelswap() 175 mvwprintw(wnd, i + 1, col, "%*d", hlen, sep->se_nblks / blk_div); in showswap() 177 col += hlen; in showswap() 190 "Total", hlen, avail / blk_div, used / blk_div); in showswap()
|
| /netbsd-src/sys/external/bsd/ipf/netinet/ |
| H A D | ip_fil_netbsd.c | 189 int (*ipf_checkp)(void *, ip_t *ip, int hlen, void *ifp, int out, mb_t **mp); 201 int rv, hlen; in ipf_check_wrapper() local 218 hlen = ip->ip_hl << 2; in ipf_check_wrapper() 241 rv = ipf_check(&ipfmain, ip, hlen, ifp, (dir == PFIL_OUT), mp); in ipf_check_wrapper() 736 int tlen = 0, hlen; in ipf_send_reset() local 755 hlen = (fin->fin_v == 6) ? sizeof(ip6_t) : sizeof(ip_t); in ipf_send_reset() 757 hlen = sizeof(ip_t); in ipf_send_reset() 766 if (sizeof(*tcp2) + hlen > MHLEN) { in ipf_send_reset() 776 m->m_len = sizeof(*tcp2) + hlen; in ipf_send_reset() 781 bzero((char *)ip, hlen); in ipf_send_reset() [all …]
|
| H A D | ip_log.c | 383 register size_t hlen; in ipf_log_pkt() local 402 hlen = (char *)fin->fin_dp - (char *)fin->fin_ip; in ipf_log_pkt() 410 hlen += MIN(sizeof(tcphdr_t), fin->fin_dlen); in ipf_log_pkt() 412 hlen += MIN(sizeof(udphdr_t), fin->fin_dlen); in ipf_log_pkt() 430 hlen += MIN(sizeof(struct icmp) + 8, in ipf_log_pkt() 434 hlen += MIN(sizeof(struct icmp), in ipf_log_pkt() 451 hlen += MIN(sizeof(struct icmp6_hdr) + 8, in ipf_log_pkt() 454 hlen += MIN(sizeof(struct icmp6_hdr), in ipf_log_pkt() 486 mlen = fin->fin_plen - hlen; in ipf_log_pkt() 495 ipfl.fl_hlen = (u_char)hlen; in ipf_log_pkt() [all …]
|
| /netbsd-src/sbin/swapctl/ |
| H A D | swaplist.c | 64 int hlen, size, inuse, ncounted, pathmax; in list_swap() local 103 header = getbsize(&hlen, &blocksize); in list_swap() 111 hlen = strlen(header); in list_swap() 119 pathmax, "Device", hlen, header, in list_swap() 134 (void)printf("%-*s %*ld ", pathmax, sep->se_path, hlen, in list_swap() 152 (void)printf("%-*s %*s ", pathmax, sep->se_path, hlen, szbuf); in list_swap() 209 hlen, szbuf, usbuf, avbuf, in list_swap() 213 hlen, in list_swap()
|
| /netbsd-src/sys/net/npf/ |
| H A D | npf_inet.c | 473 size_t off, hlen; in npf_cache_ip() local 486 hlen = sizeof(struct ip6_hdr); in npf_cache_ip() 488 npc->npc_hlen = hlen; in npf_cache_ip() 496 while ((ip6e = nbuf_advance(nbuf, hlen, sizeof(*ip6e))) != NULL) { in npf_cache_ip() 504 hlen = (ip6e->ip6e_len + 1) << 3; in npf_cache_ip() 516 hlen = sizeof(struct ip6_frag); in npf_cache_ip() 520 hlen = 0; in npf_cache_ip() 525 hlen = 0; in npf_cache_ip() 529 if (!hlen) { in npf_cache_ip() 533 npc->npc_hlen += hlen; in npf_cache_ip() [all …]
|
| /netbsd-src/sys/lib/libsa/ |
| H A D | ip.c | 124 size_t hlen; in readip() local 153 hlen = ip->ip_hl << 2; in readip() 154 if (hlen != sizeof(*ip) || ip_cksum(ip, hlen) != 0) { in readip() 157 if (ntohs(ip->ip_len) < hlen) { in readip() 167 return (ntohs(ip->ip_len) - hlen); in readip()
|
| /netbsd-src/sys/external/isc/libsodium/dist/test/default/ |
| H A D | metamorphic.c | 15 size_t hlen; in mm_generichash() local 28 hlen = randombytes_uniform(crypto_generichash_BYTES_MAX - in mm_generichash() 31 h = (unsigned char *) sodium_malloc(hlen); in mm_generichash() 32 h2 = (unsigned char *) sodium_malloc(hlen); in mm_generichash() 37 crypto_generichash_init(&st, k, klen, hlen); in mm_generichash() 43 crypto_generichash_final(&st, h, hlen); in mm_generichash() 45 crypto_generichash(h2, hlen, m, mlen, k, klen); in mm_generichash() 47 assert(memcmp(h, h2, hlen) == 0); in mm_generichash()
|
| /netbsd-src/usr.sbin/bootp/common/ |
| H A D | hwaddr.c | 150 haddrtoa(u_char *haddr, int hlen) in haddrtoa() argument 155 if (hlen > MAXHADDRLEN) in haddrtoa() 156 hlen = MAXHADDRLEN; in haddrtoa() 159 while (hlen > 0) { in haddrtoa() 163 hlen--; in haddrtoa()
|
| /netbsd-src/sbin/ping/ |
| H A D | ping.c | 1071 int hlen, dupflag = 0, dumped; in pr_pack() local 1081 hlen = ip->ip_hl << 2; in pr_pack() 1082 if (hlen < (int)sizeof(*ip) || tot_len < hlen + ICMP_MINLEN) { in pr_pack() 1093 net_len = tot_len - hlen; in pr_pack() 1094 icp = (struct icmp *)(buf + hlen); in pr_pack() 1188 if ((size_t)(tot_len - hlen) > in pr_pack() 1219 while (hlen > (int)sizeof(struct ip)) { in pr_pack() 1222 hlen = 0; in pr_pack() 1225 hlen -= 2; in pr_pack() 1233 hlen -= j; in pr_pack() [all …]
|
| /netbsd-src/external/bsd/wpa/dist/src/tls/ |
| H A D | tlsv1_server_read.c | 890 size_t hlen; in tls_process_certificate_verify() local 986 hlen = SHA256_MAC_LEN; in tls_process_certificate_verify() 988 crypto_hash_finish(conn->verify.sha256_cert, hpos, &hlen) < in tls_process_certificate_verify() 999 hlen = MD5_MAC_LEN; in tls_process_certificate_verify() 1001 crypto_hash_finish(conn->verify.md5_cert, hpos, &hlen) < 0) { in tls_process_certificate_verify() 1012 hlen = SHA1_MAC_LEN; in tls_process_certificate_verify() 1014 crypto_hash_finish(conn->verify.sha1_cert, hpos, &hlen) < 0) { in tls_process_certificate_verify() 1022 hlen += MD5_MAC_LEN; in tls_process_certificate_verify() 1028 wpa_hexdump(MSG_MSGDUMP, "TLSv1: CertificateVerify hash", hash, hlen); in tls_process_certificate_verify() 1031 hash, hlen, pos, end - pos, &alert) < 0) { in tls_process_certificate_verify() [all …]
|
| /netbsd-src/sys/netmpls/ |
| H A D | mpls_ttl.c | 319 int hlen, len; in ip4_check() local 329 hlen = iph->ip_hl << 2; in ip4_check() 330 if (hlen < sizeof(struct ip)) in ip4_check() 332 if (hlen > m->m_len) { in ip4_check() 333 if ((m = m_pullup(m, hlen)) == NULL) in ip4_check() 346 in_cksum(m, hlen) != 0) in ip4_check() 350 if (len < hlen || m->m_pkthdr.len < len) in ip4_check()
|
| /netbsd-src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/bios/ |
| H A D | nouveau_nvkm_subdev_bios_vpstate.c | 59 h->hlen = nvbios_rd08(b, h->offset + 0x1); in nvbios_vpstate_parse() 66 if (h->hlen > 0x10) in nvbios_vpstate_parse() 70 if (h->hlen > 0x11) in nvbios_vpstate_parse() 89 offset = h->offset + h->hlen + idx * (h->elen + (h->slen * h->scount)); in nvbios_vpstate_entry()
|
| /netbsd-src/lib/libedit/ |
| H A D | hist.c | 105 size_t blen, hlen; in hist_get() local 134 hlen = wcslen(hp) + 1; in hist_get() 136 if (hlen > blen && !ch_enlargebufs(el, hlen)) in hist_get() 139 memcpy(el->el_line.buffer, hp, hlen * sizeof(*hp)); in hist_get() 140 el->el_line.lastchar = el->el_line.buffer + hlen - 1; in hist_get()
|
| /netbsd-src/usr.bin/nc/ |
| H A D | socks.c | 193 size_t hlen, wlen; in socks_connect() local 246 hlen = strlen(host); in socks_connect() 247 if (hlen > 255) in socks_connect() 253 buf[4] = hlen; in socks_connect() 254 memcpy(buf + 5, host, hlen); in socks_connect() 255 memcpy(buf + 5 + hlen, &serverport, sizeof serverport); in socks_connect() 256 wlen = 7 + hlen; in socks_connect()
|