2007-05-28 06:38:30 +00:00
|
|
|
/*
|
|
|
|
* packet-fcoe.c
|
|
|
|
* Routines for FCoE dissection - Fibre Channel over Ethernet
|
|
|
|
* Copyright (c) 2006 Nuova Systems, Inc. (jre@nuovasystems.com)
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
2009-04-08 13:07:21 +00:00
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2007-05-28 06:38:30 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* Based on packet-fcip.c, Copyright 2001, Dinesh G Dutt (ddutt@cisco.com)
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* 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 23:18:38 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2007-05-28 06:38:30 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* For FCoE protocol details, see http://fcoe.com.
|
|
|
|
*/
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
2007-05-28 06:38:30 +00:00
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
#include <epan/packet.h>
|
|
|
|
#include <epan/prefs.h>
|
2011-08-31 09:00:54 +00:00
|
|
|
#include <epan/crc32-tvb.h>
|
2007-05-28 06:38:30 +00:00
|
|
|
#include <epan/etypes.h>
|
|
|
|
#include <epan/expert.h>
|
2013-09-15 09:12:01 +00:00
|
|
|
#include <epan/wmem/wmem.h>
|
2013-11-25 16:04:57 +00:00
|
|
|
#include "packet-fc.h"
|
2007-05-28 06:38:30 +00:00
|
|
|
|
2013-12-15 23:44:12 +00:00
|
|
|
void proto_register_fcoe(void);
|
|
|
|
void proto_reg_handoff_fcoe(void);
|
|
|
|
|
2007-09-20 06:50:53 +00:00
|
|
|
#define FCOE_HEADER_LEN 14 /* header: version, SOF, and padding */
|
2012-07-12 17:22:47 +00:00
|
|
|
#define FCOE_TRAILER_LEN 8 /* trailer: CRC, EOF, and padding */
|
2007-05-28 06:38:30 +00:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
FCOE_EOFn = 0x41,
|
|
|
|
FCOE_EOFt = 0x42,
|
|
|
|
FCOE_EOFrt = 0x44,
|
|
|
|
FCOE_EOFdt = 0x46,
|
|
|
|
FCOE_EOFni = 0x49,
|
|
|
|
FCOE_EOFdti = 0x4E,
|
|
|
|
FCOE_EOFrti = 0x4F,
|
|
|
|
FCOE_EOFa = 0x50
|
|
|
|
} fcoe_eof_t;
|
|
|
|
|
|
|
|
typedef enum {
|
2007-09-20 06:50:53 +00:00
|
|
|
FCOE_SOFf = 0x28,
|
|
|
|
FCOE_SOFi4 = 0x29,
|
|
|
|
FCOE_SOFi2 = 0x2D,
|
|
|
|
FCOE_SOFi3 = 0x2E,
|
|
|
|
FCOE_SOFn4 = 0x31,
|
|
|
|
FCOE_SOFn2 = 0x35,
|
|
|
|
FCOE_SOFn3 = 0x36,
|
|
|
|
FCOE_SOFc4 = 0x39
|
2007-05-28 06:38:30 +00:00
|
|
|
} fcoe_sof_t;
|
|
|
|
|
|
|
|
static const value_string fcoe_eof_vals[] = {
|
2012-07-12 17:22:47 +00:00
|
|
|
{FCOE_EOFn, "EOFn" },
|
|
|
|
{FCOE_EOFt, "EOFt" },
|
|
|
|
{FCOE_EOFrt, "EOFrt" },
|
|
|
|
{FCOE_EOFdt, "EOFdt" },
|
|
|
|
{FCOE_EOFni, "EOFni" },
|
2007-05-28 06:38:30 +00:00
|
|
|
{FCOE_EOFdti, "EOFdti" },
|
|
|
|
{FCOE_EOFrti, "EOFrti" },
|
2012-07-12 17:22:47 +00:00
|
|
|
{FCOE_EOFa, "EOFa" },
|
2007-05-28 06:38:30 +00:00
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string fcoe_sof_vals[] = {
|
|
|
|
{FCOE_SOFf, "SOFf" },
|
|
|
|
{FCOE_SOFi4, "SOFi4" },
|
|
|
|
{FCOE_SOFi2, "SOFi2" },
|
|
|
|
{FCOE_SOFi3, "SOFi3" },
|
|
|
|
{FCOE_SOFn4, "SOFn4" },
|
|
|
|
{FCOE_SOFn2, "SOFn2" },
|
|
|
|
{FCOE_SOFn3, "SOFn3" },
|
|
|
|
{FCOE_SOFc4, "SOFc4" },
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static int proto_fcoe = -1;
|
|
|
|
static int hf_fcoe_ver = -1;
|
|
|
|
static int hf_fcoe_len = -1;
|
|
|
|
static int hf_fcoe_sof = -1;
|
|
|
|
static int hf_fcoe_eof = -1;
|
|
|
|
static int hf_fcoe_crc = -1;
|
|
|
|
static int hf_fcoe_crc_bad = -1;
|
|
|
|
static int hf_fcoe_crc_good = -1;
|
|
|
|
|
|
|
|
static int ett_fcoe = -1;
|
|
|
|
static int ett_fcoe_crc = -1;
|
|
|
|
|
2013-05-26 03:29:07 +00:00
|
|
|
static expert_field ei_fcoe_crc = EI_INIT;
|
|
|
|
|
2007-05-28 06:38:30 +00:00
|
|
|
static dissector_handle_t data_handle;
|
|
|
|
static dissector_handle_t fc_handle;
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcoe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
2012-07-12 17:22:47 +00:00
|
|
|
gint crc_offset;
|
|
|
|
gint eof_offset;
|
|
|
|
gint frame_len = 0;
|
|
|
|
gint header_len = FCOE_HEADER_LEN;
|
|
|
|
guint version;
|
2008-06-25 03:05:19 +00:00
|
|
|
const char *ver;
|
2012-07-12 17:22:47 +00:00
|
|
|
guint16 len_sof;
|
|
|
|
gint bytes_remaining;
|
|
|
|
guint8 sof = 0;
|
|
|
|
guint8 eof = 0;
|
2007-05-28 06:38:30 +00:00
|
|
|
const char *eof_str;
|
2008-06-25 03:05:19 +00:00
|
|
|
const char *crc_msg;
|
|
|
|
const char *len_msg;
|
2007-05-28 06:38:30 +00:00
|
|
|
proto_item *ti;
|
|
|
|
proto_item *item;
|
2012-07-12 17:22:47 +00:00
|
|
|
proto_tree *fcoe_tree;
|
2007-05-28 06:38:30 +00:00
|
|
|
proto_tree *crc_tree;
|
2012-07-12 17:22:47 +00:00
|
|
|
tvbuff_t *next_tvb;
|
|
|
|
gboolean crc_exists;
|
|
|
|
guint32 crc_computed = 0;
|
|
|
|
guint32 crc = 0;
|
2013-11-25 16:04:57 +00:00
|
|
|
fc_data_t fc_data;
|
2007-05-28 06:38:30 +00:00
|
|
|
|
2007-09-20 06:50:53 +00:00
|
|
|
/*
|
|
|
|
* For now, handle both the version defined before and after August 2007.
|
|
|
|
* In the newer version, byte 1 is reserved and always zero. In the old
|
|
|
|
* version, it'll never be zero.
|
|
|
|
*/
|
|
|
|
if (tvb_get_guint8(tvb, 1)) {
|
|
|
|
header_len = 2;
|
|
|
|
len_sof = tvb_get_ntohs(tvb, 0);
|
|
|
|
frame_len = ((len_sof & 0x3ff0) >> 2) - 4;
|
|
|
|
sof = len_sof & 0xf;
|
|
|
|
sof |= (sof < 8) ? 0x30 : 0x20;
|
|
|
|
version = len_sof >> 14;
|
|
|
|
ver = "pre-T11 ";
|
2008-06-25 03:05:19 +00:00
|
|
|
if (version != 0)
|
2013-09-15 09:12:01 +00:00
|
|
|
ver = wmem_strdup_printf(wmem_packet_scope(), ver, "pre-T11 ver %d ", version);
|
2007-09-20 06:50:53 +00:00
|
|
|
} else {
|
2007-11-25 12:15:02 +00:00
|
|
|
frame_len = tvb_reported_length_remaining(tvb, 0) -
|
|
|
|
FCOE_HEADER_LEN - FCOE_TRAILER_LEN;
|
2007-09-20 06:50:53 +00:00
|
|
|
sof = tvb_get_guint8(tvb, FCOE_HEADER_LEN - 1);
|
2007-05-28 06:38:30 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Only version 0 is defined at this point.
|
|
|
|
* Don't print the version in the short summary if it is zero.
|
|
|
|
*/
|
|
|
|
ver = "";
|
2007-09-20 06:50:53 +00:00
|
|
|
version = tvb_get_guint8(tvb, 0) >> 4;
|
2008-06-25 03:05:19 +00:00
|
|
|
if (version != 0)
|
2013-09-15 09:12:01 +00:00
|
|
|
ver = wmem_strdup_printf(wmem_packet_scope(), ver, "ver %d ", version);
|
2007-09-20 06:50:53 +00:00
|
|
|
}
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "FCoE");
|
2007-09-20 06:50:53 +00:00
|
|
|
crc_offset = header_len + frame_len;
|
|
|
|
eof_offset = crc_offset + 4;
|
2014-06-19 17:18:16 +00:00
|
|
|
bytes_remaining = tvb_length_remaining(tvb, header_len);
|
2007-11-25 12:15:02 +00:00
|
|
|
if (bytes_remaining > frame_len)
|
|
|
|
bytes_remaining = frame_len; /* backing length */
|
|
|
|
next_tvb = tvb_new_subset(tvb, header_len, bytes_remaining, frame_len);
|
2007-09-20 06:50:53 +00:00
|
|
|
|
2012-07-12 17:22:47 +00:00
|
|
|
eof_str = "none";
|
|
|
|
if (tvb_bytes_exist(tvb, eof_offset, 1)) {
|
|
|
|
eof = tvb_get_guint8(tvb, eof_offset);
|
|
|
|
eof_str = val_to_str(eof, fcoe_eof_vals, "0x%x");
|
|
|
|
}
|
2007-05-28 06:38:30 +00:00
|
|
|
|
2012-07-12 17:22:47 +00:00
|
|
|
/*
|
|
|
|
* Check the CRC.
|
|
|
|
*/
|
|
|
|
crc_msg = "";
|
|
|
|
crc_exists = tvb_bytes_exist(tvb, crc_offset, 4);
|
|
|
|
if (crc_exists) {
|
|
|
|
crc = tvb_get_ntohl(tvb, crc_offset);
|
|
|
|
crc_computed = crc32_802_tvb(next_tvb, frame_len);
|
|
|
|
if (crc != crc_computed) {
|
|
|
|
crc_msg = " [bad FC CRC]";
|
2007-09-20 06:50:53 +00:00
|
|
|
}
|
2012-07-12 17:22:47 +00:00
|
|
|
}
|
|
|
|
len_msg = "";
|
|
|
|
if ((frame_len % 4) != 0 || frame_len < 24) {
|
|
|
|
len_msg = " [invalid length]";
|
|
|
|
}
|
2007-05-28 06:38:30 +00:00
|
|
|
|
2012-07-12 17:22:47 +00:00
|
|
|
ti = proto_tree_add_protocol_format(tree, proto_fcoe, tvb, 0,
|
|
|
|
header_len,
|
|
|
|
"FCoE %s(%s/%s) %d bytes%s%s", ver,
|
|
|
|
val_to_str(sof, fcoe_sof_vals,
|
|
|
|
"0x%x"),
|
|
|
|
eof_str, frame_len, crc_msg,
|
|
|
|
len_msg);
|
2007-05-28 06:38:30 +00:00
|
|
|
|
2012-07-12 17:22:47 +00:00
|
|
|
/* Dissect the FCoE header */
|
2007-05-28 06:38:30 +00:00
|
|
|
|
2012-07-12 17:22:47 +00:00
|
|
|
fcoe_tree = proto_item_add_subtree(ti, ett_fcoe);
|
|
|
|
proto_tree_add_uint(fcoe_tree, hf_fcoe_ver, tvb, 0, 1, version);
|
|
|
|
if (tvb_get_guint8(tvb, 1)) {
|
|
|
|
proto_tree_add_uint(fcoe_tree, hf_fcoe_len, tvb, 0, 2, frame_len);
|
|
|
|
}
|
|
|
|
proto_tree_add_uint(fcoe_tree, hf_fcoe_sof, tvb,
|
|
|
|
header_len - 1, 1, sof);
|
2007-05-28 06:38:30 +00:00
|
|
|
|
2012-07-12 17:22:47 +00:00
|
|
|
/*
|
|
|
|
* Create the CRC information.
|
|
|
|
*/
|
|
|
|
if (crc_exists) {
|
|
|
|
if (crc == crc_computed) {
|
2013-09-15 01:48:30 +00:00
|
|
|
item = proto_tree_add_uint_format_value(fcoe_tree, hf_fcoe_crc, tvb,
|
2012-07-12 17:22:47 +00:00
|
|
|
crc_offset, 4, crc,
|
2013-09-15 01:48:30 +00:00
|
|
|
"%8.8x [valid]", crc);
|
2007-11-25 15:36:38 +00:00
|
|
|
} else {
|
2013-09-15 01:48:30 +00:00
|
|
|
item = proto_tree_add_uint_format_value(fcoe_tree, hf_fcoe_crc, tvb,
|
2012-07-12 17:22:47 +00:00
|
|
|
crc_offset, 4, crc,
|
2013-09-15 01:48:30 +00:00
|
|
|
"%8.8x [error: should be %8.8x]",
|
2012-07-12 17:22:47 +00:00
|
|
|
crc, crc_computed);
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, item, &ei_fcoe_crc,
|
2012-07-12 17:22:47 +00:00
|
|
|
"Bad FC CRC %8.8x %8.x",
|
|
|
|
crc, crc_computed);
|
2007-05-28 06:38:30 +00:00
|
|
|
}
|
2012-07-12 17:22:47 +00:00
|
|
|
proto_tree_set_appendix(fcoe_tree, tvb, crc_offset,
|
2014-06-19 17:18:16 +00:00
|
|
|
tvb_length_remaining (tvb, crc_offset));
|
2012-07-12 17:22:47 +00:00
|
|
|
} else {
|
|
|
|
item = proto_tree_add_text(fcoe_tree, tvb, crc_offset, 0,
|
|
|
|
"CRC: [missing]");
|
|
|
|
}
|
|
|
|
crc_tree = proto_item_add_subtree(item, ett_fcoe_crc);
|
|
|
|
ti = proto_tree_add_boolean(crc_tree, hf_fcoe_crc_bad, tvb,
|
|
|
|
crc_offset, 4,
|
|
|
|
crc_exists && crc != crc_computed);
|
|
|
|
PROTO_ITEM_SET_GENERATED(ti);
|
|
|
|
ti = proto_tree_add_boolean(crc_tree, hf_fcoe_crc_good, tvb,
|
|
|
|
crc_offset, 4,
|
|
|
|
crc_exists && crc == crc_computed);
|
|
|
|
PROTO_ITEM_SET_GENERATED(ti);
|
2007-05-28 06:38:30 +00:00
|
|
|
|
2012-07-12 17:22:47 +00:00
|
|
|
/*
|
|
|
|
* Interpret the EOF.
|
|
|
|
*/
|
|
|
|
if (tvb_bytes_exist(tvb, eof_offset, 1)) {
|
|
|
|
proto_tree_add_item(fcoe_tree, hf_fcoe_eof, tvb, eof_offset, 1, ENC_BIG_ENDIAN);
|
2007-05-28 06:38:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Set the SOF/EOF flags in the packet_info header */
|
2013-11-25 16:04:57 +00:00
|
|
|
fc_data.sof_eof = 0;
|
2007-05-28 06:38:30 +00:00
|
|
|
if (sof == FCOE_SOFi3 || sof == FCOE_SOFi2 || sof == FCOE_SOFi4) {
|
2013-11-25 16:04:57 +00:00
|
|
|
fc_data.sof_eof = FC_DATA_SOF_FIRST_FRAME;
|
2007-05-28 06:38:30 +00:00
|
|
|
} else if (sof == FCOE_SOFf) {
|
2013-11-25 16:04:57 +00:00
|
|
|
fc_data.sof_eof = FC_DATA_SOF_SOFF;
|
2007-05-28 06:38:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (eof != FCOE_EOFn) {
|
2013-11-25 16:04:57 +00:00
|
|
|
fc_data.sof_eof |= FC_DATA_EOF_LAST_FRAME;
|
2007-05-28 06:38:30 +00:00
|
|
|
} else if (eof != FCOE_EOFt) {
|
2013-11-25 16:04:57 +00:00
|
|
|
fc_data.sof_eof |= FC_DATA_EOF_INVALID;
|
2007-05-28 06:38:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Call the FC Dissector if this is carrying an FC frame */
|
2013-11-25 16:04:57 +00:00
|
|
|
fc_data.ethertype = 0;
|
2012-07-12 17:22:47 +00:00
|
|
|
|
2007-05-28 06:38:30 +00:00
|
|
|
if (fc_handle) {
|
2013-11-25 16:04:57 +00:00
|
|
|
call_dissector_with_data(fc_handle, next_tvb, pinfo, tree, &fc_data);
|
2007-05-28 06:38:30 +00:00
|
|
|
} else if (data_handle) {
|
|
|
|
call_dissector(data_handle, next_tvb, pinfo, tree);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_fcoe(void)
|
|
|
|
{
|
2007-11-22 19:02:31 +00:00
|
|
|
module_t *fcoe_module;
|
|
|
|
|
2007-05-28 06:38:30 +00:00
|
|
|
/* Setup list of header fields See Section 1.6.1 for details*/
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_fcoe_sof,
|
2009-11-17 18:35:27 +00:00
|
|
|
{"SOF", "fcoe.sof", FT_UINT8, BASE_HEX, VALS(fcoe_sof_vals), 0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL}},
|
2007-05-28 06:38:30 +00:00
|
|
|
{ &hf_fcoe_eof,
|
2009-11-17 18:35:27 +00:00
|
|
|
{"EOF", "fcoe.eof", FT_UINT8, BASE_HEX, VALS(fcoe_eof_vals), 0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL}},
|
2007-05-28 06:38:30 +00:00
|
|
|
{ &hf_fcoe_ver,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"Version", "fcoe.ver", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}},
|
2007-05-28 06:38:30 +00:00
|
|
|
{ &hf_fcoe_len,
|
2007-09-20 06:50:53 +00:00
|
|
|
{"Frame length", "fcoe.len", FT_UINT32,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
BASE_DEC, NULL, 0, NULL, HFILL}},
|
2007-05-28 06:38:30 +00:00
|
|
|
{ &hf_fcoe_crc,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"CRC", "fcoe.crc", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}},
|
2007-05-28 06:38:30 +00:00
|
|
|
{ &hf_fcoe_crc_good,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"CRC good", "fcoe.crc_good", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
|
|
|
"True: CRC matches packet content; False: doesn't match or not checked.", HFILL }},
|
2007-05-28 06:38:30 +00:00
|
|
|
{ &hf_fcoe_crc_bad,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{"CRC bad", "fcoe.crc_bad", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
|
|
|
"True: CRC doesn't match packet content; False: matches or not checked.", HFILL }}
|
2007-05-28 06:38:30 +00:00
|
|
|
};
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_fcoe,
|
|
|
|
&ett_fcoe_crc
|
|
|
|
};
|
|
|
|
|
2013-05-26 03:29:07 +00:00
|
|
|
static ei_register_info ei[] = {
|
|
|
|
{ &ei_fcoe_crc, { "fcoe.crc.bad", PI_CHECKSUM, PI_ERROR, "Bad checksum", EXPFILL }},
|
|
|
|
};
|
|
|
|
|
|
|
|
expert_module_t* expert_fcoe;
|
|
|
|
|
2007-05-28 06:38:30 +00:00
|
|
|
/* Register the protocol name and description */
|
|
|
|
proto_fcoe = proto_register_protocol("Fibre Channel over Ethernet",
|
|
|
|
"FCoE", "fcoe");
|
|
|
|
|
|
|
|
/* Required function calls to register the header fields and
|
|
|
|
* subtrees used */
|
|
|
|
proto_register_field_array(proto_fcoe, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2013-05-26 03:29:07 +00:00
|
|
|
expert_fcoe = expert_register_protocol(proto_fcoe);
|
|
|
|
expert_register_field_array(expert_fcoe, ei, array_length(ei));
|
2007-11-22 19:02:31 +00:00
|
|
|
|
2008-08-25 18:42:30 +00:00
|
|
|
fcoe_module = prefs_register_protocol(proto_fcoe, NULL);
|
2007-11-22 19:02:31 +00:00
|
|
|
|
|
|
|
prefs_register_obsolete_preference(fcoe_module, "ethertype");
|
2007-05-28 06:38:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_fcoe(void)
|
|
|
|
{
|
2007-06-18 19:31:34 +00:00
|
|
|
dissector_handle_t fcoe_handle;
|
2012-07-12 17:22:47 +00:00
|
|
|
|
2007-06-18 19:31:34 +00:00
|
|
|
fcoe_handle = create_dissector_handle(dissect_fcoe, proto_fcoe);
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("ethertype", ETHERTYPE_FCOE, fcoe_handle);
|
2007-06-18 19:31:34 +00:00
|
|
|
data_handle = find_dissector("data");
|
2012-07-12 17:22:47 +00:00
|
|
|
fc_handle = find_dissector("fc");
|
2007-05-28 06:38:30 +00:00
|
|
|
}
|