Get rid of some unused arguments, and mark some others as unused.

Remove the declaration of "dissect_nt_sid()" from
"packet-dcerpc-samr.c"; get it by including "packet-smb-common.h",
instead.

svn path=/trunk/; revision=5313
This commit is contained in:
Guy Harris 2002-04-30 11:03:08 +00:00
parent a977e68fbc
commit da74615c79
9 changed files with 449 additions and 481 deletions

View File

@ -2,7 +2,7 @@
* Routines for DCERPC over SMB packet disassembly
* Copyright 2001, Tim Potter <tpot@samba.org>
*
* $Id: packet-dcerpc-nt.c,v 1.28 2002/04/22 09:43:02 guy Exp $
* $Id: packet-dcerpc-nt.c,v 1.29 2002/04/30 11:03:08 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -643,8 +643,7 @@ dissect_ndr_nt_NTTIME (tvbuff_t *tvb, int offset,
ALIGN_TO_4_BYTES;
offset = dissect_smb_64bit_time(tvb, pinfo, tree, offset,
hf_index);
offset = dissect_smb_64bit_time(tvb, tree, offset, hf_index);
return offset;
}

View File

@ -3,7 +3,7 @@
* Copyright 2001, Tim Potter <tpot@samba.org>
* 2002 Added all command dissectors Ronnie Sahlberg
*
* $Id: packet-dcerpc-samr.c,v 1.37 2002/04/30 01:44:34 tpot Exp $
* $Id: packet-dcerpc-samr.c,v 1.38 2002/04/30 11:03:07 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -35,8 +35,7 @@
#include "packet-dcerpc-nt.h"
#include "packet-dcerpc-samr.h"
#include "smb.h" /* for "NT_errors[]" */
int dissect_nt_sid(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, char *name);
#include "packet-smb-common.h"
static int proto_dcerpc_samr = -1;
@ -212,7 +211,7 @@ dissect_ndr_nt_SID(tvbuff_t *tvb, int offset,
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
hf_samr_count, NULL);
offset = dissect_nt_sid(tvb, pinfo, offset, tree, "Domain");
offset = dissect_nt_sid(tvb, offset, tree, "Domain");
return offset;
}

View File

@ -2,7 +2,7 @@
* Routines for SMB Browser packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
* $Id: packet-smb-browse.c,v 1.21 2002/01/24 09:20:51 guy Exp $
* $Id: packet-smb-browse.c,v 1.22 2002/04/30 11:03:08 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -356,7 +356,7 @@ static const true_false_string tfs_os_nts = {
};
static void
dissect_election_criterion_os(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset)
dissect_election_criterion_os(tvbuff_t *tvb, proto_tree *parent_tree, int offset)
{
proto_tree *tree = NULL;
proto_item *item = NULL;
@ -379,7 +379,7 @@ dissect_election_criterion_os(tvbuff_t *tvb, packet_info *pinfo, proto_tree *par
}
static void
dissect_election_criterion_desire(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset)
dissect_election_criterion_desire(tvbuff_t *tvb, proto_tree *parent_tree, int offset)
{
proto_tree *tree = NULL;
proto_item *item = NULL;
@ -408,7 +408,7 @@ dissect_election_criterion_desire(tvbuff_t *tvb, packet_info *pinfo, proto_tree
}
static void
dissect_election_criterion(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset)
dissect_election_criterion(tvbuff_t *tvb, proto_tree *parent_tree, int offset)
{
proto_tree *tree = NULL;
proto_item *item = NULL;
@ -422,7 +422,7 @@ dissect_election_criterion(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent
}
/* election desire */
dissect_election_criterion_desire(tvb, pinfo, tree, offset);
dissect_election_criterion_desire(tvb, tree, offset);
offset += 1;
/* browser protocol major version */
@ -434,7 +434,7 @@ dissect_election_criterion(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent
offset += 1;
/* election os */
dissect_election_criterion_os(tvb, pinfo, tree, offset);
dissect_election_criterion_os(tvb, tree, offset);
offset += 1;
}
@ -665,7 +665,7 @@ dissect_mailslot_browse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr
offset += 1;
/* criterion */
dissect_election_criterion(tvb, pinfo, tree, offset);
dissect_election_criterion(tvb, tree, offset);
offset += 4;
/* server uptime */

View File

@ -2,7 +2,7 @@
* Common routines for smb packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
* $Id: packet-smb-common.c,v 1.8 2002/01/24 09:20:51 guy Exp $
* $Id: packet-smb-common.c,v 1.9 2002/04/30 11:03:08 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -27,7 +27,7 @@
#include "packet-smb-common.h"
int display_ms_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int hf_index)
int display_ms_string(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_index)
{
char *str;
int len;
@ -59,7 +59,7 @@ int display_ms_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
}
int display_unicode_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int hf_index)
int display_unicode_string(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_index)
{
/* display a unicode string from the tree and return new offset */
@ -84,7 +84,7 @@ int display_unicode_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
int
dissect_smb_unknown(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
dissect_smb_unknown(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset)
{
/* display data as unknown */

View File

@ -2,7 +2,7 @@
* Routines for SMB packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
* $Id: packet-smb-common.h,v 1.9 2002/02/21 18:39:49 tpot Exp $
* $Id: packet-smb-common.h,v 1.10 2002/04/30 11:03:08 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -53,14 +53,13 @@
int dissect_smb_unknown(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset);
int display_unicode_string(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int offset, int hf_index);
int display_unicode_string(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_index);
int display_ms_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int hf_index);
int display_ms_string(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_index);
int dissect_smb_64bit_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int hf_date);
int dissect_smb_64bit_time(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_date);
int dissect_nt_sid(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, char *name);
int dissect_nt_sid(tvbuff_t *tvb, int offset, proto_tree *parent_tree, char *name);
int
dissect_nt_sec_desc(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, int len);

View File

@ -2,7 +2,7 @@
* Routines for SMB net logon packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
* $Id: packet-smb-logon.c,v 1.25 2002/01/28 00:58:46 guy Exp $
* $Id: packet-smb-logon.c,v 1.26 2002/04/30 11:03:03 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -132,7 +132,7 @@ static const true_false_string tfs_flags_enabled = {
static int
dissect_account_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
dissect_account_control(tvbuff_t *tvb, proto_tree *tree, int offset)
{
/* display the Allowable Account control bits */
@ -167,8 +167,7 @@ dissect_account_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
}
static int
display_LM_token(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree)
display_LM_token(tvbuff_t *tvb, int offset, proto_tree *tree)
{
guint16 Token;
@ -195,8 +194,7 @@ display_LM_token(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
static int
display_LMNT_token(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree)
display_LMNT_token(tvbuff_t *tvb, int offset, proto_tree *tree)
{
guint16 Token;
@ -221,18 +219,18 @@ display_LMNT_token(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
static int
dissect_smb_logon_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
dissect_smb_logon_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset)
{
/*** 0x00 (LM1.0/LM2.0 LOGON Request) ***/
/* computer name */
offset = display_ms_string(tvb, pinfo, tree, offset, hf_computer_name);
offset = display_ms_string(tvb, tree, offset, hf_computer_name);
/* user name */
offset = display_ms_string(tvb, pinfo, tree, offset, hf_user_name);
offset = display_ms_string(tvb, tree, offset, hf_user_name);
/* mailslot name */
offset = display_ms_string(tvb, pinfo, tree, offset, hf_mailslot_name);
offset = display_ms_string(tvb, tree, offset, hf_mailslot_name);
/*$$$$$ here add the Mailslot to the response list (if needed) */
@ -245,7 +243,7 @@ dissect_smb_logon_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
offset += 2;
/* LM token */
offset = display_LM_token(tvb, offset, pinfo, tree);
offset = display_LM_token(tvb, offset, tree);
return offset;
}
@ -253,22 +251,22 @@ dissect_smb_logon_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
static int
dissect_smb_logon_LM10_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
dissect_smb_logon_LM10_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset)
{
/*** 0x01 LanMan 1.0 Logon response ***/
/* user name */
offset = display_ms_string(tvb, pinfo, tree, offset, hf_user_name);
offset = display_ms_string(tvb, tree, offset, hf_user_name);
/* script name */
offset = display_ms_string(tvb, pinfo, tree, offset, hf_script_name);
offset = display_ms_string(tvb, tree, offset, hf_script_name);
return offset;
}
static int
dissect_smb_logon_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
dissect_smb_logon_2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset)
{
/*** 0x02 LM1.0 Query - Centralized Initialization ***/
/*** 0x03 LM1.0 Query - Distributed Initialization ***/
@ -276,17 +274,17 @@ dissect_smb_logon_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int off
/*** 0x04 LM1.0 Query - Distributed Query Response ***/
/* computer name */
offset = display_ms_string(tvb, pinfo, tree, offset, hf_computer_name);
offset = display_ms_string(tvb, tree, offset, hf_computer_name);
/* mailslot name */
offset = display_ms_string(tvb, pinfo, tree, offset, hf_mailslot_name);
offset = display_ms_string(tvb, tree, offset, hf_mailslot_name);
/* NT version */
proto_tree_add_item(tree, hf_nt_version, tvb, offset, 2, TRUE);
offset += 2;
/* LM token */
offset = display_LM_token(tvb, offset, pinfo, tree);
offset = display_LM_token(tvb, offset, tree);
return offset;
}
@ -294,15 +292,15 @@ dissect_smb_logon_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int off
static int
dissect_smb_logon_LM20_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
dissect_smb_logon_LM20_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset)
{
/*** 0x06 (LM2.0 LOGON Response) ***/
/* server name */
offset = display_ms_string(tvb, pinfo, tree, offset, hf_server_name);
offset = display_ms_string(tvb, tree, offset, hf_server_name);
/* LM token */
offset = display_LM_token(tvb, offset, pinfo, tree);
offset = display_LM_token(tvb, offset, tree);
return offset;
}
@ -310,15 +308,15 @@ dissect_smb_logon_LM20_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
static int
dissect_smb_pdc_query(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
dissect_smb_pdc_query(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset)
{
/*** 0x07 Query for Primary PDC ***/
/* computer name */
offset = display_ms_string(tvb, pinfo, tree, offset, hf_computer_name);
offset = display_ms_string(tvb, tree, offset, hf_computer_name);
/* mailslot name */
offset = display_ms_string(tvb, pinfo, tree, offset, hf_mailslot_name);
offset = display_ms_string(tvb, tree, offset, hf_mailslot_name);
if (tvb_reported_length_remaining(tvb, offset) > 2) {
/*
@ -333,18 +331,18 @@ dissect_smb_pdc_query(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
if (offset % 2) offset++; /* word align ... */
/* Unicode computer name */
offset = display_unicode_string(tvb, pinfo, tree, offset, hf_unicode_computer_name);
offset = display_unicode_string(tvb, tree, offset, hf_unicode_computer_name);
/* NT version */
proto_tree_add_item(tree, hf_nt_version, tvb, offset, 4, TRUE);
offset += 4;
/* LMNT token */
offset = display_LMNT_token(tvb, offset, pinfo, tree);
offset = display_LMNT_token(tvb, offset, tree);
}
/* LM token */
offset = display_LM_token(tvb, offset, pinfo, tree);
offset = display_LM_token(tvb, offset, tree);
return offset;
}
@ -352,12 +350,12 @@ dissect_smb_pdc_query(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
static int
dissect_smb_pdc_startup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
dissect_smb_pdc_startup(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset)
{
/*** 0x08 Announce startup of PDC ***/
/* pdc name */
offset = display_ms_string(tvb, pinfo, tree, offset, hf_pdc_name);
offset = display_ms_string(tvb, tree, offset, hf_pdc_name);
/* A short Announce will not have the rest */
@ -366,22 +364,22 @@ dissect_smb_pdc_startup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
if (offset % 2) offset++; /* word align ... */
/* pdc name */
offset = display_unicode_string(tvb, pinfo, tree, offset, hf_unicode_pdc_name);
offset = display_unicode_string(tvb, tree, offset, hf_unicode_pdc_name);
if (offset % 2) offset++;
/* domain name */
offset = display_unicode_string(tvb, pinfo, tree, offset, hf_domain_name);
offset = display_unicode_string(tvb, tree, offset, hf_domain_name);
/* NT version */
proto_tree_add_item(tree, hf_nt_version, tvb, offset, 4, TRUE);
offset += 4;
/* LMNT token */
offset = display_LMNT_token(tvb, offset, pinfo, tree);
offset = display_LMNT_token(tvb, offset, tree);
/* LM token */
offset = display_LM_token(tvb, offset, pinfo, tree);
offset = display_LM_token(tvb, offset, tree);
}
return offset;
@ -390,7 +388,7 @@ dissect_smb_pdc_startup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
static int
dissect_smb_pdc_failure(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
dissect_smb_pdc_failure(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset)
{
/*** 0x09 Announce failure of the PDC ***/
/*** 0x0F LM2.0 Resp. during LOGON pause ***/
@ -401,14 +399,14 @@ dissect_smb_pdc_failure(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
offset += 4;
/* LM token */
offset = display_LM_token(tvb, offset, pinfo, tree);
offset = display_LM_token(tvb, offset, tree);
return offset;
}
static int
dissect_announce_change(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
dissect_announce_change(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset)
{
/*** 0x0A ( Announce change to UAS or SAM ) ***/
guint32 info_count;
@ -434,18 +432,18 @@ dissect_announce_change(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
offset += 4;
/* pdc name */
offset = display_ms_string(tvb, pinfo, tree, offset, hf_pdc_name);
offset = display_ms_string(tvb, tree, offset, hf_pdc_name);
/* domain name */
offset = display_ms_string(tvb, pinfo, tree, offset, hf_domain_name);
offset = display_ms_string(tvb, tree, offset, hf_domain_name);
if (offset % 2) offset++; /* word align ... */
/* pdc name */
offset = display_unicode_string(tvb, pinfo, tree, offset, hf_unicode_pdc_name);
offset = display_unicode_string(tvb, tree, offset, hf_unicode_pdc_name);
/* domain name */
offset = display_unicode_string(tvb, pinfo, tree, offset, hf_domain_name);
offset = display_unicode_string(tvb, tree, offset, hf_domain_name);
/* DB count */
info_count = tvb_get_letohl(tvb, offset);
@ -468,7 +466,7 @@ dissect_announce_change(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
TRUE);
offset += 8;
offset = dissect_smb_64bit_time(tvb, pinfo, info_tree, offset,
offset = dissect_smb_64bit_time(tvb, info_tree, offset,
hf_nt_date_time);
info_count--;
@ -485,7 +483,7 @@ dissect_announce_change(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
offset = ((offset + 3)/4)*4;
/* Domain SID */
offset = dissect_nt_sid(tvb, pinfo, offset, tree, "Domain");
offset = dissect_nt_sid(tvb, offset, tree, "Domain");
}
/* NT version */
@ -493,10 +491,10 @@ dissect_announce_change(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
offset += 4;
/* LMNT token */
offset = display_LMNT_token(tvb, offset, pinfo, tree);
offset = display_LMNT_token(tvb, offset, tree);
/* LM token */
offset = display_LM_token(tvb, offset, pinfo, tree);
offset = display_LM_token(tvb, offset, tree);
return offset;
}
@ -504,7 +502,7 @@ dissect_announce_change(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
static int
dissect_smb_sam_logon_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
dissect_smb_sam_logon_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset)
{
/* Netlogon command 0x12 - decode the SAM logon request from client */
@ -515,16 +513,16 @@ dissect_smb_sam_logon_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
offset += 2;
/* computer name */
offset = display_unicode_string(tvb, pinfo, tree, offset, hf_unicode_computer_name);
offset = display_unicode_string(tvb, tree, offset, hf_unicode_computer_name);
/* user name */
offset = display_unicode_string(tvb, pinfo, tree, offset, hf_user_name);
offset = display_unicode_string(tvb, tree, offset, hf_user_name);
/* mailslot name */
offset = display_ms_string(tvb, pinfo, tree, offset, hf_mailslot_name);
offset = display_ms_string(tvb, tree, offset, hf_mailslot_name);
/* account control */
offset = dissect_account_control(tvb, pinfo, tree, offset);
offset = dissect_account_control(tvb, tree, offset);
/* Domain SID Size */
domain_sid_size = tvb_get_letohl(tvb, offset);
@ -537,7 +535,7 @@ dissect_smb_sam_logon_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
offset = ((offset + 3)/4)*4;
/* Domain SID */
offset = dissect_nt_sid(tvb, pinfo, offset, tree, "Domain");
offset = dissect_nt_sid(tvb, offset, tree, "Domain");
}
/* NT version */
@ -545,10 +543,10 @@ dissect_smb_sam_logon_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
offset += 4;
/* LMNT token */
offset = display_LMNT_token(tvb, offset, pinfo, tree);
offset = display_LMNT_token(tvb, offset, tree);
/* LM token */
offset = display_LM_token(tvb, offset, pinfo, tree);
offset = display_LM_token(tvb, offset, tree);
return offset;
}
@ -556,12 +554,12 @@ dissect_smb_sam_logon_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
static int
dissect_smb_no_user(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
dissect_smb_no_user(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset)
{
/* 0x0B (Announce no user on machine) */
/* computer name */
offset = display_ms_string(tvb, pinfo, tree, offset, hf_computer_name);
offset = display_ms_string(tvb, tree, offset, hf_computer_name);
return offset;
}
@ -569,7 +567,7 @@ dissect_smb_no_user(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int off
static int
dissect_smb_relogon_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
dissect_smb_relogon_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset)
{
/*** 0x0d LanMan Response to relogon request ***/
@ -590,7 +588,7 @@ dissect_smb_relogon_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in
offset += 4;
/* LM token */
offset = display_LM_token(tvb, offset, pinfo, tree);
offset = display_LM_token(tvb, offset, tree);
return offset;
}
@ -598,7 +596,7 @@ dissect_smb_relogon_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in
static int
dissect_smb_acc_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
dissect_smb_acc_update(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset)
{
/*** 0x11 LM2.1 Announce Acc updates ***/
@ -617,10 +615,10 @@ dissect_smb_acc_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
offset += 4;
/* computer name */
offset = display_ms_string(tvb, pinfo, tree, offset, hf_computer_name);
offset = display_ms_string(tvb, tree, offset, hf_computer_name);
/* user name */
offset = display_ms_string(tvb, pinfo, tree, offset, hf_user_name);
offset = display_ms_string(tvb, tree, offset, hf_user_name);
/* update type */
proto_tree_add_item(tree, hf_update_type, tvb, offset, 2, TRUE);
@ -631,7 +629,7 @@ dissect_smb_acc_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
offset += 4;
/* LM token */
offset = display_LM_token(tvb, offset, pinfo, tree);
offset = display_LM_token(tvb, offset, tree);
return offset;
}
@ -639,7 +637,7 @@ dissect_smb_acc_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
static int
dissect_smb_inter_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
dissect_smb_inter_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset)
{
/* 0x0e LanMan Response to interrogate request */
@ -660,7 +658,7 @@ dissect_smb_inter_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
offset += 4;
/* LMNT token */
offset = display_LMNT_token(tvb, offset, pinfo, tree);
offset = display_LMNT_token(tvb, offset, tree);
/* XXX - no LM token? Every other packet has one after the LMNT
token. */
@ -670,29 +668,29 @@ dissect_smb_inter_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
static int
dissect_smb_sam_logon_resp(tvbuff_t *tvb, packet_info *pinfo,
dissect_smb_sam_logon_resp(tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree *tree, int offset)
{
/* Netlogon command 0x13 - decode the SAM logon response from server */
/* server name */
offset = display_unicode_string(tvb, pinfo, tree, offset, hf_server_name);
offset = display_unicode_string(tvb, tree, offset, hf_server_name);
/* user name */
offset = display_unicode_string(tvb, pinfo, tree, offset, hf_user_name);
offset = display_unicode_string(tvb, tree, offset, hf_user_name);
/* domain name */
offset = display_unicode_string(tvb, pinfo, tree, offset, hf_domain_name);
offset = display_unicode_string(tvb, tree, offset, hf_domain_name);
/* NT version */
proto_tree_add_item(tree, hf_nt_version, tvb, offset, 4, TRUE);
offset += 4;
/* LMNT token */
offset = display_LMNT_token(tvb, offset, pinfo, tree);
offset = display_LMNT_token(tvb, offset, tree);
/* LM token */
offset = display_LM_token(tvb, offset, pinfo, tree);
offset = display_LM_token(tvb, offset, tree);
return offset;
}

View File

@ -8,7 +8,7 @@ XXX Fixme : shouldnt show [malformed frame] for long packets
* significant rewrite to tvbuffify the dissector, Ronnie Sahlberg and
* Guy Harris 2001
*
* $Id: packet-smb-pipe.c,v 1.75 2002/04/29 22:43:21 guy Exp $
* $Id: packet-smb-pipe.c,v 1.76 2002/04/30 11:03:06 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -232,8 +232,8 @@ static const value_string weekday_vals[] = {
};
static int
add_word_param(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
proto_tree *tree, int convert, int hf_index)
add_word_param(tvbuff_t *tvb, int offset, int count _U_,
packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index)
{
guint16 WParam;
@ -249,8 +249,8 @@ add_word_param(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
}
static int
add_dword_param(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
proto_tree *tree, int convert, int hf_index)
add_dword_param(tvbuff_t *tvb, int offset, int count _U_,
packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index)
{
guint32 LParam;
@ -266,8 +266,8 @@ add_dword_param(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
}
static int
add_byte_param(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
proto_tree *tree, int convert, int hf_index)
add_byte_param(tvbuff_t *tvb, int offset, int count, packet_info *pinfo _U_,
proto_tree *tree, int convert _U_, int hf_index)
{
guint8 BParam;
@ -290,8 +290,8 @@ add_byte_param(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
}
static int
add_pad_param(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
proto_tree *tree, int convert, int hf_index)
add_pad_param(tvbuff_t *tvb _U_, int offset, int count, packet_info *pinfo _U_,
proto_tree *tree _U_, int convert _U_, int hf_index _U_)
{
/*
* This is for parameters that have descriptor entries but that
@ -302,8 +302,8 @@ add_pad_param(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
}
static void
add_null_pointer_param(tvbuff_t *tvb, int offset, int count,
packet_info *pinfo, proto_tree *tree, int convert, int hf_index)
add_null_pointer_param(tvbuff_t *tvb, int offset, int count _U_,
packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index)
{
if (hf_index != -1) {
proto_tree_add_text(tree, tvb, offset, 0,
@ -316,8 +316,8 @@ add_null_pointer_param(tvbuff_t *tvb, int offset, int count,
}
static int
add_string_param(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
proto_tree *tree, int convert, int hf_index)
add_string_param(tvbuff_t *tvb, int offset, int count _U_,
packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index)
{
guint string_len;
@ -356,8 +356,8 @@ get_stringz_pointer_value(tvbuff_t *tvb, int offset, int convert, int *cptrp,
}
static int
add_stringz_pointer_param(tvbuff_t *tvb, int offset, int count,
packet_info *pinfo, proto_tree *tree, int convert, int hf_index)
add_stringz_pointer_param(tvbuff_t *tvb, int offset, int count _U_,
packet_info *pinfo _U_, proto_tree *tree, int convert, int hf_index)
{
int cptr;
const char *string;
@ -392,7 +392,7 @@ add_stringz_pointer_param(tvbuff_t *tvb, int offset, int count,
static int
add_bytes_pointer_param(tvbuff_t *tvb, int offset, int count,
packet_info *pinfo, proto_tree *tree, int convert, int hf_index)
packet_info *pinfo _U_, proto_tree *tree, int convert, int hf_index)
{
int cptr;
@ -425,8 +425,8 @@ add_bytes_pointer_param(tvbuff_t *tvb, int offset, int count,
}
static int
add_detail_level(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
proto_tree *tree, int convert, int hf_index)
add_detail_level(tvbuff_t *tvb, int offset, int count _U_, packet_info *pinfo,
proto_tree *tree, int convert _U_, int hf_index)
{
struct smb_info *smb_info = pinfo->private_data;
smb_transact_info_t *trp = smb_info->sip->extra_info;
@ -441,8 +441,8 @@ add_detail_level(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
}
static int
add_max_uses(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
proto_tree *tree, int convert, int hf_index)
add_max_uses(tvbuff_t *tvb, int offset, int count _U_, packet_info *pinfo _U_,
proto_tree *tree, int convert _U_, int hf_index)
{
guint16 WParam;
@ -461,8 +461,8 @@ add_max_uses(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
}
static int
add_server_type(tvbuff_t *tvb, int offset, int count,
packet_info *pinfo, proto_tree *tree, int convert, int hf_index)
add_server_type(tvbuff_t *tvb, int offset, int count _U_,
packet_info *pinfo, proto_tree *tree, int convert _U_, int hf_index _U_)
{
dissect_smb_server_type_flags(tvb, pinfo, tree, offset, FALSE);
offset += 4;
@ -470,8 +470,8 @@ add_server_type(tvbuff_t *tvb, int offset, int count,
}
static int
add_server_type_info(tvbuff_t *tvb, int offset, int count,
packet_info *pinfo, proto_tree *tree, int convert, int hf_index)
add_server_type_info(tvbuff_t *tvb, int offset, int count _U_,
packet_info *pinfo, proto_tree *tree, int convert _U_, int hf_index _U_)
{
dissect_smb_server_type_flags(tvb, pinfo, tree, offset, TRUE);
offset += 4;
@ -479,8 +479,8 @@ add_server_type_info(tvbuff_t *tvb, int offset, int count,
}
static int
add_reltime(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
proto_tree *tree, int convert, int hf_index)
add_reltime(tvbuff_t *tvb, int offset, int count _U_, packet_info *pinfo _U_,
proto_tree *tree, int convert _U_, int hf_index)
{
nstime_t nstime;
@ -498,8 +498,7 @@ add_reltime(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
* it's-local-time-not-UTC time.
*/
static int
add_abstime_common(tvbuff_t *tvb, int offset, int count,
packet_info *pinfo, proto_tree *tree, int convert, int hf_index,
add_abstime_common(tvbuff_t *tvb, int offset, proto_tree *tree, int hf_index,
const char *absent_name)
{
nstime_t nstime;
@ -533,24 +532,22 @@ add_abstime_common(tvbuff_t *tvb, int offset, int count,
}
static int
add_abstime_absent_never(tvbuff_t *tvb, int offset, int count,
packet_info *pinfo, proto_tree *tree, int convert, int hf_index)
add_abstime_absent_never(tvbuff_t *tvb, int offset, int count _U_,
packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index)
{
return add_abstime_common(tvb, offset, count, pinfo, tree,
convert, hf_index, "Never");
return add_abstime_common(tvb, offset, tree, hf_index, "Never");
}
static int
add_abstime_absent_unknown(tvbuff_t *tvb, int offset, int count,
packet_info *pinfo, proto_tree *tree, int convert, int hf_index)
add_abstime_absent_unknown(tvbuff_t *tvb, int offset, int count _U_,
packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index)
{
return add_abstime_common(tvb, offset, count, pinfo, tree,
convert, hf_index, "Unknown");
return add_abstime_common(tvb, offset, tree, hf_index, "Unknown");
}
static int
add_nlogons(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
proto_tree *tree, int convert, int hf_index)
add_nlogons(tvbuff_t *tvb, int offset, int count _U_, packet_info *pinfo _U_,
proto_tree *tree, int convert _U_, int hf_index)
{
guint16 nlogons;
@ -567,8 +564,8 @@ add_nlogons(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
}
static int
add_max_storage(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
proto_tree *tree, int convert, int hf_index)
add_max_storage(tvbuff_t *tvb, int offset, int count _U_,
packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index)
{
guint32 max_storage;
@ -585,7 +582,7 @@ add_max_storage(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
}
static int
add_logon_hours(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
add_logon_hours(tvbuff_t *tvb, int offset, int count, packet_info *pinfo _U_,
proto_tree *tree, int convert, int hf_index)
{
int cptr;
@ -622,8 +619,8 @@ add_logon_hours(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
}
static int
add_tzoffset(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
proto_tree *tree, int convert, int hf_index)
add_tzoffset(tvbuff_t *tvb, int offset, int count _U_, packet_info *pinfo _U_,
proto_tree *tree, int convert _U_, int hf_index)
{
gint16 tzoffset;
@ -648,8 +645,8 @@ add_tzoffset(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
}
static int
add_timeinterval(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
proto_tree *tree, int convert, int hf_index)
add_timeinterval(tvbuff_t *tvb, int offset, int count _U_,
packet_info *pinfo _U_, proto_tree *tree, int convert _U_, int hf_index)
{
guint16 timeinterval;
@ -662,8 +659,8 @@ add_timeinterval(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
}
static int
add_logon_args(tvbuff_t *tvb, int offset, int count, packet_info *pinfo,
proto_tree *tree, int convert, int hf_index)
add_logon_args(tvbuff_t *tvb, int offset, int count, packet_info *pinfo _U_,
proto_tree *tree, int convert _U_, int hf_index _U_)
{
if (count != 54) {
proto_tree_add_text(tree, tvb, offset, count,
@ -753,8 +750,8 @@ struct lanman_desc {
const item_t *resp;
const gchar *resp_data_entry_list_label;
gint *ett_data_entry_list;
proto_item *(*resp_data_element_item)(tvbuff_t *, packet_info *,
proto_tree *, int);
proto_item *(*resp_data_element_item)(tvbuff_t *, proto_tree *,
int);
gint *ett_resp_data_element_item;
const item_list_t *resp_data_list;
const item_t *resp_aux_data;
@ -777,8 +774,7 @@ static const item_t lm_params_resp_netshareenum[] = {
* Create a subtree for a share.
*/
static proto_item *
netshareenum_share_entry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset)
netshareenum_share_entry(tvbuff_t *tvb, proto_tree *tree, int offset)
{
if (tree) {
return proto_tree_add_text(tree, tvb, offset, -1,
@ -978,8 +974,7 @@ static const item_t lm_params_req_netserverenum2[] = {
* Create a subtree for a server.
*/
static proto_item *
netserverenum2_server_entry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset)
netserverenum2_server_entry(tvbuff_t *tvb, proto_tree *tree, int offset)
{
if (tree) {
return proto_tree_add_text(tree, tvb, offset, -1,
@ -2516,7 +2511,7 @@ dissect_response_data(tvbuff_t *tvb, packet_info *pinfo, int convert,
*/
entry_item =
(*lanman->resp_data_element_item)
(tvb, pinfo, data_tree, offset);
(tvb, data_tree, offset);
entry_tree = proto_item_add_subtree(
entry_item,
*lanman->ett_resp_data_element_item);
@ -3514,8 +3509,7 @@ dissect_pipe_smb(tvbuff_t *sp_tvb, tvbuff_t *s_tvb, tvbuff_t *pd_tvb,
if (!smb_info->request) {
if (p_tvb == NULL)
return FALSE;
offset = dissect_ipc_state(p_tvb, pinfo, pipe_tree, 0,
FALSE);
offset = dissect_ipc_state(p_tvb, pipe_tree, 0, FALSE);
}
break;
@ -3526,8 +3520,7 @@ dissect_pipe_smb(tvbuff_t *sp_tvb, tvbuff_t *s_tvb, tvbuff_t *pd_tvb,
if (smb_info->request) {
if (p_tvb == NULL)
return FALSE;
offset = dissect_ipc_state(p_tvb, pinfo, pipe_tree, 0,
TRUE);
offset = dissect_ipc_state(p_tvb, pipe_tree, 0, TRUE);
}
break;
@ -3593,7 +3586,7 @@ dissect_pipe_smb(tvbuff_t *sp_tvb, tvbuff_t *s_tvb, tvbuff_t *pd_tvb,
if (d_tvb == NULL)
return FALSE;
offset = dissect_file_data(d_tvb, pinfo, pipe_tree, 0,
offset = dissect_file_data(d_tvb, pipe_tree, 0,
tvb_reported_length(d_tvb),
tvb_reported_length(d_tvb));
}
@ -3605,7 +3598,7 @@ dissect_pipe_smb(tvbuff_t *sp_tvb, tvbuff_t *s_tvb, tvbuff_t *pd_tvb,
if (d_tvb == NULL)
return FALSE;
offset = dissect_file_data(d_tvb, pinfo, pipe_tree,
offset = dissect_file_data(d_tvb, pipe_tree,
offset, tvb_reported_length(d_tvb),
tvb_reported_length(d_tvb));
} else {

File diff suppressed because it is too large Load Diff

10
smb.h
View File

@ -2,7 +2,7 @@
* Defines for smb packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
* $Id: smb.h,v 1.37 2002/04/24 06:18:51 tpot Exp $
* $Id: smb.h,v 1.38 2002/04/30 11:03:07 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -290,8 +290,8 @@ typedef struct smb_info {
/*
* Show file data for a read or write.
*/
extern int dissect_file_data(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int offset, guint16 bc, guint16 datalen);
extern int dissect_file_data(tvbuff_t *tvb, proto_tree *tree, int offset,
guint16 bc, guint16 datalen);
/*
* Add a FID to the protocol tree and the Info column.
@ -302,8 +302,8 @@ extern void add_fid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/*
* Dissect named pipe state information.
*/
extern int dissect_ipc_state(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *parent_tree, int offset, gboolean setstate);
extern int dissect_ipc_state(tvbuff_t *tvb, proto_tree *parent_tree,
int offset, gboolean setstate);
extern gboolean smb_dcerpc_reassembly;
extern GHashTable *dcerpc_fragment_table;