summaryrefslogtreecommitdiff
path: root/epan/packet.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2002-05-09 23:50:34 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>2002-05-09 23:50:34 +0000
commit41cc7f0707c5c62ae5651fcd70a9e9b12a4ce387 (patch)
tree46737517f86dbb9ec37210737dd521c9c3920608 /epan/packet.c
parent9625720a39eddda6ef4c34725fe8017160cf05d9 (diff)
downloadwireshark-41cc7f0707c5c62ae5651fcd70a9e9b12a4ce387.tar.gz
Merge the work in Novell_NCP_branch into the mainline code.
A little work still needs to be done on the new NCP dissector -- make some of the COL_INFO texts more useful, handle a Unicode issue, and modify some of the cases that use "request conditions". But the NCP dissector as it stands is very usable now. Note: I didn't merge in the PROTO_LENGTH_UNTIL_END macro... I wanted to think about the various possible macros and review an email conversation I had with Guy on the subject. svn path=/trunk/; revision=5432
Diffstat (limited to 'epan/packet.c')
-rw-r--r--epan/packet.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/epan/packet.c b/epan/packet.c
index 769c0df11d..d7a7fe2507 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.68 2002/04/28 00:13:05 guy Exp $
+ * $Id: packet.c,v 1.69 2002/05/09 23:50:28 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -237,6 +237,39 @@ free_data_sources(frame_data *fd)
fd->data_src = NULL;
}
+/* Allow dissectors to register a "final_registration" routine
+ * that is run like the proto_register_XXX() routine, but the end
+ * end of the epan_init() function; that is, *after* all other
+ * subsystems, liked dfilters, have finished initializing. This is
+ * useful for dissector registration routines which need to compile
+ * display filters. dfilters can't initialize itself until all protocols
+ * have registereed themselvs. */
+static GSList *final_registration_routines;
+
+void
+register_final_registration_routine(void (*func)(void))
+{
+ final_registration_routines = g_slist_append(final_registration_routines,
+ func);
+}
+
+/* Call all the registered "final_registration" routines. */
+static void
+call_final_registration_routine(gpointer routine, gpointer dummy)
+{
+ void (*func)(void) = routine;
+
+ (*func)();
+}
+
+void
+final_registration_all_protocols(void)
+{
+ g_slist_foreach(final_registration_routines,
+ &call_final_registration_routine, NULL);
+}
+
+
/* Creates the top-most tvbuff and calls dissect_frame() */
void
dissect_packet(epan_dissect_t *edt, union wtap_pseudo_header *pseudo_header,