diff options
author | Roland Knall <roland.knall@br-automation.com> | 2016-07-05 16:01:10 +0200 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2016-07-05 15:27:03 +0000 |
commit | d2456988df66b00bd81da9c08b20d932c586a38f (patch) | |
tree | 5f1ad33f720bc3e88c210a1997e3eb6e2a669ace /epan/dissectors/packet-opensafety.c | |
parent | 5cc5ba625f64254896a8ebb61d679798362eceb7 (diff) |
openSAFETY: Add byte offset of frame
Add the absolute byte offset of each openSAFETY frame to
dissection, so a change in the offset can be easily detected
Change-Id: Ib935eff7ba1e2e1169cb9071a5c9703cc58fc123
Reviewed-on: https://code.wireshark.org/review/16301
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-opensafety.c')
-rw-r--r-- | epan/dissectors/packet-opensafety.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/epan/dissectors/packet-opensafety.c b/epan/dissectors/packet-opensafety.c index 0b8c9ee91c..eaaa84731b 100644 --- a/epan/dissectors/packet-opensafety.c +++ b/epan/dissectors/packet-opensafety.c @@ -140,6 +140,7 @@ static int hf_oss_msg_sender = -1; static int hf_oss_msg_receiver = -1; static int hf_oss_length= -1; static int hf_oss_crc = -1; +static int hf_oss_byte_offset = -1; static int hf_oss_crc_valid = -1; static int hf_oss_crc2_valid = -1; @@ -1788,6 +1789,9 @@ dissect_opensafety_message(opensafety_packet_info *packet, val_to_str(packet->msg_id, opensafety_message_type_values, "Unknown Message (0x%02X) ")); } + item = proto_tree_add_uint(opensafety_tree, hf_oss_byte_offset, packet->frame.frame_tvb, 0, 1, packet->frame.byte_offset); + PROTO_ITEM_SET_GENERATED(item); + if ( packet->msg_type == OPENSAFETY_SNMT_MESSAGE_TYPE ) { proto_item_append_text(opensafety_item, ", SNMT"); @@ -2181,6 +2185,7 @@ opensafety_package_dissector(const gchar *protocolName, const gchar *sub_diss_ha packet->msg_type = type; packet->frame.frame_tvb = next_tvb; + packet->frame.byte_offset = frameOffset + tvb_raw_offset(message_tvb); packet->frame.subframe1 = frameStart1; packet->frame.subframe2 = frameStart2; packet->frame.length = frameLength; @@ -2420,6 +2425,9 @@ proto_register_opensafety(void) { "SCM UDID Valid", "opensafety.scm_udid.valid", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_oss_byte_offset, + { "Byte Offset", "opensafety.msg.byte_offset", + FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_oss_msg, { "Message", "opensafety.msg.id", FT_UINT8, BASE_HEX, VALS(opensafety_message_type_values), 0x0, NULL, HFILL } }, |