#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/smbutil.c,v 1.36 2005-01-29 10:37:02 guy Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/smbutil.c,v 1.39 2007-07-15 19:07:39 guy Exp $";
#endif
#include <tcpdump-stdinc.h>
return;
printf("[%03X] ", i);
for (i = 0; i < len; /*nothing*/) {
+ TCHECK(buf[i]);
printf("%02X ", buf[i] & 0xff);
i++;
if (i%8 == 0)
print_asc(&buf[i - n], n);
printf("\n");
}
+ return;
+
+trunc:
+ printf("\n");
+ printf("WARNING: Short packet. Try increasing the snap length\n");
}
{
int reverse = 0;
const char *attrib_fmt = "READONLY|HIDDEN|SYSTEM|VOLUME|DIR|ARCHIVE|";
- int len;
while (*fmt && buf<maxbuf) {
switch (*fmt) {
{
/*XXX unistr() */
const char *s;
+ u_int32_t len;
+
len = 0;
s = unistr(buf, &len, (*fmt == 'R') ? 0 : unicodestr);
if (s == NULL)
case 'Y': /* like 'Z', but always ASCII */
{
const char *s;
+ u_int32_t len;
+
TCHECK(*buf);
if (*buf != 4 && *buf != 2) {
printf("Error! ASCIIZ buffer of type %u", *buf);
t = interpret_long_date(buf);
buf += 8;
break;
+ default:
+ t = 0;
+ break;
}
if (t != 0) {
lt = localtime(&t);
};
/* Server Error Messages */
-err_code_struct server_msgs[] = {
+static const err_code_struct server_msgs[] = {
{ "ERRerror", 1, "Non-specific error code." },
{ "ERRbadpw", 2, "Bad password - name/password pair in a Tree Connect or Session Setup are invalid." },
{ "ERRbadtype", 3, "reserved." },
};
/* Hard Error Messages */
-err_code_struct hard_msgs[] = {
+static const err_code_struct hard_msgs[] = {
{ "ERRnowrite", 19, "Attempt to write on write-protected diskette." },
{ "ERRbadunit", 20, "Unknown unit." },
{ "ERRnotready", 21, "Drive not ready." },