aboutsummaryrefslogtreecommitdiffstats
path: root/packet-smb-pipe.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-04-13 23:58:37 +0000
committerGuy Harris <guy@alum.mit.edu>2003-04-13 23:58:37 +0000
commitf2b07ad41198c5f8f2b4018418c1658e3285e759 (patch)
treea2a95e23d02694963c2519f792be2c3ded6cd560 /packet-smb-pipe.c
parent106df618b52b764275b27d53126b7ed1f1e9d1dd (diff)
"dcerpc_fragment_table" is used only in packet-smb-pipe.c, except for
the call to initialize it; move the call to initialize it to the registration routine for the dissector that uses it, move the definition of ""dcerpc_fragment_table" to packet-smb-pipe.c, make it static, and remove the declaration of it from smb.h. Add some casts to squelch compiler complaints. svn path=/trunk/; revision=7449
Diffstat (limited to 'packet-smb-pipe.c')
-rw-r--r--packet-smb-pipe.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/packet-smb-pipe.c b/packet-smb-pipe.c
index 0091027cf9..0e9b3363bc 100644
--- a/packet-smb-pipe.c
+++ b/packet-smb-pipe.c
@@ -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.90 2003/04/12 08:14:48 sahlberg Exp $
+ * $Id: packet-smb-pipe.c,v 1.91 2003/04/13 23:58:36 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -3196,6 +3196,14 @@ proto_register_pipe_lanman(void)
static heur_dissector_list_t smb_transact_heur_subdissector_list;
+static GHashTable *dcerpc_fragment_table = NULL;
+
+static void
+smb_dcerpc_reassembly_init(void)
+{
+ fragment_table_init(&dcerpc_fragment_table);
+}
+
gboolean
dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree,
proto_tree *tree, guint32 fid)
@@ -3250,7 +3258,7 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree
*/
if((!pinfo->fd->flags.visited) && smb_priv->sip){
/* check if we are already reassembling this pdu or not */
- hash_value = g_hash_table_lookup(smb_priv->ct->dcerpc_fid_to_frame, fid);
+ hash_value = g_hash_table_lookup(smb_priv->ct->dcerpc_fid_to_frame, (void *)fid);
if(!hash_value){
/* this is a new pdu. check if the dissector wants us
to reassemble it or if we already got the full pdu
@@ -3327,7 +3335,7 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree
/* if we completed reassembly */
if(fd_head){
- g_hash_table_remove(smb_priv->ct->dcerpc_fid_to_frame, fid);
+ g_hash_table_remove(smb_priv->ct->dcerpc_fid_to_frame, (void *)fid);
new_tvb = tvb_new_real_data(fd_head->data,
fd_head->datalen, fd_head->datalen);
tvb_set_child_real_data_tvbuff(d_tvb, new_tvb);
@@ -3352,7 +3360,7 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree
seen this fragment and if so if we were able to reassemble it
or not.
*/
- hash_value = g_hash_table_lookup(smb_priv->ct->dcerpc_frame_to_dcerpc_pdu, pinfo->fd->num);
+ hash_value = g_hash_table_lookup(smb_priv->ct->dcerpc_frame_to_dcerpc_pdu, (void *)pinfo->fd->num);
if(!hash_value){
/* we didnt find it, try any of the heurisitc dissectors
and bail out
@@ -3360,7 +3368,7 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree
result = dissector_try_heuristic(smb_transact_heur_subdissector_list, d_tvb, pinfo, parent_tree);
goto clean_up_and_exit;
}
- fd_head=fragment_get(pinfo, hash_value, dcerpc_fragment_table);
+ fd_head=fragment_get(pinfo, (guint32)hash_value, dcerpc_fragment_table);
if(!fd_head){
/* we didnt find it, try any of the heurisitc dissectors
and bail out
@@ -3418,6 +3426,7 @@ void
proto_register_pipe_dcerpc(void)
{
register_heur_dissector_list("smb_transact", &smb_transact_heur_subdissector_list);
+ register_init_routine(smb_dcerpc_reassembly_init);
}
#define CALL_NAMED_PIPE 0x54