Lines Matching defs: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);
250 return m_examine_pppoe(m, off, modif, pr);
254 return m_examine_arp(m, off, modif, pr);
258 return m_examine_ip(m, off, modif, pr);
262 return m_examine_ip6(m, off, modif, pr);
269 return m_examine_hex(m, off, modif, pr);
273 m_examine_pppoe(const struct mbuf *m, int off, const char *modif,
281 pktlen = m_peek_len(m, modif) - off;
285 return m_examine_hex(m, off, modif, pr);
288 if (m_peek_data(m, off, sizeof(ph), (void *)(&ph)) < 0) {
290 return m_examine_hex(m, off, modif, pr);
292 off += sizeof(ph);
294 while (off + sizeof(pt) > pktlen) {
295 if (m_peek_data(m, off, sizeof(pt), (void *)(&pt)) < 0) {
297 return m_examine_hex(m, off, modif, pr);
299 off += sizeof(pt);
303 off += ntohs(pt.len);
342 return m_examine_hex(m, off, modif, pr);
348 return m_examine_hex(m, off, modif, pr);
351 return m_examine_ppp(m, off, modif, pr);
355 m_examine_ppp(const struct mbuf *m, int off, const char *modif,
362 pktlen = m_peek_len(m, modif) - off;
366 return m_examine_hex(m, off, modif, pr);
369 if (m_peek_data(m, off, sizeof(h), (void *)(&h)) < 0) {
371 return m_examine_hex(m, off, modif, pr);
373 off += sizeof(h);
400 return m_examine_ip(m, off, modif, pr);
404 return m_examine_ip6(m, off, modif, pr);
425 return m_examine_ip(m, off, modif, pr);
429 return m_examine_ip6(m, off, modif, pr);
442 return m_examine_hex(m, off, modif, pr);
446 m_examine_arp(const struct mbuf *m, int off, const char *modif,
455 pktlen = m_peek_len(m, modif) - off;
459 return m_examine_hex(m, off, modif, pr);
462 if (m_peek_data(m, off, sizeof(ar), (void *)(&ar)) < 0) {
464 return m_examine_hex(m, off, modif, pr);
466 off += sizeof(ar);
479 return m_examine_hex(m, off, modif, pr);
511 return m_examine_hex(m, off, modif, pr);
514 if (m_peek_data(m, off, sizeof(esaddr), (void *)(esaddr)) < 0) {
516 return m_examine_hex(m, off, modif, pr);
518 off += sizeof(esaddr);
521 if (m_peek_data(m, off, sizeof(isaddr), (void *)(&isaddr)) < 0) {
523 return m_examine_hex(m, off, modif, pr);
525 off += sizeof(isaddr);
528 if (m_peek_data(m, off, sizeof(etaddr), (void *)(etaddr)) < 0) {
530 return m_examine_hex(m, off, modif, pr);
532 off += sizeof(etaddr);
535 if (m_peek_data(m, off, sizeof(itaddr), (void *)(&itaddr)) < 0) {
537 return m_examine_hex(m, off, modif, pr);
539 off += sizeof(itaddr);
542 return m_examine_hex(m, off, modif, pr);
546 m_examine_ip(const struct mbuf *m, int off, const char *modif,
553 pktlen = m_peek_len(m, modif) - off;
557 return m_examine_hex(m, off, modif, pr);
560 if (m_peek_data(m, off, sizeof(ip), (void *)(&ip)) < 0) {
562 return m_examine_hex(m, off, modif, pr);
564 off += sizeof(ip);
589 return m_examine_icmp(m, off, modif, pr);
592 return m_examine_tcp(m, off, modif, pr);
595 return m_examine_udp(m, off, modif, pr);
601 return m_examine_hex(m, off, modif, pr);
605 m_examine_icmp(const struct mbuf *m, int off, const char *modif,
611 pktlen = m_peek_len(m, modif) - off;
615 return m_examine_hex(m, off, modif, pr);
618 if (m_peek_data(m, off, sizeof(icmphdr), (void *)(&icmphdr)) < 0) {
620 return m_examine_hex(m, off, modif, pr);
622 off += sizeof(icmphdr);
647 return m_examine_hex(m, off, modif, pr);
651 m_examine_ip6(const struct mbuf *m, int off, const char *modif,
662 pktlen = m_peek_len(m, modif) - off;
666 return m_examine_hex(m, off, modif, pr);
669 if (m_peek_data(m, off, sizeof(ip6), (void *)(&ip6)) < 0) {
671 return m_examine_hex(m, off, modif, pr);
673 off += sizeof(ip6);
688 if (m_peek_data(m, off, sizeof(hbh), (void *)(&hbh)) < 0) {
690 return m_examine_hex(m, off, modif, pr);
694 off += hbhlen;
702 return m_examine_icmp6(m, off, modif, pr);
705 return m_examine_tcp(m, off, modif, pr);
708 return m_examine_udp(m, off, modif, pr);
714 return m_examine_hex(m, off, modif, pr);
718 m_examine_icmp6(const struct mbuf *m, int off, const char *modif,
724 pktlen = m_peek_len(m, modif) - off;
728 return m_examine_hex(m, off, modif, pr);
731 if (m_peek_data(m, off, sizeof(icmp6), (void *)(&icmp6)) < 0) {
733 return m_examine_hex(m, off, modif, pr);
735 off += sizeof(icmp6);
790 return m_examine_hex(m, off, modif, pr);
794 m_examine_tcp(const struct mbuf *m, int off, const char *modif,
800 pktlen = m_peek_len(m, modif) - off;
804 return m_examine_hex(m, off, modif, pr);
807 if (m_peek_data(m, off, sizeof(tcp), (void *)(&tcp)) < 0) {
809 return m_examine_hex(m, off, modif, pr);
811 off += sizeof(tcp);
846 if ((bufp == NULL) || (m_peek_data(m, off, len, bufp) < 0)) {
850 return m_examine_hex(m, off, modif, pr);
852 off += len;
920 if (off < pktlen)
921 m_examine_hex(m, off, modif, pr);
927 m_examine_udp(const struct mbuf *m, int off, const char *modif,
933 pktlen = m_peek_len(m, modif) - off;
937 return m_examine_hex(m, off, modif, pr);
940 if (m_peek_data(m, off, sizeof(udp), (void *)(&udp)) < 0) {
942 return m_examine_hex(m, off, modif, pr);
944 off += sizeof(udp);
950 return m_examine_hex(m, off, modif, pr);
954 m_examine_hex(const struct mbuf *m, int off, const char *modif,
961 pktlen = m_peek_len(m, modif) - off;
968 (*pr)("offset %04d: ", off);
970 if (m_peek_data(m, off, sizeof(v), (void *)(&v)) < 0)
973 off++;
982 (*pr)("offset %04d: ", off);