diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-08-04 04:04:35 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-08-04 04:04:35 +0000 |
commit | ddfdc5bfb137e2db7e4d10f860a66f08b3718f5d (patch) | |
tree | ba532188860e3ac77b8fab9f4a46d05e2f83b4be | |
parent | 1b3f1fca49c886b504c863d8ad654860c1edd0a4 (diff) | |
download | wireshark-ddfdc5bfb137e2db7e4d10f860a66f08b3718f5d.tar.gz wireshark-ddfdc5bfb137e2db7e4d10f860a66f08b3718f5d.tar.bz2 wireshark-ddfdc5bfb137e2db7e4d10f860a66f08b3718f5d.zip |
Replace the protocol-specific data in the "packet_info" structure with a
"void *" that a dissector can set to point to such a structure; that
means that the stuff in the epan directory doesn't have to know anything
about the protocol-specific private data one dissector passes to
another, and that structure doesn't have to be changed if a dissector
wants to pass some new type of data to another dissector.
svn path=/trunk/; revision=3818
-rw-r--r-- | epan/packet_info.c | 7 | ||||
-rw-r--r-- | epan/packet_info.h | 12 | ||||
-rw-r--r-- | packet-afs.c | 129 | ||||
-rw-r--r-- | packet-rx.c | 18 | ||||
-rw-r--r-- | packet-rx.h | 20 |
5 files changed, 96 insertions, 90 deletions
diff --git a/epan/packet_info.c b/epan/packet_info.c index 7ae0f9d844..b8956365d7 100644 --- a/epan/packet_info.c +++ b/epan/packet_info.c @@ -1,12 +1,11 @@ /* packet_info.c * Routines for handling packet information * - * $Id: packet_info.c,v 1.1 2001/04/01 04:50:42 hagbard Exp $ + * $Id: packet_info.c,v 1.2 2001/08/04 04:04:35 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * By Gerald Combs <gerald@ethereal.com> * Copyright 1998 Gerald Combs - * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -29,7 +28,6 @@ #include <glib.h> - #include "packet_info.h" void blank_packetinfo(void) @@ -47,6 +45,7 @@ void blank_packetinfo(void) pi.destport = 0; pi.current_proto = "<Missing Protocol Name>"; pi.p2p_dir = P2P_DIR_UNKNOWN; + pi.private = NULL; } diff --git a/epan/packet_info.h b/epan/packet_info.h index be1d1d9622..f236b7559a 100644 --- a/epan/packet_info.h +++ b/epan/packet_info.h @@ -1,7 +1,7 @@ /* packet_info.h * Definitions for packet info structures and routines * - * $Id: packet_info.h,v 1.4 2001/06/04 07:27:50 guy Exp $ + * $Id: packet_info.h,v 1.5 2001/08/04 04:04:35 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -111,15 +111,7 @@ typedef struct _packet_info { int iplen; int iphdrlen; int p2p_dir; - union { - struct { - guint8 type; - guint8 flags; - guint16 serviceid; - guint32 callnumber; - guint32 seq; - } rx; /* fields specific for RX protocol */ - } ps; /* protocol specific data */ + void *private; /* pointer to data passed from one dissector to another */ } packet_info; void blank_packetinfo(void); diff --git a/packet-afs.c b/packet-afs.c index 0394989a9f..c6534377df 100644 --- a/packet-afs.c +++ b/packet-afs.c @@ -8,7 +8,7 @@ * Portions based on information/specs retrieved from the OpenAFS sources at * www.openafs.org, Copyright IBM. * - * $Id: packet-afs.c,v 1.32 2001/06/18 01:49:16 guy Exp $ + * $Id: packet-afs.c,v 1.33 2001/08/04 04:04:33 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -82,43 +82,43 @@ GMemChunk *afs_request_vals = NULL; /* * Dissector prototypes */ -static int dissect_acl(tvbuff_t *tvb, packet_info *pinfo, +static int dissect_acl(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset); -static void dissect_fs_reply(tvbuff_t *tvb, packet_info *pinfo, +static void dissect_fs_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); -static void dissect_fs_request(tvbuff_t *tvb, packet_info *pinfo, +static void dissect_fs_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); -static void dissect_bos_reply(tvbuff_t *tvb, packet_info *pinfo, +static void dissect_bos_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); -static void dissect_bos_request(tvbuff_t *tvb, packet_info *pinfo, +static void dissect_bos_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); -static void dissect_vol_reply(tvbuff_t *tvb, packet_info *pinfo, +static void dissect_vol_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); -static void dissect_vol_request(tvbuff_t *tvb, packet_info *pinfo, +static void dissect_vol_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); -static void dissect_kauth_reply(tvbuff_t *tvb, packet_info *pinfo, +static void dissect_kauth_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); -static void dissect_kauth_request(tvbuff_t *tvb, packet_info *pinfo, +static void dissect_kauth_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); -static void dissect_cb_reply(tvbuff_t *tvb, packet_info *pinfo, +static void dissect_cb_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); -static void dissect_cb_request(tvbuff_t *tvb, packet_info *pinfo, +static void dissect_cb_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); -static void dissect_prot_reply(tvbuff_t *tvb, packet_info *pinfo, +static void dissect_prot_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); -static void dissect_prot_request(tvbuff_t *tvb, packet_info *pinfo, +static void dissect_prot_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); -static void dissect_vldb_reply(tvbuff_t *tvb, packet_info *pinfo, +static void dissect_vldb_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); -static void dissect_vldb_request(tvbuff_t *tvb, packet_info *pinfo, +static void dissect_vldb_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); -static void dissect_ubik_reply(tvbuff_t *tvb, packet_info *pinfo, +static void dissect_ubik_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); -static void dissect_ubik_request(tvbuff_t *tvb, packet_info *pinfo, +static void dissect_ubik_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); -static void dissect_backup_reply(tvbuff_t *tvb, packet_info *pinfo, +static void dissect_backup_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); -static void dissect_backup_request(tvbuff_t *tvb, packet_info *pinfo, +static void dissect_backup_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); /* @@ -184,6 +184,7 @@ afs_init_protocol(void) static void dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { + struct rxinfo *rxinfo = pinfo->private; int reply = 0; conversation_t *conversation; struct afs_request_key request_key, *new_request_key; @@ -192,7 +193,7 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) int port, node, typenode, opcode; value_string const *vals; int offset = 0; - void (*dissector)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode); + void (*dissector)(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode); if (check_col(pinfo->fd, COL_PROTOCOL)) { @@ -202,7 +203,7 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_clear(pinfo->fd, COL_INFO); } - reply = (pinfo->ps.rx.flags & RX_CLIENT_INITIATED) == 0; + reply = (rxinfo->flags & RX_CLIENT_INITIATED) == 0; port = ((reply == 0) ? pinfo->destport : pinfo->srcport ); /* @@ -227,8 +228,8 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } request_key.conversation = conversation->index; - request_key.service = pinfo->ps.rx.serviceid; - request_key.callnumber = pinfo->ps.rx.callnumber; + request_key.service = rxinfo->serviceid; + request_key.callnumber = rxinfo->callnumber; request_val = (struct afs_request_val *) g_hash_table_lookup( afs_request_hash, &request_key); @@ -393,7 +394,7 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Process the packet according to what service it is */ if ( dissector ) { - (*dissector)(tvb, pinfo, afs_op_tree, offset, opcode); + (*dissector)(tvb, rxinfo, afs_op_tree, offset, opcode); } } } @@ -401,7 +402,7 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* if it's the last packet, and it's a reply, remove opcode from hash */ /* ignoring for now, I'm not sure how the chunk deallocation works */ - if ( pinfo->ps.rx.flags & RX_LAST_PACKET && reply ){ + if ( rxinfo->flags & RX_LAST_PACKET && reply ){ } } @@ -424,7 +425,7 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) */ /* FIXME: sscanf is probably quite dangerous if we run outside the packet. */ static int -dissect_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) +dissect_acl(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset) { int old_offset; gint32 bytes; @@ -485,15 +486,15 @@ dissect_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) */ static void -dissect_fs_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode) +dissect_fs_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode) { - if ( pinfo->ps.rx.type == RX_PACKET_TYPE_DATA ) + if ( rxinfo->type == RX_PACKET_TYPE_DATA ) { switch ( opcode ) { case 130: /* fetch data */ /* only on first packet */ - if ( pinfo->ps.rx.seq == 1 ) + if ( rxinfo->seq == 1 ) { OUT_FS_AFSFetchStatus("Status"); OUT_FS_AFSCallBack(); @@ -502,7 +503,7 @@ dissect_fs_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset OUT_BYTES_ALL(hf_afs_fs_data); break; case 131: /* fetch acl */ - offset = dissect_acl(tvb, pinfo, tree, offset); + offset = dissect_acl(tvb, rxinfo, tree, offset); OUT_FS_AFSFetchStatus("Status"); OUT_FS_AFSVolSync(); break; @@ -592,14 +593,14 @@ dissect_fs_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset break; } } - else if ( pinfo->ps.rx.type == RX_PACKET_TYPE_ABORT ) + else if ( rxinfo->type == RX_PACKET_TYPE_ABORT ) { OUT_UINT(hf_afs_fs_errcode); } } static void -dissect_fs_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode) +dissect_fs_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode) { offset += 4; /* skip the opcode */ @@ -625,7 +626,7 @@ dissect_fs_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offs break; case 134: /* Store ACL */ OUT_FS_AFSFid("Target"); - offset = dissect_acl(tvb, pinfo, tree, offset); + offset = dissect_acl(tvb, rxinfo, tree, offset); break; case 135: /* Store Status */ OUT_FS_AFSFid("Target"); @@ -754,9 +755,9 @@ dissect_fs_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offs * BOS Helpers */ static void -dissect_bos_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode) +dissect_bos_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode) { - if ( pinfo->ps.rx.type == RX_PACKET_TYPE_DATA ) + if ( rxinfo->type == RX_PACKET_TYPE_DATA ) { switch ( opcode ) { @@ -877,14 +878,14 @@ dissect_bos_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offse break; } } - else if ( pinfo->ps.rx.type == RX_PACKET_TYPE_ABORT ) + else if ( rxinfo->type == RX_PACKET_TYPE_ABORT ) { OUT_UINT(hf_afs_bos_errcode); } } static void -dissect_bos_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode) +dissect_bos_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode) { offset += 4; /* skip the opcode */ @@ -1014,9 +1015,9 @@ dissect_bos_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int off * VOL Helpers */ static void -dissect_vol_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode) +dissect_vol_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode) { - if ( pinfo->ps.rx.type == RX_PACKET_TYPE_DATA ) + if ( rxinfo->type == RX_PACKET_TYPE_DATA ) { switch ( opcode ) { @@ -1027,14 +1028,14 @@ dissect_vol_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offse break; } } - else if ( pinfo->ps.rx.type == RX_PACKET_TYPE_ABORT ) + else if ( rxinfo->type == RX_PACKET_TYPE_ABORT ) { OUT_UINT(hf_afs_vol_errcode); } } static void -dissect_vol_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode) +dissect_vol_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode) { offset += 4; /* skip the opcode */ @@ -1051,22 +1052,22 @@ dissect_vol_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int off * KAUTH Helpers */ static void -dissect_kauth_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode) +dissect_kauth_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode) { - if ( pinfo->ps.rx.type == RX_PACKET_TYPE_DATA ) + if ( rxinfo->type == RX_PACKET_TYPE_DATA ) { switch ( opcode ) { } } - else if ( pinfo->ps.rx.type == RX_PACKET_TYPE_ABORT ) + else if ( rxinfo->type == RX_PACKET_TYPE_ABORT ) { OUT_UINT(hf_afs_kauth_errcode); } } static void -dissect_kauth_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode) +dissect_kauth_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode) { offset += 4; /* skip the opcode */ @@ -1109,22 +1110,22 @@ dissect_kauth_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o * CB Helpers */ static void -dissect_cb_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode) +dissect_cb_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode) { - if ( pinfo->ps.rx.type == RX_PACKET_TYPE_DATA ) + if ( rxinfo->type == RX_PACKET_TYPE_DATA ) { switch ( opcode ) { } } - else if ( pinfo->ps.rx.type == RX_PACKET_TYPE_ABORT ) + else if ( rxinfo->type == RX_PACKET_TYPE_ABORT ) { OUT_UINT(hf_afs_cb_errcode); } } static void -dissect_cb_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode) +dissect_cb_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode) { offset += 4; /* skip the opcode */ @@ -1156,9 +1157,9 @@ dissect_cb_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offs * PROT Helpers */ static void -dissect_prot_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode) +dissect_prot_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode) { - if ( pinfo->ps.rx.type == RX_PACKET_TYPE_DATA ) + if ( rxinfo->type == RX_PACKET_TYPE_DATA ) { switch ( opcode ) { @@ -1211,14 +1212,14 @@ dissect_prot_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offs break; } } - else if ( pinfo->ps.rx.type == RX_PACKET_TYPE_ABORT ) + else if ( rxinfo->type == RX_PACKET_TYPE_ABORT ) { OUT_UINT(hf_afs_prot_errcode); } } static void -dissect_prot_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode) +dissect_prot_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode) { offset += 4; /* skip the opcode */ @@ -1299,9 +1300,9 @@ dissect_prot_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of * VLDB Helpers */ static void -dissect_vldb_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode) +dissect_vldb_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode) { - if ( pinfo->ps.rx.type == RX_PACKET_TYPE_DATA ) + if ( rxinfo->type == RX_PACKET_TYPE_DATA ) { switch ( opcode ) { @@ -1430,14 +1431,14 @@ dissect_vldb_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offs break; } } - else if ( pinfo->ps.rx.type == RX_PACKET_TYPE_ABORT ) + else if ( rxinfo->type == RX_PACKET_TYPE_ABORT ) { OUT_UINT(hf_afs_vldb_errcode); } } static void -dissect_vldb_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode) +dissect_vldb_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode) { offset += 4; /* skip the opcode */ @@ -1482,7 +1483,7 @@ dissect_vldb_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of * UBIK Helpers */ static void -dissect_ubik_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode) +dissect_ubik_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode) { switch ( opcode ) { @@ -1528,7 +1529,7 @@ dissect_ubik_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offs } static void -dissect_ubik_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode) +dissect_ubik_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode) { offset += 4; /* skip the opcode */ @@ -1607,22 +1608,22 @@ dissect_ubik_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of * BACKUP Helpers */ static void -dissect_backup_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode) +dissect_backup_reply(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode) { - if ( pinfo->ps.rx.type == RX_PACKET_TYPE_DATA ) + if ( rxinfo->type == RX_PACKET_TYPE_DATA ) { switch ( opcode ) { } } - else if ( pinfo->ps.rx.type == RX_PACKET_TYPE_ABORT ) + else if ( rxinfo->type == RX_PACKET_TYPE_ABORT ) { OUT_UINT(hf_afs_backup_errcode); } } static void -dissect_backup_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int opcode) +dissect_backup_request(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *tree, int offset, int opcode) { offset += 4; /* skip the opcode */ diff --git a/packet-rx.c b/packet-rx.c index 7fbe61c7a9..f178890aad 100644 --- a/packet-rx.c +++ b/packet-rx.c @@ -4,7 +4,7 @@ * Based on routines from tcpdump patches by * Ken Hornstein <kenh@cmf.nrl.navy.mil> * - * $Id: packet-rx.c,v 1.23 2001/07/03 00:46:52 guy Exp $ + * $Id: packet-rx.c,v 1.24 2001/08/04 04:04:34 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -408,14 +408,14 @@ dissect_rx_acks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int static int -dissect_rx_flags(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset) +dissect_rx_flags(tvbuff_t *tvb, struct rxinfo *rxinfo, proto_tree *parent_tree, int offset) { proto_tree *tree; proto_item *item; guint8 flags; flags = tvb_get_guint8(tvb, offset); - pinfo->ps.rx.flags = flags; + rxinfo->flags = flags; item = proto_tree_add_uint(parent_tree, hf_rx_flags, tvb, offset, 1, flags); @@ -442,6 +442,7 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) proto_tree *tree; proto_item *item; int offset = 0; + struct rxinfo rxinfo; guint8 type; guint32 seq, callnumber; guint16 serviceid; @@ -476,14 +477,14 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) proto_tree_add_uint(tree, hf_rx_callnumber, tvb, offset, 4, callnumber); offset += 4; - pinfo->ps.rx.callnumber = callnumber; + rxinfo.callnumber = callnumber; /* seq : 4 bytes */ seq = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(tree, hf_rx_seq, tvb, offset, 4, seq); offset += 4; - pinfo->ps.rx.seq = seq; + rxinfo.seq = seq; /* serial : 4 bytes */ proto_tree_add_uint(tree, hf_rx_serial, tvb, @@ -495,10 +496,10 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) proto_tree_add_uint(tree, hf_rx_type, tvb, offset, 1, type); offset += 1; - pinfo->ps.rx.type = type; + rxinfo.type = type; /* flags : 1 byte */ - offset = dissect_rx_flags(tvb, pinfo, tree, offset); + offset = dissect_rx_flags(tvb, &rxinfo, tree, offset); /* userstatus : 1 byte */ proto_tree_add_uint(tree, hf_rx_userstatus, tvb, @@ -520,7 +521,7 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) proto_tree_add_uint(tree, hf_rx_serviceid, tvb, offset, 2, serviceid); offset += 2; - pinfo->ps.rx.serviceid = serviceid; + rxinfo.serviceid = serviceid; switch (type) { case RX_PACKET_TYPE_ACK: @@ -554,6 +555,7 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) break; case RX_PACKET_TYPE_DATA: { tvbuff_t *next_tvb; + pinfo->private = &rxinfo; next_tvb = tvb_new_subset(tvb, offset, -1, -1); call_dissector(afs_handle, next_tvb, pinfo, parent_tree); }; diff --git a/packet-rx.h b/packet-rx.h index b39a5627c4..aef406405e 100644 --- a/packet-rx.h +++ b/packet-rx.h @@ -1,13 +1,12 @@ /* packet-rx.h * Definitions for packet disassembly structures and routines * - * $Id: packet-rx.h,v 1.5 2001/05/27 01:48:24 guy Exp $ + * $Id: packet-rx.h,v 1.6 2001/08/04 04:04:34 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * By Gerald Combs <gerald@ethereal.com> * Copyright 1998 Gerald Combs * - * * 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 @@ -26,6 +25,20 @@ #ifndef PACKET_RX_H #define PACKET_RX_H +/* + * Private data passed from the RX dissector to the AFS dissector. + */ +struct rxinfo { + guint8 type; + guint8 flags; + guint16 serviceid; + guint32 callnumber; + guint32 seq; +}; + +/* + * RX protocol definitions. + */ struct rx_header { guint32 epoch; guint32 cid; @@ -107,4 +120,3 @@ struct rxkad_response { #endif - |