aboutsummaryrefslogtreecommitdiffstats
path: root/packet.c
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@ns.aus.com>2000-03-26 06:57:41 +0000
committerRichard Sharpe <sharpe@ns.aus.com>2000-03-26 06:57:41 +0000
commit92646c4b3cf7394cdbb5ce6fb43c87d27e207f17 (patch)
tree6530a58f66d7b883e68e9973777385087ec33139 /packet.c
parentdf1a7250cf18b6c44c87466892f74dd1a1cb3fcf (diff)
downloadwireshark-92646c4b3cf7394cdbb5ce6fb43c87d27e207f17.tar.gz
wireshark-92646c4b3cf7394cdbb5ce6fb43c87d27e207f17.tar.bz2
wireshark-92646c4b3cf7394cdbb5ce6fb43c87d27e207f17.zip
First pass at per frame proto data. Keep each proto block as a GSList list.
Use glib as far as possible. Currently have data structures and routines defined ... Next will write the routines ... svn path=/trunk/; revision=1748
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c48
1 files changed, 47 insertions, 1 deletions
diff --git a/packet.c b/packet.c
index 163e74ebb8..4182e1c54b 100644
--- a/packet.c
+++ b/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.66 2000/03/23 00:38:10 guy Exp $
+ * $Id: packet.c,v 1.67 2000/03/26 06:57:40 sharpe Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -1154,6 +1154,52 @@ dissect_packet(const u_char *pd, frame_data *fd, proto_tree *tree)
}
}
+gint p_compare(gconstpointer a, gconstpointer b)
+{
+
+ if (((frame_proto_data *)a) -> proto > ((frame_proto_data *)b) -> proto)
+ return 1;
+ else if (((frame_proto_data *)a) -> proto == ((frame_proto_data *)b) -> proto)
+ return 0;
+ else
+ return -1;
+
+}
+
+void
+p_add_proto_data(frame_data *fd, int proto, void *proto_data)
+{
+ frame_proto_data *p1 = malloc(sizeof(frame_proto_data)); /* FIXME */
+
+ g_assert(p1 != NULL);
+
+ p1 -> proto = proto;
+ p1 -> proto_data = proto_data;
+
+ /* Allocate a frame_proto_data struct and then add it to the GSLIST */
+
+
+ fd -> pfd = g_slist_insert_sorted(fd -> pfd,
+ (gpointer *)p1,
+ p_compare);
+
+}
+
+void *
+p_get_proto_data(frame_data *fd, int proto)
+{
+
+ return(NULL);
+
+}
+
+void
+p_rem_proto_data(frame_data *fd, int proto)
+{
+
+
+}
+
void
proto_register_frame(void)
{