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-wcp.c | |
parent | 31f2f8cabb4bce12d9cd9b60cd7644fe971b220e (diff) |
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-wcp.c')
-rw-r--r-- | packet-wcp.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/packet-wcp.c b/packet-wcp.c index f8490021fe..3f8bcd4d6e 100644 --- a/packet-wcp.c +++ b/packet-wcp.c @@ -2,12 +2,11 @@ * Routines for Wellfleet Compression frame disassembly * Copyright 2001, Jeffrey C. Foster <jfoste@woodward.com> * - * $Id: packet-wcp.c,v 1.10 2001/06/18 02:17:54 guy Exp $ + * $Id: packet-wcp.c,v 1.11 2001/09/03 10:33:07 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * By Gerald Combs <gerald@ethereal.com> * Copyright 1998 - * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -470,21 +469,26 @@ wcp_window_t *get_wcp_window_ptr( packet_info *pinfo){ /* find the conversation for this side of the DLCI, create one if needed */ /* and return the wcp_window data structure pointer */ - conversation_t *conv = find_conversation( &pinfo->dl_src, &pinfo->dl_src, PT_NONE, + conversation_t *conv; + wcp_window_t *wcp_win_data; + + conv = find_conversation( &pinfo->dl_src, &pinfo->dl_src, PT_NONE, ((pinfo->pseudo_header->x25.flags & FROM_DCE)? 1:0), ((pinfo->pseudo_header->x25.flags & FROM_DCE)? 1:0), 0); - if ( !conv){ - conv = conversation_new( &pinfo->dl_src, &pinfo->dl_src, PT_NONE, ((pinfo->pseudo_header->x25.flags & FROM_DCE)? 1:0), ((pinfo->pseudo_header->x25.flags & FROM_DCE)? 1:0), - g_mem_chunk_alloc( wcp_window), 0); - - ((wcp_window_t*)conv->data)->buf_cur = ((wcp_window_t*)conv->data)->buffer; + 0); + } + wcp_win_data = conversation_get_proto_data(conv, proto_wcp); + if ( !wcp_win_data){ + wcp_win_data = g_mem_chunk_alloc( wcp_window); + wcp_win_data->buf_cur = wcp_win_data->buffer; + conversation_add_proto_data(conv, proto_wcp, wcp_win_data); } - return (wcp_window_t*)conv->data; + return wcp_win_data; } |