aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk/iax2_analysis.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-05-24 11:28:30 -0700
committerGuy Harris <guy@alum.mit.edu>2014-05-24 18:31:25 +0000
commit6db77b000fe58173eeed23b91b32c92c681feda2 (patch)
tree5113821a7f5e1b43734eccf94783d37962b37712 /ui/gtk/iax2_analysis.c
parent33ae4cb024e36192ff7c6fa1d3d6bdcce9b25b7a (diff)
Allow wtap_read() and wtap_seek_read() to return records other than packets.
Add a "record type" field to "struct wtap_pkthdr"; currently, it can be REC_TYPE_PACKET, for a record containing a packet, or REC_TYPE_FILE_TYPE_SPECIFIC, for records containing file-type-specific data. Modify code that reads packets to be able to handle non-packet records, even if that just means ignoring them. Rename some routines to indicate that they handle more than just packets. We don't yet have any libwiretap code that supplies records other than REC_TYPE_PACKET or that supporting writing records other than REC_TYPE_PACKET, or any code to support plugins for handling REC_TYPE_FILE_TYPE_SPECIFIC records; this is just the first step for bug 8590. Change-Id: Idb40b78f17c2c3aea72031bcd252abf9bc11c813 Reviewed-on: https://code.wireshark.org/review/1773 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/gtk/iax2_analysis.c')
-rw-r--r--ui/gtk/iax2_analysis.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/ui/gtk/iax2_analysis.c b/ui/gtk/iax2_analysis.c
index 6f7fe77c73..d132bf35e8 100644
--- a/ui/gtk/iax2_analysis.c
+++ b/ui/gtk/iax2_analysis.c
@@ -3688,7 +3688,6 @@ void iax2_analysis_cb(GtkAction *action _U_, gpointer user_data _U_)
gchar filter_text[256];
dfilter_t *sfcode;
capture_file *cf;
- gboolean frame_matched;
frame_data *fdata;
GList *strinfo_list;
GList *filtered_list = NULL;
@@ -3710,17 +3709,16 @@ void iax2_analysis_cb(GtkAction *action _U_, gpointer user_data _U_)
if (fdata == NULL)
return; /* if we exit here it's an error */
- /* dissect the current frame */
- if (!cf_read_frame(cf, fdata))
- return; /* error reading the frame */
+ /* dissect the current record */
+ if (!cf_read_record(cf, fdata))
+ return; /* error reading the record */
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);
- /* if it is not an iax2 frame, show an error dialog */
- frame_matched = dfilter_apply_edt(sfcode, &edt);
- if (frame_matched != 1) {
+ /* if it is not an iax2 packet, show an error dialog */
+ if (!dfilter_apply_edt(sfcode, &edt)) {
epan_dissect_cleanup(&edt);
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Please select an IAX2 packet.");