From 2ec4f9e91612934c7c60dca4035db0112a8217c2 Mon Sep 17 00:00:00 2001 From: etxrab Date: Wed, 26 May 2010 19:11:23 +0000 Subject: From Jakub Zawadzki: New functions: cf_read_frame_r, cf_read_frame It's much easier to write: cf_read_frame (cf, fdata, &err, &err_info) Than: wtap_seek_read (cf->wth, fdata->file_off, &cf->pseudo_header, cf->pd, fdata->cap_len, &err, &err_info) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32980 f5534014-38df-0310-8fa8-9805f1628bb7 --- gtk/iax2_analysis.c | 3 +-- gtk/main.c | 3 +-- gtk/packet_list_store.c | 3 +-- gtk/packet_win.c | 3 +-- gtk/rtp_analysis.c | 3 +-- gtk/sctp_assoc_analyse.c | 3 +-- gtk/tcp_graph.c | 3 +-- 7 files changed, 7 insertions(+), 14 deletions(-) (limited to 'gtk') diff --git a/gtk/iax2_analysis.c b/gtk/iax2_analysis.c index 4bd35c3356..2061e14d0a 100644 --- a/gtk/iax2_analysis.c +++ b/gtk/iax2_analysis.c @@ -3413,8 +3413,7 @@ static void iax2_analysis_cb(GtkWidget *w _U_, gpointer data _U_) return; /* if we exit here it's an error */ /* dissect the current frame */ - if (!wtap_seek_read(cf->wth, fdata->file_off, &cf->pseudo_header, - cf->pd, fdata->cap_len, &err, &err_info)) { + if (!cf_read_frame(cf, fdata, &err, &err_info)) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, cf_read_error_message(err, err_info), cf->filename); return; diff --git a/gtk/main.c b/gtk/main.c index 8cab7ee277..5548c52ae4 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -590,8 +590,7 @@ get_filter_from_packet_list_row_and_column(gpointer data) if (fdata != NULL) { epan_dissect_t edt; - if (!wtap_seek_read(cfile.wth, fdata->file_off, &cfile.pseudo_header, - cfile.pd, fdata->cap_len, &err, &err_info)) { + if (!cf_read_frame(&cfile, fdata, &err, &err_info)) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, cf_read_error_message(err, err_info), cfile.filename); return NULL; diff --git a/gtk/packet_list_store.c b/gtk/packet_list_store.c index fae8f8bec9..269dae14d3 100644 --- a/gtk/packet_list_store.c +++ b/gtk/packet_list_store.c @@ -1097,8 +1097,7 @@ packet_list_dissect_and_cache_record(PacketList *packet_list, PacketListRecord * else cinfo = NULL; - if (!wtap_seek_read(cfile.wth, fdata->file_off, &pseudo_header, - pd, fdata->cap_len, &err, &err_info)) { + if (!cf_read_frame_r(&cfile, fdata, &pseudo_header, pd, &err, &err_info)) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, cf_read_error_message(err, err_info), cfile.filename); return; diff --git a/gtk/packet_win.c b/gtk/packet_win.c index 2c5b7edfb8..a296f0a816 100644 --- a/gtk/packet_win.c +++ b/gtk/packet_win.c @@ -144,8 +144,7 @@ void new_window_cb(GtkWidget *w _U_) #ifdef NEW_PACKET_LIST /* With the new packetlists "lazy columns" it's neccesary to reread the frame */ - if (!wtap_seek_read(cfile.wth, cfile.current_frame->file_off, &cfile.pseudo_header, - cfile.pd, cfile.current_frame->cap_len, &err, &err_info)) { + if (!cf_read_frame(&cfile, cfile.current_frame, &err, &err_info)) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, cf_read_error_message(err, err_info), cfile.filename); return; diff --git a/gtk/rtp_analysis.c b/gtk/rtp_analysis.c index 1d0d4b8ab4..79d8288754 100644 --- a/gtk/rtp_analysis.c +++ b/gtk/rtp_analysis.c @@ -3636,8 +3636,7 @@ static void rtp_analysis_cb(GtkWidget *w _U_, gpointer data _U_) return; /* if we exit here it's an error */ /* dissect the current frame */ - if (!wtap_seek_read(cf->wth, fdata->file_off, &cf->pseudo_header, - cf->pd, fdata->cap_len, &err, &err_info)) { + if (!cf_read_frame(cf, fdata, &err, &err_info)) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, cf_read_error_message(err, err_info), cf->filename); return; diff --git a/gtk/sctp_assoc_analyse.c b/gtk/sctp_assoc_analyse.c index 29e105a566..a74c49ddca 100644 --- a/gtk/sctp_assoc_analyse.c +++ b/gtk/sctp_assoc_analyse.c @@ -899,8 +899,7 @@ static void sctp_analyse_cb(struct sctp_analyse* u_data, gboolean ext) return; /* if we exit here it's an error */ /* dissect the current frame */ - if (!wtap_seek_read(cf->wth, fdata->file_off, &cf->pseudo_header, - cf->pd, fdata->cap_len, &err, &err_info)) { + if (!cf_read_frame(cf, fdata, &err, &err_info)) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, cf_read_error_message(err, err_info), cf->filename); return; diff --git a/gtk/tcp_graph.c b/gtk/tcp_graph.c index 5eb3db7ef6..45f09cbde9 100644 --- a/gtk/tcp_graph.c +++ b/gtk/tcp_graph.c @@ -1798,8 +1798,7 @@ static struct tcpheader *select_tcpip_session (capture_file *cf, struct segment } /* dissect the current frame */ - if (!wtap_seek_read(cf->wth, fdata->file_off, &cf->pseudo_header, - cf->pd, fdata->cap_len, &err, &err_info)) { + if (!cf_read_frame(cf, fdata, &err, &err_info)) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, cf_read_error_message(err, err_info), cf->filename); return NULL; -- cgit v1.2.3