2000-10-06 10:11:40 +00:00
|
|
|
/* packet-frame.c
|
|
|
|
*
|
|
|
|
* Top-most dissector. Decides dissector based on Wiretap Encapsulation Type.
|
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2000-10-06 10:11:40 +00:00
|
|
|
* Copyright 2000 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2000-10-06 10:11:40 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2000-10-06 10:11:40 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2000-10-06 10:11:40 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2000-10-06 10:11:40 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
2000-10-06 10:11:40 +00:00
|
|
|
|
2008-10-24 00:42:09 +00:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
#include <windows.h>
|
|
|
|
#endif
|
|
|
|
|
2000-10-06 10:11:40 +00:00
|
|
|
#include <glib.h>
|
2013-08-01 23:34:47 +00:00
|
|
|
|
|
|
|
#include <wsutil/md5.h>
|
|
|
|
|
2013-12-03 23:49:51 +00:00
|
|
|
#include <epan/epan.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
2013-11-10 15:59:37 +00:00
|
|
|
#include <epan/exceptions.h>
|
Move show_exception() and show_reported_bounds_error() to
epan/show_exception.c, as it's used outside
epan/dissectors/packet-frame.c. Update their callers to include
<epan/show_exception.h> to get their declaration.
Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if
there's more stuff in the packet to dissect after the dissector call
that threw the exception, doesn't mean you shouldn't go ahead and
dissect that stuff. Use it in all those cases, including ones where
BoundsError was inappropriately being caught (you want those passed up
to the top level, so that the packet is reported as having been cut
short in the capture process).
Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that
correspond to running past the end of the data for a tvbuff; use it
rather than explicitly catching those exceptions individually, and
rather than just catching all exceptions (the only place that
DissectorError should be caught, for example, is at the top level, so
dissector bugs show up in the protocol tree).
Don't catch and then immediately rethrow exceptions without doing
anything else; just let the exceptions go up to the final catcher.
Use show_exception() to report non-fatal errors, rather than doing it
yourself.
If a dissector is called from Lua, catch all non-fatal errors and use
show_exception() to report them rather than catching only
ReportedBoundsError and adding a proto_malformed item.
Don't catch exceptions when constructing a trailer tvbuff in
packet-ieee8023.c - just construct it after the payload has been
dissected, and let whatever exceptions that throws be handled at the top
level.
Avoid some TRY/CATCH/ENDTRY cases by using checks such as
tvb_bytes_exist() before even looking in the tvbuff.
svn path=/trunk/; revision=47924
2013-02-27 22:43:54 +00:00
|
|
|
#include <epan/show_exception.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/timestamp.h>
|
2004-09-27 22:55:15 +00:00
|
|
|
#include <epan/prefs.h>
|
2013-12-21 17:23:17 +00:00
|
|
|
#include <epan/to_str.h>
|
|
|
|
#include <wiretap/wtap.h>
|
2004-09-29 00:06:36 +00:00
|
|
|
#include <epan/tap.h>
|
2005-09-11 16:55:34 +00:00
|
|
|
#include <epan/expert.h>
|
2000-10-06 10:11:40 +00:00
|
|
|
|
Move show_exception() and show_reported_bounds_error() to
epan/show_exception.c, as it's used outside
epan/dissectors/packet-frame.c. Update their callers to include
<epan/show_exception.h> to get their declaration.
Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if
there's more stuff in the packet to dissect after the dissector call
that threw the exception, doesn't mean you shouldn't go ahead and
dissect that stuff. Use it in all those cases, including ones where
BoundsError was inappropriately being caught (you want those passed up
to the top level, so that the packet is reported as having been cut
short in the capture process).
Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that
correspond to running past the end of the data for a tvbuff; use it
rather than explicitly catching those exceptions individually, and
rather than just catching all exceptions (the only place that
DissectorError should be caught, for example, is at the top level, so
dissector bugs show up in the protocol tree).
Don't catch and then immediately rethrow exceptions without doing
anything else; just let the exceptions go up to the final catcher.
Use show_exception() to report non-fatal errors, rather than doing it
yourself.
If a dissector is called from Lua, catch all non-fatal errors and use
show_exception() to report them rather than catching only
ReportedBoundsError and adding a proto_malformed item.
Don't catch exceptions when constructing a trailer tvbuff in
packet-ieee8023.c - just construct it after the payload has been
dissected, and let whatever exceptions that throws be handled at the top
level.
Avoid some TRY/CATCH/ENDTRY cases by using checks such as
tvb_bytes_exist() before even looking in the tvbuff.
svn path=/trunk/; revision=47924
2013-02-27 22:43:54 +00:00
|
|
|
#include "packet-frame.h"
|
|
|
|
|
2006-01-21 17:49:00 +00:00
|
|
|
#include "color.h"
|
|
|
|
#include "color_filters.h"
|
|
|
|
|
2013-12-15 23:44:12 +00:00
|
|
|
void proto_register_frame(void);
|
|
|
|
void proto_reg_handoff_frame(void);
|
|
|
|
|
2003-12-06 06:09:13 +00:00
|
|
|
int proto_frame = -1;
|
2013-07-27 20:57:58 +00:00
|
|
|
static int proto_pkt_comment = -1;
|
2003-12-06 06:09:13 +00:00
|
|
|
int hf_frame_arrival_time = -1;
|
2013-07-27 20:57:58 +00:00
|
|
|
static int hf_frame_shift_offset = -1;
|
|
|
|
static int hf_frame_arrival_time_epoch = -1;
|
2000-10-06 10:11:40 +00:00
|
|
|
static int hf_frame_time_delta = -1;
|
2007-03-23 18:08:17 +00:00
|
|
|
static int hf_frame_time_delta_displayed = -1;
|
2000-12-15 03:30:21 +00:00
|
|
|
static int hf_frame_time_relative = -1;
|
2009-01-29 22:43:49 +00:00
|
|
|
static int hf_frame_time_reference = -1;
|
2003-12-06 06:09:13 +00:00
|
|
|
int hf_frame_number = -1;
|
2007-01-21 23:02:07 +00:00
|
|
|
int hf_frame_len = -1;
|
2003-12-06 06:09:13 +00:00
|
|
|
int hf_frame_capture_len = -1;
|
2000-10-06 10:11:40 +00:00
|
|
|
static int hf_frame_p2p_dir = -1;
|
2001-11-01 04:00:56 +00:00
|
|
|
static int hf_frame_file_off = -1;
|
2009-01-04 12:08:17 +00:00
|
|
|
static int hf_frame_md5_hash = -1;
|
2002-05-03 21:38:20 +00:00
|
|
|
static int hf_frame_marked = -1;
|
2009-12-17 01:18:14 +00:00
|
|
|
static int hf_frame_ignored = -1;
|
2005-05-02 14:07:33 +00:00
|
|
|
static int hf_link_number = -1;
|
2005-01-19 04:49:29 +00:00
|
|
|
static int hf_frame_protocols = -1;
|
2006-01-21 17:49:00 +00:00
|
|
|
static int hf_frame_color_filter_name = -1;
|
|
|
|
static int hf_frame_color_filter_text = -1;
|
2012-02-11 12:34:39 +00:00
|
|
|
static int hf_frame_interface_id = -1;
|
2012-12-22 19:48:17 +00:00
|
|
|
static int hf_frame_pack_flags = -1;
|
|
|
|
static int hf_frame_pack_direction = -1;
|
|
|
|
static int hf_frame_pack_reception_type = -1;
|
|
|
|
static int hf_frame_pack_fcs_length = -1;
|
|
|
|
static int hf_frame_pack_reserved = -1;
|
|
|
|
static int hf_frame_pack_crc_error = -1;
|
|
|
|
static int hf_frame_pack_wrong_packet_too_long_error = -1;
|
|
|
|
static int hf_frame_pack_wrong_packet_too_short_error = -1;
|
|
|
|
static int hf_frame_pack_wrong_inter_frame_gap_error = -1;
|
|
|
|
static int hf_frame_pack_unaligned_frame_error = -1;
|
|
|
|
static int hf_frame_pack_start_frame_delimiter_error = -1;
|
|
|
|
static int hf_frame_pack_preamble_error = -1;
|
|
|
|
static int hf_frame_pack_symbol_error = -1;
|
2012-04-18 08:26:08 +00:00
|
|
|
static int hf_frame_wtap_encap = -1;
|
2012-02-11 12:34:39 +00:00
|
|
|
static int hf_comments_text = -1;
|
2002-05-03 21:38:20 +00:00
|
|
|
|
2000-10-06 10:11:40 +00:00
|
|
|
static gint ett_frame = -1;
|
2012-12-22 19:48:17 +00:00
|
|
|
static gint ett_flags = -1;
|
2012-02-11 12:34:39 +00:00
|
|
|
static gint ett_comments = -1;
|
2000-10-06 10:11:40 +00:00
|
|
|
|
2013-05-26 03:29:07 +00:00
|
|
|
static expert_field ei_comments_text = EI_INIT;
|
|
|
|
static expert_field ei_arrive_time_out_of_range = EI_INIT;
|
|
|
|
|
2002-09-04 09:40:29 +00:00
|
|
|
static int frame_tap = -1;
|
|
|
|
|
2001-11-26 01:23:59 +00:00
|
|
|
static dissector_handle_t data_handle;
|
2002-07-12 22:52:43 +00:00
|
|
|
static dissector_handle_t docsis_handle;
|
2001-11-26 01:23:59 +00:00
|
|
|
|
2001-11-01 04:00:56 +00:00
|
|
|
/* Preferences */
|
2012-05-03 19:31:03 +00:00
|
|
|
static gboolean show_file_off = FALSE;
|
|
|
|
static gboolean force_docsis_encap = FALSE;
|
|
|
|
static gboolean generate_md5_hash = FALSE;
|
2009-11-29 09:26:01 +00:00
|
|
|
static gboolean generate_epoch_time = TRUE;
|
2011-04-15 17:53:23 +00:00
|
|
|
static gboolean generate_bits_field = TRUE;
|
2001-11-01 04:00:56 +00:00
|
|
|
|
2000-10-06 10:11:40 +00:00
|
|
|
static const value_string p2p_dirs[] = {
|
2009-02-16 07:24:04 +00:00
|
|
|
{ P2P_DIR_UNKNOWN, "Unknown" },
|
2000-10-06 10:11:40 +00:00
|
|
|
{ P2P_DIR_SENT, "Sent" },
|
|
|
|
{ P2P_DIR_RECV, "Received" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
2000-11-29 05:16:15 +00:00
|
|
|
|
2012-12-22 19:48:17 +00:00
|
|
|
#define PACKET_WORD_DIRECTION_MASK 0x00000003
|
|
|
|
#define PACKET_WORD_RECEPTION_TYPE_MASK 0x0000001C
|
|
|
|
#define PACKET_WORD_FCS_LENGTH_MASK 0x000001E0
|
|
|
|
#define PACKET_WORD_RESERVED_MASK 0x0000FE00
|
|
|
|
#define PACKET_WORD_CRC_ERR_MASK 0x01000000
|
|
|
|
#define PACKET_WORD_PACKET_TOO_LONG_ERR_MASK 0x02000000
|
|
|
|
#define PACKET_WORD_PACKET_TOO_SHORT_ERR_MASK 0x04000000
|
|
|
|
#define PACKET_WORD_WRONG_INTER_FRAME_GAP_ERR_MASK 0x08000000
|
|
|
|
#define PACKET_WORD_UNALIGNED_FRAME_ERR_MASK 0x10000000
|
|
|
|
#define PACKET_WORD_START_FRAME_DELIMITER_ERR_MASK 0x20000000
|
|
|
|
#define PACKET_WORD_PREAMBLE_ERR_MASK 0x40000000
|
|
|
|
#define PACKET_WORD_SYMBOL_ERR_MASK 0x80000000
|
|
|
|
|
|
|
|
static const value_string packet_word_directions[] = {
|
|
|
|
{ 0x00, "Not available" },
|
|
|
|
{ 0x01, "Inbound" },
|
|
|
|
{ 0x02, "Outbound" },
|
|
|
|
{ 0x03, "Undefined" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string packet_word_reception_types[] = {
|
|
|
|
{ 0x00, "Not specified" },
|
|
|
|
{ 0x01, "Unicast" },
|
|
|
|
{ 0x02, "Multicast" },
|
|
|
|
{ 0x03, "Broadcast" },
|
|
|
|
{ 0x04, "Promiscuous" },
|
|
|
|
{ 0x05, "Undefined" },
|
|
|
|
{ 0x06, "Undefined" },
|
|
|
|
{ 0x07, "Undefined" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2007-06-13 22:36:58 +00:00
|
|
|
dissector_table_t wtap_encap_dissector_table;
|
2014-05-25 00:04:44 +00:00
|
|
|
static dissector_table_t wtap_fts_rec_dissector_table;;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2007-02-20 01:32:14 +00:00
|
|
|
/*
|
2005-12-16 00:32:12 +00:00
|
|
|
* Routine used to register frame end routine. The routine should only
|
2009-08-03 14:17:31 +00:00
|
|
|
* be registered when the dissector is used in the frame, not in the
|
2005-12-16 00:32:12 +00:00
|
|
|
* proto_register_XXX function.
|
|
|
|
*/
|
|
|
|
void
|
2012-09-03 12:00:40 +00:00
|
|
|
register_frame_end_routine(packet_info *pinfo, void (*func)(void))
|
2005-12-16 00:32:12 +00:00
|
|
|
{
|
2012-09-03 12:00:40 +00:00
|
|
|
pinfo->frame_end_routines = g_slist_append(pinfo->frame_end_routines, (gpointer)func);
|
2005-12-16 00:32:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
typedef void (*void_func_t)(void);
|
|
|
|
|
|
|
|
static void
|
|
|
|
call_frame_end_routine(gpointer routine, gpointer dummy _U_)
|
|
|
|
{
|
|
|
|
void_func_t func = (void_func_t)routine;
|
|
|
|
(*func)();
|
|
|
|
}
|
|
|
|
|
2002-04-08 20:30:56 +00:00
|
|
|
static void
|
2005-04-11 08:43:51 +00:00
|
|
|
dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
|
2000-10-06 10:11:40 +00:00
|
|
|
{
|
2012-05-03 19:31:03 +00:00
|
|
|
proto_item *volatile ti = NULL, *comment_item;
|
|
|
|
guint cap_len = 0, frame_len = 0;
|
|
|
|
proto_tree *volatile tree;
|
2012-02-11 12:34:39 +00:00
|
|
|
proto_tree *comments_tree;
|
2012-05-03 19:31:03 +00:00
|
|
|
proto_item *item;
|
2010-06-09 18:12:17 +00:00
|
|
|
const gchar *cap_plurality, *frame_plurality;
|
2005-04-11 08:43:51 +00:00
|
|
|
|
|
|
|
tree=parent_tree;
|
2000-10-06 10:11:40 +00:00
|
|
|
|
2014-05-25 00:04:44 +00:00
|
|
|
switch (pinfo->phdr->rec_type) {
|
2009-01-07 07:21:31 +00:00
|
|
|
|
2014-05-25 00:04:44 +00:00
|
|
|
case REC_TYPE_PACKET:
|
|
|
|
pinfo->current_proto = "Frame";
|
|
|
|
if (pinfo->pseudo_header != NULL) {
|
|
|
|
switch (pinfo->fd->lnk_t) {
|
|
|
|
|
|
|
|
case WTAP_ENCAP_WFLEET_HDLC:
|
|
|
|
case WTAP_ENCAP_CHDLC_WITH_PHDR:
|
|
|
|
case WTAP_ENCAP_PPP_WITH_PHDR:
|
|
|
|
case WTAP_ENCAP_SDLC:
|
|
|
|
case WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR:
|
|
|
|
pinfo->p2p_dir = pinfo->pseudo_header->p2p.sent ?
|
|
|
|
P2P_DIR_SENT : P2P_DIR_RECV;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WTAP_ENCAP_BLUETOOTH_HCI:
|
|
|
|
pinfo->p2p_dir = pinfo->pseudo_header->bthci.sent;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WTAP_ENCAP_LAPB:
|
|
|
|
case WTAP_ENCAP_FRELAY_WITH_PHDR:
|
|
|
|
pinfo->p2p_dir =
|
|
|
|
(pinfo->pseudo_header->x25.flags & FROM_DCE) ?
|
|
|
|
P2P_DIR_RECV : P2P_DIR_SENT;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WTAP_ENCAP_ISDN:
|
|
|
|
case WTAP_ENCAP_V5_EF:
|
|
|
|
case WTAP_ENCAP_DPNSS:
|
|
|
|
case WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR:
|
|
|
|
pinfo->p2p_dir = pinfo->pseudo_header->isdn.uton ?
|
|
|
|
P2P_DIR_SENT : P2P_DIR_RECV;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WTAP_ENCAP_LINUX_LAPD:
|
|
|
|
pinfo->p2p_dir = (pinfo->pseudo_header->lapd.pkttype == 3 ||
|
|
|
|
pinfo->pseudo_header->lapd.pkttype == 4) ?
|
|
|
|
P2P_DIR_SENT : P2P_DIR_RECV;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WTAP_ENCAP_MTP2_WITH_PHDR:
|
|
|
|
pinfo->p2p_dir = pinfo->pseudo_header->mtp2.sent ?
|
|
|
|
P2P_DIR_SENT : P2P_DIR_RECV;
|
|
|
|
pinfo->link_number = pinfo->pseudo_header->mtp2.link_number;
|
|
|
|
pinfo->annex_a_used = pinfo->pseudo_header->mtp2.annex_a_used;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WTAP_ENCAP_GSM_UM:
|
|
|
|
pinfo->p2p_dir = pinfo->pseudo_header->gsm_um.uplink ?
|
|
|
|
P2P_DIR_SENT : P2P_DIR_RECV;
|
|
|
|
break;
|
|
|
|
}
|
2002-04-13 00:02:55 +00:00
|
|
|
}
|
2014-05-25 00:04:44 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case REC_TYPE_FT_SPECIFIC_EVENT:
|
|
|
|
pinfo->current_proto = "Event";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case REC_TYPE_FT_SPECIFIC_REPORT:
|
|
|
|
pinfo->current_proto = "Report";
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
g_assert_not_reached();
|
|
|
|
break;
|
2001-12-24 17:06:53 +00:00
|
|
|
}
|
2000-10-06 10:11:40 +00:00
|
|
|
|
2013-08-01 20:59:38 +00:00
|
|
|
if(pinfo->pkt_comment){
|
2014-05-12 00:33:58 +00:00
|
|
|
item = proto_tree_add_item(tree, proto_pkt_comment, tvb, 0, 0, ENC_NA);
|
2012-02-11 12:34:39 +00:00
|
|
|
comments_tree = proto_item_add_subtree(item, ett_comments);
|
2014-05-12 00:33:58 +00:00
|
|
|
comment_item = proto_tree_add_string_format(comments_tree, hf_comments_text, tvb, 0, 0,
|
2013-08-01 20:59:38 +00:00
|
|
|
pinfo->pkt_comment, "%s",
|
|
|
|
pinfo->pkt_comment);
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, comment_item, &ei_comments_text,
|
2013-08-01 20:59:38 +00:00
|
|
|
"%s", pinfo->pkt_comment);
|
2012-03-02 13:31:16 +00:00
|
|
|
|
2012-02-11 12:34:39 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2009-08-15 08:05:10 +00:00
|
|
|
/* if FRAME is not referenced from any filters we dont need to worry about
|
|
|
|
generating any tree items. */
|
|
|
|
if(!proto_field_is_referenced(tree, proto_frame)) {
|
2010-01-08 21:07:51 +00:00
|
|
|
tree=NULL;
|
2012-02-25 23:24:34 +00:00
|
|
|
if(pinfo->fd->flags.has_ts) {
|
|
|
|
if(pinfo->fd->abs_ts.nsecs < 0 || pinfo->fd->abs_ts.nsecs >= 1000000000)
|
2013-05-26 03:29:07 +00:00
|
|
|
expert_add_info(pinfo, NULL, &ei_arrive_time_out_of_range);
|
2012-02-25 23:24:34 +00:00
|
|
|
}
|
2010-01-08 21:07:51 +00:00
|
|
|
} else {
|
2012-12-22 19:48:17 +00:00
|
|
|
proto_tree *fh_tree;
|
2010-01-08 21:07:51 +00:00
|
|
|
gboolean old_visible;
|
|
|
|
|
|
|
|
/* Put in frame header information. */
|
2014-06-19 17:18:16 +00:00
|
|
|
cap_len = tvb_length(tvb);
|
2010-01-08 21:07:51 +00:00
|
|
|
frame_len = tvb_reported_length(tvb);
|
|
|
|
|
|
|
|
cap_plurality = plurality(cap_len, "", "s");
|
|
|
|
frame_plurality = plurality(frame_len, "", "s");
|
|
|
|
|
2014-05-12 00:33:58 +00:00
|
|
|
ti = proto_tree_add_protocol_format(tree, proto_frame, tvb, 0, tvb_captured_length(tvb),
|
2012-02-25 23:24:34 +00:00
|
|
|
"Frame %u: %u byte%s on wire",
|
|
|
|
pinfo->fd->num, frame_len, frame_plurality);
|
2011-04-15 17:53:23 +00:00
|
|
|
if (generate_bits_field)
|
2012-02-25 23:24:34 +00:00
|
|
|
proto_item_append_text(ti, " (%u bits)", frame_len * 8);
|
|
|
|
proto_item_append_text(ti, ", %u byte%s captured",
|
|
|
|
cap_len, cap_plurality);
|
|
|
|
if (generate_bits_field) {
|
|
|
|
proto_item_append_text(ti, " (%u bits)",
|
|
|
|
cap_len * 8);
|
|
|
|
}
|
2013-07-30 23:14:09 +00:00
|
|
|
if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID) {
|
2012-02-25 23:24:34 +00:00
|
|
|
proto_item_append_text(ti, " on interface %u",
|
2013-07-30 23:14:09 +00:00
|
|
|
pinfo->phdr->interface_id);
|
2012-02-25 23:24:34 +00:00
|
|
|
}
|
2013-07-30 23:14:09 +00:00
|
|
|
if (pinfo->phdr->presence_flags & WTAP_HAS_PACK_FLAGS) {
|
|
|
|
if (pinfo->phdr->pack_flags & 0x00000001) {
|
2012-12-22 19:48:17 +00:00
|
|
|
proto_item_append_text(ti, " (inbound)");
|
|
|
|
pinfo->p2p_dir = P2P_DIR_RECV;
|
|
|
|
}
|
2013-07-30 23:14:09 +00:00
|
|
|
if (pinfo->phdr->pack_flags & 0x00000002) {
|
2012-12-22 19:48:17 +00:00
|
|
|
proto_item_append_text(ti, " (outbound)");
|
|
|
|
pinfo->p2p_dir = P2P_DIR_SENT;
|
|
|
|
}
|
|
|
|
}
|
2010-01-08 21:07:51 +00:00
|
|
|
|
|
|
|
fh_tree = proto_item_add_subtree(ti, ett_frame);
|
2009-08-15 08:05:10 +00:00
|
|
|
|
2013-07-30 23:14:09 +00:00
|
|
|
if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID && proto_field_is_referenced(tree, hf_frame_interface_id)) {
|
|
|
|
const char *interface_name = epan_get_interface_name(pinfo->epan, pinfo->phdr->interface_id);
|
2013-07-22 19:38:38 +00:00
|
|
|
|
|
|
|
if (interface_name)
|
2013-07-30 23:14:09 +00:00
|
|
|
proto_tree_add_uint_format_value(fh_tree, hf_frame_interface_id, tvb, 0, 0, pinfo->phdr->interface_id, "%u (%s)", pinfo->phdr->interface_id, interface_name);
|
2013-07-22 19:38:38 +00:00
|
|
|
else
|
2013-07-30 23:14:09 +00:00
|
|
|
proto_tree_add_uint(fh_tree, hf_frame_interface_id, tvb, 0, 0, pinfo->phdr->interface_id);
|
2013-07-22 19:38:38 +00:00
|
|
|
}
|
2012-05-03 19:31:03 +00:00
|
|
|
|
2013-07-30 23:14:09 +00:00
|
|
|
if (pinfo->phdr->presence_flags & WTAP_HAS_PACK_FLAGS) {
|
2012-12-22 19:48:17 +00:00
|
|
|
proto_tree *flags_tree;
|
|
|
|
proto_item *flags_item;
|
|
|
|
|
2013-07-30 23:14:09 +00:00
|
|
|
flags_item = proto_tree_add_uint(fh_tree, hf_frame_pack_flags, tvb, 0, 0, pinfo->phdr->pack_flags);
|
2012-12-22 19:48:17 +00:00
|
|
|
flags_tree = proto_item_add_subtree(flags_item, ett_flags);
|
2013-07-30 23:14:09 +00:00
|
|
|
proto_tree_add_uint(flags_tree, hf_frame_pack_direction, tvb, 0, 0, pinfo->phdr->pack_flags);
|
|
|
|
proto_tree_add_uint(flags_tree, hf_frame_pack_reception_type, tvb, 0, 0, pinfo->phdr->pack_flags);
|
|
|
|
proto_tree_add_uint(flags_tree, hf_frame_pack_fcs_length, tvb, 0, 0, pinfo->phdr->pack_flags);
|
|
|
|
proto_tree_add_uint(flags_tree, hf_frame_pack_reserved, tvb, 0, 0, pinfo->phdr->pack_flags);
|
|
|
|
proto_tree_add_boolean(flags_tree, hf_frame_pack_crc_error, tvb, 0, 0, pinfo->phdr->pack_flags);
|
|
|
|
proto_tree_add_boolean(flags_tree, hf_frame_pack_wrong_packet_too_long_error, tvb, 0, 0, pinfo->phdr->pack_flags);
|
|
|
|
proto_tree_add_boolean(flags_tree, hf_frame_pack_wrong_packet_too_short_error, tvb, 0, 0, pinfo->phdr->pack_flags);
|
|
|
|
proto_tree_add_boolean(flags_tree, hf_frame_pack_wrong_inter_frame_gap_error, tvb, 0, 0, pinfo->phdr->pack_flags);
|
|
|
|
proto_tree_add_boolean(flags_tree, hf_frame_pack_unaligned_frame_error, tvb, 0, 0, pinfo->phdr->pack_flags);
|
|
|
|
proto_tree_add_boolean(flags_tree, hf_frame_pack_start_frame_delimiter_error, tvb, 0, 0, pinfo->phdr->pack_flags);
|
|
|
|
proto_tree_add_boolean(flags_tree, hf_frame_pack_preamble_error, tvb, 0, 0, pinfo->phdr->pack_flags);
|
|
|
|
proto_tree_add_boolean(flags_tree, hf_frame_pack_symbol_error, tvb, 0, 0, pinfo->phdr->pack_flags);
|
2012-12-22 19:48:17 +00:00
|
|
|
}
|
|
|
|
|
2014-05-25 00:04:44 +00:00
|
|
|
if (pinfo->phdr->rec_type == REC_TYPE_PACKET)
|
|
|
|
proto_tree_add_int(fh_tree, hf_frame_wtap_encap, tvb, 0, 0, pinfo->fd->lnk_t);
|
2012-02-11 12:34:39 +00:00
|
|
|
|
2012-02-25 23:24:34 +00:00
|
|
|
if (pinfo->fd->flags.has_ts) {
|
|
|
|
proto_tree_add_time(fh_tree, hf_frame_arrival_time, tvb,
|
|
|
|
0, 0, &(pinfo->fd->abs_ts));
|
|
|
|
if(pinfo->fd->abs_ts.nsecs < 0 || pinfo->fd->abs_ts.nsecs >= 1000000000) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_arrive_time_out_of_range,
|
2012-05-03 19:31:03 +00:00
|
|
|
"Arrival Time: Fractional second %09ld is invalid,"
|
|
|
|
" the valid range is 0-1000000000",
|
|
|
|
(long) pinfo->fd->abs_ts.nsecs);
|
2012-02-25 23:24:34 +00:00
|
|
|
}
|
|
|
|
item = proto_tree_add_time(fh_tree, hf_frame_shift_offset, tvb,
|
|
|
|
0, 0, &(pinfo->fd->shift_offset));
|
2010-01-08 21:07:51 +00:00
|
|
|
PROTO_ITEM_SET_GENERATED(item);
|
|
|
|
|
2012-02-25 23:24:34 +00:00
|
|
|
if(generate_epoch_time) {
|
|
|
|
proto_tree_add_time(fh_tree, hf_frame_arrival_time_epoch, tvb,
|
|
|
|
0, 0, &(pinfo->fd->abs_ts));
|
|
|
|
}
|
2009-11-25 19:18:41 +00:00
|
|
|
|
2012-09-23 16:25:28 +00:00
|
|
|
if (proto_field_is_referenced(tree, hf_frame_time_delta)) {
|
|
|
|
nstime_t del_cap_ts;
|
2007-02-20 01:32:14 +00:00
|
|
|
|
2013-07-21 20:48:30 +00:00
|
|
|
frame_delta_abs_time(pinfo->epan, pinfo->fd, pinfo->fd->num - 1, &del_cap_ts);
|
2012-09-23 16:25:28 +00:00
|
|
|
|
|
|
|
item = proto_tree_add_time(fh_tree, hf_frame_time_delta, tvb,
|
|
|
|
0, 0, &(del_cap_ts));
|
|
|
|
PROTO_ITEM_SET_GENERATED(item);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (proto_field_is_referenced(tree, hf_frame_time_delta_displayed)) {
|
|
|
|
nstime_t del_dis_ts;
|
|
|
|
|
2013-07-21 20:48:30 +00:00
|
|
|
frame_delta_abs_time(pinfo->epan, pinfo->fd, pinfo->fd->prev_dis_num, &del_dis_ts);
|
2012-09-23 16:25:28 +00:00
|
|
|
|
|
|
|
item = proto_tree_add_time(fh_tree, hf_frame_time_delta_displayed, tvb,
|
|
|
|
0, 0, &(del_dis_ts));
|
|
|
|
PROTO_ITEM_SET_GENERATED(item);
|
|
|
|
}
|
2000-10-06 10:11:40 +00:00
|
|
|
|
2012-02-25 23:24:34 +00:00
|
|
|
item = proto_tree_add_time(fh_tree, hf_frame_time_relative, tvb,
|
2013-07-21 23:07:33 +00:00
|
|
|
0, 0, &(pinfo->rel_ts));
|
2012-02-25 23:24:34 +00:00
|
|
|
PROTO_ITEM_SET_GENERATED(item);
|
2010-01-08 21:07:51 +00:00
|
|
|
|
2012-02-25 23:24:34 +00:00
|
|
|
if(pinfo->fd->flags.ref_time){
|
|
|
|
ti = proto_tree_add_item(fh_tree, hf_frame_time_reference, tvb, 0, 0, ENC_NA);
|
|
|
|
PROTO_ITEM_SET_GENERATED(ti);
|
|
|
|
}
|
2010-01-08 21:07:51 +00:00
|
|
|
}
|
2000-10-06 10:11:40 +00:00
|
|
|
|
2010-01-08 21:07:51 +00:00
|
|
|
proto_tree_add_uint(fh_tree, hf_frame_number, tvb,
|
|
|
|
0, 0, pinfo->fd->num);
|
2000-10-06 10:11:40 +00:00
|
|
|
|
2010-01-08 21:07:51 +00:00
|
|
|
proto_tree_add_uint_format(fh_tree, hf_frame_len, tvb,
|
|
|
|
0, 0, frame_len, "Frame Length: %u byte%s (%u bits)",
|
|
|
|
frame_len, frame_plurality, frame_len * 8);
|
2007-03-23 18:08:17 +00:00
|
|
|
|
2010-01-08 21:07:51 +00:00
|
|
|
proto_tree_add_uint_format(fh_tree, hf_frame_capture_len, tvb,
|
|
|
|
0, 0, cap_len, "Capture Length: %u byte%s (%u bits)",
|
|
|
|
cap_len, cap_plurality, cap_len * 8);
|
2007-03-23 18:08:17 +00:00
|
|
|
|
2010-01-08 21:07:51 +00:00
|
|
|
if (generate_md5_hash) {
|
|
|
|
const guint8 *cp;
|
2012-05-03 19:31:03 +00:00
|
|
|
md5_state_t md_ctx;
|
|
|
|
md5_byte_t digest[16];
|
2012-12-26 05:57:06 +00:00
|
|
|
const gchar *digest_string;
|
2000-12-15 03:30:21 +00:00
|
|
|
|
2010-01-08 21:07:51 +00:00
|
|
|
cp = tvb_get_ptr(tvb, 0, cap_len);
|
2000-12-15 03:30:21 +00:00
|
|
|
|
2010-01-08 21:07:51 +00:00
|
|
|
md5_init(&md_ctx);
|
|
|
|
md5_append(&md_ctx, cp, cap_len);
|
|
|
|
md5_finish(&md_ctx, digest);
|
|
|
|
|
2013-12-19 20:53:44 +00:00
|
|
|
digest_string = bytestring_to_str(wmem_packet_scope(), digest, 16, '\0');
|
2010-01-08 21:07:51 +00:00
|
|
|
ti = proto_tree_add_string(fh_tree, hf_frame_md5_hash, tvb, 0, 0, digest_string);
|
|
|
|
PROTO_ITEM_SET_GENERATED(ti);
|
|
|
|
}
|
|
|
|
|
|
|
|
ti = proto_tree_add_boolean(fh_tree, hf_frame_marked, tvb, 0, 0,pinfo->fd->flags.marked);
|
2009-01-29 22:43:49 +00:00
|
|
|
PROTO_ITEM_SET_GENERATED(ti);
|
2005-01-19 04:49:29 +00:00
|
|
|
|
2010-01-08 21:07:51 +00:00
|
|
|
ti = proto_tree_add_boolean(fh_tree, hf_frame_ignored, tvb, 0, 0,pinfo->fd->flags.ignored);
|
|
|
|
PROTO_ITEM_SET_GENERATED(ti);
|
2000-11-29 05:16:15 +00:00
|
|
|
|
2010-01-08 21:07:51 +00:00
|
|
|
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
|
|
|
|
* TRY_TO_FAKE_THIS_ITEM() optimisation for the tree by
|
|
|
|
* setting it as visible.
|
|
|
|
*
|
|
|
|
* See proto.h for details.
|
|
|
|
*/
|
|
|
|
old_visible = proto_tree_set_visible(fh_tree, TRUE);
|
|
|
|
ti = proto_tree_add_string(fh_tree, hf_frame_protocols, tvb, 0, 0, "");
|
|
|
|
PROTO_ITEM_SET_GENERATED(ti);
|
|
|
|
proto_tree_set_visible(fh_tree, old_visible);
|
2000-10-06 10:11:40 +00:00
|
|
|
}
|
2010-01-08 21:07:51 +00:00
|
|
|
|
|
|
|
/* Check for existences of P2P pseudo header */
|
|
|
|
if (pinfo->p2p_dir != P2P_DIR_UNKNOWN) {
|
|
|
|
proto_tree_add_int(fh_tree, hf_frame_p2p_dir, tvb,
|
|
|
|
0, 0, pinfo->p2p_dir);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check for existences of MTP2 link number */
|
|
|
|
if ((pinfo->pseudo_header != NULL ) && (pinfo->fd->lnk_t == WTAP_ENCAP_MTP2_WITH_PHDR)) {
|
|
|
|
proto_tree_add_uint(fh_tree, hf_link_number, tvb,
|
|
|
|
0, 0, pinfo->link_number);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (show_file_off) {
|
2013-09-30 15:59:27 +00:00
|
|
|
proto_tree_add_int64_format_value(fh_tree, hf_frame_file_off, tvb,
|
2010-01-08 21:07:51 +00:00
|
|
|
0, 0, pinfo->fd->file_off,
|
2013-09-30 15:59:27 +00:00
|
|
|
"%" G_GINT64_MODIFIER "d (0x%" G_GINT64_MODIFIER "x)",
|
2010-01-08 21:07:51 +00:00
|
|
|
pinfo->fd->file_off, pinfo->fd->file_off);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(pinfo->fd->color_filter != NULL) {
|
2013-03-19 20:00:52 +00:00
|
|
|
const color_filter_t *color_filter = (const color_filter_t *)pinfo->fd->color_filter;
|
2010-01-08 21:07:51 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pinfo->fd->flags.ignored) {
|
|
|
|
/* Ignored package, stop handling here */
|
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "<Ignored>");
|
2014-05-12 00:33:58 +00:00
|
|
|
proto_tree_add_text (tree, tvb, 0, 0, "This frame is marked as ignored");
|
2010-01-08 21:07:51 +00:00
|
|
|
return;
|
2006-02-23 09:11:00 +00:00
|
|
|
}
|
2010-01-08 21:07:51 +00:00
|
|
|
|
|
|
|
/* Portable Exception Handling to trap Wireshark specific exceptions like BoundsError exceptions */
|
|
|
|
TRY {
|
2006-01-25 21:34:04 +00:00
|
|
|
#ifdef _MSC_VER
|
2012-05-03 19:31:03 +00:00
|
|
|
/* Win32: Visual-C Structured Exception Handling (SEH) to trap hardware exceptions
|
|
|
|
like memory access violations.
|
|
|
|
(a running debugger will be called before the except part below) */
|
2012-10-29 20:12:28 +00:00
|
|
|
/* Note: A Windows "exceptional exception" may leave the kazlib's (Portable Exception Handling)
|
|
|
|
stack in an inconsistent state thus causing a crash at some point in the
|
|
|
|
handling of the exception.
|
|
|
|
See: https://www.wireshark.org/lists/wireshark-dev/200704/msg00243.html
|
|
|
|
*/
|
2010-01-08 21:07:51 +00:00
|
|
|
__try {
|
|
|
|
#endif
|
2014-05-25 00:04:44 +00:00
|
|
|
switch (pinfo->phdr->rec_type) {
|
|
|
|
|
|
|
|
case REC_TYPE_PACKET:
|
|
|
|
if ((force_docsis_encap) && (docsis_handle)) {
|
|
|
|
call_dissector(docsis_handle, tvb, pinfo, parent_tree);
|
|
|
|
} else {
|
|
|
|
if (!dissector_try_uint(wtap_encap_dissector_table, pinfo->fd->lnk_t,
|
|
|
|
tvb, pinfo, parent_tree)) {
|
|
|
|
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "UNKNOWN");
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "WTAP_ENCAP = %d",
|
|
|
|
pinfo->fd->lnk_t);
|
|
|
|
call_dissector(data_handle,tvb, pinfo, parent_tree);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case REC_TYPE_FT_SPECIFIC_EVENT:
|
|
|
|
case REC_TYPE_FT_SPECIFIC_REPORT:
|
|
|
|
if (!dissector_try_uint(wtap_fts_rec_dissector_table, pinfo->file_type_subtype,
|
2010-01-08 21:07:51 +00:00
|
|
|
tvb, pinfo, parent_tree)) {
|
|
|
|
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "UNKNOWN");
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "WTAP_ENCAP = %d",
|
2014-05-25 00:04:44 +00:00
|
|
|
pinfo->file_type_subtype);
|
2010-01-08 21:07:51 +00:00
|
|
|
call_dissector(data_handle,tvb, pinfo, parent_tree);
|
|
|
|
}
|
2014-05-25 00:04:44 +00:00
|
|
|
break;
|
2010-01-08 21:07:51 +00:00
|
|
|
}
|
|
|
|
#ifdef _MSC_VER
|
2011-11-28 16:23:55 +00:00
|
|
|
} __except(EXCEPTION_EXECUTE_HANDLER /* handle all exceptions */) {
|
2010-01-08 21:07:51 +00:00
|
|
|
switch(GetExceptionCode()) {
|
|
|
|
case(STATUS_ACCESS_VIOLATION):
|
|
|
|
show_exception(tvb, pinfo, parent_tree, DissectorError,
|
|
|
|
"STATUS_ACCESS_VIOLATION: dissector accessed an invalid memory address");
|
|
|
|
break;
|
|
|
|
case(STATUS_INTEGER_DIVIDE_BY_ZERO):
|
|
|
|
show_exception(tvb, pinfo, parent_tree, DissectorError,
|
|
|
|
"STATUS_INTEGER_DIVIDE_BY_ZERO: dissector tried an integer division by zero");
|
|
|
|
break;
|
|
|
|
case(STATUS_STACK_OVERFLOW):
|
|
|
|
show_exception(tvb, pinfo, parent_tree, DissectorError,
|
|
|
|
"STATUS_STACK_OVERFLOW: dissector overflowed the stack (e.g. endless loop)");
|
2012-05-03 19:31:03 +00:00
|
|
|
/* XXX - this will have probably corrupted the stack,
|
|
|
|
which makes problems later in the exception code */
|
2010-01-08 21:07:51 +00:00
|
|
|
break;
|
|
|
|
/* XXX - add other hardware exception codes as required */
|
|
|
|
default:
|
|
|
|
show_exception(tvb, pinfo, parent_tree, DissectorError,
|
|
|
|
g_strdup_printf("dissector caused an unknown exception: 0x%x", GetExceptionCode()));
|
|
|
|
}
|
|
|
|
}
|
2006-01-22 02:22:14 +00:00
|
|
|
#endif
|
2000-10-06 10:11:40 +00:00
|
|
|
}
|
Move show_exception() and show_reported_bounds_error() to
epan/show_exception.c, as it's used outside
epan/dissectors/packet-frame.c. Update their callers to include
<epan/show_exception.h> to get their declaration.
Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if
there's more stuff in the packet to dissect after the dissector call
that threw the exception, doesn't mean you shouldn't go ahead and
dissect that stuff. Use it in all those cases, including ones where
BoundsError was inappropriately being caught (you want those passed up
to the top level, so that the packet is reported as having been cut
short in the capture process).
Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that
correspond to running past the end of the data for a tvbuff; use it
rather than explicitly catching those exceptions individually, and
rather than just catching all exceptions (the only place that
DissectorError should be caught, for example, is at the top level, so
dissector bugs show up in the protocol tree).
Don't catch and then immediately rethrow exceptions without doing
anything else; just let the exceptions go up to the final catcher.
Use show_exception() to report non-fatal errors, rather than doing it
yourself.
If a dissector is called from Lua, catch all non-fatal errors and use
show_exception() to report them rather than catching only
ReportedBoundsError and adding a proto_malformed item.
Don't catch exceptions when constructing a trailer tvbuff in
packet-ieee8023.c - just construct it after the payload has been
dissected, and let whatever exceptions that throws be handled at the top
level.
Avoid some TRY/CATCH/ENDTRY cases by using checks such as
tvb_bytes_exist() before even looking in the tvbuff.
svn path=/trunk/; revision=47924
2013-02-27 22:43:54 +00:00
|
|
|
CATCH_BOUNDS_AND_DISSECTOR_ERRORS {
|
2005-04-11 08:43:51 +00:00
|
|
|
show_exception(tvb, pinfo, parent_tree, EXCEPT_CODE, GET_MESSAGE);
|
2003-10-23 05:01:39 +00:00
|
|
|
}
|
|
|
|
ENDTRY;
|
|
|
|
|
2013-11-05 17:48:48 +00:00
|
|
|
if(proto_field_is_referenced(tree, hf_frame_protocols)) {
|
2014-05-11 21:55:20 +00:00
|
|
|
wmem_strbuf_t *val = wmem_strbuf_sized_new(wmem_packet_scope(), 128, 0);
|
2013-11-05 17:48:48 +00:00
|
|
|
wmem_list_frame_t *frame;
|
|
|
|
/* skip the first entry, it's always the "frame" protocol */
|
|
|
|
frame = wmem_list_frame_next(wmem_list_head(pinfo->layers));
|
|
|
|
if (frame) {
|
|
|
|
wmem_strbuf_append(val, proto_get_protocol_filter_name(GPOINTER_TO_UINT(wmem_list_frame_data(frame))));
|
|
|
|
frame = wmem_list_frame_next(frame);
|
|
|
|
}
|
|
|
|
while (frame) {
|
|
|
|
wmem_strbuf_append_c(val, ':');
|
|
|
|
wmem_strbuf_append(val, proto_get_protocol_filter_name(GPOINTER_TO_UINT(wmem_list_frame_data(frame))));
|
|
|
|
frame = wmem_list_frame_next(frame);
|
|
|
|
}
|
|
|
|
proto_item_append_string(ti, wmem_strbuf_get_str(val));
|
2005-01-19 04:49:29 +00:00
|
|
|
}
|
|
|
|
|
2008-05-21 14:18:37 +00:00
|
|
|
/* Call postdissectors if we have any (while trying to avoid another
|
|
|
|
* TRY/CATCH)
|
|
|
|
*/
|
|
|
|
if (have_postdissector()) {
|
2010-01-08 21:07:51 +00:00
|
|
|
TRY {
|
2008-05-21 14:18:37 +00:00
|
|
|
#ifdef _MSC_VER
|
2012-05-03 19:31:03 +00:00
|
|
|
/* Win32: Visual-C Structured Exception Handling (SEH)
|
|
|
|
to trap hardware exceptions like memory access violations */
|
2010-01-08 21:07:51 +00:00
|
|
|
/* (a running debugger will be called before the except part below) */
|
2012-10-29 20:12:28 +00:00
|
|
|
/* Note: A Windows "exceptional exception" may leave the kazlib's (Portable Exception Handling)
|
|
|
|
stack in an inconsistent state thus causing a crash at some point in the
|
|
|
|
handling of the exception.
|
|
|
|
See: https://www.wireshark.org/lists/wireshark-dev/200704/msg00243.html
|
|
|
|
*/
|
2010-01-08 21:07:51 +00:00
|
|
|
__try {
|
2008-05-21 14:18:37 +00:00
|
|
|
#endif
|
2010-01-08 21:07:51 +00:00
|
|
|
call_all_postdissectors(tvb, pinfo, parent_tree);
|
2008-05-21 14:18:37 +00:00
|
|
|
#ifdef _MSC_VER
|
2011-11-28 16:23:55 +00:00
|
|
|
} __except(EXCEPTION_EXECUTE_HANDLER /* handle all exceptions */) {
|
2010-01-08 21:07:51 +00:00
|
|
|
switch(GetExceptionCode()) {
|
|
|
|
case(STATUS_ACCESS_VIOLATION):
|
|
|
|
show_exception(tvb, pinfo, parent_tree, DissectorError,
|
|
|
|
"STATUS_ACCESS_VIOLATION: dissector accessed an invalid memory address");
|
|
|
|
break;
|
|
|
|
case(STATUS_INTEGER_DIVIDE_BY_ZERO):
|
|
|
|
show_exception(tvb, pinfo, parent_tree, DissectorError,
|
|
|
|
"STATUS_INTEGER_DIVIDE_BY_ZERO: dissector tried an integer division by zero");
|
|
|
|
break;
|
|
|
|
case(STATUS_STACK_OVERFLOW):
|
|
|
|
show_exception(tvb, pinfo, parent_tree, DissectorError,
|
|
|
|
"STATUS_STACK_OVERFLOW: dissector overflowed the stack (e.g. endless loop)");
|
2012-05-03 19:31:03 +00:00
|
|
|
/* XXX - this will have probably corrupted the stack,
|
|
|
|
which makes problems later in the exception code */
|
2010-01-08 21:07:51 +00:00
|
|
|
break;
|
|
|
|
/* XXX - add other hardware exception codes as required */
|
|
|
|
default:
|
|
|
|
show_exception(tvb, pinfo, parent_tree, DissectorError,
|
|
|
|
g_strdup_printf("dissector caused an unknown exception: 0x%x", GetExceptionCode()));
|
|
|
|
}
|
|
|
|
}
|
2008-05-21 14:18:37 +00:00
|
|
|
#endif
|
2010-01-08 21:07:51 +00:00
|
|
|
}
|
Move show_exception() and show_reported_bounds_error() to
epan/show_exception.c, as it's used outside
epan/dissectors/packet-frame.c. Update their callers to include
<epan/show_exception.h> to get their declaration.
Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if
there's more stuff in the packet to dissect after the dissector call
that threw the exception, doesn't mean you shouldn't go ahead and
dissect that stuff. Use it in all those cases, including ones where
BoundsError was inappropriately being caught (you want those passed up
to the top level, so that the packet is reported as having been cut
short in the capture process).
Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that
correspond to running past the end of the data for a tvbuff; use it
rather than explicitly catching those exceptions individually, and
rather than just catching all exceptions (the only place that
DissectorError should be caught, for example, is at the top level, so
dissector bugs show up in the protocol tree).
Don't catch and then immediately rethrow exceptions without doing
anything else; just let the exceptions go up to the final catcher.
Use show_exception() to report non-fatal errors, rather than doing it
yourself.
If a dissector is called from Lua, catch all non-fatal errors and use
show_exception() to report them rather than catching only
ReportedBoundsError and adding a proto_malformed item.
Don't catch exceptions when constructing a trailer tvbuff in
packet-ieee8023.c - just construct it after the payload has been
dissected, and let whatever exceptions that throws be handled at the top
level.
Avoid some TRY/CATCH/ENDTRY cases by using checks such as
tvb_bytes_exist() before even looking in the tvbuff.
svn path=/trunk/; revision=47924
2013-02-27 22:43:54 +00:00
|
|
|
CATCH_BOUNDS_AND_DISSECTOR_ERRORS {
|
2010-01-08 21:07:51 +00:00
|
|
|
show_exception(tvb, pinfo, parent_tree, EXCEPT_CODE, GET_MESSAGE);
|
|
|
|
}
|
|
|
|
ENDTRY;
|
2008-05-21 14:18:37 +00:00
|
|
|
}
|
2005-01-19 04:49:29 +00:00
|
|
|
|
2006-01-24 00:26:57 +00:00
|
|
|
tap_queue_packet(frame_tap, pinfo, NULL);
|
2007-02-20 01:32:14 +00:00
|
|
|
|
2004-11-28 20:52:52 +00:00
|
|
|
|
2012-09-03 12:00:40 +00:00
|
|
|
if (pinfo->frame_end_routines) {
|
|
|
|
g_slist_foreach(pinfo->frame_end_routines, &call_frame_end_routine, NULL);
|
|
|
|
g_slist_free(pinfo->frame_end_routines);
|
|
|
|
pinfo->frame_end_routines = NULL;
|
2005-12-16 00:32:12 +00:00
|
|
|
}
|
2003-10-23 05:01:39 +00:00
|
|
|
}
|
|
|
|
|
2000-10-06 10:11:40 +00:00
|
|
|
void
|
|
|
|
proto_register_frame(void)
|
|
|
|
{
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_frame_arrival_time,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "Arrival Time", "frame.time",
|
|
|
|
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0,
|
|
|
|
"Absolute time when this frame was captured", HFILL }},
|
2000-10-06 10:11:40 +00:00
|
|
|
|
2011-08-13 17:39:38 +00:00
|
|
|
{ &hf_frame_shift_offset,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "Time shift for this packet", "frame.offset_shift",
|
|
|
|
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
|
|
|
|
"Time shift applied to this packet", HFILL }},
|
2011-08-13 17:39:38 +00:00
|
|
|
|
2009-11-29 09:26:01 +00:00
|
|
|
{ &hf_frame_arrival_time_epoch,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "Epoch Time", "frame.time_epoch",
|
|
|
|
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
|
|
|
|
"Epoch time when this frame was captured", HFILL }},
|
2009-11-29 09:26:01 +00:00
|
|
|
|
2000-10-06 10:11:40 +00:00
|
|
|
{ &hf_frame_time_delta,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "Time delta from previous captured frame", "frame.time_delta",
|
|
|
|
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2007-03-23 18:08:17 +00:00
|
|
|
|
|
|
|
{ &hf_frame_time_delta_displayed,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "Time delta from previous displayed frame", "frame.time_delta_displayed",
|
|
|
|
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2000-10-06 10:11:40 +00:00
|
|
|
|
2000-12-15 03:30:21 +00:00
|
|
|
{ &hf_frame_time_relative,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "Time since reference or first frame", "frame.time_relative",
|
|
|
|
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
|
|
|
|
"Time relative to time reference or first frame", HFILL }},
|
2000-12-15 03:30:21 +00:00
|
|
|
|
2009-01-29 22:43:49 +00:00
|
|
|
{ &hf_frame_time_reference,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "This is a Time Reference frame", "frame.ref_time",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0x0,
|
|
|
|
"This frame is a Time Reference frame", HFILL }},
|
2009-01-29 22:43:49 +00:00
|
|
|
|
2000-10-06 10:11:40 +00:00
|
|
|
{ &hf_frame_number,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "Frame Number", "frame.number",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2007-01-21 23:02:07 +00:00
|
|
|
|
|
|
|
{ &hf_frame_len,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "Frame length on the wire", "frame.len",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2000-10-06 10:11:40 +00:00
|
|
|
|
|
|
|
{ &hf_frame_capture_len,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "Frame length stored into the capture file", "frame.cap_len",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2000-10-06 10:11:40 +00:00
|
|
|
|
2009-01-04 12:08:17 +00:00
|
|
|
{ &hf_frame_md5_hash,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "Frame MD5 Hash", "frame.md5_hash",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2009-01-04 12:08:17 +00:00
|
|
|
|
2000-10-06 10:11:40 +00:00
|
|
|
{ &hf_frame_p2p_dir,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "Point-to-Point Direction", "frame.p2p_dir",
|
|
|
|
FT_INT8, BASE_DEC, VALS(p2p_dirs), 0x0,
|
|
|
|
NULL, HFILL }},
|
2001-11-01 04:00:56 +00:00
|
|
|
|
2005-05-02 14:07:33 +00:00
|
|
|
{ &hf_link_number,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "Link Number", "frame.link_nr",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2005-05-02 14:07:33 +00:00
|
|
|
|
2001-11-01 04:00:56 +00:00
|
|
|
{ &hf_frame_file_off,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "File Offset", "frame.file_off",
|
|
|
|
FT_INT64, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2001-11-01 04:00:56 +00:00
|
|
|
|
2002-05-03 21:38:20 +00:00
|
|
|
{ &hf_frame_marked,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "Frame is marked", "frame.marked",
|
|
|
|
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
|
|
|
"Frame is marked in the GUI", HFILL }},
|
2003-09-22 09:06:10 +00:00
|
|
|
|
2009-12-17 01:18:14 +00:00
|
|
|
{ &hf_frame_ignored,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "Frame is ignored", "frame.ignored",
|
|
|
|
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
|
|
|
"Frame is ignored by the dissectors", HFILL }},
|
2009-12-17 01:18:14 +00:00
|
|
|
|
2005-01-19 04:49:29 +00:00
|
|
|
{ &hf_frame_protocols,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "Protocols in frame", "frame.protocols",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Protocols carried by this frame", HFILL }},
|
2006-01-21 17:49:00 +00:00
|
|
|
|
|
|
|
{ &hf_frame_color_filter_name,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "Coloring Rule Name", "frame.coloring_rule.name",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"The frame matched the coloring rule with this name", HFILL }},
|
2009-01-29 22:43:49 +00:00
|
|
|
|
2006-01-21 17:49:00 +00:00
|
|
|
{ &hf_frame_color_filter_text,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "Coloring Rule String", "frame.coloring_rule.string",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"The frame matched this coloring rule string", HFILL }},
|
2012-02-11 12:34:39 +00:00
|
|
|
|
|
|
|
{ &hf_frame_interface_id,
|
2012-05-03 19:31:03 +00:00
|
|
|
{ "Interface id", "frame.interface_id",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2012-02-11 12:34:39 +00:00
|
|
|
|
2012-12-22 19:48:17 +00:00
|
|
|
{ &hf_frame_pack_flags,
|
|
|
|
{ "Packet flags", "frame.packet_flags",
|
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_frame_pack_direction,
|
|
|
|
{ "Direction", "frame.packet_flags_direction",
|
2014-03-07 04:55:37 +00:00
|
|
|
FT_UINT32, BASE_HEX, VALS(packet_word_directions), PACKET_WORD_DIRECTION_MASK,
|
2012-12-22 19:48:17 +00:00
|
|
|
NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_frame_pack_reception_type,
|
|
|
|
{ "Reception type", "frame.packet_flags_reception_type",
|
2014-03-07 04:55:37 +00:00
|
|
|
FT_UINT32, BASE_DEC, VALS(packet_word_reception_types), PACKET_WORD_RECEPTION_TYPE_MASK,
|
2012-12-22 19:48:17 +00:00
|
|
|
NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_frame_pack_fcs_length,
|
|
|
|
{ "FCS length", "frame.packet_flags_fcs_length",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, PACKET_WORD_FCS_LENGTH_MASK,
|
|
|
|
NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_frame_pack_reserved,
|
|
|
|
{ "Reserved", "frame.packet_flags_reserved",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, PACKET_WORD_RESERVED_MASK,
|
|
|
|
NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_frame_pack_crc_error,
|
|
|
|
{ "CRC error", "frame.packet_flags_crc_error",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_CRC_ERR_MASK,
|
|
|
|
NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_frame_pack_wrong_packet_too_long_error,
|
|
|
|
{ "Packet too long error", "frame.packet_flags_packet_too_error",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_PACKET_TOO_LONG_ERR_MASK,
|
|
|
|
NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_frame_pack_wrong_packet_too_short_error,
|
|
|
|
{ "Packet too short error", "frame.packet_flags_packet_too_short_error",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_PACKET_TOO_SHORT_ERR_MASK,
|
|
|
|
NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_frame_pack_wrong_inter_frame_gap_error,
|
|
|
|
{ "Wrong interframe gap error", "frame.packet_flags_wrong_inter_frame_gap_error",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_WRONG_INTER_FRAME_GAP_ERR_MASK,
|
|
|
|
NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_frame_pack_unaligned_frame_error,
|
|
|
|
{ "Unaligned frame error", "frame.packet_flags_unaligned_frame_error",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_UNALIGNED_FRAME_ERR_MASK,
|
|
|
|
NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_frame_pack_start_frame_delimiter_error,
|
|
|
|
{ "Start frame delimiter error", "frame.packet_flags_start_frame_delimiter_error",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_START_FRAME_DELIMITER_ERR_MASK,
|
|
|
|
NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_frame_pack_preamble_error,
|
|
|
|
{ "Preamble error", "frame.packet_flags_preamble_error",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_PREAMBLE_ERR_MASK,
|
|
|
|
NULL, HFILL }},
|
|
|
|
|
|
|
|
{ &hf_frame_pack_symbol_error,
|
|
|
|
{ "Symbol error", "frame.packet_flags_symbol_error",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_set_notset), PACKET_WORD_SYMBOL_ERR_MASK,
|
|
|
|
NULL, HFILL }},
|
|
|
|
|
2012-02-11 12:34:39 +00:00
|
|
|
{ &hf_comments_text,
|
2012-07-22 03:06:37 +00:00
|
|
|
{ "Comment", "frame.comment",
|
2012-05-03 19:31:03 +00:00
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2009-01-29 22:43:49 +00:00
|
|
|
};
|
2013-08-01 23:34:47 +00:00
|
|
|
|
2012-06-06 20:35:37 +00:00
|
|
|
static hf_register_info hf_encap =
|
|
|
|
{ &hf_frame_wtap_encap,
|
|
|
|
{ "Encapsulation type", "frame.encap_type",
|
|
|
|
FT_INT16, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }};
|
2013-08-01 23:34:47 +00:00
|
|
|
|
2012-06-06 20:35:37 +00:00
|
|
|
static gint *ett[] = {
|
2012-02-11 12:34:39 +00:00
|
|
|
&ett_frame,
|
2012-12-22 19:48:17 +00:00
|
|
|
&ett_flags,
|
2012-02-11 12:34:39 +00:00
|
|
|
&ett_comments
|
2000-10-06 10:11:40 +00:00
|
|
|
};
|
2012-06-06 20:35:37 +00:00
|
|
|
|
2013-05-26 03:29:07 +00:00
|
|
|
static ei_register_info ei[] = {
|
|
|
|
{ &ei_comments_text, { "frame.comment.expert", PI_COMMENTS_GROUP, PI_COMMENT, "Formatted comment", EXPFILL }},
|
2013-07-03 02:59:31 +00:00
|
|
|
{ &ei_arrive_time_out_of_range, { "frame.time_invalid", PI_SEQUENCE, PI_NOTE, "Arrival Time: Fractional second out of range (0-1000000000)", EXPFILL }},
|
2013-05-26 03:29:07 +00:00
|
|
|
};
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
module_t *frame_module;
|
2013-05-26 03:29:07 +00:00
|
|
|
expert_module_t* expert_frame;
|
2000-10-06 10:11:40 +00:00
|
|
|
|
2012-06-06 20:35:37 +00:00
|
|
|
if (hf_encap.hfinfo.strings == NULL) {
|
|
|
|
int encap_count = wtap_get_num_encap_types();
|
|
|
|
value_string *arr;
|
|
|
|
int i;
|
2013-08-01 23:34:47 +00:00
|
|
|
|
|
|
|
hf_encap.hfinfo.strings = arr = g_new(value_string, encap_count+1);
|
|
|
|
|
2012-06-06 20:35:37 +00:00
|
|
|
for (i = 0; i < encap_count; i++) {
|
|
|
|
arr[i].value = i;
|
|
|
|
arr[i].strptr = wtap_encap_string(i);
|
|
|
|
}
|
|
|
|
arr[encap_count].value = 0;
|
|
|
|
arr[encap_count].strptr = NULL;
|
|
|
|
}
|
|
|
|
|
2001-12-08 06:41:48 +00:00
|
|
|
wtap_encap_dissector_table = register_dissector_table("wtap_encap",
|
|
|
|
"Wiretap encapsulation type", FT_UINT32, BASE_DEC);
|
2014-05-25 00:04:44 +00:00
|
|
|
wtap_fts_rec_dissector_table = register_dissector_table("wtap_fts_rec",
|
|
|
|
"Wiretap file type for file-type-specific records", FT_UINT32, BASE_DEC);
|
2000-11-29 05:16:15 +00:00
|
|
|
|
2001-01-03 06:56:03 +00:00
|
|
|
proto_frame = proto_register_protocol("Frame", "Frame", "frame");
|
2012-02-11 12:34:39 +00:00
|
|
|
proto_pkt_comment = proto_register_protocol("Packet comments", "Pkt_Comment", "pkt_comment");
|
2000-10-06 10:11:40 +00:00
|
|
|
proto_register_field_array(proto_frame, hf, array_length(hf));
|
2012-06-06 20:35:37 +00:00
|
|
|
proto_register_field_array(proto_frame, &hf_encap, 1);
|
2000-10-06 10:11:40 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2013-05-26 03:29:07 +00:00
|
|
|
expert_frame = expert_register_protocol(proto_frame);
|
|
|
|
expert_register_field_array(expert_frame, ei, array_length(ei));
|
2001-04-01 21:12:05 +00:00
|
|
|
register_dissector("frame",dissect_frame,proto_frame);
|
2000-10-06 10:11:40 +00:00
|
|
|
|
2001-01-03 06:56:03 +00:00
|
|
|
/* You can't disable dissection of "Frame", as that would be
|
|
|
|
tantamount to not doing any dissection whatsoever. */
|
2004-01-03 18:40:08 +00:00
|
|
|
proto_set_cant_toggle(proto_frame);
|
2000-10-06 10:11:40 +00:00
|
|
|
|
2001-12-08 21:03:41 +00:00
|
|
|
/* Our preferences */
|
|
|
|
frame_module = prefs_register_protocol(proto_frame, NULL);
|
|
|
|
prefs_register_bool_preference(frame_module, "show_file_off",
|
2009-01-29 22:43:49 +00:00
|
|
|
"Show File Offset", "Show offset of frame in capture file", &show_file_off);
|
2002-07-12 22:52:43 +00:00
|
|
|
prefs_register_bool_preference(frame_module, "force_docsis_encap",
|
|
|
|
"Treat all frames as DOCSIS frames", "Treat all frames as DOCSIS Frames", &force_docsis_encap);
|
2009-01-04 12:08:17 +00:00
|
|
|
prefs_register_bool_preference(frame_module, "generate_md5_hash",
|
|
|
|
"Generate an MD5 hash of each frame",
|
|
|
|
"Whether or not MD5 hashes should be generated for each frame, useful for finding duplicate frames.",
|
|
|
|
&generate_md5_hash);
|
2009-11-29 09:26:01 +00:00
|
|
|
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);
|
2011-04-15 17:53:23 +00:00
|
|
|
prefs_register_bool_preference(frame_module, "generate_bits_field",
|
|
|
|
"Show the number of bits in the frame",
|
|
|
|
"Whether or not the number of bits in the frame should be shown.",
|
|
|
|
&generate_bits_field);
|
2002-09-04 09:40:29 +00:00
|
|
|
|
|
|
|
frame_tap=register_tap("frame");
|
2000-10-06 10:11:40 +00:00
|
|
|
}
|
2001-11-26 01:23:59 +00:00
|
|
|
|
|
|
|
void
|
2001-12-08 21:03:41 +00:00
|
|
|
proto_reg_handoff_frame(void)
|
|
|
|
{
|
|
|
|
data_handle = find_dissector("data");
|
2002-07-12 22:52:43 +00:00
|
|
|
docsis_handle = find_dissector("docsis");
|
2001-11-26 01:23:59 +00:00
|
|
|
}
|
2013-11-05 17:48:48 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 8
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: t
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
|
|
|
|
* :indentSize=8:tabSize=8:noTabs=false:
|
|
|
|
*/
|