*
* Top-most dissector. Decides dissector based on Wiretap Encapsulation Type.
*
- * $Id: packet-frame.c,v 1.36 2003/03/03 23:29:57 guy Exp $
+ * $Id: packet-frame.c,v 1.42 2003/12/06 06:09:10 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include "prefs.h"
#include "tap.h"
-static int proto_frame = -1;
-static int hf_frame_arrival_time = -1;
+int proto_frame = -1;
+int hf_frame_arrival_time = -1;
static int hf_frame_time_delta = -1;
static int hf_frame_time_relative = -1;
-static int hf_frame_number = -1;
-static int hf_frame_packet_len = -1;
-static int hf_frame_capture_len = -1;
+int hf_frame_number = -1;
+int hf_frame_packet_len = -1;
+int hf_frame_capture_len = -1;
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 proto_short = -1;
int proto_malformed = -1;
switch (pinfo->fd->lnk_t) {
case WTAP_ENCAP_WFLEET_HDLC:
- case WTAP_ENCAP_CHDLC:
+ case WTAP_ENCAP_CHDLC_WITH_PHDR:
case WTAP_ENCAP_PPP_WITH_PHDR:
case WTAP_ENCAP_SDLC:
pinfo->p2p_dir = pinfo->pseudo_header->p2p.sent ?
proto_tree_add_boolean_hidden(fh_tree, hf_frame_marked, tvb, 0, 0,pinfo->fd->flags.marked);
+ if(pinfo->fd->flags.ref_time){
+ proto_tree_add_item(fh_tree, hf_frame_ref_time, tvb, 0, 0, FALSE);
+ }
+
ts.secs = pinfo->fd->abs_secs;
ts.nsecs = pinfo->fd->abs_usecs*1000;
call_dissector(data_handle,tvb, pinfo, tree);
}
}
- CATCH(BoundsError) {
+ CATCH_ALL {
+ show_exception(tvb, pinfo, tree, EXCEPT_CODE);
+ }
+ ENDTRY;
+
+ tap_queue_packet(frame_tap, pinfo, NULL);
+}
+
+void
+show_exception(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
+ unsigned long exception)
+{
+ switch (exception) {
+
+ case BoundsError:
if (check_col(pinfo->cinfo, COL_INFO))
col_append_str(pinfo->cinfo, COL_INFO, "[Short Frame]");
proto_tree_add_protocol_format(tree, proto_short, tvb, 0, 0,
"[Short Frame: %s]", pinfo->current_proto);
- }
- CATCH(ReportedBoundsError) {
+ break;
+
+ case ReportedBoundsError:
show_reported_bounds_error(tvb, pinfo, tree);
+ break;
}
- ENDTRY;
-
- tap_queue_packet(frame_tap, pinfo, NULL);
}
void
static hf_register_info hf[] = {
{ &hf_frame_arrival_time,
{ "Arrival Time", "frame.time", FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0,
- "", HFILL }},
+ "Absolute time when this frame was captured", HFILL }},
{ &hf_frame_time_delta,
{ "Time delta from previous packet", "frame.time_delta", FT_RELATIVE_TIME, BASE_NONE, NULL,
0x0,
- "", HFILL }},
+ "Time delta since previous diplayed frame", HFILL }},
{ &hf_frame_time_relative,
- { "Time relative to first packet", "frame.time_relative", FT_RELATIVE_TIME, BASE_NONE, NULL,
+ { "Time since reference or first frame", "frame.time_relative", FT_RELATIVE_TIME, BASE_NONE, NULL,
0x0,
- "", HFILL }},
+ "Time relative reference or first frame", HFILL }},
{ &hf_frame_number,
{ "Frame Number", "frame.number", FT_UINT32, BASE_DEC, NULL, 0x0,
{ &hf_frame_marked,
{ "Frame is marked", "frame.marked", FT_BOOLEAN, 8, NULL, 0x0,
"Frame is marked in the GUI", HFILL }},
+
+ { &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 }},
};
static gint *ett[] = {
&ett_frame,