From 4d2d42310610e736f23466472ca5dd70b7655c7f Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 11 Apr 2017 21:56:14 -0700 Subject: [PATCH] Rename routines to clarify what they do. XXX_prime_with_YYY makes it a bit clearer than does XXX_prime_YYY that we're not priming YYY, we're priming XXX *using* YYY. Change-Id: I1686b8b5469bc0f0bd6db8551fb6301776a1b133 Reviewed-on: https://code.wireshark.org/review/21031 Reviewed-by: Guy Harris --- debian/libwireshark0.symbols | 4 ++-- epan/color_filters.c | 2 +- epan/column-utils.c | 2 +- epan/dfilter/dfilter.c | 2 +- epan/epan.c | 6 +++--- epan/epan.h | 4 ++-- epan/proto.c | 2 +- epan/proto.h | 2 +- epan/tap.c | 2 +- file.c | 6 +++--- rawshark.c | 2 +- sharkd.c | 6 +++--- tfshark.c | 6 +++--- tshark.c | 8 ++++---- ui/gtk/iax2_analysis.c | 2 +- ui/gtk/packet_win.c | 2 +- ui/gtk/rtp_analysis.c | 4 ++-- ui/gtk/sctp_assoc_analyse.c | 2 +- ui/qt/iax2_analysis_dialog.cpp | 2 +- ui/qt/rtp_analysis_dialog.cpp | 4 ++-- ui/tap-rlc-graph.c | 2 +- ui/tap-tcp-stream.c | 2 +- 22 files changed, 37 insertions(+), 37 deletions(-) diff --git a/debian/libwireshark0.symbols b/debian/libwireshark0.symbols index 86816fbba7..1f526cfa9d 100644 --- a/debian/libwireshark0.symbols +++ b/debian/libwireshark0.symbols @@ -486,8 +486,8 @@ libwireshark.so.0 libwireshark0 #MINVER# epan_dissect_init@Base 1.9.1 epan_dissect_new@Base 1.9.1 epan_dissect_packet_contains_field@Base 1.12.0~rc1 - epan_dissect_prime_dfilter@Base 1.9.1 - epan_dissect_prime_hfid@Base 2.1.0 + epan_dissect_prime_with_dfilter@Base 2.3.0 + epan_dissect_prime_with_hfid@Base 2.3.0 epan_dissect_reset@Base 1.12.0~rc1 epan_dissect_run@Base 1.9.1 epan_dissect_run_with_taps@Base 1.9.1 diff --git a/epan/color_filters.c b/epan/color_filters.c index 52809dfd37..6f7e40d51c 100644 --- a/epan/color_filters.c +++ b/epan/color_filters.c @@ -479,7 +479,7 @@ prime_edt(gpointer data, gpointer user_data) epan_dissect_t *edt = (epan_dissect_t *)user_data; if (colorf->c_colorfilter != NULL) - epan_dissect_prime_dfilter(edt, colorf->c_colorfilter); + epan_dissect_prime_with_dfilter(edt, colorf->c_colorfilter); } /* Prime the epan_dissect_t with all the compiler diff --git a/epan/column-utils.c b/epan/column-utils.c index 499f8715b4..05545cab6d 100644 --- a/epan/column-utils.c +++ b/epan/column-utils.c @@ -388,7 +388,7 @@ col_custom_prime_edt(epan_dissect_t *edt, column_info *cinfo) if (col_item->fmt_matx[COL_CUSTOM] && col_item->col_custom_dfilter) { - epan_dissect_prime_dfilter(edt, col_item->col_custom_dfilter); + epan_dissect_prime_with_dfilter(edt, col_item->col_custom_dfilter); } } } diff --git a/epan/dfilter/dfilter.c b/epan/dfilter/dfilter.c index c9b24779a5..d29d600ada 100644 --- a/epan/dfilter/dfilter.c +++ b/epan/dfilter/dfilter.c @@ -426,7 +426,7 @@ dfilter_prime_proto_tree(const dfilter_t *df, proto_tree *tree) int i; for (i = 0; i < df->num_interesting_fields; i++) { - proto_tree_prime_hfid(tree, df->interesting_fields[i]); + proto_tree_prime_with_hfid(tree, df->interesting_fields[i]); } } diff --git a/epan/epan.c b/epan/epan.c index 464cc75cb1..726d2f558c 100644 --- a/epan/epan.c +++ b/epan/epan.c @@ -530,15 +530,15 @@ epan_dissect_free(epan_dissect_t* edt) } void -epan_dissect_prime_dfilter(epan_dissect_t *edt, const dfilter_t* dfcode) +epan_dissect_prime_with_dfilter(epan_dissect_t *edt, const dfilter_t* dfcode) { dfilter_prime_proto_tree(dfcode, edt->tree); } void -epan_dissect_prime_hfid(epan_dissect_t *edt, int hfid) +epan_dissect_prime_with_hfid(epan_dissect_t *edt, int hfid) { - proto_tree_prime_hfid(edt->tree, hfid); + proto_tree_prime_with_hfid(edt->tree, hfid); } /* ----------------------- */ diff --git a/epan/epan.h b/epan/epan.h index 5e7e87cfa4..65fca37988 100644 --- a/epan/epan.h +++ b/epan/epan.h @@ -218,12 +218,12 @@ epan_dissect_file_run_with_taps(epan_dissect_t *edt, struct wtap_pkthdr *phdr, /** Prime an epan_dissect_t's proto_tree using the fields/protocols used in a dfilter. */ WS_DLL_PUBLIC void -epan_dissect_prime_dfilter(epan_dissect_t *edt, const struct epan_dfilter *dfcode); +epan_dissect_prime_with_dfilter(epan_dissect_t *edt, const struct epan_dfilter *dfcode); /** Prime an epan_dissect_t's proto_tree with a field/protocol specified by its hfid */ WS_DLL_PUBLIC void -epan_dissect_prime_hfid(epan_dissect_t *edt, int hfid); +epan_dissect_prime_with_hfid(epan_dissect_t *edt, int hfid); /** fill the dissect run output into the packet list columns */ WS_DLL_PUBLIC diff --git a/epan/proto.c b/epan/proto.c index 330d5a144a..a8f8e5c212 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -5828,7 +5828,7 @@ proto_tree_create_root(packet_info *pinfo) /* "prime" a proto_tree with a single hfid that a dfilter * is interested in. */ void -proto_tree_prime_hfid(proto_tree *tree _U_, const gint hfid) +proto_tree_prime_with_hfid(proto_tree *tree _U_, const gint hfid) { header_field_info *hfinfo; diff --git a/epan/proto.h b/epan/proto.h index c60c36a704..6258958531 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -1020,7 +1020,7 @@ proto_tree_set_fake_protocols(proto_tree *tree, gboolean fake_protocols); @param hfid the interesting field id @todo what *does* interesting mean? */ extern void -proto_tree_prime_hfid(proto_tree *tree, const int hfid); +proto_tree_prime_with_hfid(proto_tree *tree, const int hfid); /** Get a parent item of a subtree. @param tree the tree to get the parent from diff --git a/epan/tap.c b/epan/tap.c index 87f46aca38..3db0d5cc7a 100644 --- a/epan/tap.c +++ b/epan/tap.c @@ -319,7 +319,7 @@ void tap_build_interesting (epan_dissect_t *edt) interesting hf_fields */ for(tl=tap_listener_queue;tl;tl=tl->next){ if(tl->code){ - epan_dissect_prime_dfilter(edt, tl->code); + epan_dissect_prime_with_dfilter(edt, tl->code); } } } diff --git a/file.c b/file.c index 4f3908009f..865b7703b0 100644 --- a/file.c +++ b/file.c @@ -1151,7 +1151,7 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf, cf->prev_cap = fdata; if (dfcode != NULL) { - epan_dissect_prime_dfilter(edt, dfcode); + epan_dissect_prime_with_dfilter(edt, dfcode); } #if 0 /* Prepare coloring rules, this ensures that display filter rules containing @@ -1238,7 +1238,7 @@ read_packet(capture_file *cf, dfilter_t *dfcode, epan_dissect_t *edt, epan_dissect_t rf_edt; epan_dissect_init(&rf_edt, cf->epan, TRUE, FALSE); - epan_dissect_prime_dfilter(&rf_edt, cf->rfcode); + epan_dissect_prime_with_dfilter(&rf_edt, cf->rfcode); 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); @@ -3439,7 +3439,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_prime_with_dfilter(&edt, sfcode); 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); diff --git a/rawshark.c b/rawshark.c index 988d59ae91..60c1e8d12b 100644 --- a/rawshark.c +++ b/rawshark.c @@ -1066,7 +1066,7 @@ process_packet(capture_file *cf, epan_dissect_t *edt, gint64 offset, filter. */ if (n_rfilters > 0) { for(i = 0; i < n_rfcodes; i++) { - epan_dissect_prime_dfilter(edt, rfcodes[i]); + epan_dissect_prime_with_dfilter(edt, rfcodes[i]); } } diff --git a/sharkd.c b/sharkd.c index 666e46a652..ffd9019bdb 100644 --- a/sharkd.c +++ b/sharkd.c @@ -302,10 +302,10 @@ process_packet_first_pass(capture_file *cf, epan_dissect_t *edt, /* If we're running a read filter, prime the epan_dissect_t with that filter. */ if (cf->rfcode) - epan_dissect_prime_dfilter(edt, cf->rfcode); + epan_dissect_prime_with_dfilter(edt, cf->rfcode); if (cf->dfcode) - epan_dissect_prime_dfilter(edt, cf->dfcode); + epan_dissect_prime_with_dfilter(edt, cf->dfcode); frame_data_set_before_dissect(&fdlocal, &cf->elapsed_time, &ref, prev_dis); @@ -907,7 +907,7 @@ sharkd_filter(const char *dftext, guint8 **result) break; /* frame_data_set_before_dissect */ - epan_dissect_prime_dfilter(&edt, dfcode); + epan_dissect_prime_with_dfilter(&edt, dfcode); epan_dissect_run(&edt, cfile.cd_t, &phdr, frame_tvbuff_new_buffer(fdata, &buf), fdata, NULL); diff --git a/tfshark.c b/tfshark.c index 28c2c42ab5..f834159c4b 100644 --- a/tfshark.c +++ b/tfshark.c @@ -1085,7 +1085,7 @@ process_packet_first_pass(capture_file *cf, epan_dissect_t *edt, /* If we're running a read filter, prime the epan_dissect_t with that filter. */ if (cf->rfcode) - epan_dissect_prime_dfilter(edt, cf->rfcode); + epan_dissect_prime_with_dfilter(edt, cf->rfcode); frame_data_set_before_dissect(&fdlocal, &cf->elapsed_time, &ref, prev_dis); @@ -1147,7 +1147,7 @@ process_packet_second_pass(capture_file *cf, epan_dissect_t *edt, frame_data *fd /* If we're running a display filter, prime the epan_dissect_t with that filter. */ if (cf->dfcode) - epan_dissect_prime_dfilter(edt, cf->dfcode); + epan_dissect_prime_with_dfilter(edt, cf->dfcode); col_custom_prime_edt(edt, &cf->cinfo); @@ -1601,7 +1601,7 @@ process_packet(capture_file *cf, epan_dissect_t *edt, gint64 offset, /* If we're running a filter, prime the epan_dissect_t with that filter. */ if (cf->dfcode) - epan_dissect_prime_dfilter(edt, cf->dfcode); + epan_dissect_prime_with_dfilter(edt, cf->dfcode); col_custom_prime_edt(edt, &cf->cinfo); diff --git a/tshark.c b/tshark.c index dee68f3c96..458b08fa35 100644 --- a/tshark.c +++ b/tshark.c @@ -2805,10 +2805,10 @@ process_packet_first_pass(capture_file *cf, epan_dissect_t *edt, /* If we're running a read filter, prime the epan_dissect_t with that filter. */ if (cf->rfcode) - epan_dissect_prime_dfilter(edt, cf->rfcode); + epan_dissect_prime_with_dfilter(edt, cf->rfcode); if (cf->dfcode) - epan_dissect_prime_dfilter(edt, cf->dfcode); + epan_dissect_prime_with_dfilter(edt, cf->dfcode); frame_data_set_before_dissect(&fdlocal, &cf->elapsed_time, &ref, prev_dis); @@ -2880,7 +2880,7 @@ process_packet_second_pass(capture_file *cf, epan_dissect_t *edt, frame_data *fd /* If we're running a display filter, prime the epan_dissect_t with that filter. */ if (cf->dfcode) - epan_dissect_prime_dfilter(edt, cf->dfcode); + epan_dissect_prime_with_dfilter(edt, cf->dfcode); col_custom_prime_edt(edt, &cf->cinfo); @@ -3555,7 +3555,7 @@ process_packet(capture_file *cf, epan_dissect_t *edt, gint64 offset, struct wtap /* If we're running a filter, prime the epan_dissect_t with that filter. */ if (cf->dfcode) - epan_dissect_prime_dfilter(edt, cf->dfcode); + epan_dissect_prime_with_dfilter(edt, cf->dfcode); col_custom_prime_edt(edt, &cf->cinfo); diff --git a/ui/gtk/iax2_analysis.c b/ui/gtk/iax2_analysis.c index 19b8e633b6..a4d3b5b8a4 100644 --- a/ui/gtk/iax2_analysis.c +++ b/ui/gtk/iax2_analysis.c @@ -3566,7 +3566,7 @@ void iax2_analysis_cb(GtkAction *action _U_, gpointer user_data _U_) 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_prime_with_dfilter(&edt, sfcode); epan_dissect_run(&edt, cf->cd_t, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL); diff --git a/ui/gtk/packet_win.c b/ui/gtk/packet_win.c index 7459019653..635f305bb5 100644 --- a/ui/gtk/packet_win.c +++ b/ui/gtk/packet_win.c @@ -262,7 +262,7 @@ finfo_window_refresh(struct FieldinfoWinData *DataPtr) epan_dissect_init(&edt, cfile.epan, TRUE, TRUE); /* Makes any sense? if (old_finfo->hfinfo) - proto_tree_prime_hfid(edt.tree, old_finfo->hfinfo->id); + proto_tree_prime_with_hfid(edt.tree, old_finfo->hfinfo->id); */ epan_dissect_run(&edt, cfile.cd_t, &DataPtr->phdr, frame_tvbuff_new(DataPtr->frame, DataPtr->pd), DataPtr->frame, NULL); diff --git a/ui/gtk/rtp_analysis.c b/ui/gtk/rtp_analysis.c index 3decd2e41f..a3f3435631 100644 --- a/ui/gtk/rtp_analysis.c +++ b/ui/gtk/rtp_analysis.c @@ -3897,8 +3897,8 @@ rtp_analysis_cb(GtkAction *action _U_, gpointer user_data _U_) 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_prime_hfid(&edt, hfid_rtp_ssrc); + epan_dissect_prime_with_dfilter(&edt, sfcode); + epan_dissect_prime_with_hfid(&edt, hfid_rtp_ssrc); epan_dissect_run(&edt, cf->cd_t, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL); /* diff --git a/ui/gtk/sctp_assoc_analyse.c b/ui/gtk/sctp_assoc_analyse.c index 23fb5159e1..b942cf3b72 100644 --- a/ui/gtk/sctp_assoc_analyse.c +++ b/ui/gtk/sctp_assoc_analyse.c @@ -1000,7 +1000,7 @@ sctp_analyse_cb(struct sctp_analyse *u_data, gboolean ext) return; /* error reading the record */ epan_dissect_init(&edt, cf->epan, TRUE, FALSE); - epan_dissect_prime_dfilter(&edt, sfcode); + epan_dissect_prime_with_dfilter(&edt, sfcode); epan_dissect_run(&edt, cf->cd_t, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL); /* if it is not an sctp packet, show the dialog */ diff --git a/ui/qt/iax2_analysis_dialog.cpp b/ui/qt/iax2_analysis_dialog.cpp index c15ae044f4..ee4e5fdfe0 100644 --- a/ui/qt/iax2_analysis_dialog.cpp +++ b/ui/qt/iax2_analysis_dialog.cpp @@ -333,7 +333,7 @@ Iax2AnalysisDialog::Iax2AnalysisDialog(QWidget &parent, CaptureFile &cf) : epan_dissect_t edt; epan_dissect_init(&edt, cap_file_.capFile()->epan, TRUE, FALSE); - epan_dissect_prime_dfilter(&edt, sfcode); + epan_dissect_prime_with_dfilter(&edt, sfcode); epan_dissect_run(&edt, cap_file_.capFile()->cd_t, &cap_file_.capFile()->phdr, frame_tvbuff_new_buffer(fdata, &cap_file_.capFile()->buf), fdata, NULL); diff --git a/ui/qt/rtp_analysis_dialog.cpp b/ui/qt/rtp_analysis_dialog.cpp index e30b9dd44c..5d82e46772 100644 --- a/ui/qt/rtp_analysis_dialog.cpp +++ b/ui/qt/rtp_analysis_dialog.cpp @@ -1604,8 +1604,8 @@ void RtpAnalysisDialog::findStreams() epan_dissect_t edt; epan_dissect_init(&edt, cap_file_.capFile()->epan, TRUE, FALSE); - epan_dissect_prime_dfilter(&edt, sfcode); - epan_dissect_prime_hfid(&edt, hfid_rtp_ssrc); + epan_dissect_prime_with_dfilter(&edt, sfcode); + epan_dissect_prime_with_hfid(&edt, hfid_rtp_ssrc); epan_dissect_run(&edt, cap_file_.capFile()->cd_t, &cap_file_.capFile()->phdr, frame_tvbuff_new_buffer(fdata, &cap_file_.capFile()->buf), fdata, NULL); diff --git a/ui/tap-rlc-graph.c b/ui/tap-rlc-graph.c index e5bb6cfeb5..5ff9676e9d 100644 --- a/ui/tap-rlc-graph.c +++ b/ui/tap-rlc-graph.c @@ -145,7 +145,7 @@ rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf, } epan_dissect_init(&edt, cf->epan, TRUE, FALSE); - epan_dissect_prime_dfilter(&edt, sfcode); + epan_dissect_prime_with_dfilter(&edt, sfcode); epan_dissect_run_with_taps(&edt, cf->cd_t, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL); rel_ts = edt.pi.rel_ts; epan_dissect_cleanup(&edt); diff --git a/ui/tap-tcp-stream.c b/ui/tap-tcp-stream.c index 44115aa99f..69b7a87ee7 100644 --- a/ui/tap-tcp-stream.c +++ b/ui/tap-tcp-stream.c @@ -318,7 +318,7 @@ select_tcpip_session(capture_file *cf, struct segment *hdrs) } epan_dissect_init(&edt, cf->epan, TRUE, FALSE); - epan_dissect_prime_dfilter(&edt, sfcode); + epan_dissect_prime_with_dfilter(&edt, sfcode); epan_dissect_run_with_taps(&edt, cf->cd_t, &cf->phdr, frame_tvbuff_new_buffer(fdata, &cf->buf), fdata, NULL); rel_ts = edt.pi.rel_ts; epan_dissect_cleanup(&edt);