"dissect_mailslot_browse()", "dissect_mailslot_lanman()", and

"dissect_smb_logon()" always return TRUE, so just get rid of their
return value.

"call_dissector()" automatically calls the data dissector if the
protocol for the dissector being called is disabled, so we don't have to
check its result and call the data dissector if it returns 0.

svn path=/trunk/; revision=9027
This commit is contained in:
Guy Harris 2003-11-19 03:53:33 +00:00
parent 2030e7e74b
commit 69f30a1f12
3 changed files with 21 additions and 25 deletions

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.33 2003/11/16 23:17:21 guy Exp $
* $Id: packet-smb-browse.c,v 1.34 2003/11/19 03:53:32 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -563,7 +563,7 @@ dissect_smb_server_type_flags(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
static gboolean
static void
dissect_mailslot_browse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
{
int offset = 0;
@ -793,8 +793,6 @@ dissect_mailslot_browse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr
offset += namelen;
break;
}
return TRUE;
}
/*
@ -814,7 +812,7 @@ dissect_mailslot_browse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr
*
* XXX - what other browser packets go out to that mailslot?
*/
static gboolean
static void
dissect_mailslot_lanman(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
{
int offset = 0;
@ -898,8 +896,6 @@ dissect_mailslot_lanman(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr
offset += namelen;
break;
}
return TRUE;
}
void
@ -1164,8 +1160,8 @@ proto_register_smb_browse(void)
proto_register_field_array(proto_smb_browse, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
new_register_dissector("mailslot_browse", dissect_mailslot_browse,
register_dissector("mailslot_browse", dissect_mailslot_browse,
proto_smb_browse);
new_register_dissector("mailslot_lanman", dissect_mailslot_lanman,
register_dissector("mailslot_lanman", dissect_mailslot_lanman,
proto_smb_browse);
}

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.35 2003/11/16 23:17:21 guy Exp $
* $Id: packet-smb-logon.c,v 1.36 2003/11/19 03:53:32 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -814,7 +814,7 @@ static int (*dissect_smb_logon_cmds[])(tvbuff_t *tvb, packet_info *pinfo, proto_
};
static gboolean
static void
dissect_smb_logon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
int offset = 0;
@ -855,8 +855,6 @@ dissect_smb_logon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = dissect_smb_unknown(tvb, pinfo, smb_logon_tree,
offset);
}
return TRUE;
}
void
@ -1030,5 +1028,5 @@ proto_register_smb_logon( void)
proto_register_field_array(proto_smb_logon, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
new_register_dissector("netlogon", dissect_smb_logon, proto_smb_logon);
register_dissector("netlogon", dissect_smb_logon, proto_smb_logon);
}

View File

@ -2,7 +2,7 @@
* Routines for SMB mailslot packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
* $Id: packet-smb-mailslot.c,v 1.34 2003/11/16 23:17:21 guy Exp $
* $Id: packet-smb-mailslot.c,v 1.35 2003/11/19 03:53:33 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -85,7 +85,6 @@ dissect_mailslot_smb(tvbuff_t *mshdr_tvb, tvbuff_t *setup_tvb,
guint16 opcode;
int offset = 0;
int len;
gboolean dissected;
if (!proto_is_protocol_enabled(find_protocol_by_id(proto_smb_msp))) {
return FALSE;
@ -184,30 +183,33 @@ dissect_mailslot_smb(tvbuff_t *mshdr_tvb, tvbuff_t *setup_tvb,
proto_item_set_len(item, offset);
}
dissected = FALSE;
switch(trans_subcmd){
case MAILSLOT_BROWSE:
dissected = call_dissector(mailslot_browse_handle, tvb, pinfo,
call_dissector(mailslot_browse_handle, tvb, pinfo,
parent_tree);
break;
case MAILSLOT_LANMAN:
dissected = call_dissector(mailslot_lanman_handle, tvb, pinfo,
call_dissector(mailslot_lanman_handle, tvb, pinfo,
parent_tree);
break;
case MAILSLOT_NET:
case MAILSLOT_TEMP_NETLOGON:
case MAILSLOT_MSSP:
dissected = call_dissector(netlogon_handle, tvb, pinfo,
call_dissector(netlogon_handle, tvb, pinfo,
parent_tree);
break;
}
if (!dissected) {
default:
/*
* We dissected the mailslot header, but not the
* message; dissect the latter as data, but indicate
* that we successfully dissected the mailslot stuff.
* We dissected the mailslot header, but we don't know
* how to dissect the message; dissect the latter as data,
* but indicate that we successfully dissected the mailslot
* stuff.
*/
call_dissector(data_handle,tvb, pinfo, parent_tree);
break;
}
return TRUE;
}