Lines Matching refs:buf

170          const u_char *buf, int ofs, const u_char *maxbuf)  in name_ptr()  argument
175 p = buf + ofs; in name_ptr()
194 p = buf + l; in name_ptr()
210 const u_char *buf, int ofs, const u_char *maxbuf, char *name) in name_extract() argument
212 const u_char *p = name_ptr(ndo, buf, ofs, maxbuf); in name_extract()
250 const unsigned char *buf, int len) in print_asc() argument
254 safeputchar(ndo, buf[i]); in print_asc()
276 const unsigned char *buf, int len) in print_data() argument
284 ND_TCHECK(buf[i]); in print_data()
285 ND_PRINT((ndo, "%02X ", buf[i] & 0xff)); in print_data()
290 print_asc(ndo, &buf[i - 16], 8); in print_data()
292 print_asc(ndo, &buf[i - 8], 8); in print_data()
309 print_asc(ndo, &buf[i - (i % 16)], n); in print_data()
313 print_asc(ndo, &buf[i - n], n); in print_data()
346 static char buf[MAX_UNISTR_SIZE+1]; in unistr() local
397 buf[l] = s[0]; in unistr()
401 buf[l] = '.'; in unistr()
414 buf[l] = s[0]; in unistr()
419 buf[l] = '.'; in unistr()
428 buf[l] = 0; in unistr()
429 return buf; in unistr()
437 const u_char *buf, const char *fmt, const u_char *maxbuf, in smb_fdata1() argument
443 while (*fmt && buf<maxbuf) { in smb_fdata1()
446 ND_TCHECK(buf[0]); in smb_fdata1()
447 write_bits(ndo, buf[0], attrib_fmt); in smb_fdata1()
448 buf++; in smb_fdata1()
453 ND_TCHECK2(buf[0], 2); in smb_fdata1()
454 write_bits(ndo, EXTRACT_LE_16BITS(buf), attrib_fmt); in smb_fdata1()
455 buf += 2; in smb_fdata1()
474 ND_TCHECK(buf[0]); in smb_fdata1()
475 write_bits(ndo, buf[0], bitfmt); in smb_fdata1()
476 buf++; in smb_fdata1()
483 ND_TCHECK2(buf[0], l); in smb_fdata1()
484 buf += l; in smb_fdata1()
497 ND_TCHECK(buf[0]); in smb_fdata1()
498 x = buf[0]; in smb_fdata1()
500 buf += 1; in smb_fdata1()
507 ND_TCHECK2(buf[0], 2); in smb_fdata1()
508 x = reverse ? EXTRACT_16BITS(buf) : in smb_fdata1()
509 EXTRACT_LE_16BITS(buf); in smb_fdata1()
511 buf += 2; in smb_fdata1()
518 ND_TCHECK2(buf[0], 4); in smb_fdata1()
519 x = reverse ? EXTRACT_32BITS(buf) : in smb_fdata1()
520 EXTRACT_LE_32BITS(buf); in smb_fdata1()
522 buf += 4; in smb_fdata1()
529 ND_TCHECK2(buf[0], 8); in smb_fdata1()
530 x = reverse ? EXTRACT_64BITS(buf) : in smb_fdata1()
531 EXTRACT_LE_64BITS(buf); in smb_fdata1()
533 buf += 8; in smb_fdata1()
542 ND_TCHECK2(buf[0], 8); in smb_fdata1()
543 x1 = reverse ? EXTRACT_32BITS(buf) : in smb_fdata1()
544 EXTRACT_LE_32BITS(buf); in smb_fdata1()
545 x2 = reverse ? EXTRACT_32BITS(buf + 4) : in smb_fdata1()
546 EXTRACT_LE_32BITS(buf + 4); in smb_fdata1()
549 buf += 8; in smb_fdata1()
556 ND_TCHECK(buf[0]); in smb_fdata1()
557 x = buf[0]; in smb_fdata1()
559 buf += 1; in smb_fdata1()
566 ND_TCHECK2(buf[0], 2); in smb_fdata1()
567 x = reverse ? EXTRACT_16BITS(buf) : in smb_fdata1()
568 EXTRACT_LE_16BITS(buf); in smb_fdata1()
570 buf += 2; in smb_fdata1()
577 ND_TCHECK2(buf[0], 4); in smb_fdata1()
578 x = reverse ? EXTRACT_32BITS(buf) : in smb_fdata1()
579 EXTRACT_LE_32BITS(buf); in smb_fdata1()
581 buf += 4; in smb_fdata1()
591 ND_TCHECK(buf[0]); in smb_fdata1()
592 stringlen = buf[0]; in smb_fdata1()
594 buf += 1; in smb_fdata1()
598 ND_TCHECK2(buf[0], 2); in smb_fdata1()
599 stringlen = reverse ? EXTRACT_16BITS(buf) : in smb_fdata1()
600 EXTRACT_LE_16BITS(buf); in smb_fdata1()
602 buf += 2; in smb_fdata1()
606 ND_TCHECK2(buf[0], 4); in smb_fdata1()
607 stringlen = reverse ? EXTRACT_32BITS(buf) : in smb_fdata1()
608 EXTRACT_LE_32BITS(buf); in smb_fdata1()
610 buf += 4; in smb_fdata1()
624 s = unistr(ndo, buf, &len, (*fmt == 'R') ? 0 : unicodestr); in smb_fdata1()
628 buf += len; in smb_fdata1()
638 ND_TCHECK(*buf); in smb_fdata1()
639 if (*buf != 4 && *buf != 2) { in smb_fdata1()
640 ND_PRINT((ndo, "Error! ASCIIZ buffer of type %u", *buf)); in smb_fdata1()
644 s = unistr(ndo, buf + 1, &len, (*fmt == 'Y') ? 0 : unicodestr); in smb_fdata1()
648 buf += len + 1; in smb_fdata1()
655 ND_TCHECK2(*buf, l); in smb_fdata1()
656 ND_PRINT((ndo, "%-*.*s", l, l, buf)); in smb_fdata1()
657 buf += l; in smb_fdata1()
665 ND_TCHECK2(*buf, stringlen); in smb_fdata1()
666 ND_PRINT((ndo, "%-*.*s", (int)stringlen, (int)stringlen, buf)); in smb_fdata1()
667 buf += stringlen; in smb_fdata1()
676 s = unistr(ndo, buf, &stringlen, unicodestr); in smb_fdata1()
680 buf += stringlen; in smb_fdata1()
687 ND_TCHECK2(*buf, l); in smb_fdata1()
689 ND_PRINT((ndo, "%02x", *buf++)); in smb_fdata1()
704 name_type = name_extract(ndo, startbuf, PTR_DIFF(buf, startbuf), in smb_fdata1()
708 len = name_len(ndo, buf, maxbuf); in smb_fdata1()
711 buf += len; in smb_fdata1()
716 ND_TCHECK(buf[15]); in smb_fdata1()
717 name_type = buf[15]; in smb_fdata1()
718 ND_PRINT((ndo, "%-15.15s NameType=0x%02X (%s)", buf, name_type, in smb_fdata1()
720 buf += 16; in smb_fdata1()
737 ND_TCHECK2(buf[0], 4); in smb_fdata1()
738 x = EXTRACT_LE_32BITS(buf); in smb_fdata1()
742 t = make_unix_date(buf); in smb_fdata1()
743 buf += 4; in smb_fdata1()
746 ND_TCHECK2(buf[0], 4); in smb_fdata1()
747 x = EXTRACT_LE_32BITS(buf); in smb_fdata1()
751 t = make_unix_date2(buf); in smb_fdata1()
752 buf += 4; in smb_fdata1()
755 ND_TCHECK2(buf[0], 8); in smb_fdata1()
756 t = interpret_long_date(buf); in smb_fdata1()
757 buf += 8; in smb_fdata1()
784 if (buf >= maxbuf && *fmt) in smb_fdata1()
787 return(buf); in smb_fdata1()
797 const u_char *buf, const char *fmt, const u_char *maxbuf, in smb_fdata() argument
808 while (buf < maxbuf) { in smb_fdata()
811 buf2 = smb_fdata(ndo, buf, fmt, maxbuf, unicodestr); in smb_fdata()
815 if (buf2 == buf) in smb_fdata()
816 return(buf); in smb_fdata()
817 buf = buf2; in smb_fdata()
819 return(buf); in smb_fdata()
823 if (buf >= maxbuf) in smb_fdata()
824 return(buf); in smb_fdata()
829 buf = maxbuf; in smb_fdata()
834 return(buf); in smb_fdata()
839 if (buf >= maxbuf) in smb_fdata()
840 return(buf); in smb_fdata()
845 return(buf); in smb_fdata()
850 buf = smb_fdata1(ndo, buf, s, maxbuf, unicodestr); in smb_fdata()
851 if (buf == NULL) in smb_fdata()
861 if (!depth && buf < maxbuf) { in smb_fdata()
862 size_t len = PTR_DIFF(maxbuf, buf); in smb_fdata()
864 print_data(ndo, buf, len); in smb_fdata()
865 return(buf + len); in smb_fdata()
867 return(buf); in smb_fdata()