From enhancement bug #4272: Patch to add new filterable field -

frame.time_epoch


svn path=/trunk/; revision=31110
This commit is contained in:
Stephen Fisher 2009-11-29 09:26:01 +00:00
parent 3720bf815c
commit c241b33233

View file

@ -47,6 +47,7 @@
int proto_frame = -1; int proto_frame = -1;
int hf_frame_arrival_time = -1; int hf_frame_arrival_time = -1;
int hf_frame_arrival_time_epoch = -1;
static int hf_frame_time_invalid = -1; static int hf_frame_time_invalid = -1;
static int hf_frame_time_delta = -1; static int hf_frame_time_delta = -1;
static int hf_frame_time_delta_displayed = -1; static int hf_frame_time_delta_displayed = -1;
@ -79,6 +80,7 @@ static dissector_handle_t docsis_handle;
static gboolean show_file_off = FALSE; static gboolean show_file_off = FALSE;
static gboolean force_docsis_encap = FALSE; static gboolean force_docsis_encap = FALSE;
static gboolean generate_md5_hash = FALSE; static gboolean generate_md5_hash = FALSE;
static gboolean generate_epoch_time = TRUE;
static const value_string p2p_dirs[] = { static const value_string p2p_dirs[] = {
{ P2P_DIR_UNKNOWN, "Unknown" }, { P2P_DIR_UNKNOWN, "Unknown" },
@ -216,6 +218,11 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
expert_add_info_format(pinfo, item, PI_MALFORMED, PI_WARN, "Arrival Time: Fractional second out of range (0-1000000000)"); expert_add_info_format(pinfo, item, PI_MALFORMED, PI_WARN, "Arrival Time: Fractional second out of range (0-1000000000)");
} }
if(generate_epoch_time) {
proto_tree_add_time(fh_tree, hf_frame_arrival_time_epoch, tvb,
0, 0, &ts);
}
ts = pinfo->fd->del_cap_ts; ts = pinfo->fd->del_cap_ts;
item = proto_tree_add_time(fh_tree, hf_frame_time_delta, tvb, item = proto_tree_add_time(fh_tree, hf_frame_time_delta, tvb,
@ -530,6 +537,10 @@ proto_register_frame(void)
{ "Arrival Time", "frame.time", FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0, { "Arrival Time", "frame.time", FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0,
"Absolute time when this frame was captured", HFILL }}, "Absolute time when this frame was captured", HFILL }},
{ &hf_frame_arrival_time_epoch,
{ "Epoch Time", "frame.time_epoch", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
"Epoch time when this frame was captured", HFILL }},
{ &hf_frame_time_invalid, { &hf_frame_time_invalid,
{ "Arrival Timestamp invalid", "frame.time_invalid", FT_NONE, BASE_NONE, NULL, 0x0, { "Arrival Timestamp invalid", "frame.time_invalid", FT_NONE, BASE_NONE, NULL, 0x0,
"The timestamp from the capture is out of the valid range", HFILL }}, "The timestamp from the capture is out of the valid range", HFILL }},
@ -638,6 +649,10 @@ proto_register_frame(void)
"Generate an MD5 hash of each frame", "Generate an MD5 hash of each frame",
"Whether or not MD5 hashes should be generated for each frame, useful for finding duplicate frames.", "Whether or not MD5 hashes should be generated for each frame, useful for finding duplicate frames.",
&generate_md5_hash); &generate_md5_hash);
prefs_register_bool_preference(frame_module, "generate_epoch_time",
"Generate an epoch time entry for each frame",
"Whether or not an Epoch time entry should be generated for each frame.",
&generate_epoch_time);
frame_tap=register_tap("frame"); frame_tap=register_tap("frame");
} }