diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-09-03 10:33:12 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-09-03 10:33:12 +0000 |
commit | 3388bde488ac5c54044a487ca4199f5dda0715ba (patch) | |
tree | 1c0bb040cbd4022d4c91c56160dc76dca922f005 /packet-dsi.c | |
parent | 31f2f8cabb4bce12d9cd9b60cd7644fe971b220e (diff) | |
download | wireshark-3388bde488ac5c54044a487ca4199f5dda0715ba.tar.gz wireshark-3388bde488ac5c54044a487ca4199f5dda0715ba.tar.bz2 wireshark-3388bde488ac5c54044a487ca4199f5dda0715ba.zip |
Instead of having a single datum attached to a conversation, have a list
of protocol-id-plus-datum pairs, so that multiple protocols can attach
information to the same conversation.
Dissectors that attach information to a conversation should not assume
that if they find a conversation it has one of its data attached to it;
the conversation might've been created by another dissector.
svn path=/trunk/; revision=3901
Diffstat (limited to 'packet-dsi.c')
-rw-r--r-- | packet-dsi.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/packet-dsi.c b/packet-dsi.c index 0c1d72f44d..2ef73a826e 100644 --- a/packet-dsi.c +++ b/packet-dsi.c @@ -2,15 +2,14 @@ * Routines for dsi packet dissection * Copyright 2001, Randy McEoin <rmceoin@pe.com> * - * $Id: packet-dsi.c,v 1.2 2001/06/18 02:17:46 guy Exp $ + * $Id: packet-dsi.c,v 1.3 2001/09/03 10:33:05 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * By Gerald Combs <gerald@ethereal.com> * Copyright 1998 Gerald Combs * * Copied from packet-pop.c * - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -318,17 +317,19 @@ dissect_dsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) conversation = find_conversation(&pinfo->src, &pinfo->dst, PT_TCP, pinfo->srcport, pinfo->destport, 0); - if (conversation == NULL) { - hash_info = g_mem_chunk_alloc(vals); - hash_info->state = NONE; + if (conversation == NULL) + { conversation = conversation_new(&pinfo->src, &pinfo->dst, - pinfo->ptype, pinfo->srcport, pinfo->destport, - hash_info, 0); - - conversation_set_dissector(conversation, dissect_dsi); - }else + pinfo->ptype, pinfo->srcport, pinfo->destport, 0); + } + conversation_set_dissector(conversation, dissect_dsi); + hash_info = conversation_get_proto_data(conversation, proto_dsi); + if (hash_info == NULL) { - hash_info = conversation->data; + hash_info = g_mem_chunk_alloc(vals); + hash_info->state = NONE; + conversation_add_proto_data(conversation, proto_dsi, + hash_info); } prev_cont=dsi_state_machine( hash_info, tvb, pinfo, offset); |