3 * $Id: epan.c,v 1.23 2003/05/04 18:50:53 gerald Exp $
5 * Ethereal Protocol Analyzer Library
14 #include "epan_dissect.h"
16 #include "conversation.h"
20 #include "column-utils.h"
25 * XXX - this takes the plugin directory as an argument, because
26 * libethereal now has its own configure script and "config.h" file,
27 * which is what code in the "epan" directory includes, but we need
28 * to define PLUGIN_DIR in the top-level directory, as it's used by,
29 * for example, the Makefile for the Gryphon plugin, so it knows
30 * where to install the plugin.
32 * Eventually, we should probably have an "epan-configure" script
33 * (or "libethereal-configure", or whatever), along the lines of what
34 * GTK+ and GLib have, that can print, among other things, the directory
35 * into which plugins should be installed. That way, only libethereal
36 * need know what directory that is; programs using it won't, *and*
37 * Makefiles for plugins can just use "epan-configure" to figure out
38 * where to install the plugins.
40 * (Would that *more* libraries had configure scripts like that, so
41 * that configure scripts didn't have to go through various contortions
42 * to figure out where the header files and libraries for various
43 * libraries are located.)
46 epan_init(const char *plugin_dir, void (register_all_protocols)(void),
47 void (register_all_handoffs)(void))
53 proto_init(plugin_dir,register_all_protocols,register_all_handoffs);
56 final_registration_all_protocols();
57 host_name_lookup_init();
69 host_name_lookup_cleanup();
73 epan_conversation_init(void)
79 epan_circuit_init(void)
85 epan_dissect_new(gboolean create_proto_tree, gboolean proto_tree_visible)
89 edt = g_new(epan_dissect_t, 1);
91 if (create_proto_tree) {
92 edt->tree = proto_tree_create_root();
93 proto_tree_set_visible(edt->tree, proto_tree_visible);
103 epan_dissect_run(epan_dissect_t *edt, void* pseudo_header,
104 const guint8* data, frame_data *fd, column_info *cinfo)
106 dissect_packet(edt, pseudo_header, data, fd, cinfo);
111 epan_dissect_free(epan_dissect_t* edt)
113 /* Free the data sources list. */
114 free_data_sources(&edt->pi);
116 /* Free all tvb's created from this tvb, unless dissector
117 * wanted to store the pointer (in which case, the dissector
118 * would have incremented the usage count on that tvbuff_t*) */
119 tvb_free_chain(edt->tvb);
122 proto_tree_free(edt->tree);
129 epan_dissect_prime_dfilter(epan_dissect_t *edt, const dfilter_t* dfcode)
131 dfilter_prime_proto_tree(dfcode, edt->tree);
135 epan_dissect_fill_in_columns(epan_dissect_t *edt)
137 fill_in_columns(&edt->pi);