diff options
author | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-07-11 05:47:02 +0000 |
---|---|---|
committer | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-07-11 05:47:02 +0000 |
commit | ce81449ed9294f0104598762ce293c3521820987 (patch) | |
tree | 26efdeea2934c6e99869fc3e5761451043dc3e05 /ui | |
parent | 19d2d0dc765cd2417d693746226472207190434a (diff) | |
download | wireshark-ce81449ed9294f0104598762ce293c3521820987.tar.gz wireshark-ce81449ed9294f0104598762ce293c3521820987.tar.bz2 wireshark-ce81449ed9294f0104598762ce293c3521820987.zip |
packet dissection now takes pointer to tvb instead of guint8 data
implement frame_tvbuff, right now almost a copy of 'real' tvb.
svn path=/trunk/; revision=50497
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gtk/iax2_analysis.c | 4 | ||||
-rw-r--r-- | ui/gtk/main.c | 5 | ||||
-rw-r--r-- | ui/gtk/packet_list_store.c | 3 | ||||
-rw-r--r-- | ui/gtk/packet_win.c | 10 | ||||
-rw-r--r-- | ui/gtk/rlc_lte_graph.c | 3 | ||||
-rw-r--r-- | ui/gtk/rtp_analysis.c | 4 | ||||
-rw-r--r-- | ui/gtk/sctp_assoc_analyse.c | 4 | ||||
-rw-r--r-- | ui/gtk/tcp_graph.c | 4 | ||||
-rw-r--r-- | ui/qt/packet_list.cpp | 4 | ||||
-rw-r--r-- | ui/qt/packet_list_model.cpp | 3 |
10 files changed, 30 insertions, 14 deletions
diff --git a/ui/gtk/iax2_analysis.c b/ui/gtk/iax2_analysis.c index d412eda5b5..142727c6b3 100644 --- a/ui/gtk/iax2_analysis.c +++ b/ui/gtk/iax2_analysis.c @@ -89,6 +89,8 @@ #include "ui/gtk/old-gtk-compat.h" #include "ui/gtk/gui_utils.h" +#include "frame_tvbuff.h" + enum { PACKET_COLUMN, @@ -3713,7 +3715,7 @@ void iax2_analysis_cb(GtkAction *action _U_, gpointer user_data _U_) return; /* error reading the frame */ epan_dissect_init(&edt, TRUE, FALSE); epan_dissect_prime_dfilter(&edt, sfcode); - epan_dissect_run(&edt, &cf->phdr, buffer_start_ptr(&cf->buf), + epan_dissect_run(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL); /* if it is not an iax2 frame, show an error dialog */ diff --git a/ui/gtk/main.c b/ui/gtk/main.c index 7028b69380..ae5e03b82c 100644 --- a/ui/gtk/main.c +++ b/ui/gtk/main.c @@ -88,6 +88,7 @@ /* general (not GTK specific) */ #include "../file.h" +#include "../frame_tvbuff.h" #include "../summary.h" #include "../filters.h" #include "../disabled_protos.h" @@ -549,7 +550,7 @@ get_ip_address_list_from_packet_list_row(gpointer data) epan_dissect_init(&edt, FALSE, FALSE); col_custom_prime_edt(&edt, &cfile.cinfo); - epan_dissect_run(&edt, &cfile.phdr, buffer_start_ptr(&cfile.buf), + epan_dissect_run(&edt, &cfile.phdr, frame_tvbuff_new_buffer(fdata, &cfile.buf), fdata, &cfile.cinfo); epan_dissect_fill_in_columns(&edt, TRUE, TRUE); @@ -590,7 +591,7 @@ get_filter_from_packet_list_row_and_column(gpointer data) epan_dissect_init(&edt, have_custom_cols(&cfile.cinfo), FALSE); col_custom_prime_edt(&edt, &cfile.cinfo); - epan_dissect_run(&edt, &cfile.phdr, buffer_start_ptr(&cfile.buf), + epan_dissect_run(&edt, &cfile.phdr, frame_tvbuff_new_buffer(fdata, &cfile.buf), fdata, &cfile.cinfo); epan_dissect_fill_in_columns(&edt, TRUE, TRUE); diff --git a/ui/gtk/packet_list_store.c b/ui/gtk/packet_list_store.c index 2ebc094947..8a5a008e0e 100644 --- a/ui/gtk/packet_list_store.c +++ b/ui/gtk/packet_list_store.c @@ -48,6 +48,7 @@ #include "color.h" #include "color_filters.h" +#include "frame_tvbuff.h" #include "globals.h" @@ -1154,7 +1155,7 @@ packet_list_dissect_and_cache_record(PacketList *packet_list, PacketListRecord * * XXX - need to catch an OutOfMemoryError exception and * attempt to recover from it. */ - epan_dissect_run(&edt, &phdr, buffer_start_ptr(&buf), fdata, cinfo); + epan_dissect_run(&edt, &phdr, frame_tvbuff_new_buffer(fdata, &buf), fdata, cinfo); if (dissect_color) fdata->color_filter = color_filters_colorize_packet(&edt); diff --git a/ui/gtk/packet_win.c b/ui/gtk/packet_win.c index 1af6c767bf..5cb45dfff8 100644 --- a/ui/gtk/packet_win.c +++ b/ui/gtk/packet_win.c @@ -68,6 +68,8 @@ #include "ui/gtk/gtkglobals.h" #include "ui/gtk/gui_utils.h" +#include "frame_tvbuff.h" + #define BV_SIZE 75 #define TV_SIZE 95 @@ -193,7 +195,7 @@ redissect_packet_window(gpointer object, gpointer user_data _U_) proto_tree_draw(NULL, DataPtr->tree_view); epan_dissect_cleanup(&(DataPtr->edt)); epan_dissect_init(&(DataPtr->edt), TRUE, TRUE); - epan_dissect_run(&(DataPtr->edt), &DataPtr->phdr, DataPtr->pd, DataPtr->frame, NULL); + 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); @@ -268,7 +270,7 @@ finfo_window_refresh(struct FieldinfoWinData *DataPtr) if (old_finfo->hfinfo) proto_tree_prime_hfid(edt.tree, old_finfo->hfinfo->id); */ - epan_dissect_run(&edt, &DataPtr->phdr, DataPtr->pd, DataPtr->frame, NULL); + epan_dissect_run(&edt, &DataPtr->phdr, frame_tvbuff_new(DataPtr->frame, DataPtr->pd), DataPtr->frame, NULL); /* Try to find finfo which looks like old_finfo. * We might not found one, if protocol requires specific magic values, etc... */ @@ -731,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_run(&(DataPtr->edt), &DataPtr->phdr, DataPtr->pd, DataPtr->frame, NULL); + 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); } @@ -963,7 +965,7 @@ void new_packet_window(GtkWidget *w _U_, gboolean reference, gboolean editable _ memcpy(DataPtr->pd, buffer_start_ptr(&cfile.buf), DataPtr->frame->cap_len); epan_dissect_init(&(DataPtr->edt), TRUE, TRUE); - epan_dissect_run(&(DataPtr->edt), &DataPtr->phdr, DataPtr->pd, + 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 f6a2bffe94..1e28bd960d 100644 --- a/ui/gtk/rlc_lte_graph.c +++ b/ui/gtk/rlc_lte_graph.c @@ -39,6 +39,7 @@ #include <epan/tap.h> #include "../globals.h" +#include "../frame_tvbuff.h" #include "ui/simple_dialog.h" #include "../stat_menu.h" @@ -915,7 +916,7 @@ static rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf, struct segment epan_dissect_init(&edt, TRUE, FALSE); epan_dissect_prime_dfilter(&edt, sfcode); - epan_dissect_run_with_taps(&edt, &cf->phdr, buffer_start_ptr(&cf->buf), fdata, NULL); + epan_dissect_run_with_taps(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL); epan_dissect_cleanup(&edt); remove_tap_listener(&th); diff --git a/ui/gtk/rtp_analysis.c b/ui/gtk/rtp_analysis.c index 5bd3f49558..647775e6d4 100644 --- a/ui/gtk/rtp_analysis.c +++ b/ui/gtk/rtp_analysis.c @@ -93,6 +93,8 @@ #include "ui/gtk/old-gtk-compat.h" +#include "frame_tvbuff.h" + enum { PACKET_COLUMN, @@ -3946,7 +3948,7 @@ rtp_analysis_cb(GtkAction *action _U_, gpointer user_data _U_) return; /* error reading the frame */ epan_dissect_init(&edt, TRUE, FALSE); epan_dissect_prime_dfilter(&edt, sfcode); - epan_dissect_run(&edt, &cf->phdr, buffer_start_ptr(&cf->buf), fdata, NULL); + epan_dissect_run(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL); /* if it is not an rtp frame, show the rtpstream dialog */ frame_matched = dfilter_apply_edt(sfcode, &edt); diff --git a/ui/gtk/sctp_assoc_analyse.c b/ui/gtk/sctp_assoc_analyse.c index aafc43ff88..952819b337 100644 --- a/ui/gtk/sctp_assoc_analyse.c +++ b/ui/gtk/sctp_assoc_analyse.c @@ -41,6 +41,8 @@ #include "ui/gtk/sctp_stat.h" #include "ui/gtk/gtkglobals.h" +#include "frame_tvbuff.h" + static sctp_assoc_info_t static_assoc; void @@ -977,7 +979,7 @@ sctp_analyse_cb(struct sctp_analyse *u_data, gboolean ext) epan_dissect_init(&edt, TRUE, FALSE); epan_dissect_prime_dfilter(&edt, sfcode); - epan_dissect_run(&edt, &cf->phdr, buffer_start_ptr(&cf->buf), fdata, NULL); + epan_dissect_run(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL); frame_matched = dfilter_apply_edt(sfcode, &edt); /* if it is not an sctp frame, show the dialog */ diff --git a/ui/gtk/tcp_graph.c b/ui/gtk/tcp_graph.c index 7d5a7243b3..8aa9793856 100644 --- a/ui/gtk/tcp_graph.c +++ b/ui/gtk/tcp_graph.c @@ -55,6 +55,8 @@ #include "ui/gtk/old-gtk-compat.h" +#include "frame_tvbuff.h" + #define TCP_SYN(flags) ( flags & TH_SYN ) #define TCP_ACK(flags) ( flags & TH_ACK ) #define TCP_FIN(flags) ( flags & TH_FIN ) @@ -1987,7 +1989,7 @@ static struct tcpheader *select_tcpip_session(capture_file *cf, struct segment * epan_dissect_init(&edt, TRUE, FALSE); epan_dissect_prime_dfilter(&edt, sfcode); - epan_dissect_run_with_taps(&edt, &cf->phdr, buffer_start_ptr(&cf->buf), fdata, NULL); + epan_dissect_run_with_taps(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL); epan_dissect_cleanup(&edt); remove_tap_listener(&th); diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index 0eeb4a1588..44bb090378 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -45,6 +45,8 @@ #include "wsutil/str_util.h" +#include "frame_tvbuff.h" + #include <QTreeWidget> #include <QTabWidget> #include <QTextEdit> @@ -578,7 +580,7 @@ QString &PacketList::getFilterFromRowAndColumn() epan_dissect_init(&edt, have_custom_cols(&cap_file_->cinfo), FALSE); col_custom_prime_edt(&edt, &cap_file_->cinfo); - epan_dissect_run(&edt, &cap_file_->phdr, buffer_start_ptr(&cap_file_->buf), fdata, &cap_file_->cinfo); + epan_dissect_run(&edt, &cap_file_->phdr, frame_tvbuff_new_buffer(fdata, &cap_file_->buf), fdata, &cap_file_->cinfo); epan_dissect_fill_in_columns(&edt, TRUE, TRUE); if ((cap_file_->cinfo.col_custom_occurrence[ctx_column_]) || diff --git a/ui/qt/packet_list_model.cpp b/ui/qt/packet_list_model.cpp index 28d65c385e..3f7d00221e 100644 --- a/ui/qt/packet_list_model.cpp +++ b/ui/qt/packet_list_model.cpp @@ -34,6 +34,7 @@ #include "color.h" #include "color_filters.h" +#include "frame_tvbuff.h" #include "wireshark_application.h" #include <QColor> @@ -247,7 +248,7 @@ QVariant PacketListModel::data(const QModelIndex &index, int role) const if (dissect_columns) col_custom_prime_edt(&edt, cinfo); - epan_dissect_run(&edt, &phdr, buffer_start_ptr(&buf), fdata, cinfo); + epan_dissect_run(&edt, &phdr, frame_tvbuff_new_buffer(fdata, &buf), fdata, cinfo); if (enable_color_) fdata->color_filter = color_filters_colorize_packet(&edt); |