diff options
author | Pavel Odintsov <pavel.odintsov@gmail.com> | 2016-02-17 14:13:04 +0300 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2016-02-27 17:16:23 +0000 |
commit | dbe1d13ea4347f148e22b9450687e9c22a3cfd39 (patch) | |
tree | dd901f193adcee4f1a8c8aa18ccf1bf7f62798bc /epan | |
parent | d4dd4fd8481a2059713619a3e0d28ced7edbdf31 (diff) |
sFlow v5: Add original packet header length to protocol tree.
Change-Id: I05af7d55fac139b462895d3a219c94ea2e8359c4
Reviewed-on: https://code.wireshark.org/review/13982
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-sflow.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/epan/dissectors/packet-sflow.c b/epan/dissectors/packet-sflow.c index 59ff00411a..982226c200 100644 --- a/epan/dissectors/packet-sflow.c +++ b/epan/dissectors/packet-sflow.c @@ -570,6 +570,7 @@ static int hf_sflow_5_extended_80211_rx_version = -1; static int hf_sflow_flow_sample_dropped_packets = -1; static int hf_sflow_counters_sample_expanded_source_id_index = -1; static int hf_sflow_245_header_payload_removed = -1; +static int hf_sflow_245_original_packet_header_length = -1; static int hf_sflow_245_ethernet_destination_mac_address = -1; static int hf_sflow_counters_sample_source_id_class = -1; static int hf_sflow_5_extended_url_url_length = -1; @@ -641,7 +642,7 @@ static gint dissect_sflow_245_sampled_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, volatile gint offset) { guint32 version, header_proto, frame_length; - volatile guint32 header_length; + guint32 header_length; tvbuff_t *next_tvb; proto_tree *sflow_245_header_tree; proto_item *ti; @@ -664,7 +665,7 @@ dissect_sflow_245_sampled_header(tvbuff_t *tvb, packet_info *pinfo, offset += 4; } - header_length = tvb_get_ntohl(tvb, offset); + proto_tree_add_item_ret_uint(tree, hf_sflow_245_original_packet_header_length, tvb, offset, 4, ENC_BIG_ENDIAN, &header_length); offset += 4; if (header_length % 4) /* XDR requires 4-byte alignment */ @@ -3011,6 +3012,11 @@ proto_register_sflow(void) { FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_sflow_245_original_packet_header_length, + { "Original packet length", "sflow_245.header.original_packet_header_length", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, { &hf_sflow_245_extended_mpls_in_label_stack_entries, { "In Label Stack Entries", "sflow_245.extended_mpls.in_label_stack_entries", FT_UINT32, BASE_DEC, NULL, 0x0, |