/freebsd/contrib/tcpdump/ |
H A D | print-pktap.c | 73 uint32_t dlt, hdrlen; in pktap_header_print() local 79 hdrlen = GET_LE_U_4(hdr->pkt_len); in pktap_header_print() 83 (dltname != NULL ? dltname : "UNKNOWN"), dlt, hdrlen); in pktap_header_print() 101 uint32_t dlt, hdrlen, rectype; in pktap_if_print() local 116 hdrlen = GET_LE_U_4(hdr->pkt_len); in pktap_if_print() 117 if (hdrlen < sizeof(pktap_header_t)) { in pktap_if_print() 126 hdrlen, sizeof(pktap_header_t)); in pktap_if_print() 129 if (hdrlen > length) { in pktap_if_print() 131 hdrlen, length); in pktap_if_print() 134 ND_TCHECK_LEN(p, hdrlen); in pktap_if_print() [all …]
|
H A D | print-pflog.c | 140 u_int hdrlen; in pflog_if_print() local 154 hdrlen = GET_U_1(hdr->length); in pflog_if_print() 155 if (hdrlen < MIN_PFLOG_HDRLEN) { in pflog_if_print() 157 ndo->ndo_ll_hdr_len += hdrlen; /* XXX: not really */ in pflog_if_print() 160 hdrlen = roundup2(hdrlen, 4); in pflog_if_print() 162 if (caplen < hdrlen) { in pflog_if_print() 164 ndo->ndo_ll_hdr_len += hdrlen; /* XXX: true? */ in pflog_if_print() 175 length -= hdrlen; in pflog_if_print() 176 caplen -= hdrlen; in pflog_if_print() 177 p += hdrlen; in pflog_if_print() [all …]
|
H A D | print-llc.c | 153 int hdrlen; in llc_print() local 183 hdrlen = 3; /* DSAP, SSAP, 1-byte control field */ in llc_print() 205 hdrlen = 4; /* DSAP, SSAP, 2-byte control field */ in llc_print() 253 p += hdrlen; in llc_print() 254 length -= hdrlen; in llc_print() 255 caplen -= hdrlen; in llc_print() 270 return (-(hdrlen + 5)); /* include LLC and SNAP header */ in llc_print() 272 return (hdrlen + 5); /* include LLC and SNAP header */ in llc_print() 278 return (hdrlen); in llc_print() 290 return (hdrlen); in llc_print() [all …]
|
H A D | print-macsec.c | 115 u_int hdrlen = *hdrlenp; in macsec_print() local 127 return hdrlen + caplen; in macsec_print() 132 return hdrlen + caplen; in macsec_print() 140 return hdrlen + caplen; in macsec_print() 145 return hdrlen + caplen; in macsec_print() 154 return hdrlen + caplen; in macsec_print() 208 return hdrlen + caplen; in macsec_print() 213 return hdrlen + caplen; in macsec_print() 238 return hdrlen + caplen; in macsec_print() 243 return hdrlen + caplen; in macsec_print()
|
H A D | print-sll.c | 227 u_int hdrlen; in sll_if_print() local 243 hdrlen = SLL_HDR_LEN; in sll_if_print() 285 hdrlen += llc_hdrlen; in sll_if_print() 305 ndo->ndo_ll_hdr_len += hdrlen + caplen; in sll_if_print() 324 hdrlen += 4; in sll_if_print() 336 ndo->ndo_ll_hdr_len += hdrlen; in sll_if_print() 410 u_int hdrlen; in sll2_if_print() local 439 hdrlen = SLL2_HDR_LEN; in sll2_if_print() 481 hdrlen += llc_hdrlen; in sll2_if_print() 501 ndo->ndo_ll_hdr_len += hdrlen + caplen; in sll2_if_print() [all …]
|
H A D | print-ether.c | 145 u_int hdrlen; in ether_common_print() local 179 hdrlen = 2*MAC_ADDR_LEN; in ether_common_print() 193 hdrlen += switch_tag_len; in ether_common_print() 205 hdrlen += 2; in ether_common_print() 222 int ret = macsec_print(ndo, &p, &length, &caplen, &hdrlen, in ether_common_print() 229 return hdrlen; in ether_common_print() 243 hdrlen += 2; in ether_common_print() 262 return hdrlen + caplen; in ether_common_print() 267 return hdrlen + length; in ether_common_print() 285 hdrlen += 4; in ether_common_print() [all …]
|
H A D | print.c | 334 u_int hdrlen = 0; in pretty_print_packet() local 436 hdrlen = ndo->ndo_ll_hdr_len; in pretty_print_packet() 470 if (h->caplen > hdrlen) in pretty_print_packet() 471 hex_and_ascii_print(ndo, "\n\t", sp + hdrlen, in pretty_print_packet() 472 h->caplen - hdrlen); in pretty_print_packet() 489 if (h->caplen > hdrlen) in pretty_print_packet() 490 hex_print(ndo, "\n\t", sp + hdrlen, in pretty_print_packet() 491 h->caplen - hdrlen); in pretty_print_packet() 508 if (h->caplen > hdrlen) in pretty_print_packet() 509 ascii_print(ndo, sp + hdrlen, h->caplen - hdrlen); in pretty_print_packet()
|
H A D | print-ppi.c | 74 uint32_t hdrlen; in ppi_if_print() local 118 hdrlen = ndo->ndo_ll_hdr_len; in ppi_if_print() 125 hdrlen = 0; in ppi_if_print() 127 ndo->ndo_ll_hdr_len += len + hdrlen; in ppi_if_print()
|
H A D | print-802_11.c | 2106 uint16_t fc, const u_char *p, u_int hdrlen, in ieee_802_11_hdr_print() argument 2128 (const struct meshcntl_t *)(p + hdrlen - meshdrlen); in ieee_802_11_hdr_print() 2163 u_int caplen, hdrlen, meshdrlen; in ieee802_11_print() local 2188 hdrlen = extract_header_length(ndo, fc); in ieee802_11_print() 2189 if (hdrlen == 0) { in ieee802_11_print() 2194 hdrlen = roundup2(hdrlen, 4); in ieee802_11_print() 2197 if(!ND_TTEST_1(p + hdrlen)) { in ieee802_11_print() 2199 return hdrlen; in ieee802_11_print() 2201 meshdrlen = extract_mesh_header_length(ndo, p + hdrlen); in ieee802_11_print() 2202 hdrlen += meshdrlen; in ieee802_11_print() [all …]
|
H A D | print-atalk.c | 77 u_int hdrlen; in ltalk_if_print() local 80 hdrlen = llap_print(ndo, p, h->len); in ltalk_if_print() 81 if (hdrlen == 0) { in ltalk_if_print() 86 ndo->ndo_ll_hdr_len += hdrlen; in ltalk_if_print() 100 u_int hdrlen; in llap_print() local 114 hdrlen = sizeof(*lp); in llap_print() 135 hdrlen += ddpSSize; in llap_print() 159 hdrlen += ddpSize; in llap_print() 176 return (hdrlen); in llap_print()
|
/freebsd/sys/net80211/ |
H A D | ieee80211_crypto_wep.c | 75 static int wep_encrypt(struct ieee80211_key *, struct mbuf *, int hdrlen); 76 static int wep_decrypt(struct ieee80211_key *, struct mbuf *, int hdrlen); 185 int hdrlen; in wep_encap() local 188 hdrlen = ieee80211_hdrspace(ic, mtod(m, void *)); in wep_encap() 207 ovbcopy(ivp + wep.ic_header, ivp, hdrlen); in wep_encap() 208 ivp += hdrlen; in wep_encap() 216 !wep_encrypt(k, m, hdrlen)) in wep_encap() 238 wep_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen) in wep_decap() argument 255 !wep_decrypt(k, m, hdrlen)) { in wep_decap() 270 ovbcopy(mtod(m, void *), mtod(m, uint8_t *) + wep.ic_header, hdrlen); in wep_decap() [all …]
|
H A D | ieee80211_crypto_ccmp.c | 89 static int ccmp_encrypt(struct ieee80211_key *, struct mbuf *, int hdrlen); 91 struct mbuf *, int hdrlen); 169 int hdrlen; in ccmp_encap() local 172 hdrlen = ieee80211_hdrspace(ic, mtod(m, void *)); in ccmp_encap() 194 ovbcopy(ivp + ccmp.ic_header, ivp, hdrlen); in ccmp_encap() 195 ivp += hdrlen; in ccmp_encap() 203 !ccmp_encrypt(k, m, hdrlen)) in ccmp_encap() 233 ccmp_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen) in ccmp_decap() argument 252 ivp = mtod(m, uint8_t *) + hdrlen; in ccmp_decap() 282 !ccmp_decrypt(k, pn, m, hdrlen)) in ccmp_decap() [all …]
|
H A D | ieee80211_crypto_tkip.c | 182 int hdrlen; in tkip_encap() local 210 hdrlen = ieee80211_hdrspace(ic, mtod(m, void *)); in tkip_encap() 219 memmove(ivp, ivp + tkip.ic_header, hdrlen); in tkip_encap() 220 ivp += hdrlen; in tkip_encap() 228 !tkip_encrypt(ctx, k, m, hdrlen)) in tkip_encap() 259 int hdrlen; in tkip_enmic() local 264 hdrlen = ieee80211_hdrspace(ic, wh); in tkip_enmic() 267 m, hdrlen, m->m_pkthdr.len - hdrlen, mic); in tkip_enmic() 287 tkip_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen) in tkip_decap() argument 308 ivp = mtod(m, uint8_t *) + hdrlen; in tkip_decap() [all …]
|
H A D | ieee80211_input.c | 314 ieee80211_decap(struct ieee80211vap *vap, struct mbuf *m, int hdrlen, in ieee80211_decap() argument 321 KASSERT(hdrlen <= sizeof(wh), in ieee80211_decap() 322 ("hdrlen %d > max %zd", hdrlen, sizeof(wh))); in ieee80211_decap() 324 if (m->m_len < hdrlen + sizeof(*llc) && in ieee80211_decap() 325 (m = m_pullup(m, hdrlen + sizeof(*llc))) == NULL) { in ieee80211_decap() 330 memcpy(&wh, mtod(m, caddr_t), hdrlen); in ieee80211_decap() 331 llc = (struct llc *)(mtod(m, caddr_t) + hdrlen); in ieee80211_decap() 340 m_adj(m, hdrlen + sizeof(struct llc) - sizeof(*eh)); in ieee80211_decap() 343 m_adj(m, hdrlen - sizeof(*eh)); in ieee80211_decap()
|
/freebsd/lib/libc/net/ |
H A D | ip6opt.c | 241 int hdrlen, optlen; in inet6_option_next() local 253 hdrlen = (ip6e->ip6e_len + 1) << 3; in inet6_option_next() 254 if (cmsg->cmsg_len < CMSG_SPACE(hdrlen)) in inet6_option_next() 262 lim = (u_int8_t *)ip6e + hdrlen; in inet6_option_next() 297 int hdrlen, optlen; in inet6_option_find() local 309 hdrlen = (ip6e->ip6e_len + 1) << 3; in inet6_option_find() 310 if (cmsg->cmsg_len < CMSG_SPACE(hdrlen)) in inet6_option_find() 318 lim = (u_int8_t *)ip6e + hdrlen; in inet6_option_find()
|
/freebsd/usr.sbin/bhyve/ |
H A D | pci_e82545.c | 1089 unsigned hdrlen, vlen, pktlen, len, left, mss, now, nnow, nleft, pvoff; in e82545_transmit() local 1223 hdrlen = vlen = 0; in e82545_transmit() 1227 hdrlen = ETHER_ADDR_LEN*2; in e82545_transmit() 1233 hdrlen = MAX(hdrlen, ckinfo[0].ck_off + 2U); in e82545_transmit() 1235 hdrlen = MAX(hdrlen, ckinfo[1].ck_off + 2U); in e82545_transmit() 1237 if (hdrlen != 0 && iov[0].iov_len > hdrlen && in e82545_transmit() 1238 iov[0].iov_len < hdrlen + 100) in e82545_transmit() 1239 hdrlen = iov[0].iov_len; in e82545_transmit() 1242 hdrlen = sc->esc_txctx.tcp_seg_setup.fields.hdr_len; in e82545_transmit() 1248 if (hdrlen > 240) { in e82545_transmit() [all …]
|
/freebsd/sys/contrib/dev/athk/ath10k/ |
H A D | bmi.c | 270 u32 hdrlen = sizeof(cmd.id) + sizeof(cmd.write_mem); in ath10k_bmi_write_memory() local 283 txlen = min(length, BMI_MAX_DATA_SIZE - hdrlen); in ath10k_bmi_write_memory() 293 ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, hdrlen + txlen, in ath10k_bmi_write_memory() 358 u32 hdrlen = sizeof(cmd->id) + sizeof(cmd->lz_data); in ath10k_bmi_lz_data_large() local 377 txlen = min(length, BMI_MAX_LARGE_DATA_SIZE - hdrlen); in ath10k_bmi_lz_data_large() 385 ret = ath10k_hif_exchange_bmi_msg(ar, cmd, hdrlen + txlen, in ath10k_bmi_lz_data_large() 410 u32 hdrlen = sizeof(cmd.id) + sizeof(cmd.lz_data); in ath10k_bmi_lz_data() local 423 txlen = min(length, BMI_MAX_DATA_SIZE - hdrlen); in ath10k_bmi_lz_data() 431 ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, hdrlen + txlen, in ath10k_bmi_lz_data()
|
/freebsd/usr.sbin/usbdump/ |
H A D | usbdump.c | 105 uint8_t hdrlen; member 580 uint32_t hdrlen; in fix_packets() local 593 temp.hdrlen = hdr->bh_hdrlen; in fix_packets() 596 hdrlen = hdr->bh_hdrlen; in fix_packets() 599 if ((hdrlen >= sizeof(temp)) && (hdrlen <= 255) && in fix_packets() 600 ((ptr + hdrlen) <= (data + datalen))) { in fix_packets() 602 memset(ptr + sizeof(temp), 0, hdrlen - sizeof(temp)); in fix_packets() 604 err(EXIT_FAILURE, "Invalid header length %d", hdrlen); in fix_packets() 607 next = ptr + BPF_WORDALIGN(hdrlen + caplen); in fix_packets() 631 temp.hdrlen = hdr32->hdrlen; in print_packets() [all …]
|
/freebsd/sys/netinet/ |
H A D | tcp_output.c | 203 unsigned ipoptlen, optlen, hdrlen, ulen; in tcp_default_output() local 778 hdrlen = sizeof (struct ip6_hdr) + sizeof (struct tcphdr); in tcp_default_output() 781 hdrlen = sizeof (struct tcpiphdr); in tcp_default_output() 878 hdrlen += optlen = tcp_addoptions(&to, opt); in tcp_default_output() 893 hdrlen += sizeof(struct udphdr); in tcp_default_output() 928 max_len = if_hw_tsomax - hdrlen - in tcp_default_output() 995 KASSERT(len + hdrlen + ipoptlen <= IP_MAXPACKET, in tcp_default_output() 1000 if (max_linkhdr + hdrlen > MCLBYTES) in tcp_default_output() 1002 if (max_linkhdr + hdrlen > MHLEN) in tcp_default_output() 1057 if (MHLEN < hdrlen + max_linkhdr) in tcp_default_output() [all …]
|
/freebsd/sys/net/ |
H A D | bpf.c | 566 struct sockaddr *sockp, int *hdrlen, struct bpf_d *d) in bpf_movein() argument 708 *hdrlen = hlen; in bpf_movein() 2499 int hdrlen; in bpf_hdrlen() local 2501 hdrlen = d->bd_bif->bif_hdrlen; in bpf_hdrlen() 2507 hdrlen += SIZEOF_BPF_HDR(struct bpf_hdr32); in bpf_hdrlen() 2510 hdrlen += SIZEOF_BPF_HDR(struct bpf_hdr); in bpf_hdrlen() 2513 hdrlen += SIZEOF_BPF_HDR(struct bpf_xhdr); in bpf_hdrlen() 2516 hdrlen = BPF_WORDALIGN32(hdrlen); in bpf_hdrlen() 2519 hdrlen = BPF_WORDALIGN(hdrlen); in bpf_hdrlen() 2521 return (hdrlen - d->bd_bif->bif_hdrlen); in bpf_hdrlen() [all …]
|
/freebsd/sys/dev/iwm/ |
H A D | if_iwm_util.c | 183 size_t hdrlen, datasz; in iwm_send_cmd() local 218 hdrlen = sizeof(cmd->hdr_wide); in iwm_send_cmd() 221 hdrlen = sizeof(cmd->hdr); in iwm_send_cmd() 230 size_t totlen = hdrlen + paylen; in iwm_send_cmd() 289 | ((hdrlen + paylen) << 4)); in iwm_send_cmd() 295 (unsigned long) (hcmd->len[0] + hcmd->len[1] + hdrlen), in iwm_send_cmd()
|
/freebsd/libexec/rbootd/ |
H A D | bpf.c | 291 int datlen, caplen, hdrlen; in BpfRead() local 317 hdrlen = bhp->bh_hdrlen; in BpfRead() 330 memmove((char *)&rconn->rmp, (char *)bp + hdrlen, caplen); in BpfRead() 332 bp += BPF_WORDALIGN(caplen + hdrlen); in BpfRead()
|
/freebsd/tests/atf_python/sys/netlink/ |
H A D | message.py | 126 hdr, hdrlen = BaseNetlinkMessage.parse_nl_header(data) 159 hdr, hdrlen = BaseNetlinkMessage.parse_nl_header(data) 168 offset = align4(hdrlen) 170 base_hdr, hdrlen = self.parse_base_header(data[offset:]) 172 offset += align4(hdrlen)
|
/freebsd/sys/compat/linux/ |
H A D | linux_netlink.c | 291 int hdrlen = NETLINK_ALIGN(raw_hdrlen); in nlmsg_copy_all_nla() local 292 int attrs_len = hdr->nlmsg_len - sizeof(struct nlmsghdr) - hdrlen; in nlmsg_copy_all_nla() 293 struct nlattr *nla_head = (struct nlattr *)((char *)(hdr + 1) + hdrlen); in nlmsg_copy_all_nla() 444 int hdrlen = NETLINK_ALIGN(sizeof(struct rtmsg)); in rtnl_newroute_to_linux() local 445 int attrs_len = hdr->nlmsg_len - sizeof(struct nlmsghdr) - hdrlen; in rtnl_newroute_to_linux() 446 struct nlattr *nla_head = (struct nlattr *)((char *)(hdr + 1) + hdrlen); in rtnl_newroute_to_linux()
|
/freebsd/crypto/openssl/ssl/record/ |
H A D | ssl3_record_tls13.c | 28 size_t taglen, offset, loop, hdrlen; in tls13_enc() local 159 || !WPACKET_get_total_written(&wpkt, &hdrlen) in tls13_enc() 160 || hdrlen != SSL3_RT_HEADER_LENGTH in tls13_enc()
|