debug smb_read

This commit is contained in:
Kelvin Sherlock 2014-09-05 20:56:03 -04:00
parent a5bda4e74e
commit 2f0f7c2a09
1 changed files with 25 additions and 0 deletions

25
smb.c
View File

@ -258,6 +258,7 @@ static void dump_create(const smb2_create_response *msg)
msg->create_contexts_length);
fprintf(stdout, " buffer:\n");
hexdump((const char *)msg - sizeof(smb2_header_sync) +
msg->create_contexts_offset,
msg->create_contexts_length);
@ -265,6 +266,26 @@ static void dump_create(const smb2_create_response *msg)
fprintf(stdout, "\n");
}
static void dump_read(const smb2_read_response *msg)
{
fprintf(stdout, " structure_size: %04x\n", msg->structure_size);
fprintf(stdout, "data_offset: %02x\n", msg->data_offset);
fprintf(stdout, "reserved: %02x\n", msg->reserved);
fprintf(stdout, "data_length: %08lx\n", msg->data_length);
fprintf(stdout, "data_remaining: %08lx\n", msg->data_remaining);
fprintf(stdout, "reserved2: %08lx\n", msg->reserved2);
fprintf(stdout, " buffer:\n");
hexdump((const char *)msg + sizeof(smb2_read_response) +
msg->data_offset,
msg->data_length);
fprintf(stdout, "\n");
}
static void dump_response(const smb_response *msg)
{
@ -305,6 +326,10 @@ static void dump_response(const smb_response *msg)
dump_close(&msg->body.close);
break;
case SMB2_READ:
dump_read(&msg->body.read);
break;
default:
break;