diff options
-rw-r--r-- | epan/dissectors/packet-frame.c | 1 | ||||
-rw-r--r-- | epan/packet.c | 13 | ||||
-rw-r--r-- | epan/packet_info.h | 2 |
3 files changed, 11 insertions, 5 deletions
diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c index 54eadfd934..274d88fe01 100644 --- a/epan/dissectors/packet-frame.c +++ b/epan/dissectors/packet-frame.c @@ -396,6 +396,7 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) ti = proto_tree_add_boolean(fh_tree, hf_frame_ignored, tvb, 0, 0,pinfo->fd->flags.ignored); PROTO_ITEM_SET_GENERATED(ti); + pinfo->curr_layer_num = 0; if(proto_field_is_referenced(tree, hf_frame_protocols)) { /* we are going to be using proto_item_append_string() on * hf_frame_protocols, and we must therefore disable the diff --git a/epan/packet.c b/epan/packet.c index 6197f7a966..e5ea41c71b 100644 --- a/epan/packet.c +++ b/epan/packet.c @@ -532,11 +532,14 @@ call_dissector_work(dissector_handle_t handle, tvbuff_t *tvb, packet_info *pinfo * Add the protocol name to the layers * if not told not to. Asn2wrs generated dissectors may be added multiple times otherwise. */ - if ((pinfo->layer_names)&&(add_proto_name)) { - if (pinfo->layer_names->len > 0) - g_string_append(pinfo->layer_names, ":"); - g_string_append(pinfo->layer_names, - proto_get_protocol_filter_name(proto_get_id(handle->protocol))); + if (add_proto_name) { + pinfo->curr_layer_num++; + if (pinfo->layer_names) { + if (pinfo->layer_names->len > 0) + g_string_append(pinfo->layer_names, ":"); + g_string_append(pinfo->layer_names, + proto_get_protocol_filter_name(proto_get_id(handle->protocol))); + } } } diff --git a/epan/packet_info.h b/epan/packet_info.h index b813b2dd4f..e2a242247d 100644 --- a/epan/packet_info.h +++ b/epan/packet_info.h @@ -182,6 +182,8 @@ typedef struct _packet_info { */ void *private_data; /**< pointer to data passed from one dissector to another */ GHashTable *private_table; /**< a hash table passed from one dissector to another */ + + guint16 curr_layer_num; /**< The current "depth" or layer number in the current frame */ /* TODO: Use emem_strbuf_t instead */ GString *layer_names; /**< layers of each protocol */ guint16 link_number; |