diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-08-12 00:15:40 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-08-12 00:15:40 +0000 |
commit | 2c6e256a872d1252546cefb59bfce7464fa2aa58 (patch) | |
tree | 63965b628fbb6957e1f74557f4024b153354440c /packet.c | |
parent | eb587ac5f1bf0ef98505a9d2125ccaefdbf02f78 (diff) | |
download | wireshark-2c6e256a872d1252546cefb59bfce7464fa2aa58.tar.gz wireshark-2c6e256a872d1252546cefb59bfce7464fa2aa58.tar.bz2 wireshark-2c6e256a872d1252546cefb59bfce7464fa2aa58.zip |
"p_get_proto_data()" should, if it finds an entry, return the pointer
supplied in the "p_add_proto_data()" call that created the entry, not
the pointer to the data structure that holds the protocol and data
arguments to "p_add_proto_data()" (the protocol is uninteresting, as
its value is the value supplied as the "proto" argument to
"p_get_proto_data()".
The "frame_proto_data" structure isn't needed outside the code that
handles it; remove its definition from "packet.h" and put it in
"packet.c".
svn path=/trunk/; revision=2260
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -1,7 +1,7 @@ /* packet.c * Routines for packet disassembly * - * $Id: packet.c,v 1.98 2000/08/11 13:34:33 deniel Exp $ + * $Id: packet.c,v 1.99 2000/08/12 00:15:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -107,6 +107,13 @@ static int proto_malformed = -1; static gint ett_frame = -1; +/* Protocol-specific data attched to a frame_data structure - protocol + index and opaque pointer. */ +typedef struct _frame_proto_data { + int proto; + void *proto_data; +} frame_proto_data; + GMemChunk *frame_proto_data_area = NULL; /* @@ -1279,7 +1286,7 @@ p_add_proto_data(frame_data *fd, int proto, void *proto_data) void * p_get_proto_data(frame_data *fd, int proto) { - frame_proto_data temp; + frame_proto_data temp, *p1; GSList *item; temp.proto = proto; @@ -1287,7 +1294,10 @@ p_get_proto_data(frame_data *fd, int proto) item = g_slist_find_custom(fd->pfd, (gpointer *)&temp, p_compare); - if (item) return (void *)item->data; + if (item) { + p1 = (frame_proto_data *)item->data; + return p1->proto_data; + } return NULL; |