aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-frame.c
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2013-07-22 19:38:38 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2013-07-22 19:38:38 +0000
commit7ec1a78fe8a7e7f61f241a89ade467c476e01656 (patch)
treea76017762631b8178af36a9981afb422227a0e7a /epan/dissectors/packet-frame.c
parentb0a94d2b988d20aee2631ff152bb4e5ce1183049 (diff)
Abuse epan_t more: add callback to get interface name.
svn path=/trunk/; revision=50794
Diffstat (limited to 'epan/dissectors/packet-frame.c')
-rw-r--r--epan/dissectors/packet-frame.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c
index c3e40f116d..1abdbe8d88 100644
--- a/epan/dissectors/packet-frame.c
+++ b/epan/dissectors/packet-frame.c
@@ -288,8 +288,14 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
fh_tree = proto_item_add_subtree(ti, ett_frame);
- if (pinfo->fd->flags.has_if_id)
- proto_tree_add_uint(fh_tree, hf_frame_interface_id, tvb, 0, 0, pinfo->fd->interface_id);
+ if (pinfo->fd->flags.has_if_id && proto_field_is_referenced(tree, hf_frame_interface_id)) {
+ const char *interface_name = epan_get_interface_name(pinfo->epan, pinfo->fd->interface_id);
+
+ if (interface_name)
+ proto_tree_add_uint_format_value(fh_tree, hf_frame_interface_id, tvb, 0, 0, pinfo->fd->interface_id, "%u (%s)", pinfo->fd->interface_id, interface_name);
+ else
+ proto_tree_add_uint(fh_tree, hf_frame_interface_id, tvb, 0, 0, pinfo->fd->interface_id);
+ }
if (pinfo->fd->flags.has_pack_flags) {
proto_tree *flags_tree;