diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2006-01-21 17:49:00 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2006-01-21 17:49:00 +0000 |
commit | 864edeb5accd4934f7bfd708a55598aba7ac94f5 (patch) | |
tree | 0004b0a9802812388b62b57139dd01725ee0daa3 | |
parent | 5ccce794e6f1595846b7926719aa50ae5366016d (diff) |
add matched coloring rule name and string to the frame dissector output (or nothing if no coloring rule matched or none was set)
svn path=/trunk/; revision=17068
-rw-r--r-- | epan/dissectors/packet-frame.c | 24 | ||||
-rw-r--r-- | file.c | 1 | ||||
-rw-r--r-- | tethereal.c | 1 |
3 files changed, 25 insertions, 1 deletions
diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c index ec63cf7b67..9c1bd9b957 100644 --- a/epan/dissectors/packet-frame.c +++ b/epan/dissectors/packet-frame.c @@ -36,6 +36,9 @@ #include <epan/tap.h> #include <epan/expert.h> +#include "color.h" +#include "color_filters.h" + int proto_frame = -1; int hf_frame_arrival_time = -1; static int hf_frame_time_delta = -1; @@ -49,6 +52,8 @@ static int hf_frame_marked = -1; static int hf_frame_ref_time = -1; static int hf_link_number = -1; static int hf_frame_protocols = -1; +static int hf_frame_color_filter_name = -1; +static int hf_frame_color_filter_text = -1; static int proto_short = -1; int proto_malformed = -1; @@ -250,6 +255,16 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) "File Offset: %ld (0x%lx)", pinfo->fd->file_off, pinfo->fd->file_off); } + + if(pinfo->fd->color_filter != NULL) { + color_filter_t *color_filter = pinfo->fd->color_filter; + item = proto_tree_add_string(fh_tree, hf_frame_color_filter_name, tvb, + 0, 0, color_filter->filter_name); + PROTO_ITEM_SET_GENERATED(item); + item = proto_tree_add_string(fh_tree, hf_frame_color_filter_text, tvb, + 0, 0, color_filter->filter_text); + PROTO_ITEM_SET_GENERATED(item); + } } TRY { @@ -426,7 +441,14 @@ proto_register_frame(void) { &hf_frame_protocols, { "Protocols in frame", "frame.protocols", FT_STRING, 0, NULL, 0x0, "Protocols carried by this frame", HFILL }}, - }; + + { &hf_frame_color_filter_name, + { "Coloring Rule Name", "frame.coloring_rule.name", FT_STRING, 0, NULL, 0x0, + "The frame matched the coloring rule with this name", HFILL }}, + { &hf_frame_color_filter_text, + { "Coloring Rule String", "frame.coloring_rule.string", FT_STRING, 0, NULL, 0x0, + "The frame matched this coloring rule string", HFILL }}, + }; static gint *ett[] = { &ett_frame, }; @@ -915,6 +915,7 @@ read_packet(capture_file *cf, long offset) fdata->flags.visited = 0; fdata->flags.marked = 0; fdata->flags.ref_time = 0; + fdata->color_filter = NULL; fdata->abs_ts = *((nstime_t *) &phdr->ts); diff --git a/tethereal.c b/tethereal.c index ec097c7cc4..2243e5c46e 100644 --- a/tethereal.c +++ b/tethereal.c @@ -2043,6 +2043,7 @@ fill_in_fdata(frame_data *fdata, capture_file *cf, fdata->flags.visited = 0; fdata->flags.marked = 0; fdata->flags.ref_time = 0; + fdata->color_filter = NULL; /* If we don't have the time stamp of the first packet in the capture, it's because this is the first packet. Save the time |