diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-12-08 00:30:55 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-12-08 08:31:41 +0000 |
commit | 8aa14236f8b0ea69901ea9ed87ebabd0d278e973 (patch) | |
tree | b49b5d6b0ee5d647cf33054c5f280d2dc4fa4f99 /sharkd.c | |
parent | f29b3deb6d867b16fb8bc4bd5f66a5b6326a6727 (diff) | |
download | wireshark-8aa14236f8b0ea69901ea9ed87ebabd0d278e973.tar.gz wireshark-8aa14236f8b0ea69901ea9ed87ebabd0d278e973.tar.bz2 wireshark-8aa14236f8b0ea69901ea9ed87ebabd0d278e973.zip |
Have the frame_tvbuff.c routines not use the global cfile.
Have the routines that create them take a pointer to a struct
packet_provider_data, store that in the tvbuff data, and use it to get
the wtap from which packets are being read.
While we're at it, don't include globals.h in any header files, and
include it in source files iff the source file actually uses cfile. Add
whatever includes that requires.
Change-Id: I9f1ee391f951dc427ff62c80f67aa4877a37c229
Reviewed-on: https://code.wireshark.org/review/24733
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'sharkd.c')
-rw-r--r-- | sharkd.c | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -301,7 +301,9 @@ process_packet(capture_file *cf, epan_dissect_t *edt, cf->provider.ref = &ref_frame; } - epan_dissect_run(edt, cf->cd_t, whdr, frame_tvbuff_new(&fdlocal, pd), &fdlocal, NULL); + epan_dissect_run(edt, cf->cd_t, whdr, + frame_tvbuff_new(&cf->provider, &fdlocal, pd), + &fdlocal, NULL); /* Run the read filter if we have one. */ if (cf->rfcode) @@ -569,7 +571,9 @@ sharkd_dissect_request(unsigned int framenum, void (*cb)(epan_dissect_t *, proto * XXX - need to catch an OutOfMemoryError exception and * attempt to recover from it. */ - epan_dissect_run(&edt, cfile.cd_t, &phdr, frame_tvbuff_new_buffer(fdata, &buf), fdata, cinfo); + epan_dissect_run(&edt, cfile.cd_t, &phdr, + frame_tvbuff_new_buffer(&cfile.provider, fdata, &buf), + fdata, cinfo); if (cinfo) { /* "Stringify" non frame_data vals */ @@ -621,7 +625,9 @@ sharkd_dissect_columns(frame_data *fdata, column_info *cinfo, gboolean dissect_c * XXX - need to catch an OutOfMemoryError exception and * attempt to recover from it. */ - epan_dissect_run(&edt, cfile.cd_t, &phdr, frame_tvbuff_new_buffer(fdata, &buf), fdata, cinfo); + epan_dissect_run(&edt, cfile.cd_t, &phdr, + frame_tvbuff_new_buffer(&cfile.provider, fdata, &buf), + fdata, cinfo); if (cinfo) { /* "Stringify" non frame_data vals */ @@ -678,7 +684,9 @@ sharkd_retap(void) if (!wtap_seek_read(cfile.provider.wth, fdata->file_off, &phdr, &buf, &err, &err_info)) break; - epan_dissect_run_with_taps(&edt, cfile.cd_t, &phdr, frame_tvbuff_new(fdata, ws_buffer_start_ptr(&buf)), fdata, cinfo); + epan_dissect_run_with_taps(&edt, cfile.cd_t, &phdr, + frame_tvbuff_new(&cfile.provider, fdata, ws_buffer_start_ptr(&buf)), + fdata, cinfo); epan_dissect_reset(&edt); } @@ -736,7 +744,9 @@ sharkd_filter(const char *dftext, guint8 **result) /* frame_data_set_before_dissect */ epan_dissect_prime_with_dfilter(&edt, dfcode); - epan_dissect_run(&edt, cfile.cd_t, &phdr, frame_tvbuff_new_buffer(fdata, &buf), fdata, NULL); + epan_dissect_run(&edt, cfile.cd_t, &phdr, + frame_tvbuff_new_buffer(&cfile.provider, fdata, &buf), + fdata, NULL); if (dfilter_apply_edt(dfcode, &edt)) passed_bits |= (1 << (framenum % 8)); |