Include transport protocols' hfids in the list of wanted hfids.

We need to get the fields corresponding to those protocols, so we know
the range within the packet that those protocols cover.

Improve a debugging message while we're at it.

Bug: 15208
Change-Id: Idc329079584e8d035622b148503a2ec1a295ccaa
Reviewed-on: https://code.wireshark.org/review/30280
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2018-10-20 01:56:59 -07:00
parent 7e88bb5e53
commit 69b5325044
2 changed files with 8 additions and 1 deletions

View File

@ -666,7 +666,7 @@ static void get_pdu_fields(gpointer k, gpointer v, gpointer p) {
start = fi->start;
end = fi->start + fi->length;
dbg_print(dbg_pdu,5,dbg_facility,"get_pdu_fields: found field %i-%i",start,end);
dbg_print(dbg_pdu,5,dbg_facility,"get_pdu_fields: found field %s, %i-%i, length %i", fi->hfinfo->abbrev, start, end, fi->length);
for (j = 0; j < data->ranges->len; j++) {

View File

@ -298,6 +298,13 @@ static void analyze_pdu_config(mate_config* mc, mate_cfg_pdu* cfg) {
arg.cfg = cfg;
g_hash_table_foreach(cfg->hfids_attr,analyze_pdu_hfids,&arg);
/* Add the hfids of transport protocols as wanted hfids */
for (guint i = 0; i < cfg->transport_ranges->len; i++) {
int hfid = *((int*)g_ptr_array_index(cfg->transport_ranges,i));
mc->wanted_hfids = g_array_append_val(mc->wanted_hfids, hfid);
mc->num_fields_wanted++;
}
ett = &cfg->ett;
g_array_append_val(mc->ett,ett);