Lines Matching refs:off
103 m_peek_data(const struct mbuf *m, int off, int len, void *vp)
108 if (off < 0 || len < 0)
111 while (off > 0) {
114 if (off < m->m_len)
116 off -= m->m_len;
122 count = uimin(m->m_len - off, len);
123 memcpy(cp, mtod(m, char *) + off, count);
126 off = 0;
224 m_examine_ether(const struct mbuf *m, int off, const char *modif,
230 pktlen = m_peek_len(m, modif) - off;
234 return m_examine_hex(m, off, modif, pr);
237 if (m_peek_data(m, off, sizeof(eh), (void *)(&eh)) < 0) {
239 return m_examine_hex(m, off, modif, pr);
241 off += sizeof(eh);
252 pktlen = m_peek_len(m, modif) - off;
254 return m_examine_hex(m, off, modif, pr);
256 if (m_peek_data(m, off + 2, sizeof(eh.ether_type), (void *)(&eh.ether_type)) < 0) {
258 return m_examine_hex(m, off, modif, pr);
260 off += 4;
265 return m_examine_pppoe(m, off, modif, pr);
269 return m_examine_arp(m, off, modif, pr);
273 return m_examine_ip(m, off, modif, pr);
277 return m_examine_ip6(m, off, modif, pr);
284 return m_examine_hex(m, off, modif, pr);
288 m_examine_pppoe(const struct mbuf *m, int off, const char *modif,
296 pktlen = m_peek_len(m, modif) - off;
300 return m_examine_hex(m, off, modif, pr);
303 if (m_peek_data(m, off, sizeof(ph), (void *)(&ph)) < 0) {
305 return m_examine_hex(m, off, modif, pr);
307 off += sizeof(ph);
309 while (off + sizeof(pt) > pktlen) {
310 if (m_peek_data(m, off, sizeof(pt), (void *)(&pt)) < 0) {
312 return m_examine_hex(m, off, modif, pr);
314 off += sizeof(pt);
318 off += ntohs(pt.len);
357 return m_examine_hex(m, off, modif, pr);
363 return m_examine_hex(m, off, modif, pr);
366 return m_examine_ppp(m, off, modif, pr);
370 m_examine_ppp(const struct mbuf *m, int off, const char *modif,
377 pktlen = m_peek_len(m, modif) - off;
381 return m_examine_hex(m, off, modif, pr);
384 if (m_peek_data(m, off, sizeof(h), (void *)(&h)) < 0) {
386 return m_examine_hex(m, off, modif, pr);
388 off += sizeof(h);
415 return m_examine_ip(m, off, modif, pr);
419 return m_examine_ip6(m, off, modif, pr);
440 return m_examine_ip(m, off, modif, pr);
444 return m_examine_ip6(m, off, modif, pr);
457 return m_examine_hex(m, off, modif, pr);
461 m_examine_arp(const struct mbuf *m, int off, const char *modif,
470 pktlen = m_peek_len(m, modif) - off;
474 return m_examine_hex(m, off, modif, pr);
477 if (m_peek_data(m, off, sizeof(ar), (void *)(&ar)) < 0) {
479 return m_examine_hex(m, off, modif, pr);
481 off += sizeof(ar);
494 return m_examine_hex(m, off, modif, pr);
526 return m_examine_hex(m, off, modif, pr);
529 if (m_peek_data(m, off, sizeof(esaddr), (void *)(esaddr)) < 0) {
531 return m_examine_hex(m, off, modif, pr);
533 off += sizeof(esaddr);
536 if (m_peek_data(m, off, sizeof(isaddr), (void *)(&isaddr)) < 0) {
538 return m_examine_hex(m, off, modif, pr);
540 off += sizeof(isaddr);
543 if (m_peek_data(m, off, sizeof(etaddr), (void *)(etaddr)) < 0) {
545 return m_examine_hex(m, off, modif, pr);
547 off += sizeof(etaddr);
550 if (m_peek_data(m, off, sizeof(itaddr), (void *)(&itaddr)) < 0) {
552 return m_examine_hex(m, off, modif, pr);
554 off += sizeof(itaddr);
557 return m_examine_hex(m, off, modif, pr);
561 m_examine_ip(const struct mbuf *m, int off, const char *modif,
568 pktlen = m_peek_len(m, modif) - off;
572 return m_examine_hex(m, off, modif, pr);
575 if (m_peek_data(m, off, sizeof(ip), (void *)(&ip)) < 0) {
577 return m_examine_hex(m, off, modif, pr);
579 off += sizeof(ip);
604 return m_examine_icmp(m, off, modif, pr);
607 return m_examine_tcp(m, off, modif, pr);
610 return m_examine_udp(m, off, modif, pr);
616 return m_examine_hex(m, off, modif, pr);
620 m_examine_icmp(const struct mbuf *m, int off, const char *modif,
626 pktlen = m_peek_len(m, modif) - off;
630 return m_examine_hex(m, off, modif, pr);
633 if (m_peek_data(m, off, sizeof(icmphdr), (void *)(&icmphdr)) < 0) {
635 return m_examine_hex(m, off, modif, pr);
637 off += sizeof(icmphdr);
662 return m_examine_hex(m, off, modif, pr);
666 m_examine_ip6(const struct mbuf *m, int off, const char *modif,
677 pktlen = m_peek_len(m, modif) - off;
681 return m_examine_hex(m, off, modif, pr);
684 if (m_peek_data(m, off, sizeof(ip6), (void *)(&ip6)) < 0) {
686 return m_examine_hex(m, off, modif, pr);
688 off += sizeof(ip6);
703 if (m_peek_data(m, off, sizeof(hbh), (void *)(&hbh)) < 0) {
705 return m_examine_hex(m, off, modif, pr);
709 off += hbhlen;
717 return m_examine_icmp6(m, off, modif, pr);
720 return m_examine_tcp(m, off, modif, pr);
723 return m_examine_udp(m, off, modif, pr);
729 return m_examine_hex(m, off, modif, pr);
733 m_examine_icmp6(const struct mbuf *m, int off, const char *modif,
739 pktlen = m_peek_len(m, modif) - off;
743 return m_examine_hex(m, off, modif, pr);
746 if (m_peek_data(m, off, sizeof(icmp6), (void *)(&icmp6)) < 0) {
748 return m_examine_hex(m, off, modif, pr);
750 off += sizeof(icmp6);
805 return m_examine_hex(m, off, modif, pr);
809 m_examine_tcp(const struct mbuf *m, int off, const char *modif,
815 pktlen = m_peek_len(m, modif) - off;
819 return m_examine_hex(m, off, modif, pr);
822 if (m_peek_data(m, off, sizeof(tcp), (void *)(&tcp)) < 0) {
824 return m_examine_hex(m, off, modif, pr);
826 off += sizeof(tcp);
861 if ((bufp == NULL) || (m_peek_data(m, off, len, bufp) < 0)) {
865 return m_examine_hex(m, off, modif, pr);
867 off += len;
935 if (off < pktlen)
936 m_examine_hex(m, off, modif, pr);
942 m_examine_udp(const struct mbuf *m, int off, const char *modif,
948 pktlen = m_peek_len(m, modif) - off;
952 return m_examine_hex(m, off, modif, pr);
955 if (m_peek_data(m, off, sizeof(udp), (void *)(&udp)) < 0) {
957 return m_examine_hex(m, off, modif, pr);
959 off += sizeof(udp);
965 return m_examine_hex(m, off, modif, pr);
969 m_examine_hex(const struct mbuf *m, int off, const char *modif,
976 pktlen = m_peek_len(m, modif) - off;
983 (*pr)("offset %04d: ", off);
985 if (m_peek_data(m, off, sizeof(v), (void *)(&v)) < 0)
988 off++;
997 (*pr)("offset %04d: ", off);