diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-11-18 02:51:20 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-11-18 02:51:20 +0000 |
commit | bdd9eb3cf47561aca18659ad746a3587f2ca55d5 (patch) | |
tree | 3a5e9eb2ad0ce745c0fab538f7cbb08c2fffb106 /packet-smb-pipe.c | |
parent | e361502b7095dfc89ae14cd16d9bc700aea33f5a (diff) | |
download | wireshark-bdd9eb3cf47561aca18659ad746a3587f2ca55d5.tar.gz wireshark-bdd9eb3cf47561aca18659ad746a3587f2ca55d5.tar.bz2 wireshark-bdd9eb3cf47561aca18659ad746a3587f2ca55d5.zip |
Pass in the "smb_info" structure a pointer to the "smb_saved_info_t"
structure, so that it can be updated by subdissectors; this way the
updates affect the structure immediately, and don't get lost if the
subdissector later throws an exception.
Use "tvb_reported_length()" to check for an interim mailslot reply;
"tvb_length()" could give the wrong answer if a short snapshot length
was given in the capture.
svn path=/trunk/; revision=4218
Diffstat (limited to 'packet-smb-pipe.c')
-rw-r--r-- | packet-smb-pipe.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/packet-smb-pipe.c b/packet-smb-pipe.c index ba0f94c4fa..29eba32e0a 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.42 2001/11/18 01:46:50 guy Exp $ + * $Id: packet-smb-pipe.c,v 1.43 2001/11/18 02:51:19 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -365,7 +365,7 @@ add_detail_level(tvbuff_t *tvb, int offset, int count, packet_info *pinfo, proto_tree *tree, int convert, int hf_index) { struct smb_info *smb_info = pinfo->private_data; - smb_transact_info_t *trp = smb_info->extra_info; + smb_transact_info_t *trp = smb_info->sip->extra_info; guint16 level; level = tvb_get_letohs(tvb, offset); @@ -1821,7 +1821,7 @@ dissect_response_data(tvbuff_t *tvb, packet_info *pinfo, int convert, const struct lanman_desc *lanman, gboolean has_ent_count, guint16 ent_count) { - smb_transact_info_t *trp = smb_info->extra_info; + smb_transact_info_t *trp = smb_info->sip->extra_info; const item_list_t *resp_data_list; int offset, start_offset; const item_t *resp_data; @@ -1947,7 +1947,7 @@ dissect_pipe_lanman(tvbuff_t *t_tvb, tvbuff_t *p_tvb, tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree) { smb_info_t *smb_info = pinfo->private_data; - smb_transact_info_t *trp = smb_info->extra_info; + smb_transact_info_t *trp = smb_info->sip->extra_info; int offset = 0, start_offset; guint16 cmd; guint16 status; @@ -2203,13 +2203,18 @@ gboolean dissect_pipe_smb(tvbuff_t *t_tvb, tvbuff_t *p_tvb, tvbuff_t *d_tvb, const char *pipe, packet_info *pinfo, proto_tree *tree) { - smb_info_t *smb_info = pinfo->private_data; - smb_transact_info_t *tri = smb_info->extra_info; + smb_info_t *smb_info; + smb_transact_info_t *tri; if (!proto_is_protocol_enabled(proto_smb_lanman)) return FALSE; pinfo->current_proto = "LANMAN"; + smb_info = pinfo->private_data; + if (smb_info->sip != NULL) + tri = smb_info->sip->extra_info; + else + tri = NULL; if(smb_info->request){ if(strncmp(pipe,"LANMAN",6) == 0){ tri->trans_subcmd=PIPE_LANMAN; @@ -2219,6 +2224,13 @@ dissect_pipe_smb(tvbuff_t *t_tvb, tvbuff_t *p_tvb, tvbuff_t *d_tvb, } } + if (tri == NULL) { + /* + * We don't know what type of pipe transaction this + * was, so indicate that we didn't dissect it. + */ + return FALSE; + } switch(tri->trans_subcmd){ case PIPE_LANMAN: return dissect_pipe_lanman(t_tvb, p_tvb, d_tvb, pinfo, tree); |