gryphon: fix handling the ioctl code in a response.

It's not in the response message, it's taken from the request message,
so display it with a zero offset and length, so it doesn't match any
bytes in the packet.

It's a 32-bit field, so make it an FT_UINT32.
This commit is contained in:
Guy Harris 2023-02-21 00:34:05 -08:00
parent e5884912cd
commit a4b61bc069
1 changed files with 9 additions and 5 deletions

View File

@ -4003,11 +4003,16 @@ decode_response(tvbuff_t *tvb, packet_info* pinfo, int offset, int src, proto_tr
p_add_proto_data(wmem_file_scope(), pinfo, proto_gryphon, (guint32)tvb_raw_offset(tvb), pkt_info);
}
/* this is the old original way of displaying */
/*
* This is the old original way of displaying.
*
* XXX - is there some reason not to display the context for ioctl
* commands, and to display the ioctl code here, rather than in
* the part of the tree for the ioctl response?
*/
proto_tree_add_uint(pt, hf_gryphon_command, tvb, offset, 1, cmd);
if (pkt_info->ioctl_command != 0) {
/* N.B. Shown in one byte, but ioctl_command is a 4-byte value */
proto_tree_add_uint(pt, hf_gryphon_cmd_ioctl_context, tvb, offset + 1, 1, pkt_info->ioctl_command);
proto_tree_add_uint(pt, hf_gryphon_cmd_ioctl_context, tvb, 0, 0, pkt_info->ioctl_command);
} else {
proto_tree_add_item(pt, hf_gryphon_cmd_context, tvb, offset + 1, 1, ENC_NA);
}
@ -4379,9 +4384,8 @@ proto_register_gryphon(void)
{ &hf_gryphon_cmd_context,
{ "Context", "gryphon.cmd.context", FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }},
/* N.B. Shown in one byte, but ioctl_command is a 4-byte value */
{ &hf_gryphon_cmd_ioctl_context,
{ "IOCTL Response", "gryphon.cmd.ioctl_response", FT_UINT8, BASE_DEC, VALS(ioctls), 0x0,
{ "IOCTL Response", "gryphon.cmd.ioctl_response", FT_UINT32, BASE_DEC, VALS(ioctls), 0x0,
NULL, HFILL }},
{ &hf_gryphon_data,
{ "Data", "gryphon.data", FT_BYTES, BASE_NONE, NULL, 0x0,