Some work on multi file dissection
- make init_dissection/cleanup_dissection private for libwireshark - implement epan_new(), epan_free() - pass epan_t to epan_dissect* svn path=/trunk/; revision=50761
This commit is contained in:
parent
9e7b6f1a69
commit
28e9dcc4a9
1
cfile.h
1
cfile.h
|
@ -68,6 +68,7 @@ typedef enum {
|
|||
#define NODES_PER_LEVEL (1<<LOG2_NODES_PER_LEVEL)
|
||||
|
||||
typedef struct _capture_file {
|
||||
epan_t *epan;
|
||||
file_state state; /* Current state of capture file */
|
||||
gchar *filename; /* Name of capture file */
|
||||
gchar *source; /* Temp file source, e.g. "Pipe from elsewhere" */
|
||||
|
|
28
epan/epan.c
28
epan/epan.c
|
@ -40,6 +40,7 @@
|
|||
#include "epan_dissect.h"
|
||||
#include "wsutil/report_err.h"
|
||||
|
||||
#include "epan-int.h"
|
||||
#include "conversation.h"
|
||||
#include "circuit.h"
|
||||
#include "except.h"
|
||||
|
@ -134,6 +135,26 @@ epan_cleanup(void)
|
|||
wmem_cleanup();
|
||||
}
|
||||
|
||||
epan_t *
|
||||
epan_new(void)
|
||||
{
|
||||
epan_t *session = g_slice_new(epan_t);
|
||||
|
||||
/* XXX, it should take session as param */
|
||||
init_dissection();
|
||||
|
||||
return session;
|
||||
}
|
||||
|
||||
void
|
||||
epan_free(epan_t *session)
|
||||
{
|
||||
/* XXX, it should take session as param */
|
||||
cleanup_dissection();
|
||||
|
||||
g_slice_free(epan_t, session);
|
||||
}
|
||||
|
||||
void
|
||||
epan_conversation_init(void)
|
||||
{
|
||||
|
@ -159,10 +180,11 @@ epan_circuit_cleanup(void)
|
|||
}
|
||||
|
||||
epan_dissect_t*
|
||||
epan_dissect_init(epan_dissect_t *edt, const gboolean create_proto_tree, const gboolean proto_tree_visible)
|
||||
epan_dissect_init(epan_dissect_t *edt, epan_t *session, const gboolean create_proto_tree, const gboolean proto_tree_visible)
|
||||
{
|
||||
g_assert(edt);
|
||||
|
||||
edt->session = session;
|
||||
edt->pi.pool = wmem_allocator_new(WMEM_ALLOCATOR_SIMPLE);
|
||||
|
||||
if (create_proto_tree) {
|
||||
|
@ -179,13 +201,13 @@ epan_dissect_init(epan_dissect_t *edt, const gboolean create_proto_tree, const g
|
|||
}
|
||||
|
||||
epan_dissect_t*
|
||||
epan_dissect_new(const gboolean create_proto_tree, const gboolean proto_tree_visible)
|
||||
epan_dissect_new(epan_t *session, const gboolean create_proto_tree, const gboolean proto_tree_visible)
|
||||
{
|
||||
epan_dissect_t *edt;
|
||||
|
||||
edt = g_new0(epan_dissect_t, 1);
|
||||
|
||||
return epan_dissect_init(edt, create_proto_tree, proto_tree_visible);
|
||||
return epan_dissect_init(edt, session, create_proto_tree, proto_tree_visible);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
11
epan/epan.h
11
epan/epan.h
|
@ -125,14 +125,11 @@ void epan_circuit_cleanup(void);
|
|||
* some protocols cannot be decoded without knowledge of previous packets.
|
||||
* This inter-packet "state" is stored in the epan_t.
|
||||
*/
|
||||
/* XXX - NOTE: epan_t, epan_new and epan_free are currently unused! */
|
||||
typedef struct epan_session epan_t;
|
||||
|
||||
epan_t*
|
||||
epan_new(void);
|
||||
WS_DLL_PUBLIC epan_t *epan_new(void);
|
||||
|
||||
void
|
||||
epan_free(epan_t*);
|
||||
WS_DLL_PUBLIC void epan_free(epan_t *session);
|
||||
|
||||
WS_DLL_PUBLIC const gchar*
|
||||
epan_get_version(void);
|
||||
|
@ -140,14 +137,14 @@ epan_get_version(void);
|
|||
/** initialize an existing single packet dissection */
|
||||
WS_DLL_PUBLIC
|
||||
epan_dissect_t*
|
||||
epan_dissect_init(epan_dissect_t *edt, const gboolean create_proto_tree, const gboolean proto_tree_visible);
|
||||
epan_dissect_init(epan_dissect_t *edt, epan_t *session, const gboolean create_proto_tree, const gboolean proto_tree_visible);
|
||||
|
||||
/** get a new single packet dissection
|
||||
* should be freed using epan_dissect_free() after packet dissection completed
|
||||
*/
|
||||
WS_DLL_PUBLIC
|
||||
epan_dissect_t*
|
||||
epan_dissect_new(const gboolean create_proto_tree, const gboolean proto_tree_visible);
|
||||
epan_dissect_new(epan_t *session, const gboolean create_proto_tree, const gboolean proto_tree_visible);
|
||||
|
||||
/** Indicate whether we should fake protocols or not */
|
||||
WS_DLL_PUBLIC
|
||||
|
|
|
@ -39,6 +39,7 @@ extern "C" {
|
|||
* to addresses in your byte array.
|
||||
*/
|
||||
struct _epan_dissect_t {
|
||||
struct epan_session *session;
|
||||
tvbuff_t *tvb;
|
||||
proto_tree *tree;
|
||||
packet_info pi;
|
||||
|
|
|
@ -382,10 +382,10 @@ WS_DLL_PUBLIC void set_actual_length(tvbuff_t *tvb, const guint specified_len);
|
|||
WS_DLL_PUBLIC void register_init_routine(void (*func)(void));
|
||||
|
||||
/* Initialize all data structures used for dissection. */
|
||||
WS_DLL_PUBLIC void init_dissection(void);
|
||||
void init_dissection(void);
|
||||
|
||||
/* Free data structures allocated for dissection. */
|
||||
WS_DLL_PUBLIC void cleanup_dissection(void);
|
||||
void cleanup_dissection(void);
|
||||
|
||||
/* Allow protocols to register a "cleanup" routine to be
|
||||
* run after the initial sequential run through the packets.
|
||||
|
|
43
file.c
43
file.c
|
@ -320,10 +320,9 @@ cf_open(capture_file *cf, const char *fname, gboolean is_tempfile, int *err)
|
|||
the packets, so we know how much we'll ultimately need. */
|
||||
buffer_init(&cf->buf, 1500);
|
||||
|
||||
/* Cleanup all data structures used for dissection. */
|
||||
cleanup_dissection();
|
||||
/* Initialize all data structures used for dissection. */
|
||||
init_dissection();
|
||||
/* Create new epan session for dissection. */
|
||||
epan_free(cf->epan);
|
||||
cf->epan = epan_new();
|
||||
|
||||
/* We're about to start reading the file. */
|
||||
cf->state = FILE_READ_IN_PROGRESS;
|
||||
|
@ -492,7 +491,8 @@ cf_close(capture_file *cf)
|
|||
/* close things, if not already closed before */
|
||||
color_filters_cleanup();
|
||||
cf_reset_state(cf);
|
||||
cleanup_dissection();
|
||||
epan_free(cf->epan);
|
||||
cf->epan = NULL;
|
||||
|
||||
cf_callback_invoke(cf_cb_file_closed, cf);
|
||||
}
|
||||
|
@ -1127,7 +1127,7 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
|
|||
prev_cap = fdata;
|
||||
|
||||
/* Dissect the frame. */
|
||||
epan_dissect_init(&edt, create_proto_tree, FALSE);
|
||||
epan_dissect_init(&edt, cf->epan, create_proto_tree, FALSE);
|
||||
|
||||
if (dfcode != NULL) {
|
||||
epan_dissect_prime_dfilter(&edt, dfcode);
|
||||
|
@ -1217,7 +1217,7 @@ read_packet(capture_file *cf, dfilter_t *dfcode,
|
|||
passed = TRUE;
|
||||
if (cf->rfcode) {
|
||||
epan_dissect_t edt;
|
||||
epan_dissect_init(&edt, TRUE, FALSE);
|
||||
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
|
||||
epan_dissect_prime_dfilter(&edt, cf->rfcode);
|
||||
epan_dissect_run(&edt, phdr, frame_tvbuff_new(&fdlocal, buf), &fdlocal, NULL);
|
||||
passed = dfilter_apply_edt(cf->rfcode, &edt);
|
||||
|
@ -1819,10 +1819,9 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item, gb
|
|||
want to dissect those before their time. */
|
||||
cf->redissecting = TRUE;
|
||||
|
||||
/* Cleanup all data structures used for dissection. */
|
||||
cleanup_dissection();
|
||||
/* Initialize all data structures used for dissection. */
|
||||
init_dissection();
|
||||
/* 'reset' dissection session */
|
||||
epan_free(cf->epan);
|
||||
cf->epan = epan_new();
|
||||
|
||||
/* We need to redissect the packets so we have to discard our old
|
||||
* packet list store. */
|
||||
|
@ -2293,7 +2292,7 @@ retap_packet(capture_file *cf _U_, frame_data *fdata,
|
|||
retap_callback_args_t *args = (retap_callback_args_t *)argsp;
|
||||
epan_dissect_t edt;
|
||||
|
||||
epan_dissect_init(&edt, args->construct_protocol_tree, FALSE);
|
||||
epan_dissect_init(&edt, cf->epan, args->construct_protocol_tree, FALSE);
|
||||
epan_dissect_run_with_taps(&edt, phdr, frame_tvbuff_new(fdata, pd), fdata, args->cinfo);
|
||||
epan_dissect_cleanup(&edt);
|
||||
|
||||
|
@ -2384,7 +2383,7 @@ print_packet(capture_file *cf, frame_data *fdata,
|
|||
XXX - do we need it if we're just printing the hex data? */
|
||||
proto_tree_needed =
|
||||
args->print_args->print_dissections != print_dissections_none || args->print_args->print_hex || have_custom_cols(&cf->cinfo);
|
||||
epan_dissect_init(&edt, proto_tree_needed, proto_tree_needed);
|
||||
epan_dissect_init(&edt, cf->epan, proto_tree_needed, proto_tree_needed);
|
||||
|
||||
/* Fill in the column information if we're printing the summary
|
||||
information. */
|
||||
|
@ -2690,7 +2689,7 @@ write_pdml_packet(capture_file *cf _U_, frame_data *fdata,
|
|||
epan_dissect_t edt;
|
||||
|
||||
/* Create the protocol tree, but don't fill in the column information. */
|
||||
epan_dissect_init(&edt, TRUE, TRUE);
|
||||
epan_dissect_init(&edt, cf->epan, TRUE, TRUE);
|
||||
epan_dissect_run(&edt, phdr, frame_tvbuff_new(fdata, pd), fdata, NULL);
|
||||
|
||||
/* Write out the information in that tree. */
|
||||
|
@ -2763,7 +2762,7 @@ write_psml_packet(capture_file *cf, frame_data *fdata,
|
|||
/* Fill in the column information, only create the protocol tree
|
||||
if having custom columns. */
|
||||
proto_tree_needed = have_custom_cols(&cf->cinfo);
|
||||
epan_dissect_init(&edt, proto_tree_needed, proto_tree_needed);
|
||||
epan_dissect_init(&edt, cf->epan, proto_tree_needed, proto_tree_needed);
|
||||
col_custom_prime_edt(&edt, &cf->cinfo);
|
||||
epan_dissect_run(&edt, phdr, frame_tvbuff_new(fdata, pd), fdata, &cf->cinfo);
|
||||
epan_dissect_fill_in_columns(&edt, FALSE, TRUE);
|
||||
|
@ -2838,7 +2837,7 @@ write_csv_packet(capture_file *cf, frame_data *fdata,
|
|||
/* Fill in the column information, only create the protocol tree
|
||||
if having custom columns. */
|
||||
proto_tree_needed = have_custom_cols(&cf->cinfo);
|
||||
epan_dissect_init(&edt, proto_tree_needed, proto_tree_needed);
|
||||
epan_dissect_init(&edt, cf->epan, proto_tree_needed, proto_tree_needed);
|
||||
col_custom_prime_edt(&edt, &cf->cinfo);
|
||||
epan_dissect_run(&edt, phdr, frame_tvbuff_new(fdata, pd), fdata, &cf->cinfo);
|
||||
epan_dissect_fill_in_columns(&edt, FALSE, TRUE);
|
||||
|
@ -2902,14 +2901,14 @@ cf_write_csv_packets(capture_file *cf, print_args_t *print_args)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
write_carrays_packet(capture_file *cf _U_, frame_data *fdata,
|
||||
write_carrays_packet(capture_file *cf, frame_data *fdata,
|
||||
struct wtap_pkthdr *phdr,
|
||||
const guint8 *pd, void *argsp)
|
||||
{
|
||||
FILE *fh = (FILE *)argsp;
|
||||
epan_dissect_t edt;
|
||||
|
||||
epan_dissect_init(&edt, TRUE, TRUE);
|
||||
epan_dissect_init(&edt, cf->epan, TRUE, TRUE);
|
||||
epan_dissect_run(&edt, phdr, frame_tvbuff_new(fdata, pd), fdata, NULL);
|
||||
proto_tree_write_carrays(fdata->num, fh, &edt);
|
||||
epan_dissect_cleanup(&edt);
|
||||
|
@ -3001,7 +3000,7 @@ match_protocol_tree(capture_file *cf, frame_data *fdata, void *criterion)
|
|||
}
|
||||
|
||||
/* Construct the protocol tree, including the displayed text */
|
||||
epan_dissect_init(&edt, TRUE, TRUE);
|
||||
epan_dissect_init(&edt, cf->epan, TRUE, TRUE);
|
||||
/* We don't need the column information */
|
||||
epan_dissect_run(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
|
||||
|
@ -3105,7 +3104,7 @@ match_summary_line(capture_file *cf, frame_data *fdata, void *criterion)
|
|||
}
|
||||
|
||||
/* Don't bother constructing the protocol tree */
|
||||
epan_dissect_init(&edt, FALSE, FALSE);
|
||||
epan_dissect_init(&edt, cf->epan, FALSE, FALSE);
|
||||
/* Get the column information */
|
||||
epan_dissect_run(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata,
|
||||
&cf->cinfo);
|
||||
|
@ -3413,7 +3412,7 @@ match_dfilter(capture_file *cf, frame_data *fdata, void *criterion)
|
|||
return MR_ERROR;
|
||||
}
|
||||
|
||||
epan_dissect_init(&edt, TRUE, FALSE);
|
||||
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
|
||||
epan_dissect_prime_dfilter(&edt, sfcode);
|
||||
epan_dissect_run(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
result = dfilter_apply_edt(sfcode, &edt) ? MR_MATCHED : MR_NOTMATCHED;
|
||||
|
@ -3745,7 +3744,7 @@ cf_select_packet(capture_file *cf, int row)
|
|||
old_edt = cf->edt;
|
||||
/* Create the logical protocol tree. */
|
||||
/* We don't need the columns here. */
|
||||
cf->edt = epan_dissect_new(TRUE, TRUE);
|
||||
cf->edt = epan_dissect_new(cf->epan, TRUE, TRUE);
|
||||
|
||||
tap_build_interesting(cf->edt);
|
||||
epan_dissect_run(cf->edt, &cf->phdr, frame_tvbuff_new_buffer(cf->current_frame, &cf->buf),
|
||||
|
|
|
@ -151,7 +151,7 @@ process_frame(frame_data *frame, column_info *cinfo, ph_stats_t* ps)
|
|||
return FALSE; /* failure */
|
||||
|
||||
/* Dissect the frame tree not visible */
|
||||
epan_dissect_init(&edt, TRUE, FALSE);
|
||||
epan_dissect_init(&edt, cfile.epan, TRUE, FALSE);
|
||||
/* Don't fake protocols. We need them for the protocol hierarchy */
|
||||
epan_dissect_fake_protocols(&edt, FALSE);
|
||||
epan_dissect_run(&edt, &phdr, frame_tvbuff_new_buffer(frame, &buf), frame, cinfo);
|
||||
|
|
|
@ -1060,7 +1060,7 @@ process_packet(capture_file *cf, gint64 offset, struct wtap_pkthdr *whdr,
|
|||
/* The protocol tree will be "visible", i.e., printed, only if we're
|
||||
printing packet details, which is true if we're in verbose mode ("verbose"
|
||||
is true). */
|
||||
epan_dissect_init(&edt, create_proto_tree, FALSE);
|
||||
epan_dissect_init(&edt, cf->epan, create_proto_tree, FALSE);
|
||||
|
||||
/* If we're running a read filter, prime the epan_dissect_t with that
|
||||
filter. */
|
||||
|
@ -1573,10 +1573,9 @@ raw_cf_open(capture_file *cf, const char *fname)
|
|||
|
||||
/* The open succeeded. Fill in the information for this file. */
|
||||
|
||||
/* Cleanup all data structures used for dissection. */
|
||||
cleanup_dissection();
|
||||
/* Initialize all data structures used for dissection. */
|
||||
init_dissection();
|
||||
/* Create new epan session for dissection. */
|
||||
epan_free(cf->epan);
|
||||
cf->epan = epan_new();
|
||||
|
||||
cf->wth = NULL;
|
||||
cf->f_datalen = 0; /* not used, but set it anyway */
|
||||
|
|
20
tshark.c
20
tshark.c
|
@ -2196,10 +2196,9 @@ capture(void)
|
|||
relinquish_special_privs_perm();
|
||||
print_current_user();
|
||||
|
||||
/* Cleanup all data structures used for dissection. */
|
||||
cleanup_dissection();
|
||||
/* Initialize all data structures used for dissection. */
|
||||
init_dissection();
|
||||
/* Create new dissection section. */
|
||||
epan_free(cfile.epan);
|
||||
cfile.epan = epan_new();
|
||||
|
||||
#ifdef _WIN32
|
||||
/* Catch a CTRL+C event and, if we get it, clean up and exit. */
|
||||
|
@ -2687,7 +2686,7 @@ process_packet_first_pass(capture_file *cf,
|
|||
|
||||
/* We're not going to display the protocol tree on this pass,
|
||||
so it's not going to be "visible". */
|
||||
epan_dissect_init(&edt, create_proto_tree, FALSE);
|
||||
epan_dissect_init(&edt, cf->epan, create_proto_tree, FALSE);
|
||||
|
||||
/* If we're running a read filter, prime the epan_dissect_t with that
|
||||
filter. */
|
||||
|
@ -2763,7 +2762,7 @@ process_packet_second_pass(capture_file *cf, frame_data *fdata,
|
|||
printing packet details, which is true if we're printing stuff
|
||||
("print_packet_info" is true) and we're in verbose mode
|
||||
("packet_details" is true). */
|
||||
epan_dissect_init(&edt, create_proto_tree, print_packet_info && print_details);
|
||||
epan_dissect_init(&edt, cf->epan, create_proto_tree, print_packet_info && print_details);
|
||||
|
||||
/* If we're running a display filter, prime the epan_dissect_t with that
|
||||
filter. */
|
||||
|
@ -3222,7 +3221,7 @@ process_packet(capture_file *cf, gint64 offset, struct wtap_pkthdr *whdr,
|
|||
printing packet details, which is true if we're printing stuff
|
||||
("print_packet_info" is true) and we're in verbose mode
|
||||
("packet_details" is true). */
|
||||
epan_dissect_init(&edt, create_proto_tree, print_packet_info && print_details);
|
||||
epan_dissect_init(&edt, cf->epan, create_proto_tree, print_packet_info && print_details);
|
||||
|
||||
/* If we're running a filter, prime the epan_dissect_t with that
|
||||
filter. */
|
||||
|
@ -3706,10 +3705,9 @@ cf_open(capture_file *cf, const char *fname, gboolean is_tempfile, int *err)
|
|||
|
||||
/* The open succeeded. Fill in the information for this file. */
|
||||
|
||||
/* Cleanup all data structures used for dissection. */
|
||||
cleanup_dissection();
|
||||
/* Initialize all data structures used for dissection. */
|
||||
init_dissection();
|
||||
/* Create new epan session for dissection. */
|
||||
epan_free(cf->epan);
|
||||
cf->epan = epan_new();
|
||||
|
||||
cf->wth = wth;
|
||||
cf->f_datalen = 0; /* not used, but set it anyway */
|
||||
|
|
|
@ -3712,7 +3712,7 @@ void iax2_analysis_cb(GtkAction *action _U_, gpointer user_data _U_)
|
|||
/* dissect the current frame */
|
||||
if (!cf_read_frame(cf, fdata))
|
||||
return; /* error reading the frame */
|
||||
epan_dissect_init(&edt, TRUE, FALSE);
|
||||
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
|
||||
epan_dissect_prime_dfilter(&edt, sfcode);
|
||||
epan_dissect_run(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf),
|
||||
fdata, NULL);
|
||||
|
|
|
@ -547,7 +547,7 @@ get_ip_address_list_from_packet_list_row(gpointer data)
|
|||
if (!cf_read_frame (&cfile, fdata))
|
||||
return NULL; /* error reading the frame */
|
||||
|
||||
epan_dissect_init(&edt, FALSE, FALSE);
|
||||
epan_dissect_init(&edt, cfile.epan, FALSE, FALSE);
|
||||
col_custom_prime_edt(&edt, &cfile.cinfo);
|
||||
|
||||
epan_dissect_run(&edt, &cfile.phdr, frame_tvbuff_new_buffer(fdata, &cfile.buf),
|
||||
|
@ -588,7 +588,7 @@ get_filter_from_packet_list_row_and_column(gpointer data)
|
|||
if (!cf_read_frame(&cfile, fdata))
|
||||
return NULL; /* error reading the frame */
|
||||
/* proto tree, visible. We need a proto tree if there's custom columns */
|
||||
epan_dissect_init(&edt, have_custom_cols(&cfile.cinfo), FALSE);
|
||||
epan_dissect_init(&edt, cfile.epan, have_custom_cols(&cfile.cinfo), FALSE);
|
||||
col_custom_prime_edt(&edt, &cfile.cinfo);
|
||||
|
||||
epan_dissect_run(&edt, &cfile.phdr, frame_tvbuff_new_buffer(fdata, &cfile.buf),
|
||||
|
|
|
@ -1142,7 +1142,7 @@ packet_list_dissect_and_cache_record(PacketList *packet_list, PacketListRecord *
|
|||
create_proto_tree = (dissect_color && color_filters_used()) ||
|
||||
(dissect_columns && have_custom_cols(cinfo));
|
||||
|
||||
epan_dissect_init(&edt,
|
||||
epan_dissect_init(&edt, cfile.epan,
|
||||
create_proto_tree,
|
||||
FALSE /* proto_tree_visible */);
|
||||
|
||||
|
|
|
@ -75,6 +75,7 @@
|
|||
|
||||
/* Data structure holding information about a packet-detail window. */
|
||||
struct PacketWinData {
|
||||
epan_t *epan;
|
||||
frame_data *frame; /* The frame being displayed */
|
||||
struct wtap_pkthdr phdr; /* Packet header */
|
||||
guint8 *pd; /* Packet data */
|
||||
|
@ -194,7 +195,7 @@ redissect_packet_window(gpointer object, gpointer user_data _U_)
|
|||
/* XXX, can be optimized? */
|
||||
proto_tree_draw(NULL, DataPtr->tree_view);
|
||||
epan_dissect_cleanup(&(DataPtr->edt));
|
||||
epan_dissect_init(&(DataPtr->edt), TRUE, TRUE);
|
||||
epan_dissect_init(&(DataPtr->edt), DataPtr->epan, TRUE, TRUE);
|
||||
epan_dissect_run(&(DataPtr->edt), &DataPtr->phdr, frame_tvbuff_new(DataPtr->frame, DataPtr->pd), DataPtr->frame, NULL);
|
||||
add_byte_views(&(DataPtr->edt), DataPtr->tree_view, DataPtr->bv_nb_ptr);
|
||||
proto_tree_draw(DataPtr->edt.tree, DataPtr->tree_view);
|
||||
|
@ -265,7 +266,7 @@ finfo_window_refresh(struct FieldinfoWinData *DataPtr)
|
|||
}
|
||||
|
||||
/* redisect */
|
||||
epan_dissect_init(&edt, TRUE, TRUE);
|
||||
epan_dissect_init(&edt, DataPtr->epan, TRUE, TRUE);
|
||||
/* Makes any sense?
|
||||
if (old_finfo->hfinfo)
|
||||
proto_tree_prime_hfid(edt.tree, old_finfo->hfinfo->id);
|
||||
|
@ -732,7 +733,7 @@ edit_pkt_tree_row_activated_cb(GtkTreeView *tree_view, GtkTreePath *path, GtkTre
|
|||
|
||||
proto_tree_draw(NULL, DataPtr->tree_view);
|
||||
epan_dissect_cleanup(&(DataPtr->edt));
|
||||
epan_dissect_init(&(DataPtr->edt), TRUE, TRUE);
|
||||
epan_dissect_init(&(DataPtr->edt), DataPtr->epan, TRUE, TRUE);
|
||||
epan_dissect_run(&(DataPtr->edt), &DataPtr->phdr, frame_tvbuff_new(DataPtr->frame, DataPtr->pd), DataPtr->frame, NULL);
|
||||
add_byte_views(&(DataPtr->edt), DataPtr->tree_view, DataPtr->bv_nb_ptr);
|
||||
proto_tree_draw(DataPtr->edt.tree, DataPtr->tree_view);
|
||||
|
@ -959,12 +960,14 @@ void new_packet_window(GtkWidget *w _U_, gboolean reference, gboolean editable _
|
|||
/* Allocate data structure to represent this window. */
|
||||
DataPtr = (struct PacketWinData *) g_malloc(sizeof(struct PacketWinData));
|
||||
|
||||
/* XXX, protect cfile.epan from closing (ref counting?) */
|
||||
DataPtr->epan = cfile.epan;
|
||||
DataPtr->frame = fd;
|
||||
DataPtr->phdr = cfile.phdr;
|
||||
DataPtr->pd = (guint8 *)g_malloc(DataPtr->frame->cap_len);
|
||||
memcpy(DataPtr->pd, buffer_start_ptr(&cfile.buf), DataPtr->frame->cap_len);
|
||||
|
||||
epan_dissect_init(&(DataPtr->edt), TRUE, TRUE);
|
||||
epan_dissect_init(&(DataPtr->edt), DataPtr->epan, TRUE, TRUE);
|
||||
epan_dissect_run(&(DataPtr->edt), &DataPtr->phdr, frame_tvbuff_new(DataPtr->frame, DataPtr->pd),
|
||||
DataPtr->frame, &cfile.cinfo);
|
||||
epan_dissect_fill_in_columns(&(DataPtr->edt), FALSE, TRUE);
|
||||
|
|
|
@ -914,7 +914,7 @@ static rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf, struct segment
|
|||
exit(1);
|
||||
}
|
||||
|
||||
epan_dissect_init(&edt, TRUE, FALSE);
|
||||
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
|
||||
epan_dissect_prime_dfilter(&edt, sfcode);
|
||||
epan_dissect_run_with_taps(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
epan_dissect_cleanup(&edt);
|
||||
|
|
|
@ -3947,7 +3947,7 @@ rtp_analysis_cb(GtkAction *action _U_, gpointer user_data _U_)
|
|||
/* dissect the current frame */
|
||||
if (!cf_read_frame(cf, fdata))
|
||||
return; /* error reading the frame */
|
||||
epan_dissect_init(&edt, TRUE, FALSE);
|
||||
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
|
||||
epan_dissect_prime_dfilter(&edt, sfcode);
|
||||
epan_dissect_run(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
|
||||
|
|
|
@ -977,7 +977,7 @@ sctp_analyse_cb(struct sctp_analyse *u_data, gboolean ext)
|
|||
if (!cf_read_frame(cf, fdata))
|
||||
return; /* error reading the frame */
|
||||
|
||||
epan_dissect_init(&edt, TRUE, FALSE);
|
||||
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
|
||||
epan_dissect_prime_dfilter(&edt, sfcode);
|
||||
epan_dissect_run(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
frame_matched = dfilter_apply_edt(sfcode, &edt);
|
||||
|
|
|
@ -1987,7 +1987,7 @@ static struct tcpheader *select_tcpip_session(capture_file *cf, struct segment *
|
|||
exit(1);
|
||||
}
|
||||
|
||||
epan_dissect_init(&edt, TRUE, FALSE);
|
||||
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
|
||||
epan_dissect_prime_dfilter(&edt, sfcode);
|
||||
epan_dissect_run_with_taps(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
|
||||
epan_dissect_cleanup(&edt);
|
||||
|
|
|
@ -577,7 +577,7 @@ QString &PacketList::getFilterFromRowAndColumn()
|
|||
if (!cf_read_frame(cap_file_, fdata))
|
||||
return filter; /* error reading the frame */
|
||||
/* proto tree, visible. We need a proto tree if there's custom columns */
|
||||
epan_dissect_init(&edt, have_custom_cols(&cap_file_->cinfo), FALSE);
|
||||
epan_dissect_init(&edt, cap_file_->epan, have_custom_cols(&cap_file_->cinfo), FALSE);
|
||||
col_custom_prime_edt(&edt, &cap_file_->cinfo);
|
||||
|
||||
epan_dissect_run(&edt, &cap_file_->phdr, frame_tvbuff_new_buffer(fdata, &cap_file_->buf), fdata, &cap_file_->cinfo);
|
||||
|
|
|
@ -239,7 +239,7 @@ QVariant PacketListModel::data(const QModelIndex &index, int role) const
|
|||
create_proto_tree = (color_filters_used() && enable_color_) ||
|
||||
(have_custom_cols(cinfo) && dissect_columns);
|
||||
|
||||
epan_dissect_init(&edt,
|
||||
epan_dissect_init(&edt, cap_file_->epan,
|
||||
create_proto_tree,
|
||||
FALSE /* proto_tree_visible */);
|
||||
|
||||
|
|
Loading…
Reference in New Issue