tshark: add support for field alias when specifying a list of fields to display

The ek/pdml/json output will display the new filter name and not the
aliased older one
This commit is contained in:
Pascal Quantin 2023-06-13 21:49:45 +02:00 committed by John Thacker
parent aa54f33700
commit 274e67998e
1 changed files with 7 additions and 1 deletions

View File

@ -1344,7 +1344,13 @@ main(int argc, char *argv[])
break;
case 'e':
/* Field entry */
output_fields_add(output_fields, ws_optarg);
{
header_field_info *hfi = proto_registrar_get_byalias(ws_optarg);
if (hfi)
output_fields_add(output_fields, hfi->abbrev);
else
output_fields_add(output_fields, ws_optarg);
}
break;
case 'E':
/* Field option */