5 * Wireshark Protocol Analyzer Library
7 * Copyright (c) 2001 by Gerald Combs <gerald@wireshark.org>
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 #if (defined(HAVE_LIBGCRYPT) || defined(HAVE_LIBGNUTLS)) && defined(_WIN32)
29 #include <winposixtype.h>
34 #endif /* HAVE_LIBGCRYPT */
37 #include <gnutls/gnutls.h>
38 #endif /* HAVE_LIBGNUTLS */
43 #include "epan_dissect.h"
44 #include "report_err.h"
46 #include "conversation.h"
51 #include "column-utils.h"
53 #include "addr_resolv.h"
59 int wslua_init(void*);
67 epan_get_version(void) {
72 epan_init(void (*register_all_protocols_func)(register_cb cb, gpointer client_data),
73 void (*register_all_handoffs_func)(register_cb cb, gpointer client_data),
76 void (*report_failure)(const char *, va_list),
77 void (*report_open_failure)(const char *, int, gboolean),
78 void (*report_read_failure)(const char *, int),
79 void (*report_write_failure)(const char *, int))
81 init_report_err(report_failure, report_open_failure,
82 report_read_failure, report_write_failure);
84 /* initialize memory allocation subsystem */
88 /* initialize the GUID to name mapping table */
94 #elif defined(HAVE_LIBGCRYPT)
95 gcry_check_version(NULL);
100 proto_init(register_all_protocols_func, register_all_handoffs_func,
104 final_registration_all_protocols();
105 host_name_lookup_init();
126 oid_resolv_cleanup();
128 #ifdef HAVE_LIBGNUTLS
129 gnutls_global_deinit();
132 host_name_lookup_cleanup();
136 epan_conversation_init(void)
142 epan_circuit_init(void)
148 epan_dissect_new(gboolean create_proto_tree, gboolean proto_tree_visible)
152 edt = g_new(epan_dissect_t, 1);
154 if (create_proto_tree) {
155 edt->tree = proto_tree_create_root();
156 proto_tree_set_visible(edt->tree, proto_tree_visible);
166 epan_dissect_run(epan_dissect_t *edt, void* pseudo_header,
167 const guint8* data, frame_data *fd, column_info *cinfo)
169 /* free all memory allocated during previous packet */
172 dissect_packet(edt, pseudo_header, data, fd, cinfo);
177 epan_dissect_free(epan_dissect_t* edt)
179 /* Free the data sources list. */
180 free_data_sources(&edt->pi);
182 /* Free all tvb's created from this tvb, unless dissector
183 * wanted to store the pointer (in which case, the dissector
184 * would have incremented the usage count on that tvbuff_t*) */
185 tvb_free_chain(edt->tvb);
188 proto_tree_free(edt->tree);
195 epan_dissect_prime_dfilter(epan_dissect_t *edt, const dfilter_t* dfcode)
197 dfilter_prime_proto_tree(dfcode, edt->tree);
201 epan_dissect_fill_in_columns(epan_dissect_t *edt)
203 col_fill_in(&edt->pi);