aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-05-24 17:04:44 -0700
committerGuy Harris <guy@alum.mit.edu>2014-05-25 00:05:07 +0000
commit318cf8a6782d8911c7c2891c395062f98eb0a316 (patch)
treec078f54d1ac8b39bb0b8bbe99226394bbcb98055 /file.c
parent6dffc3b7e364b7446c30db54d2193476a5f0fa93 (diff)
Add support for dissecting non-packet records.
Add a dissector table indexed by the file type, and, for the file-type-specific records, have the frame dissector skip the usual pseudo-header processing, as the pseudo-header has a file-type-specific record subtype in it, and call the dissector for that file type's records. Change-Id: Ibe97cf6340ffb0dabc08f355891bc346391b91f9 Reviewed-on: https://code.wireshark.org/review/1782 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'file.c')
-rw-r--r--file.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/file.c b/file.c
index 7630989115..b56718c81f 100644
--- a/file.c
+++ b/file.c
@@ -1176,7 +1176,7 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
}
/* Dissect the frame. */
- epan_dissect_run_with_taps(edt, phdr, frame_tvbuff_new(fdata, buf), fdata, cinfo);
+ epan_dissect_run_with_taps(edt, cf->cd_t, phdr, frame_tvbuff_new(fdata, buf), fdata, cinfo);
/* If we don't have a display filter, set "passed_dfilter" to 1. */
if (dfcode != NULL) {
@@ -1263,7 +1263,7 @@ read_packet(capture_file *cf, dfilter_t *dfcode, epan_dissect_t *edt,
epan_dissect_init(&rf_edt, cf->epan, TRUE, FALSE);
epan_dissect_prime_dfilter(&rf_edt, cf->rfcode);
- epan_dissect_run(&rf_edt, phdr, frame_tvbuff_new(&fdlocal, buf), &fdlocal, NULL);
+ epan_dissect_run(&rf_edt, cf->cd_t, phdr, frame_tvbuff_new(&fdlocal, buf), &fdlocal, NULL);
passed = dfilter_apply_edt(cf->rfcode, &rf_edt);
epan_dissect_cleanup(&rf_edt);
}
@@ -2361,13 +2361,13 @@ typedef struct {
} retap_callback_args_t;
static gboolean
-retap_packet(capture_file *cf _U_, frame_data *fdata,
+retap_packet(capture_file *cf, frame_data *fdata,
struct wtap_pkthdr *phdr, const guint8 *pd,
void *argsp)
{
retap_callback_args_t *args = (retap_callback_args_t *)argsp;
- epan_dissect_run_with_taps(&args->edt, phdr, frame_tvbuff_new(fdata, pd), fdata, args->cinfo);
+ epan_dissect_run_with_taps(&args->edt, cf->cd_t, phdr, frame_tvbuff_new(fdata, pd), fdata, args->cinfo);
epan_dissect_reset(&args->edt);
return TRUE;
@@ -2469,10 +2469,10 @@ print_packet(capture_file *cf, frame_data *fdata,
information. */
if (args->print_args->print_summary) {
col_custom_prime_edt(&args->edt, &cf->cinfo);
- epan_dissect_run(&args->edt, phdr, frame_tvbuff_new(fdata, pd), fdata, &cf->cinfo);
+ epan_dissect_run(&args->edt, cf->cd_t, phdr, frame_tvbuff_new(fdata, pd), fdata, &cf->cinfo);
epan_dissect_fill_in_columns(&args->edt, FALSE, TRUE);
} else
- epan_dissect_run(&args->edt, phdr, frame_tvbuff_new(fdata, pd), fdata, NULL);
+ epan_dissect_run(&args->edt, cf->cd_t, phdr, frame_tvbuff_new(fdata, pd), fdata, NULL);
if (args->print_formfeed) {
if (!new_page(args->print_args->stream))
@@ -2776,14 +2776,14 @@ typedef struct {
} write_packet_callback_args_t;
static gboolean
-write_pdml_packet(capture_file *cf _U_, frame_data *fdata,
+write_pdml_packet(capture_file *cf, frame_data *fdata,
struct wtap_pkthdr *phdr, const guint8 *pd,
void *argsp)
{
write_packet_callback_args_t *args = (write_packet_callback_args_t *)argsp;
/* Create the protocol tree, but don't fill in the column information. */
- epan_dissect_run(&args->edt, phdr, frame_tvbuff_new(fdata, pd), fdata, NULL);
+ epan_dissect_run(&args->edt, cf->cd_t, phdr, frame_tvbuff_new(fdata, pd), fdata, NULL);
/* Write out the information in that tree. */
proto_tree_write_pdml(&args->edt, args->fh);
@@ -2857,7 +2857,7 @@ write_psml_packet(capture_file *cf, frame_data *fdata,
write_packet_callback_args_t *args = (write_packet_callback_args_t *)argsp;
col_custom_prime_edt(&args->edt, &cf->cinfo);
- epan_dissect_run(&args->edt, phdr, frame_tvbuff_new(fdata, pd), fdata, &cf->cinfo);
+ epan_dissect_run(&args->edt, cf->cd_t, phdr, frame_tvbuff_new(fdata, pd), fdata, &cf->cinfo);
epan_dissect_fill_in_columns(&args->edt, FALSE, TRUE);
/* Write out the information in that tree. */
@@ -2939,7 +2939,7 @@ write_csv_packet(capture_file *cf, frame_data *fdata,
/* Fill in the column information */
col_custom_prime_edt(&args->edt, &cf->cinfo);
- epan_dissect_run(&args->edt, phdr, frame_tvbuff_new(fdata, pd), fdata, &cf->cinfo);
+ epan_dissect_run(&args->edt, cf->cd_t, phdr, frame_tvbuff_new(fdata, pd), fdata, &cf->cinfo);
epan_dissect_fill_in_columns(&args->edt, FALSE, TRUE);
/* Write out the information in that tree. */
@@ -3011,13 +3011,13 @@ cf_write_csv_packets(capture_file *cf, print_args_t *print_args)
}
static gboolean
-write_carrays_packet(capture_file *cf _U_, frame_data *fdata,
+write_carrays_packet(capture_file *cf, frame_data *fdata,
struct wtap_pkthdr *phdr,
const guint8 *pd, void *argsp)
{
write_packet_callback_args_t *args = (write_packet_callback_args_t *)argsp;
- epan_dissect_run(&args->edt, phdr, frame_tvbuff_new(fdata, pd), fdata, NULL);
+ epan_dissect_run(&args->edt, cf->cd_t, phdr, frame_tvbuff_new(fdata, pd), fdata, NULL);
proto_tree_write_carrays(fdata->num, args->fh, &args->edt);
epan_dissect_reset(&args->edt);
@@ -3117,7 +3117,7 @@ match_protocol_tree(capture_file *cf, frame_data *fdata, void *criterion)
/* Construct the protocol tree, including the displayed text */
epan_dissect_init(&edt, cf->epan, TRUE, TRUE);
/* We don't need the column information */
- epan_dissect_run(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
+ epan_dissect_run(&edt, cf->cd_t, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
/* Iterate through all the nodes, seeing if they have text that matches. */
mdata->cf = cf;
@@ -3221,7 +3221,7 @@ match_summary_line(capture_file *cf, frame_data *fdata, void *criterion)
/* Don't bother constructing the protocol tree */
epan_dissect_init(&edt, cf->epan, FALSE, FALSE);
/* Get the column information */
- epan_dissect_run(&edt, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata,
+ epan_dissect_run(&edt, cf->cd_t, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata,
&cf->cinfo);
/* Find the Info column */
@@ -3529,7 +3529,7 @@ match_dfilter(capture_file *cf, frame_data *fdata, void *criterion)
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);
+ epan_dissect_run(&edt, cf->cd_t, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL);
result = dfilter_apply_edt(sfcode, &edt) ? MR_MATCHED : MR_NOTMATCHED;
epan_dissect_cleanup(&edt);
return result;
@@ -3862,7 +3862,7 @@ cf_select_packet(capture_file *cf, int row)
cf->edt = epan_dissect_new(cf->epan, TRUE, TRUE);
tap_build_interesting(cf->edt);
- epan_dissect_run(cf->edt, &cf->phdr, frame_tvbuff_new_buffer(cf->current_frame, &cf->buf),
+ epan_dissect_run(cf->edt, cf->cd_t, &cf->phdr, frame_tvbuff_new_buffer(cf->current_frame, &cf->buf),
cf->current_frame, NULL);
dfilter_macro_build_ftv_cache(cf->edt->tree);