diff options
author | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-07-21 18:38:03 +0000 |
---|---|---|
committer | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-07-21 18:38:03 +0000 |
commit | 28e9dcc4a9261a61b16dfd9a2051205289beb926 (patch) | |
tree | 69465d340a5472a87467c43de32fd9f6a3035b1a /ui | |
parent | 9e7b6f1a69c516579ffd4618f89e20559d738666 (diff) |
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
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gtk/iax2_analysis.c | 2 | ||||
-rw-r--r-- | ui/gtk/main.c | 4 | ||||
-rw-r--r-- | ui/gtk/packet_list_store.c | 2 | ||||
-rw-r--r-- | ui/gtk/packet_win.c | 11 | ||||
-rw-r--r-- | ui/gtk/rlc_lte_graph.c | 2 | ||||
-rw-r--r-- | ui/gtk/rtp_analysis.c | 2 | ||||
-rw-r--r-- | ui/gtk/sctp_assoc_analyse.c | 2 | ||||
-rw-r--r-- | ui/gtk/tcp_graph.c | 2 | ||||
-rw-r--r-- | ui/qt/packet_list.cpp | 2 | ||||
-rw-r--r-- | ui/qt/packet_list_model.cpp | 2 |
10 files changed, 17 insertions, 14 deletions
diff --git a/ui/gtk/iax2_analysis.c b/ui/gtk/iax2_analysis.c index fe8de8db34..aa00b35279 100644 --- a/ui/gtk/iax2_analysis.c +++ b/ui/gtk/iax2_analysis.c @@ -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); diff --git a/ui/gtk/main.c b/ui/gtk/main.c index ab137a2d97..4835b50da0 100644 --- a/ui/gtk/main.c +++ b/ui/gtk/main.c @@ -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), diff --git a/ui/gtk/packet_list_store.c b/ui/gtk/packet_list_store.c index 8a5a008e0e..e7cb64bef8 100644 --- a/ui/gtk/packet_list_store.c +++ b/ui/gtk/packet_list_store.c @@ -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 */); diff --git a/ui/gtk/packet_win.c b/ui/gtk/packet_win.c index 541e9c1a68..32535eeee1 100644 --- a/ui/gtk/packet_win.c +++ b/ui/gtk/packet_win.c @@ -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); diff --git a/ui/gtk/rlc_lte_graph.c b/ui/gtk/rlc_lte_graph.c index 1e28bd960d..79039d14b3 100644 --- a/ui/gtk/rlc_lte_graph.c +++ b/ui/gtk/rlc_lte_graph.c @@ -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); diff --git a/ui/gtk/rtp_analysis.c b/ui/gtk/rtp_analysis.c index b3d9778b73..312edefd6a 100644 --- a/ui/gtk/rtp_analysis.c +++ b/ui/gtk/rtp_analysis.c @@ -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); diff --git a/ui/gtk/sctp_assoc_analyse.c b/ui/gtk/sctp_assoc_analyse.c index 952819b337..7844bc0a89 100644 --- a/ui/gtk/sctp_assoc_analyse.c +++ b/ui/gtk/sctp_assoc_analyse.c @@ -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); diff --git a/ui/gtk/tcp_graph.c b/ui/gtk/tcp_graph.c index 8aa9793856..c7d715702f 100644 --- a/ui/gtk/tcp_graph.c +++ b/ui/gtk/tcp_graph.c @@ -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); diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index 44bb090378..39fae25159 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -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); diff --git a/ui/qt/packet_list_model.cpp b/ui/qt/packet_list_model.cpp index 3f7d00221e..96fd7eba4f 100644 --- a/ui/qt/packet_list_model.cpp +++ b/ui/qt/packet_list_model.cpp @@ -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 */); |