aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-frame.c
diff options
context:
space:
mode:
authorDavid Perry <boolean263@protonmail.com>2021-07-19 21:25:40 +0000
committerGuy Harris <gharris@sonic.net>2021-07-19 21:25:40 +0000
commitdc7089e83110a5dc5dfb5c9a21c95fc3d9cb97f2 (patch)
tree67a33ccd6b0cddb428adc24f35759e0fd136d25f /epan/dissectors/packet-frame.c
parentc7ed8aa3ee25ecb4f4788b0f08fd37e3de2f3473 (diff)
Carry drop count/packet ID/queue ID as options on packet block
Diffstat (limited to 'epan/dissectors/packet-frame.c')
-rw-r--r--epan/dissectors/packet-frame.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c
index 0588549840..3c753720d3 100644
--- a/epan/dissectors/packet-frame.c
+++ b/epan/dissectors/packet-frame.c
@@ -338,6 +338,9 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
proto_item *volatile ti = NULL;
guint cap_len = 0, frame_len = 0;
guint32 pack_flags = 0;
+ guint32 interface_queue = 0;
+ guint64 drop_count = 0;
+ guint64 packet_id = 0;
proto_tree *volatile tree;
proto_tree *comments_tree;
proto_tree *volatile fh_tree = NULL;
@@ -617,10 +620,9 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
}
}
- if (pinfo->rec->presence_flags & WTAP_HAS_INT_QUEUE)
- proto_tree_add_uint(fh_tree, hf_frame_interface_queue, tvb, 0, 0,
- pinfo->rec->rec_header.packet_header.interface_queue);
-
+ if (WTAP_OPTTYPE_SUCCESS == wtap_block_get_uint32_option_value(fr_data->pkt_block, OPT_PKT_QUEUE, &interface_queue)) {
+ proto_tree_add_uint(fh_tree, hf_frame_interface_queue, tvb, 0, 0, interface_queue);
+ }
if (WTAP_OPTTYPE_SUCCESS == wtap_block_get_uint32_option_value(fr_data->pkt_block, OPT_PKT_FLAGS, &pack_flags)) {
proto_tree *flags_tree;
proto_item *flags_item;
@@ -645,9 +647,9 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
proto_tree_add_bitmask_list_value(flags_tree, tvb, 0, 0, flags, pack_flags);
}
- if (pinfo->rec->presence_flags & WTAP_HAS_PACKET_ID)
- proto_tree_add_uint64(fh_tree, hf_frame_packet_id, tvb, 0, 0,
- pinfo->rec->rec_header.packet_header.packet_id);
+ if (WTAP_OPTTYPE_SUCCESS == wtap_block_get_uint64_option_value(fr_data->pkt_block, OPT_PKT_PACKETID, &packet_id)) {
+ proto_tree_add_uint64(fh_tree, hf_frame_packet_id, tvb, 0, 0, packet_id);
+ }
if (wtap_block_count_option(fr_data->pkt_block, OPT_PKT_VERDICT) > 0) {
proto_tree *verdict_tree;
@@ -725,9 +727,9 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
0, 0, cap_len, "Capture Length: %u byte%s (%u bits)",
cap_len, cap_plurality, cap_len * 8);
- if (pinfo->rec->presence_flags & WTAP_HAS_DROP_COUNT)
- proto_tree_add_uint64(fh_tree, hf_frame_drop_count, tvb, 0, 0,
- pinfo->rec->rec_header.packet_header.drop_count);
+ if (WTAP_OPTTYPE_SUCCESS == wtap_block_get_uint64_option_value(fr_data->pkt_block, OPT_PKT_DROPCOUNT, &drop_count)) {
+ proto_tree_add_uint64(fh_tree, hf_frame_drop_count, tvb, 0, 0, drop_count);
+ }
if (generate_md5_hash) {
const guint8 *cp;