diff options
author | Gerald Combs <gerald@wireshark.org> | 2005-01-19 04:49:29 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2005-01-19 04:49:29 +0000 |
commit | 561fbc8b2580515702c5b491a83f8ca7e7cfe635 (patch) | |
tree | f8c9d31da31a83213b24c35d2a0a0438db5f690c /epan/dissectors | |
parent | 5b84b7e764bf78c3c4d58bc192c775ea3fc606d1 (diff) |
Add a field called "frame.protocols" which shows the protocols present
in the frame. The filter "frame.protocols contains ip:icmp:ip" could
be used to find any ICMP packets containing IP headers.
Clean up whitespace.
svn path=/trunk/; revision=13118
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-frame.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c index e80ce51eda..5e7c57e788 100644 --- a/epan/dissectors/packet-frame.c +++ b/epan/dissectors/packet-frame.c @@ -46,6 +46,7 @@ static int hf_frame_p2p_dir = -1; static int hf_frame_file_off = -1; static int hf_frame_marked = -1; static int hf_frame_ref_time = -1; +static int hf_frame_protocols = -1; static int proto_short = -1; int proto_malformed = -1; @@ -166,6 +167,10 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) 0, 0, cap_len, "Capture Length: %d byte%s", cap_len, plurality(cap_len, "", "s")); + ti = proto_tree_add_string(fh_tree, hf_frame_protocols, tvb, + 0, 0, ""); + pinfo->layer_names = g_string_new(""); + /* Check for existences of P2P pseudo header */ if (pinfo->p2p_dir != P2P_DIR_UNKNOWN) { proto_tree_add_uint(fh_tree, hf_frame_p2p_dir, tvb, @@ -180,7 +185,6 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } } - TRY { if (!dissector_try_port(wtap_encap_dissector_table, pinfo->fd->lnk_t, tvb, pinfo, tree)) { @@ -198,8 +202,14 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } ENDTRY; + if (tree) { + proto_item_append_string(ti, pinfo->layer_names->str); + g_string_free(pinfo->layer_names, TRUE); + pinfo->layer_names = NULL; + } + tap_queue_packet(frame_tap, pinfo, NULL); - + if (mate_handle) call_dissector(mate_handle,tvb, pinfo, tree); } @@ -313,6 +323,10 @@ proto_register_frame(void) { &hf_frame_ref_time, { "This is a Ref Time frame", "frame.ref_time", FT_NONE, 0, NULL, 0x0, "This frame is a Reference Time frame", HFILL }}, + + { &hf_frame_protocols, + { "Protocols in frame", "frame.protocols", FT_STRING, 0, NULL, 0x0, + "Protocols carried by this frame", HFILL }}, }; static gint *ett[] = { &ett_frame, |