diff options
author | Michael Mann <mmann78@netscape.net> | 2015-01-03 21:56:16 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-01-04 16:32:03 +0000 |
commit | 553da374461efb87436dbbed7d319d252d4fe2e6 (patch) | |
tree | 1f581449dc0a022f8feb4f2088aec6fb47fd023f /epan/dissectors/packet-zbee-zcl-general.c | |
parent | 2085bbec9d0e4661af77a6e9530cffd5df15ecc8 (diff) |
Create BASE_DOT, BASE_DASH, and BASE_SEMICOLON types for the FT_BYTES field type.
These "bases" will put a ".", "-", or ":" respectively between hexidecimal bytes in the field in packet view and display filter. FT_BYTES with BASE_NONE will have no separator in the packet view, but continue to have the ':' as a separator in the display filter.
Converted the "string" hf_ entries that used tvb_fc_to_str as a string to use proto_tree_add_item with FT_BYTES/BASE_DOT type.
Converted applicable tvb_bytes_to_ep_str_punct() calls to use the new BASE values.
Change-Id: I2442185bb314d04a3ff2ba57883652ecd738b5f9
Reviewed-on: https://code.wireshark.org/review/6098
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-zbee-zcl-general.c')
-rw-r--r-- | epan/dissectors/packet-zbee-zcl-general.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/epan/dissectors/packet-zbee-zcl-general.c b/epan/dissectors/packet-zbee-zcl-general.c index 7ef8a72253..32d0ef3d0c 100644 --- a/epan/dissectors/packet-zbee-zcl-general.c +++ b/epan/dissectors/packet-zbee-zcl-general.c @@ -1201,7 +1201,6 @@ static void dissect_zcl_part_trasfpartframe(tvbuff_t *tvb, proto_tree *tree, gui guint8 options; guint16 u16len; guint8 frame_len; - guint8 *data_frame; static const int * part_opt[] = { &hf_zbee_zcl_part_opt_first_block, @@ -1238,8 +1237,7 @@ static void dissect_zcl_part_trasfpartframe(tvbuff_t *tvb, proto_tree *tree, gui *offset += 1; /* Retrieve "PartitionedFrame" field */ - data_frame = tvb_bytes_to_ep_str_punct(tvb, *offset, frame_len, ':'); - proto_tree_add_string(tree, hf_zbee_zcl_part_part_frame, tvb, *offset, frame_len, data_frame); + proto_tree_add_item(tree, hf_zbee_zcl_part_part_frame, tvb, *offset, frame_len, ENC_NA); *offset += frame_len; } /*dissect_zcl_part_trasfpartframe*/ @@ -1457,7 +1455,7 @@ void proto_register_zbee_zcl_part(void) 0x00, NULL, HFILL } }, { &hf_zbee_zcl_part_part_frame, - { "Partition Frame", "zbee_zcl_general.part.part_frame", FT_STRING, BASE_NONE, NULL, + { "Partition Frame", "zbee_zcl_general.part.part_frame", FT_BYTES, BASE_SEMICOLON, NULL, 0x00, NULL, HFILL } }, { &hf_zbee_zcl_part_partitioned_cluster_id, @@ -2155,7 +2153,6 @@ dissect_zcl_ota_imageblockrsp(tvbuff_t *tvb, proto_tree *tree, guint *offset) { guint8 status; guint8 data_size; - guint8 *image_data; /* Retrieve 'Status' field */ status = tvb_get_guint8(tvb, *offset); @@ -2184,8 +2181,7 @@ dissect_zcl_ota_imageblockrsp(tvbuff_t *tvb, proto_tree *tree, guint *offset) *offset += 1; /* Retrieve 'Image Data' field */ - image_data = tvb_bytes_to_ep_str_punct(tvb, *offset, data_size, ':'); - proto_tree_add_string(tree, hf_zbee_zcl_ota_image_data, tvb, *offset, data_size, image_data); + proto_tree_add_item(tree, hf_zbee_zcl_ota_image_data, tvb, *offset, data_size, ENC_NA); *offset += data_size; } else if (status == ZBEE_ZCL_STAT_OTA_WAIT_FOR_DATA) { @@ -2667,7 +2663,7 @@ void proto_register_zbee_zcl_ota(void) 0x00, NULL, HFILL } }, { &hf_zbee_zcl_ota_image_data, - { "Image Data", "zbee_zcl_general.ota.image.data", FT_STRING, BASE_NONE, NULL, + { "Image Data", "zbee_zcl_general.ota.image.data", FT_BYTES, BASE_SEMICOLON, NULL, 0x00, NULL, HFILL } } }; |