aboutsummaryrefslogtreecommitdiffstats
path: root/packet-rlogin.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-09-03 10:33:12 +0000
committerGuy Harris <guy@alum.mit.edu>2001-09-03 10:33:12 +0000
commit3388bde488ac5c54044a487ca4199f5dda0715ba (patch)
tree1c0bb040cbd4022d4c91c56160dc76dca922f005 /packet-rlogin.c
parent31f2f8cabb4bce12d9cd9b60cd7644fe971b220e (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-rlogin.c')
-rw-r--r--packet-rlogin.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/packet-rlogin.c b/packet-rlogin.c
index 28070ffcc9..6bc2e4cb5e 100644
--- a/packet-rlogin.c
+++ b/packet-rlogin.c
@@ -2,7 +2,7 @@
* Routines for unix rlogin packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-rlogin.c,v 1.18 2001/07/03 00:49:57 guy Exp $
+ * $Id: packet-rlogin.c,v 1.19 2001/09/03 10:33:06 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -23,8 +23,6 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- *
*/
#ifdef HAVE_CONFIG_H
@@ -337,26 +335,26 @@ static void rlogin_display( rlogin_hash_entry_t *hash_info, tvbuff_t *tvb,
static void
dissect_rlogin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- rlogin_hash_entry_t *hash_info = 0;
conversation_t *conversation;
+ rlogin_hash_entry_t *hash_info;
gint ti_offset;
/* Lookup this connection*/
conversation = find_conversation( &pinfo->src, &pinfo->dst,
pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
- if ( conversation) /* conversation found */
- hash_info = conversation->data;
-
- /* new conversation create local data structure */
- else {
+ if ( !conversation) {
+ conversation = conversation_new( &pinfo->src, &pinfo->dst,
+ pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
+ }
+ hash_info = conversation_get_proto_data(conversation, proto_rlogin);
+ if ( !hash_info) {
hash_info = g_mem_chunk_alloc(rlogin_vals);
hash_info->state = NONE;
hash_info->info_framenum = 0; /* no frame has the number 0 */
hash_info->name[ 0] = 0;
-
- conversation_new( &pinfo->src, &pinfo->dst, pinfo->ptype,
- pinfo->srcport, pinfo->destport, hash_info, 0);
+ conversation_add_proto_data(conversation, proto_rlogin,
+ hash_info);
}
if (check_col(pinfo->fd, COL_PROTOCOL)) /* update protocol */