2003-01-14 01:17:44 +00:00
|
|
|
/* packet-fc-dns.c
|
|
|
|
* Routines for FC distributed Name Server (dNS)
|
|
|
|
* Copyright 2001, Dinesh G Dutt <ddutt@andiamo.com>
|
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2003-01-14 01:17:44 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* 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.
|
2007-08-15 22:27:52 +00:00
|
|
|
*
|
2003-01-14 01:17:44 +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.
|
2007-08-15 22:27:52 +00:00
|
|
|
*
|
2003-01-14 01:17:44 +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 23:18:38 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2003-01-14 01:17:44 +00:00
|
|
|
*/
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
#define NEW_PROTO_TREE_API
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
2003-01-14 01:17:44 +00:00
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
#include <epan/packet.h>
|
2014-09-26 23:28:01 +00:00
|
|
|
#include <epan/expert.h>
|
2013-11-09 13:41:10 +00:00
|
|
|
#include <epan/to_str.h>
|
2013-09-15 09:12:01 +00:00
|
|
|
#include <epan/wmem/wmem.h>
|
2003-01-14 01:17:44 +00:00
|
|
|
#include <epan/conversation.h>
|
2005-09-17 00:02:31 +00:00
|
|
|
#include <epan/etypes.h>
|
2003-01-14 01:17:44 +00:00
|
|
|
#include "packet-fc.h"
|
|
|
|
#include "packet-fcct.h"
|
|
|
|
#include "packet-fcdns.h"
|
|
|
|
#include "packet-fcswils.h"
|
|
|
|
|
2013-12-15 23:44:12 +00:00
|
|
|
void proto_register_fcdns(void);
|
|
|
|
void proto_reg_handoff_fcdns(void);
|
|
|
|
|
2004-12-31 22:00:44 +00:00
|
|
|
/*
|
|
|
|
* See FC-GS-2.
|
|
|
|
*/
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
static dissector_handle_t dns_handle;
|
|
|
|
|
|
|
|
/* protocol and registered fields */
|
|
|
|
|
|
|
|
static header_field_info *hfi_fcdns = NULL;
|
|
|
|
|
|
|
|
#define FCDNS_HFI_INIT HFI_INIT(proto_fcdns)
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
static header_field_info hfi_fcdns_gssubtype FCDNS_HFI_INIT =
|
|
|
|
{"GS_Subtype", "fcdns.gssubtype", FT_UINT8, BASE_HEX,
|
|
|
|
VALS(fc_dns_subtype_val), 0x0, NULL, HFILL};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_opcode FCDNS_HFI_INIT =
|
|
|
|
{"Opcode", "fcdns.opcode", FT_UINT16, BASE_HEX, VALS (fc_dns_opcode_val),
|
|
|
|
0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_reason FCDNS_HFI_INIT =
|
|
|
|
{"Reason Code", "fcdns.rply.reason", FT_UINT8, BASE_HEX,
|
|
|
|
VALS (fc_ct_rjt_code_vals), 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_vendor FCDNS_HFI_INIT =
|
|
|
|
{"Vendor Unique Reject Code", "fcdns.rply.vendor", FT_UINT8,
|
|
|
|
BASE_HEX, NULL, 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_req_portid FCDNS_HFI_INIT =
|
|
|
|
{"Port Identifier", "fcdns.req.portid", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rply_pname FCDNS_HFI_INIT =
|
|
|
|
{"Port Name", "fcdns.rply.pname", FT_STRING, BASE_NONE, NULL, 0x0, NULL,
|
|
|
|
HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rply_nname FCDNS_HFI_INIT =
|
|
|
|
{"Node Name", "fcdns.rply.nname", FT_STRING, BASE_NONE, NULL, 0x0, NULL,
|
|
|
|
HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rply_gft FCDNS_HFI_INIT =
|
|
|
|
{"FC-4 Types Supported", "fcdns.rply.fc4type", FT_NONE, BASE_NONE,
|
|
|
|
NULL, 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rply_snamelen FCDNS_HFI_INIT =
|
|
|
|
{"Symbolic Node Name Length", "fcdns.rply.snamelen", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rply_sname FCDNS_HFI_INIT =
|
|
|
|
{"Symbolic Node Name", "fcdns.rply.sname", FT_STRING, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rply_ptype FCDNS_HFI_INIT =
|
|
|
|
{"Port Type", "fcdns.rply.porttype", FT_UINT8, BASE_HEX,
|
|
|
|
VALS (fc_dns_port_type_val), 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rply_fpname FCDNS_HFI_INIT =
|
|
|
|
{"Fabric Port Name", "fcdns.rply.fpname", FT_STRING, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_fc4type FCDNS_HFI_INIT =
|
|
|
|
{"FC-4 Types", "fcdns.req.fc4type", FT_NONE, BASE_NONE,
|
|
|
|
NULL, 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rply_fc4type FCDNS_HFI_INIT =
|
|
|
|
{"FC-4 Descriptor Type", "fcdns.rply.fc4type", FT_UINT8, BASE_HEX,
|
|
|
|
VALS (fc_fc4_val), 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rply_fc4desc FCDNS_HFI_INIT =
|
|
|
|
{"FC-4 Descriptor", "fcdns.rply.fc4desc", FT_BYTES, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_req_pname FCDNS_HFI_INIT =
|
|
|
|
{"Port Name", "fcdns.req.portname", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rply_portid FCDNS_HFI_INIT =
|
|
|
|
{"Port Identifier", "fcdns.rply.portid", FT_STRING, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_req_nname FCDNS_HFI_INIT =
|
|
|
|
{"Node Name", "fcdns.req.nname", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_req_domainscope FCDNS_HFI_INIT =
|
|
|
|
{"Domain ID Scope", "fcdns.req.domainid", FT_UINT8, BASE_HEX, NULL,
|
|
|
|
0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_req_areascope FCDNS_HFI_INIT =
|
|
|
|
{"Area ID Scope", "fcdns.req.areaid", FT_UINT8, BASE_HEX, NULL,
|
|
|
|
0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_req_ptype FCDNS_HFI_INIT =
|
|
|
|
{"Port Type", "fcdns.req.porttype", FT_UINT8, BASE_HEX,
|
|
|
|
VALS (fc_dns_port_type_val), 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_req_cos FCDNS_HFI_INIT =
|
|
|
|
{"Requested Class of Service", "fcdns.req.class", FT_UINT32, BASE_HEX,
|
|
|
|
NULL, 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_req_fc4types FCDNS_HFI_INIT =
|
|
|
|
{"FC-4 Types Supported", "fcdns.req.fc4types", FT_NONE, BASE_NONE,
|
|
|
|
NULL, 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_req_snamelen FCDNS_HFI_INIT =
|
|
|
|
{"Symbolic Name Length", "fcdns.req.snamelen", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_req_sname FCDNS_HFI_INIT =
|
|
|
|
{"Symbolic Port Name", "fcdns.req.sname", FT_STRING, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rply_spnamelen FCDNS_HFI_INIT =
|
|
|
|
{"Symbolic Port Name Length", "fcdns.rply.spnamelen", FT_UINT8,
|
|
|
|
BASE_DEC, NULL, 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rply_spname FCDNS_HFI_INIT =
|
|
|
|
{"Symbolic Port Name", "fcdns.rply.spname", FT_STRING, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_req_spnamelen FCDNS_HFI_INIT =
|
|
|
|
{"Symbolic Port Name Length", "fcdns.req.spnamelen", FT_UINT8,
|
|
|
|
BASE_DEC, NULL, 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_req_spname FCDNS_HFI_INIT =
|
|
|
|
{"Symbolic Port Name", "fcdns.req.spname", FT_STRING, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rply_ipa FCDNS_HFI_INIT =
|
|
|
|
{"Initial Process Associator", "fcdns.rply.ipa", FT_BYTES, BASE_NONE,
|
|
|
|
NULL, 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rply_ipnode FCDNS_HFI_INIT =
|
|
|
|
{"Node IP Address", "fcdns.rply.ipnode", FT_IPv6, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rply_ipport FCDNS_HFI_INIT =
|
|
|
|
{"Port IP Address", "fcdns.rply.ipport", FT_IPv6, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rply_fc4desclen FCDNS_HFI_INIT =
|
|
|
|
{"FC-4 Descriptor Length", "fcdns.rply.fc4desclen", FT_UINT8,
|
|
|
|
BASE_DEC, NULL, 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rply_hrdaddr FCDNS_HFI_INIT =
|
|
|
|
{"Hard Address", "fcdns.rply.hrdaddr", FT_STRING, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_req_fdesclen FCDNS_HFI_INIT =
|
|
|
|
{"FC-4 Descriptor Length", "fcdns.req.fc4desclen", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_req_fdesc FCDNS_HFI_INIT =
|
|
|
|
{"FC-4 Descriptor", "fcdns.req.fc4desc", FT_STRING, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_req_ip FCDNS_HFI_INIT =
|
|
|
|
{"IP Address", "fcdns.req.ip", FT_IPv6, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rjtdetail FCDNS_HFI_INIT =
|
|
|
|
{"Reason Code Explanantion", "fcdns.rply.reasondet", FT_UINT8,
|
|
|
|
BASE_HEX, VALS (fc_dns_rjt_det_code_val), 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_zone_mbrtype FCDNS_HFI_INIT =
|
|
|
|
{"Zone Member Type", "fcdns.zone.mbrtype", FT_UINT8, BASE_HEX,
|
|
|
|
VALS (fc_swils_zonembr_type_val), 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_zone_mbrid FCDNS_HFI_INIT =
|
|
|
|
{"Member Identifier", "fcdns.zone.mbrid", FT_STRING, BASE_NONE, NULL,
|
|
|
|
0x0, NULL, HFILL};
|
|
|
|
|
2014-09-26 23:28:01 +00:00
|
|
|
static header_field_info hfi_fcdns_id_length FCDNS_HFI_INIT =
|
|
|
|
{"Identifier Length", "fcdns.id_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL,
|
|
|
|
HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_zone_flags FCDNS_HFI_INIT =
|
|
|
|
{"Flags", "fcdns.zone_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
|
|
|
|
HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_zonelen FCDNS_HFI_INIT =
|
|
|
|
{"Name Length", "fcdns.zone_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL,
|
|
|
|
HFILL};
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
static header_field_info hfi_fcdns_zonenm FCDNS_HFI_INIT =
|
|
|
|
{"Zone Name", "fcdns.zonename", FT_STRING, BASE_NONE, NULL, 0x0, NULL,
|
|
|
|
HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_portip FCDNS_HFI_INIT =
|
|
|
|
{"Port IP Address", "fcdns.portip", FT_IPv4, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL};
|
|
|
|
|
2014-09-26 23:28:01 +00:00
|
|
|
static header_field_info hfi_fcdns_num_entries FCDNS_HFI_INIT =
|
|
|
|
{"Number of Entries", "fcdns.num_entries", FT_UINT32, BASE_HEX,
|
|
|
|
NULL, 0x0, NULL, HFILL};
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
static header_field_info hfi_fcdns_sw2_objfmt FCDNS_HFI_INIT =
|
|
|
|
{"Name Entry Object Format", "fcdns.entry.objfmt", FT_UINT8, BASE_HEX,
|
|
|
|
NULL, 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_num_fc4desc FCDNS_HFI_INIT =
|
|
|
|
{"Number of FC4 Descriptors Registered", "fcdns.entry.numfc4desc",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_rply_ownerid FCDNS_HFI_INIT =
|
|
|
|
{"Owner Id", "fcdns.rply.ownerid", FT_STRING, BASE_NONE, NULL, 0x0, NULL,
|
|
|
|
HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_maxres_size FCDNS_HFI_INIT =
|
|
|
|
{"Maximum/Residual Size", "fcdns.maxres_size", FT_UINT16, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_reply_cos FCDNS_HFI_INIT =
|
|
|
|
{"Class of Service Supported", "fcdns.reply.cos", FT_UINT32, BASE_HEX,
|
|
|
|
NULL, 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_cos_f FCDNS_HFI_INIT =
|
|
|
|
{"F", "fcdns.cos.f", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_set_notset), 0x01, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_cos_1 FCDNS_HFI_INIT =
|
|
|
|
{"1", "fcdns.cos.1", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_set_notset), 0x02, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_cos_2 FCDNS_HFI_INIT =
|
|
|
|
{"2", "fcdns.cos.2", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_set_notset), 0x04, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_cos_3 FCDNS_HFI_INIT =
|
|
|
|
{"3", "fcdns.cos.3", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_set_notset), 0x08, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_cos_4 FCDNS_HFI_INIT =
|
|
|
|
{"4", "fcdns.cos.4", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_set_notset), 0x10, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_cos_6 FCDNS_HFI_INIT =
|
|
|
|
{"6", "fcdns.cos.6", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_set_notset), 0x40, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_fc4type_llcsnap FCDNS_HFI_INIT =
|
|
|
|
{"LLC/SNAP", "fcdns.fc4types.llc_snap", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_set_notset), 0x0010, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_fc4type_ip FCDNS_HFI_INIT =
|
|
|
|
{"IP", "fcdns.fc4types.ip", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_set_notset), 0x0020, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_fc4type_fcp FCDNS_HFI_INIT =
|
|
|
|
{"FCP", "fcdns.fc4types.fcp", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_set_notset), 0x0100, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_fc4type_swils FCDNS_HFI_INIT =
|
|
|
|
{"SW_ILS", "fcdns.fc4types.swils", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_set_notset), 0x0010, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_fc4type_snmp FCDNS_HFI_INIT =
|
|
|
|
{"SNMP", "fcdns.fc4types.snmp", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_set_notset), 0x0004, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_fc4type_gs3 FCDNS_HFI_INIT =
|
|
|
|
{"GS3", "fcdns.fc4types.gs3", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_set_notset), 0x0001, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_fc4type_vi FCDNS_HFI_INIT =
|
|
|
|
{"VI", "fcdns.fc4types.vi", FT_BOOLEAN, 32,
|
|
|
|
TFS(&tfs_set_notset), 0x0001, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_fc4features FCDNS_HFI_INIT =
|
|
|
|
{"FC-4 Feature Bits", "fcdns.fc4features", FT_UINT8,
|
|
|
|
BASE_HEX, NULL, 0x0, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_fc4features_i FCDNS_HFI_INIT =
|
|
|
|
{"I", "fcdns.fc4features.i", FT_BOOLEAN, 8,
|
|
|
|
TFS(&tfs_set_notset), 0x02, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_fc4features_t FCDNS_HFI_INIT =
|
|
|
|
{"T", "fcdns.fc4features.t", FT_BOOLEAN, 8,
|
|
|
|
TFS(&tfs_set_notset), 0x01, NULL, HFILL};
|
|
|
|
|
|
|
|
static header_field_info hfi_fcdns_req_fc4type FCDNS_HFI_INIT =
|
|
|
|
{"FC-4 Type", "fcdns.req.fc4type", FT_UINT8, BASE_HEX,
|
|
|
|
VALS (fc_fc4_val), 0x0, NULL, HFILL};
|
|
|
|
|
2003-01-14 01:17:44 +00:00
|
|
|
|
|
|
|
/* Initialize the subtree pointers */
|
|
|
|
static gint ett_fcdns = -1;
|
2005-10-12 01:43:25 +00:00
|
|
|
static gint ett_cos_flags = -1;
|
2005-10-25 11:24:24 +00:00
|
|
|
static gint ett_fc4flags = -1;
|
2005-10-27 08:18:59 +00:00
|
|
|
static gint ett_fc4features = -1;
|
2003-01-14 01:17:44 +00:00
|
|
|
|
2014-09-26 23:28:01 +00:00
|
|
|
static expert_field ei_fcdns_no_record_of_exchange = EI_INIT;
|
|
|
|
|
2003-01-14 01:17:44 +00:00
|
|
|
typedef struct _fcdns_conv_key {
|
|
|
|
guint32 conv_idx;
|
|
|
|
} fcdns_conv_key_t;
|
|
|
|
|
|
|
|
typedef struct _fcdns_conv_data {
|
|
|
|
guint32 opcode;
|
|
|
|
} fcdns_conv_data_t;
|
|
|
|
|
2010-10-11 19:00:55 +00:00
|
|
|
static GHashTable *fcdns_req_hash = NULL;
|
2003-01-14 01:17:44 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Hash Functions
|
|
|
|
*/
|
|
|
|
static gint
|
|
|
|
fcdns_equal(gconstpointer v, gconstpointer w)
|
|
|
|
{
|
2013-03-19 20:00:52 +00:00
|
|
|
const fcdns_conv_key_t *v1 = (const fcdns_conv_key_t *)v;
|
|
|
|
const fcdns_conv_key_t *v2 = (const fcdns_conv_key_t *)w;
|
2003-01-14 01:17:44 +00:00
|
|
|
|
|
|
|
return (v1->conv_idx == v2->conv_idx);
|
|
|
|
}
|
|
|
|
|
|
|
|
static guint
|
|
|
|
fcdns_hash (gconstpointer v)
|
|
|
|
{
|
2013-03-19 20:00:52 +00:00
|
|
|
const fcdns_conv_key_t *key = (const fcdns_conv_key_t *)v;
|
2010-10-11 19:00:55 +00:00
|
|
|
guint val;
|
2003-01-14 01:17:44 +00:00
|
|
|
|
2010-10-11 19:00:55 +00:00
|
|
|
val = key->conv_idx;
|
2003-01-14 01:17:44 +00:00
|
|
|
|
2010-10-11 19:00:55 +00:00
|
|
|
return val;
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Protocol initialization
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
fcdns_init_protocol(void)
|
|
|
|
{
|
2010-10-11 19:00:55 +00:00
|
|
|
if (fcdns_req_hash)
|
|
|
|
g_hash_table_destroy(fcdns_req_hash);
|
2003-01-14 01:17:44 +00:00
|
|
|
|
2010-10-11 19:00:55 +00:00
|
|
|
fcdns_req_hash = g_hash_table_new(fcdns_hash, fcdns_equal);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-10-12 01:43:25 +00:00
|
|
|
static void
|
2013-08-22 20:54:50 +00:00
|
|
|
dissect_cos_flags (proto_tree *parent_tree, tvbuff_t *tvb, int offset, const header_field_info *hfinfo)
|
2005-10-12 01:43:25 +00:00
|
|
|
{
|
2014-06-26 02:59:50 +00:00
|
|
|
proto_item *item;
|
|
|
|
proto_tree *tree;
|
2010-10-11 19:00:55 +00:00
|
|
|
guint32 flags;
|
|
|
|
|
|
|
|
flags = tvb_get_ntohl (tvb, offset);
|
|
|
|
|
2014-06-26 02:59:50 +00:00
|
|
|
item=proto_tree_add_uint(parent_tree, hfinfo,
|
|
|
|
tvb, offset, 1, flags);
|
|
|
|
tree=proto_item_add_subtree(item, ett_cos_flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_boolean(tree, &hfi_fcdns_cos_f, tvb, offset, 4, flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
if (flags&0x01){
|
|
|
|
proto_item_append_text(item, " F");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x01 ));
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_boolean(tree, &hfi_fcdns_cos_1, tvb, offset, 4, flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
if (flags&0x02){
|
|
|
|
proto_item_append_text(item, " 1");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x02 ));
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_boolean(tree, &hfi_fcdns_cos_2, tvb, offset, 4, flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
if (flags&0x04){
|
|
|
|
proto_item_append_text(item, " 2");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x04 ));
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_boolean(tree, &hfi_fcdns_cos_3, tvb, offset, 4, flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
if (flags&0x08){
|
|
|
|
proto_item_append_text(item, " 3");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x08 ));
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_boolean(tree, &hfi_fcdns_cos_4, tvb, offset, 4, flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
if (flags&0x10){
|
|
|
|
proto_item_append_text(item, " 4");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x10 ));
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_boolean(tree, &hfi_fcdns_cos_6, tvb, offset, 4, flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
if (flags&0x40){
|
|
|
|
proto_item_append_text(item, " 6");
|
|
|
|
}
|
2013-07-15 18:05:27 +00:00
|
|
|
/*flags&=(~( 0x40 ));*/
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
|
2005-10-12 01:43:25 +00:00
|
|
|
|
2005-10-27 08:18:59 +00:00
|
|
|
|
2007-08-15 22:27:52 +00:00
|
|
|
/* The feature routines just decode FCP's FC-4 features field
|
2005-10-27 08:18:59 +00:00
|
|
|
* based on the flahs in offset and the type in offset+1
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
dissect_fc4features_and_type (proto_tree *parent_tree, tvbuff_t *tvb, int offset)
|
2003-01-14 01:17:44 +00:00
|
|
|
{
|
2014-06-26 02:59:50 +00:00
|
|
|
proto_item *item;
|
|
|
|
proto_tree *tree;
|
2010-10-11 19:00:55 +00:00
|
|
|
guint8 flags, type;
|
|
|
|
|
|
|
|
flags = tvb_get_guint8(tvb, offset);
|
|
|
|
type = tvb_get_guint8(tvb, offset+1);
|
2014-06-26 02:59:50 +00:00
|
|
|
|
|
|
|
item=proto_tree_add_uint(parent_tree, &hfi_fcdns_fc4features,
|
2010-10-11 19:00:55 +00:00
|
|
|
tvb, offset, 1, flags);
|
2014-06-26 02:59:50 +00:00
|
|
|
tree=proto_item_add_subtree(item, ett_fc4features);
|
2010-10-11 19:00:55 +00:00
|
|
|
|
|
|
|
if(type==FC_TYPE_SCSI){
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_boolean(tree, &hfi_fcdns_fc4features_i, tvb, offset, 1, flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
if (flags&0x02){
|
|
|
|
proto_item_append_text(item, " I");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x02 ));
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_boolean(tree, &hfi_fcdns_fc4features_t, tvb, offset, 1, flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
if (flags&0x01){
|
|
|
|
proto_item_append_text(item, " T");
|
|
|
|
}
|
2012-02-12 18:06:37 +00:00
|
|
|
/*flags&=(~( 0x01 ));*/
|
2010-10-11 19:00:55 +00:00
|
|
|
}
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (tree, &hfi_fcdns_req_fc4type, tvb, offset+1, 1, ENC_BIG_ENDIAN);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
|
2007-08-15 22:27:52 +00:00
|
|
|
/* The feature routines just decode FCP's FC-4 features field
|
2005-10-27 08:18:59 +00:00
|
|
|
*/
|
|
|
|
static void
|
|
|
|
dissect_fc4features (proto_tree *parent_tree, tvbuff_t *tvb, int offset)
|
2003-01-14 01:17:44 +00:00
|
|
|
{
|
2014-06-26 02:59:50 +00:00
|
|
|
proto_item *item;
|
|
|
|
proto_tree *tree;
|
2010-10-11 19:00:55 +00:00
|
|
|
guint8 flags;
|
|
|
|
|
|
|
|
flags = tvb_get_guint8(tvb, offset);
|
2014-06-26 02:59:50 +00:00
|
|
|
item=proto_tree_add_uint(parent_tree, &hfi_fcdns_fc4features,
|
2010-10-11 19:00:55 +00:00
|
|
|
tvb, offset, 1, flags);
|
2014-06-26 02:59:50 +00:00
|
|
|
tree=proto_item_add_subtree(item, ett_fc4features);
|
2010-10-11 19:00:55 +00:00
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_boolean(tree, &hfi_fcdns_fc4features_i, tvb, offset, 1, flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
if (flags&0x02){
|
|
|
|
proto_item_append_text(item, " I");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x02 ));
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_boolean(tree, &hfi_fcdns_fc4features_t, tvb, offset, 1, flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
if (flags&0x01){
|
|
|
|
proto_item_append_text(item, " T");
|
|
|
|
}
|
2012-02-12 18:06:37 +00:00
|
|
|
/*flags&=(~( 0x01 ));*/
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
|
2005-10-27 08:18:59 +00:00
|
|
|
|
2005-10-25 11:24:24 +00:00
|
|
|
|
2003-01-14 01:17:44 +00:00
|
|
|
/* Decodes LLC/SNAP, IP, FCP, VI, GS, SW_ILS types only */
|
2005-10-25 11:24:24 +00:00
|
|
|
static void
|
2013-08-22 20:54:50 +00:00
|
|
|
dissect_fc4type (proto_tree *parent_tree, tvbuff_t *tvb, int offset, header_field_info *hfinfo)
|
2003-01-14 01:17:44 +00:00
|
|
|
{
|
2014-06-26 02:59:50 +00:00
|
|
|
proto_item *item;
|
|
|
|
proto_tree *tree;
|
2010-10-11 19:00:55 +00:00
|
|
|
guint32 flags;
|
|
|
|
|
2014-06-26 02:59:50 +00:00
|
|
|
item=proto_tree_add_item(parent_tree, hfinfo, tvb, offset,
|
|
|
|
32, ENC_NA);
|
|
|
|
tree=proto_item_add_subtree(item, ett_fc4flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
|
|
|
|
flags = tvb_get_ntohl (tvb, offset);
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_boolean(tree, &hfi_fcdns_fc4type_fcp, tvb, offset, 4, flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
if (flags&0x0100){
|
|
|
|
proto_item_append_text(item, " FCP");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x0100 ));
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_boolean(tree, &hfi_fcdns_fc4type_ip, tvb, offset, 4, flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
if (flags&0x0020){
|
|
|
|
proto_item_append_text(item, " IP");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x0020 ));
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_boolean(tree, &hfi_fcdns_fc4type_llcsnap, tvb, offset, 4, flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
if (flags&0x0010){
|
|
|
|
proto_item_append_text(item, " LLC/SNAP");
|
|
|
|
}
|
2012-02-12 18:06:37 +00:00
|
|
|
/*flags&=(~( 0x0010 ));*/
|
2010-10-11 19:00:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
flags = tvb_get_ntohl (tvb, offset+4);
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_boolean(tree, &hfi_fcdns_fc4type_swils, tvb, offset+4, 4, flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
if (flags&0x0010){
|
|
|
|
proto_item_append_text(item, " SW_ILS");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x0010 ));
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_boolean(tree, &hfi_fcdns_fc4type_snmp, tvb, offset+4, 4, flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
if (flags&0x0004){
|
|
|
|
proto_item_append_text(item, " SNMP");
|
|
|
|
}
|
|
|
|
flags&=(~( 0x0004 ));
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_boolean(tree, &hfi_fcdns_fc4type_gs3, tvb, offset+4, 4, flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
if (flags&0x0001){
|
|
|
|
proto_item_append_text(item, " GS3");
|
|
|
|
}
|
2012-02-12 18:06:37 +00:00
|
|
|
/*flags&=(~( 0x0001 ));*/
|
2010-10-11 19:00:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
flags = tvb_get_ntohl (tvb, offset+8);
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_boolean(tree, &hfi_fcdns_fc4type_vi, tvb, offset+8, 4, flags);
|
2010-10-11 19:00:55 +00:00
|
|
|
if (flags&0x0001){
|
|
|
|
proto_item_append_text(item, " VI");
|
|
|
|
}
|
2012-02-12 18:06:37 +00:00
|
|
|
/*flags&=(~( 0x0001 ));*/
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Code to actually dissect the packets */
|
|
|
|
|
|
|
|
/* A bunch of get routines have a similar req packet format. The first few
|
|
|
|
* routines deal with this decoding. All assume that tree is valid */
|
|
|
|
static void
|
|
|
|
dissect_fcdns_req_portid (tvbuff_t *tvb, proto_tree *tree, int offset)
|
|
|
|
{
|
|
|
|
if (tree) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (tree, &hfi_fcdns_req_portid, tvb, offset, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_ganxt (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
guint8 len;
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
|
|
|
dissect_fcdns_req_portid (tvb, req_tree, offset+1);
|
|
|
|
}
|
|
|
|
else {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_rply_ptype, tvb, offset,
|
2011-10-06 03:35:44 +00:00
|
|
|
1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_pname, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset+4, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset+4));
|
2003-01-14 01:17:44 +00:00
|
|
|
len = tvb_get_guint8 (tvb, offset+12);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_rply_spnamelen, tvb,
|
2011-10-06 03:35:44 +00:00
|
|
|
offset+12, 1, ENC_BIG_ENDIAN);
|
2003-01-14 01:17:44 +00:00
|
|
|
if (!tvb_offset_exists (tvb, 29+len))
|
|
|
|
return;
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2003-01-14 01:17:44 +00:00
|
|
|
if (len) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_rply_spname, tvb,
|
2011-10-15 18:46:26 +00:00
|
|
|
offset+13, len, ENC_ASCII|ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (tvb_offset_exists (tvb, 292)) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_nname, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset+268, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset+268));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
if (tvb_offset_exists (tvb, 548)) {
|
|
|
|
len = tvb_get_guint8 (tvb, offset+276);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_rply_snamelen, tvb,
|
2011-10-06 03:35:44 +00:00
|
|
|
offset+276, 1, ENC_BIG_ENDIAN);
|
2003-01-14 01:17:44 +00:00
|
|
|
if (len) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_rply_sname, tvb,
|
2011-10-15 18:46:26 +00:00
|
|
|
offset+277, len, ENC_ASCII|ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (tvb_offset_exists (tvb, 556)) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_rply_ipa, tvb,
|
2011-10-05 00:25:09 +00:00
|
|
|
offset+532, 8, ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
if (tvb_offset_exists (tvb, 572)) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_rply_ipnode, tvb,
|
2011-10-10 00:39:31 +00:00
|
|
|
offset+540, 16, ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
if (tvb_offset_exists (tvb, 576)) {
|
2013-08-22 20:54:50 +00:00
|
|
|
dissect_cos_flags(req_tree, tvb, offset+556, &hfi_fcdns_reply_cos);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
if (tvb_offset_exists (tvb, 608)) {
|
2013-08-22 20:54:50 +00:00
|
|
|
dissect_fc4type(req_tree, tvb, offset+560, &hfi_fcdns_rply_gft);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
if (tvb_offset_exists (tvb, 624)) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_rply_ipport, tvb,
|
2011-10-10 00:39:31 +00:00
|
|
|
offset+592, 16, ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
if (tvb_offset_exists (tvb, 632)) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_fpname, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset+608, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset+608));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
if (tvb_offset_exists (tvb, 635)) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_hrdaddr, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset+617, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+617));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gpnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
|
|
|
dissect_fcdns_req_portid (tvb, req_tree, offset+1);
|
|
|
|
}
|
|
|
|
else {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_pname, tvb, offset,
|
2011-01-16 04:33:42 +00:00
|
|
|
8, tvb_fcwwn_to_str (tvb, offset));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gnnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
|
|
|
dissect_fcdns_req_portid (tvb, req_tree, offset+1);
|
|
|
|
}
|
|
|
|
else {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_nname, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gcsid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
|
|
|
dissect_fcdns_req_portid (tvb, req_tree, offset);
|
|
|
|
}
|
|
|
|
else {
|
2013-08-22 20:54:50 +00:00
|
|
|
dissect_cos_flags(req_tree, tvb, offset, &hfi_fcdns_reply_cos);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gftid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
|
|
|
dissect_fcdns_req_portid (tvb, req_tree, offset+1);
|
|
|
|
}
|
|
|
|
else {
|
2013-08-22 20:54:50 +00:00
|
|
|
dissect_fc4type(req_tree, tvb, offset, &hfi_fcdns_rply_gft);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gspnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
guint8 len;
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
|
|
|
dissect_fcdns_req_portid (tvb, req_tree, offset+1);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
len = tvb_get_guint8 (tvb, offset);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_rply_spnamelen,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_rply_spname, tvb,
|
2011-10-15 18:46:26 +00:00
|
|
|
offset+1, len, ENC_ASCII|ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gptid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
|
|
|
dissect_fcdns_req_portid (tvb, req_tree, offset+1);
|
|
|
|
}
|
|
|
|
else {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_rply_ptype, tvb,
|
2011-10-06 03:35:44 +00:00
|
|
|
offset, 1, ENC_BIG_ENDIAN);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gfpnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
|
|
|
dissect_fcdns_req_portid (tvb, req_tree, offset+1);
|
|
|
|
}
|
|
|
|
else {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_fpname, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gfdid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
int tot_len, desclen;
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
|
|
|
dissect_fcdns_req_portid (tvb, req_tree, offset+1);
|
2013-08-22 20:54:50 +00:00
|
|
|
dissect_fc4type(req_tree, tvb, offset+4, &hfi_fcdns_fc4type);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
else {
|
2011-07-28 15:34:18 +00:00
|
|
|
tot_len = tvb_reported_length_remaining (tvb, offset); /* excluding CT header */
|
2003-01-14 01:17:44 +00:00
|
|
|
while (tot_len > 0) {
|
|
|
|
/* The count of the descriptors is not returned and so we have
|
|
|
|
* to track the display by the length field */
|
|
|
|
desclen = tvb_get_guint8 (tvb, offset);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_rply_fc4desc, tvb,
|
2011-10-05 00:25:09 +00:00
|
|
|
offset, desclen, ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
tot_len -= 255; /* descriptors are aligned to 255 bytes */
|
|
|
|
offset += 256;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gffid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
|
|
|
dissect_fcdns_req_portid (tvb, req_tree, offset+1);
|
|
|
|
}
|
|
|
|
else {
|
2005-10-27 08:18:59 +00:00
|
|
|
dissect_fc4features(req_tree, tvb, offset);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gidpn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_pname, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
else {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gipppn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_pname, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
else {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_rply_ipport, tvb, offset,
|
2011-10-10 00:39:31 +00:00
|
|
|
16, ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gidnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
guint8 islast;
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_nname, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
do {
|
|
|
|
islast = tvb_get_guint8 (tvb, offset);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
|
2003-01-14 01:17:44 +00:00
|
|
|
tvb, offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2003-01-14 01:17:44 +00:00
|
|
|
offset += 4;
|
|
|
|
} while (!(islast & 0x80));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gipnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_nname, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
else {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_rply_ipnode, tvb, offset,
|
2011-10-10 00:39:31 +00:00
|
|
|
16, ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gpnnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
guint8 islast;
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_nname, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
do {
|
|
|
|
islast = tvb_get_guint8 (tvb, offset);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
|
2003-01-14 01:17:44 +00:00
|
|
|
tvb, offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_pname,
|
2003-01-14 01:17:44 +00:00
|
|
|
tvb, offset+8, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset+8));
|
2003-01-14 01:17:44 +00:00
|
|
|
offset += 16;
|
|
|
|
} while (!(islast & 0x80));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gsnnnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
guint8 len;
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_nname, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
len = tvb_get_guint8 (tvb, offset);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_rply_snamelen, tvb,
|
2011-10-06 03:35:44 +00:00
|
|
|
offset, 1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_rply_sname, tvb,
|
2011-10-15 18:46:26 +00:00
|
|
|
offset+1, len, ENC_ASCII|ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gidft (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
guint8 islast;
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_domainscope,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset+1, 1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_areascope,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset+2, 1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_fc4type,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset+3, 1, ENC_BIG_ENDIAN);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
do {
|
|
|
|
islast = tvb_get_guint8 (tvb, offset);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
|
2003-01-14 01:17:44 +00:00
|
|
|
tvb, offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2003-01-14 01:17:44 +00:00
|
|
|
offset += 4;
|
|
|
|
} while (!(islast & 0x80));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gpnft (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
guint8 islast;
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_domainscope,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset+1, 1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_areascope,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset+2, 1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_fc4type,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset+3, 1, ENC_BIG_ENDIAN);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
do {
|
|
|
|
islast = tvb_get_guint8 (tvb, offset);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
|
2003-01-14 01:17:44 +00:00
|
|
|
tvb, offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_pname,
|
2003-01-14 01:17:44 +00:00
|
|
|
tvb, offset+4, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset+8));
|
2003-01-14 01:17:44 +00:00
|
|
|
offset += 16;
|
|
|
|
} while (!(islast & 0x80));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gnnft (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
guint8 islast;
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_domainscope,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset+1, 1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_areascope,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset+2, 1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_fc4type,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset+3, 1, ENC_BIG_ENDIAN);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
do {
|
|
|
|
islast = tvb_get_guint8 (tvb, offset);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
|
2003-01-14 01:17:44 +00:00
|
|
|
tvb, offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_nname,
|
2003-01-14 01:17:44 +00:00
|
|
|
tvb, offset+4, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset+8));
|
2003-01-14 01:17:44 +00:00
|
|
|
offset += 16;
|
|
|
|
} while (!(islast & 0x80));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gidpt (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
guint8 islast = 0;
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_ptype,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_domainscope,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset+1, 1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_areascope,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset+2, 1, ENC_BIG_ENDIAN);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
do {
|
|
|
|
islast = tvb_get_guint8 (tvb, offset);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
|
2003-01-14 01:17:44 +00:00
|
|
|
tvb, offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2003-01-14 01:17:44 +00:00
|
|
|
offset += 4;
|
|
|
|
} while (!(islast & 0x80));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gidipp (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
guint8 islast;
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_ip, tvb, offset,
|
2011-10-10 00:39:31 +00:00
|
|
|
16, ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
do {
|
|
|
|
islast = tvb_get_guint8 (tvb, offset);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
|
2003-01-14 01:17:44 +00:00
|
|
|
tvb, offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2003-01-14 01:17:44 +00:00
|
|
|
offset += 4;
|
|
|
|
} while (!(islast & 0x80));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gidff (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
guint8 islast;
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_domainscope, tvb,
|
2011-10-06 03:35:44 +00:00
|
|
|
offset+1, 1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_areascope, tvb,
|
2011-10-06 03:35:44 +00:00
|
|
|
offset+2, 1, ENC_BIG_ENDIAN);
|
2005-10-27 08:18:59 +00:00
|
|
|
dissect_fc4features_and_type(req_tree, tvb, offset+6);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
do {
|
|
|
|
islast = tvb_get_guint8 (tvb, offset);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_rply_portid,
|
2003-01-14 01:17:44 +00:00
|
|
|
tvb, offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2003-01-14 01:17:44 +00:00
|
|
|
offset += 4;
|
|
|
|
} while (!(islast & 0x80));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_rpnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid,
|
2003-01-14 01:17:44 +00:00
|
|
|
tvb, offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_pname, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset+4, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset+4));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_rnnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree) {
|
|
|
|
if (isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid,
|
2003-01-14 01:17:44 +00:00
|
|
|
tvb, offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_nname, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset+4, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset+4));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_rcsid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree && isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2013-08-22 20:54:50 +00:00
|
|
|
dissect_cos_flags(req_tree, tvb, offset+4, &hfi_fcdns_req_cos);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_rptid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree && isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_ptype, tvb,
|
2011-10-06 03:35:44 +00:00
|
|
|
offset+4, 1, ENC_BIG_ENDIAN);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_rftid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree && isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2013-08-22 20:54:50 +00:00
|
|
|
dissect_fc4type(req_tree, tvb, offset+4, &hfi_fcdns_req_fc4types);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_rspnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
guint8 len;
|
|
|
|
|
|
|
|
if (req_tree && isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_spnamelen, tvb,
|
2011-10-06 03:35:44 +00:00
|
|
|
offset+4, 1, ENC_BIG_ENDIAN);
|
2003-01-14 01:17:44 +00:00
|
|
|
len = tvb_get_guint8 (tvb, offset+4);
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_spname, tvb, offset+5,
|
2011-10-15 18:46:26 +00:00
|
|
|
len, ENC_ASCII|ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_rippid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree && isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_ip, tvb,
|
2011-10-10 00:39:31 +00:00
|
|
|
offset+4, 16, ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_rfdid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
2011-07-28 15:34:18 +00:00
|
|
|
int len;
|
2003-01-14 01:17:44 +00:00
|
|
|
|
|
|
|
if (req_tree && isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2013-08-22 20:54:50 +00:00
|
|
|
dissect_fc4type(req_tree, tvb, offset+4, &hfi_fcdns_req_fc4types);
|
2003-01-14 01:17:44 +00:00
|
|
|
|
|
|
|
offset += 36;
|
2011-07-28 15:34:18 +00:00
|
|
|
len = tvb_reported_length_remaining (tvb, offset);
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2003-01-14 01:17:44 +00:00
|
|
|
while (len > 0) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_fdesclen, tvb, offset,
|
2011-10-06 03:35:44 +00:00
|
|
|
1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_fdesc, tvb, offset+1,
|
2011-10-15 18:46:26 +00:00
|
|
|
len, ENC_ASCII|ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
offset += 256;
|
|
|
|
len -= 256;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_rffid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree && isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb, offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2005-10-27 08:18:59 +00:00
|
|
|
dissect_fc4features_and_type(req_tree, tvb, offset+6);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_ripnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree && isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_nname, tvb, offset, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset));
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_ip, tvb, offset+8, 16, ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_rsnnnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
guint8 len;
|
|
|
|
|
|
|
|
if (req_tree && isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_nname, tvb, offset, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset));
|
2003-01-14 01:17:44 +00:00
|
|
|
len = tvb_get_guint8 (tvb, offset+8);
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_snamelen, tvb, offset+8,
|
2011-10-06 03:35:44 +00:00
|
|
|
1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_sname, tvb, offset+9,
|
2011-10-15 18:46:26 +00:00
|
|
|
len, ENC_ASCII|ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_daid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (req_tree && isreq) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb, offset+1, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+1));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-12-31 22:00:44 +00:00
|
|
|
static guint8 *
|
2003-01-14 01:17:44 +00:00
|
|
|
zonenm_to_str (tvbuff_t *tvb, gint offset)
|
|
|
|
{
|
|
|
|
int len = tvb_get_guint8 (tvb, offset);
|
2014-06-17 15:30:58 +00:00
|
|
|
return tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, len, ENC_ASCII);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_zone_mbr (tvbuff_t *tvb, proto_tree *zmbr_tree, int offset)
|
|
|
|
{
|
2004-12-31 22:00:44 +00:00
|
|
|
guint8 mbrtype;
|
|
|
|
int idlen;
|
|
|
|
char dpbuf[2+8+1];
|
|
|
|
char *str;
|
|
|
|
|
|
|
|
mbrtype = tvb_get_guint8 (tvb, offset);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_uint (zmbr_tree, &hfi_fcdns_zone_mbrtype, tvb,
|
2004-12-31 22:00:44 +00:00
|
|
|
offset, 1, mbrtype);
|
2014-09-26 23:28:01 +00:00
|
|
|
proto_tree_add_item(zmbr_tree, &hfi_fcdns_zone_flags, tvb, offset+2, 1, ENC_NA);
|
2004-12-31 22:00:44 +00:00
|
|
|
idlen = tvb_get_guint8 (tvb, offset+3);
|
2014-09-26 23:28:01 +00:00
|
|
|
proto_tree_add_uint(zmbr_tree, &hfi_fcdns_id_length, tvb, offset+3, 1, idlen);
|
2004-12-31 22:00:44 +00:00
|
|
|
switch (mbrtype) {
|
2003-01-14 01:17:44 +00:00
|
|
|
case FC_SWILS_ZONEMBR_WWN:
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (zmbr_tree, &hfi_fcdns_zone_mbrid, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset+4, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset+4));
|
2003-01-14 01:17:44 +00:00
|
|
|
break;
|
|
|
|
case FC_SWILS_ZONEMBR_DP:
|
2005-08-18 19:31:15 +00:00
|
|
|
g_snprintf(dpbuf, sizeof(dpbuf), "0x%08x", tvb_get_ntohl (tvb, offset+4));
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (zmbr_tree, &hfi_fcdns_zone_mbrid, tvb,
|
2004-12-31 22:00:44 +00:00
|
|
|
offset+4, 4, dpbuf);
|
2003-01-14 01:17:44 +00:00
|
|
|
break;
|
|
|
|
case FC_SWILS_ZONEMBR_FCID:
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (zmbr_tree, &hfi_fcdns_zone_mbrid, tvb,
|
2003-01-14 01:17:44 +00:00
|
|
|
offset+4, 4,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+5));
|
2003-01-14 01:17:44 +00:00
|
|
|
break;
|
|
|
|
case FC_SWILS_ZONEMBR_ALIAS:
|
2010-10-11 19:00:55 +00:00
|
|
|
str = zonenm_to_str (tvb, offset+4);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (zmbr_tree, &hfi_fcdns_zone_mbrid, tvb,
|
2004-12-31 22:00:44 +00:00
|
|
|
offset+4, idlen, str);
|
2003-01-14 01:17:44 +00:00
|
|
|
break;
|
|
|
|
default:
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (zmbr_tree, &hfi_fcdns_zone_mbrid, tvb,
|
2004-12-31 22:00:44 +00:00
|
|
|
offset+4, idlen,
|
2003-01-14 01:17:44 +00:00
|
|
|
"Unknown member type format");
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_swils_entries (tvbuff_t *tvb, proto_tree *tree, int offset)
|
|
|
|
{
|
|
|
|
int numrec, i, len;
|
|
|
|
guint8 objfmt;
|
|
|
|
|
|
|
|
if (tree) {
|
2014-09-26 23:28:01 +00:00
|
|
|
numrec = tvb_get_ntohl (tvb, offset);
|
|
|
|
proto_tree_add_uint(tree, &hfi_fcdns_num_entries, tvb, offset, 4, numrec);
|
2003-01-14 01:17:44 +00:00
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
for (i = 0; i < numrec; i++) {
|
|
|
|
objfmt = tvb_get_guint8 (tvb, offset);
|
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (tree, &hfi_fcdns_sw2_objfmt, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_string (tree, &hfi_fcdns_rply_ownerid, tvb, offset+1,
|
2014-06-17 15:30:58 +00:00
|
|
|
3, fc_to_str (tvb_get_string_enc(wmem_packet_scope(), tvb, offset+1,
|
|
|
|
3, ENC_ASCII)));
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (tree, &hfi_fcdns_rply_ptype, tvb, offset+4,
|
2011-10-06 03:35:44 +00:00
|
|
|
1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (tree, &hfi_fcdns_rply_portid, tvb, offset+5, 3,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fc_to_str (tvb, offset+5));
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (tree, &hfi_fcdns_rply_pname, tvb, offset+8, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset+8));
|
2003-01-14 01:17:44 +00:00
|
|
|
offset += 16;
|
|
|
|
if (!(objfmt & 0x1)) {
|
|
|
|
len = tvb_get_guint8 (tvb, offset);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (tree, &hfi_fcdns_rply_spnamelen, tvb,
|
2011-10-06 03:35:44 +00:00
|
|
|
offset, 1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (tree, &hfi_fcdns_rply_spname, tvb,
|
2011-10-15 18:46:26 +00:00
|
|
|
offset+1, len, ENC_ASCII|ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
offset += 256;
|
|
|
|
}
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (tree, &hfi_fcdns_rply_nname, tvb, offset, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset));
|
2003-01-14 01:17:44 +00:00
|
|
|
offset += 8;
|
|
|
|
if (!(objfmt & 0x1)) {
|
|
|
|
len = tvb_get_guint8 (tvb, offset);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (tree, &hfi_fcdns_rply_snamelen, tvb,
|
2011-10-06 03:35:44 +00:00
|
|
|
offset, 1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (tree, &hfi_fcdns_rply_sname, tvb,
|
2011-10-15 18:46:26 +00:00
|
|
|
offset+1, len, ENC_ASCII|ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
offset += 256;
|
|
|
|
}
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (tree, &hfi_fcdns_rply_ipa, tvb, offset, 8, ENC_NA);
|
|
|
|
proto_tree_add_item (tree, &hfi_fcdns_rply_ipnode, tvb, offset+8, 16,
|
2011-10-10 00:39:31 +00:00
|
|
|
ENC_NA);
|
2013-08-22 20:54:50 +00:00
|
|
|
dissect_cos_flags(tree, tvb, offset+24, &hfi_fcdns_reply_cos);
|
|
|
|
dissect_fc4type(tree, tvb, offset+28, &hfi_fcdns_rply_gft);
|
|
|
|
proto_tree_add_item (tree, &hfi_fcdns_rply_ipport, tvb, offset+60,
|
2011-10-10 00:39:31 +00:00
|
|
|
16, ENC_NA);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (tree, &hfi_fcdns_rply_fpname, tvb, offset+76,
|
2011-01-16 04:33:42 +00:00
|
|
|
8, tvb_fcwwn_to_str (tvb, offset+76));
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (tree, &hfi_fcdns_rply_hrdaddr, tvb, offset+85,
|
2011-01-16 04:33:42 +00:00
|
|
|
3, tvb_fc_to_str (tvb, offset+85));
|
2003-01-14 01:17:44 +00:00
|
|
|
offset += 88;
|
|
|
|
if (objfmt & 0x2) {
|
2005-10-27 08:18:59 +00:00
|
|
|
dissect_fc4features(tree, tvb, offset);
|
2003-01-14 01:17:44 +00:00
|
|
|
if (tvb_get_guint8 (tvb, offset+129)) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (tree, &hfi_fcdns_rply_fc4type, tvb,
|
2011-10-06 03:35:44 +00:00
|
|
|
offset+128, 1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (tree, &hfi_fcdns_num_fc4desc, tvb,
|
2011-10-06 03:35:44 +00:00
|
|
|
offset+129, 1, ENC_BIG_ENDIAN);
|
2003-01-14 01:17:44 +00:00
|
|
|
len = tvb_get_guint8 (tvb, offset+132);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (tree, &hfi_fcdns_rply_fc4desclen, tvb,
|
2011-10-06 03:35:44 +00:00
|
|
|
offset+132, 1, ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (tree, &hfi_fcdns_rply_fc4desc, tvb,
|
2011-10-05 00:25:09 +00:00
|
|
|
offset+133, len, ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
else {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (tree, &hfi_fcdns_num_fc4desc, tvb,
|
2011-10-06 03:35:44 +00:00
|
|
|
offset+129, 1, ENC_BIG_ENDIAN);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
2007-08-15 22:27:52 +00:00
|
|
|
offset += 388; /* FC4 desc is 260 bytes, maybe padded */
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_geid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (isreq) {
|
|
|
|
if (req_tree) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_portid, tvb, offset+1,
|
2011-01-16 04:33:42 +00:00
|
|
|
3, tvb_fc_to_str (tvb, offset+1));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dissect_fcdns_swils_entries (tvb, req_tree, offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gepn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
if (isreq) {
|
|
|
|
if (req_tree) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_pname, tvb, offset, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dissect_fcdns_swils_entries (tvb, req_tree, offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_genn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (isreq) {
|
|
|
|
if (req_tree) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_string (req_tree, &hfi_fcdns_req_nname, tvb, offset, 8,
|
2011-01-16 04:33:42 +00:00
|
|
|
tvb_fcwwn_to_str (tvb, offset));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dissect_fcdns_swils_entries (tvb, req_tree, offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_geip (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (isreq) {
|
|
|
|
if (req_tree) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_ip, tvb, offset, 16, ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dissect_fcdns_swils_entries (tvb, req_tree, offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_geft (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (isreq) {
|
|
|
|
if (req_tree) {
|
2013-08-22 20:54:50 +00:00
|
|
|
dissect_fc4type(req_tree, tvb, offset, &hfi_fcdns_fc4type);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dissect_fcdns_swils_entries (tvb, req_tree, offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gept (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (isreq) {
|
|
|
|
if (req_tree) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_req_ptype, tvb, offset+3,
|
2011-10-06 03:35:44 +00:00
|
|
|
1, ENC_BIG_ENDIAN);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dissect_fcdns_swils_entries (tvb, req_tree, offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gezm (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (isreq) {
|
|
|
|
if (req_tree) {
|
|
|
|
dissect_fcdns_zone_mbr (tvb, req_tree, offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dissect_fcdns_swils_entries (tvb, req_tree, offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_gezn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
2008-06-27 16:15:30 +00:00
|
|
|
int str_len;
|
2003-01-14 01:17:44 +00:00
|
|
|
|
|
|
|
if (isreq) {
|
|
|
|
if (req_tree) {
|
2008-06-27 16:15:30 +00:00
|
|
|
str_len = tvb_get_guint8 (tvb, offset);
|
2014-09-26 23:28:01 +00:00
|
|
|
proto_tree_add_uint(req_tree, &hfi_fcdns_zonelen, tvb, offset, 1, str_len);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_zonenm, tvb, offset+3,
|
2011-10-15 18:46:26 +00:00
|
|
|
str_len, ENC_ASCII|ENC_NA);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dissect_fcdns_swils_entries (tvb, req_tree, offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_geipp (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (isreq) {
|
|
|
|
if (req_tree) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_portip, tvb, offset, 4, ENC_BIG_ENDIAN);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dissect_fcdns_swils_entries (tvb, req_tree, offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_geff (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
|
|
|
|
{
|
|
|
|
int offset = 16; /* past the fc_ct header */
|
|
|
|
|
|
|
|
if (isreq) {
|
|
|
|
if (req_tree) {
|
2005-10-27 08:18:59 +00:00
|
|
|
dissect_fc4features(req_tree, tvb, offset);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dissect_fcdns_swils_entries (tvb, req_tree, offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fcdns_rjt (tvbuff_t *tvb, proto_tree *req_tree)
|
|
|
|
{
|
|
|
|
int offset = 0;
|
|
|
|
|
|
|
|
if (req_tree) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_reason, tvb, offset+13, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_rjtdetail, tvb, offset+14, 1,
|
2011-10-06 03:35:44 +00:00
|
|
|
ENC_BIG_ENDIAN);
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (req_tree, &hfi_fcdns_vendor, tvb, offset+15, 1, ENC_BIG_ENDIAN);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-25 16:04:57 +00:00
|
|
|
static int
|
|
|
|
dissect_fcdns (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
|
2003-01-14 01:17:44 +00:00
|
|
|
{
|
|
|
|
/* Set up structures needed to add the protocol subtree and manage it */
|
|
|
|
proto_item *ti = NULL;
|
|
|
|
proto_tree *fcdns_tree = NULL;
|
|
|
|
int offset = 0;
|
|
|
|
int opcode,
|
|
|
|
failed_opcode = 0;
|
|
|
|
int isreq = 1;
|
|
|
|
fc_ct_preamble cthdr;
|
|
|
|
conversation_t *conversation;
|
|
|
|
fcdns_conv_data_t *cdata;
|
|
|
|
fcdns_conv_key_t ckey, *req_key;
|
2013-12-10 03:25:04 +00:00
|
|
|
fc_hdr *fchdr;
|
2013-11-25 16:04:57 +00:00
|
|
|
|
2013-12-10 03:25:04 +00:00
|
|
|
/* Reject the packet if data is NULL */
|
|
|
|
if (data == NULL)
|
|
|
|
return 0;
|
|
|
|
fchdr = (fc_hdr *)data;
|
2003-01-14 01:17:44 +00:00
|
|
|
|
|
|
|
tvb_memcpy (tvb, (guint8 *)&cthdr, offset, FCCT_PRMBL_SIZE);
|
|
|
|
cthdr.revision = tvb_get_guint8 (tvb, offset);
|
|
|
|
cthdr.in_id = tvb_get_ntoh24 (tvb, offset+1);
|
2007-08-15 22:27:52 +00:00
|
|
|
cthdr.opcode = g_ntohs (cthdr.opcode);
|
2003-01-14 01:17:44 +00:00
|
|
|
opcode = cthdr.opcode;
|
2007-08-15 22:27:52 +00:00
|
|
|
cthdr.maxres_size = g_ntohs (cthdr.maxres_size);
|
2003-01-14 01:17:44 +00:00
|
|
|
|
|
|
|
/* Determine the type of server the request/response is for */
|
2013-06-14 01:02:11 +00:00
|
|
|
if (cthdr.gstype == FCCT_GSTYPE_DIRSVC)
|
|
|
|
col_set_str (pinfo->cinfo, COL_PROTOCOL, "dNS");
|
|
|
|
else
|
|
|
|
col_set_str (pinfo->cinfo, COL_PROTOCOL, "Unzoned NS");
|
2003-01-14 01:17:44 +00:00
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
if (cthdr.gstype == FCCT_GSTYPE_DIRSVC) {
|
2013-08-22 20:54:50 +00:00
|
|
|
ti = proto_tree_add_protocol_format (tree, hfi_fcdns->id, tvb, 0,
|
2011-07-28 15:34:18 +00:00
|
|
|
-1,
|
2003-01-14 01:17:44 +00:00
|
|
|
"dNS");
|
|
|
|
fcdns_tree = proto_item_add_subtree (ti, ett_fcdns);
|
|
|
|
}
|
|
|
|
else {
|
2013-08-22 20:54:50 +00:00
|
|
|
ti = proto_tree_add_protocol_format (tree, hfi_fcdns->id, tvb, 0,
|
2011-07-28 15:34:18 +00:00
|
|
|
-1,
|
2003-01-14 01:17:44 +00:00
|
|
|
"Unzoned NS");
|
|
|
|
fcdns_tree = proto_item_add_subtree (ti, ett_fcdns);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((opcode != FCCT_MSG_ACC) && (opcode != FCCT_MSG_RJT)) {
|
2005-02-02 20:07:03 +00:00
|
|
|
conversation = find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst,
|
2013-11-25 16:04:57 +00:00
|
|
|
pinfo->ptype, fchdr->oxid,
|
|
|
|
fchdr->rxid, NO_PORT2);
|
2003-01-14 01:17:44 +00:00
|
|
|
if (!conversation) {
|
2005-02-02 20:07:03 +00:00
|
|
|
conversation = conversation_new (pinfo->fd->num, &pinfo->src, &pinfo->dst,
|
2013-11-25 16:04:57 +00:00
|
|
|
pinfo->ptype, fchdr->oxid,
|
|
|
|
fchdr->rxid, NO_PORT2);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2003-01-14 01:17:44 +00:00
|
|
|
ckey.conv_idx = conversation->index;
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2003-01-14 01:17:44 +00:00
|
|
|
cdata = (fcdns_conv_data_t *)g_hash_table_lookup (fcdns_req_hash,
|
|
|
|
&ckey);
|
|
|
|
if (cdata) {
|
|
|
|
/* Since we never free the memory used by an exchange, this maybe a
|
|
|
|
* case of another request using the same exchange as a previous
|
2007-08-15 22:27:52 +00:00
|
|
|
* req.
|
2003-01-14 01:17:44 +00:00
|
|
|
*/
|
|
|
|
cdata->opcode = opcode;
|
|
|
|
}
|
|
|
|
else {
|
2013-09-15 09:12:01 +00:00
|
|
|
req_key = wmem_new(wmem_file_scope(), fcdns_conv_key_t);
|
2003-01-14 01:17:44 +00:00
|
|
|
req_key->conv_idx = conversation->index;
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2013-09-15 09:12:01 +00:00
|
|
|
cdata = wmem_new(wmem_file_scope(), fcdns_conv_data_t);
|
2003-01-14 01:17:44 +00:00
|
|
|
cdata->opcode = opcode;
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2003-01-14 01:17:44 +00:00
|
|
|
g_hash_table_insert (fcdns_req_hash, req_key, cdata);
|
|
|
|
}
|
2013-06-14 01:02:11 +00:00
|
|
|
col_add_str (pinfo->cinfo, COL_INFO, val_to_str (opcode, fc_dns_opcode_val,
|
2003-01-14 01:17:44 +00:00
|
|
|
"0x%x"));
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* Opcode is ACC or RJT */
|
2005-02-02 20:07:03 +00:00
|
|
|
conversation = find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst,
|
2013-11-25 16:04:57 +00:00
|
|
|
pinfo->ptype, fchdr->oxid,
|
|
|
|
fchdr->rxid, NO_PORT2);
|
2003-01-14 01:17:44 +00:00
|
|
|
isreq = 0;
|
|
|
|
if (!conversation) {
|
2013-06-14 01:02:11 +00:00
|
|
|
if (opcode == FCCT_MSG_ACC) {
|
|
|
|
col_add_str (pinfo->cinfo, COL_INFO,
|
2003-01-14 01:17:44 +00:00
|
|
|
val_to_str (opcode, fc_dns_opcode_val,
|
|
|
|
"0x%x"));
|
|
|
|
/* No record of what this accept is for. Can't decode */
|
2014-09-26 23:28:01 +00:00
|
|
|
proto_tree_add_expert(fcdns_tree, pinfo, &ei_fcdns_no_record_of_exchange, tvb, 0, -1);
|
2013-11-25 16:04:57 +00:00
|
|
|
return 0;
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
ckey.conv_idx = conversation->index;
|
|
|
|
|
|
|
|
cdata = (fcdns_conv_data_t *)g_hash_table_lookup (fcdns_req_hash, &ckey);
|
|
|
|
|
|
|
|
if (cdata != NULL) {
|
|
|
|
if (opcode == FCCT_MSG_ACC) {
|
|
|
|
opcode = cdata->opcode;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
failed_opcode = cdata->opcode;
|
|
|
|
}
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2013-06-14 01:02:11 +00:00
|
|
|
if (opcode != FCCT_MSG_RJT) {
|
|
|
|
col_add_fstr (pinfo->cinfo, COL_INFO, "ACC (%s)",
|
|
|
|
val_to_str (opcode, fc_dns_opcode_val,
|
|
|
|
"0x%x"));
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
col_add_fstr (pinfo->cinfo, COL_INFO, "RJT (%s)",
|
|
|
|
val_to_str (failed_opcode,
|
|
|
|
fc_dns_opcode_val,
|
|
|
|
"0x%x"));
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2003-01-14 01:17:44 +00:00
|
|
|
if (tree) {
|
|
|
|
if ((cdata == NULL) && (opcode != FCCT_MSG_RJT)) {
|
|
|
|
/* No record of what this accept is for. Can't decode */
|
2014-09-26 23:28:01 +00:00
|
|
|
proto_tree_add_expert(fcdns_tree, pinfo, &ei_fcdns_no_record_of_exchange, tvb, 0, -1);
|
2013-11-25 16:04:57 +00:00
|
|
|
return 0;
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tree) {
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_tree_add_item (fcdns_tree, &hfi_fcdns_opcode, tvb, offset+8, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item (fcdns_tree, &hfi_fcdns_maxres_size, tvb, offset+10,
|
2011-10-06 03:35:44 +00:00
|
|
|
2, ENC_BIG_ENDIAN);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2003-01-14 01:17:44 +00:00
|
|
|
switch (opcode) {
|
|
|
|
case FCCT_MSG_RJT:
|
|
|
|
dissect_fcdns_rjt (tvb, fcdns_tree);
|
|
|
|
break;
|
|
|
|
case FCDNS_GA_NXT:
|
|
|
|
dissect_fcdns_ganxt (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GPN_ID:
|
|
|
|
dissect_fcdns_gpnid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GNN_ID:
|
|
|
|
dissect_fcdns_gnnid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GCS_ID:
|
|
|
|
dissect_fcdns_gcsid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GFT_ID:
|
|
|
|
dissect_fcdns_gftid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GSPN_ID:
|
|
|
|
dissect_fcdns_gspnid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GPT_ID:
|
|
|
|
dissect_fcdns_gptid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GFPN_ID:
|
|
|
|
dissect_fcdns_gfpnid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GFD_ID:
|
|
|
|
dissect_fcdns_gfdid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GFF_ID:
|
|
|
|
dissect_fcdns_gffid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GID_PN:
|
|
|
|
dissect_fcdns_gidpn (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GIPP_PN:
|
|
|
|
dissect_fcdns_gipppn (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GID_NN:
|
|
|
|
dissect_fcdns_gidnn (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GPN_NN:
|
|
|
|
dissect_fcdns_gpnnn (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GIP_NN:
|
|
|
|
dissect_fcdns_gipnn (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GSNN_NN:
|
|
|
|
dissect_fcdns_gsnnnn (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GID_FT:
|
|
|
|
dissect_fcdns_gidft (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GPN_FT:
|
|
|
|
dissect_fcdns_gpnft (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GNN_FT:
|
|
|
|
dissect_fcdns_gnnft (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GID_PT:
|
|
|
|
dissect_fcdns_gidpt (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GID_IPP:
|
|
|
|
dissect_fcdns_gidipp (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GID_FF:
|
|
|
|
dissect_fcdns_gidff (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_RPN_ID:
|
|
|
|
dissect_fcdns_rpnid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_RNN_ID:
|
|
|
|
dissect_fcdns_rnnid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_RCS_ID:
|
|
|
|
dissect_fcdns_rcsid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_RPT_ID:
|
|
|
|
dissect_fcdns_rptid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_RFT_ID:
|
|
|
|
dissect_fcdns_rftid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_RSPN_ID:
|
|
|
|
dissect_fcdns_rspnid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_RIPP_ID:
|
|
|
|
dissect_fcdns_rippid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_RFD_ID:
|
|
|
|
dissect_fcdns_rfdid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_RFF_ID:
|
|
|
|
dissect_fcdns_rffid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_RIP_NN:
|
|
|
|
dissect_fcdns_ripnn (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_RSNN_NN:
|
|
|
|
dissect_fcdns_rsnnnn (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_DA_ID:
|
|
|
|
dissect_fcdns_daid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GE_ID:
|
|
|
|
dissect_fcdns_geid (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GE_PN:
|
|
|
|
dissect_fcdns_gepn (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GE_NN:
|
|
|
|
dissect_fcdns_genn (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GE_IP:
|
|
|
|
dissect_fcdns_geip (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GE_FT:
|
|
|
|
dissect_fcdns_geft (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GE_PT:
|
|
|
|
dissect_fcdns_gept (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GE_ZM:
|
|
|
|
dissect_fcdns_gezm (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GE_ZN:
|
|
|
|
dissect_fcdns_gezn (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GE_IPP:
|
|
|
|
dissect_fcdns_geipp (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
case FCDNS_GE_FF:
|
|
|
|
dissect_fcdns_geff (tvb, fcdns_tree, isreq);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2013-11-25 16:04:57 +00:00
|
|
|
|
2014-06-19 17:18:16 +00:00
|
|
|
return tvb_length(tvb);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
|
2006-05-21 04:49:01 +00:00
|
|
|
/* Register the protocol with Wireshark */
|
2003-01-14 01:17:44 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_fcdns (void)
|
2007-08-15 22:27:52 +00:00
|
|
|
{
|
2013-11-07 20:14:18 +00:00
|
|
|
#ifndef HAVE_HFI_SECTION_INIT
|
2013-08-22 20:54:50 +00:00
|
|
|
static header_field_info *hfi[] = {
|
|
|
|
/* &hfi_fcdns_gssubtype */
|
|
|
|
&hfi_fcdns_opcode,
|
|
|
|
&hfi_fcdns_req_portid,
|
|
|
|
&hfi_fcdns_rply_pname,
|
|
|
|
&hfi_fcdns_rply_nname,
|
|
|
|
&hfi_fcdns_rply_snamelen,
|
|
|
|
&hfi_fcdns_rply_sname,
|
|
|
|
&hfi_fcdns_rply_ptype,
|
|
|
|
&hfi_fcdns_rply_fpname,
|
|
|
|
&hfi_fcdns_req_pname,
|
|
|
|
&hfi_fcdns_rply_portid,
|
|
|
|
&hfi_fcdns_req_nname,
|
|
|
|
&hfi_fcdns_req_domainscope,
|
|
|
|
&hfi_fcdns_req_areascope,
|
|
|
|
&hfi_fcdns_req_fc4type,
|
|
|
|
&hfi_fcdns_req_ptype,
|
|
|
|
&hfi_fcdns_req_ip,
|
|
|
|
&hfi_fcdns_rply_fc4type,
|
|
|
|
&hfi_fcdns_req_snamelen,
|
|
|
|
&hfi_fcdns_req_sname,
|
|
|
|
&hfi_fcdns_rply_spnamelen,
|
|
|
|
&hfi_fcdns_rply_spname,
|
|
|
|
&hfi_fcdns_rply_ipa,
|
|
|
|
&hfi_fcdns_rply_ipnode,
|
|
|
|
&hfi_fcdns_rply_ipport,
|
|
|
|
&hfi_fcdns_rply_fc4desclen,
|
|
|
|
&hfi_fcdns_rply_fc4desc,
|
|
|
|
&hfi_fcdns_rply_hrdaddr,
|
|
|
|
&hfi_fcdns_req_fdesclen,
|
|
|
|
&hfi_fcdns_req_fdesc,
|
|
|
|
&hfi_fcdns_req_spnamelen,
|
|
|
|
&hfi_fcdns_req_spname,
|
|
|
|
&hfi_fcdns_reason,
|
|
|
|
&hfi_fcdns_rjtdetail,
|
|
|
|
&hfi_fcdns_vendor,
|
|
|
|
&hfi_fcdns_zone_mbrtype,
|
|
|
|
&hfi_fcdns_zone_mbrid,
|
|
|
|
&hfi_fcdns_zonenm,
|
|
|
|
&hfi_fcdns_portip,
|
|
|
|
&hfi_fcdns_sw2_objfmt,
|
|
|
|
&hfi_fcdns_num_fc4desc,
|
|
|
|
&hfi_fcdns_rply_ownerid,
|
|
|
|
&hfi_fcdns_maxres_size,
|
|
|
|
&hfi_fcdns_reply_cos,
|
|
|
|
&hfi_fcdns_req_cos,
|
|
|
|
&hfi_fcdns_cos_f,
|
|
|
|
&hfi_fcdns_cos_1,
|
|
|
|
&hfi_fcdns_cos_2,
|
|
|
|
&hfi_fcdns_cos_3,
|
|
|
|
&hfi_fcdns_cos_4,
|
|
|
|
&hfi_fcdns_cos_6,
|
|
|
|
&hfi_fcdns_fc4type_llcsnap,
|
|
|
|
&hfi_fcdns_fc4type_ip,
|
|
|
|
&hfi_fcdns_fc4type_fcp,
|
|
|
|
&hfi_fcdns_fc4type_swils,
|
|
|
|
&hfi_fcdns_fc4type_snmp,
|
|
|
|
&hfi_fcdns_fc4type_gs3,
|
|
|
|
&hfi_fcdns_fc4type_vi,
|
|
|
|
&hfi_fcdns_rply_gft,
|
|
|
|
&hfi_fcdns_req_fc4types,
|
|
|
|
&hfi_fcdns_fc4type,
|
|
|
|
&hfi_fcdns_fc4features,
|
|
|
|
&hfi_fcdns_fc4features_i,
|
|
|
|
&hfi_fcdns_fc4features_t,
|
2003-01-14 01:17:44 +00:00
|
|
|
};
|
2013-11-07 20:14:18 +00:00
|
|
|
#endif
|
2003-01-14 01:17:44 +00:00
|
|
|
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_fcdns,
|
2005-10-12 01:43:25 +00:00
|
|
|
&ett_cos_flags,
|
2005-10-25 11:24:24 +00:00
|
|
|
&ett_fc4flags,
|
2005-10-27 08:18:59 +00:00
|
|
|
&ett_fc4features,
|
2003-01-14 01:17:44 +00:00
|
|
|
};
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2014-09-26 23:28:01 +00:00
|
|
|
static ei_register_info ei[] = {
|
|
|
|
{ &ei_fcdns_no_record_of_exchange, { "fcdns.no_record_of_exchange", PI_UNDECODED, PI_WARN, "No record of Exchg. Unable to decode MSG_ACC/RJT", EXPFILL }},
|
|
|
|
};
|
|
|
|
|
|
|
|
expert_module_t* expert_fcdns;
|
2013-08-22 20:54:50 +00:00
|
|
|
int proto_fcdns;
|
|
|
|
|
2014-09-26 23:28:01 +00:00
|
|
|
proto_fcdns = proto_register_protocol("Fibre Channel Name Server", "FC-dNS", "fcdns");
|
2013-08-22 20:54:50 +00:00
|
|
|
hfi_fcdns = proto_registrar_get_nth(proto_fcdns);
|
2003-01-14 01:17:44 +00:00
|
|
|
|
2013-08-22 20:54:50 +00:00
|
|
|
proto_register_fields(proto_fcdns, hfi, array_length(hfi));
|
2003-01-14 01:17:44 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2014-09-26 23:28:01 +00:00
|
|
|
expert_fcdns = expert_register_protocol(proto_fcdns);
|
|
|
|
expert_register_field_array(expert_fcdns, ei, array_length(ei));
|
2003-01-14 01:17:44 +00:00
|
|
|
register_init_routine (&fcdns_init_protocol);
|
2013-08-22 20:54:50 +00:00
|
|
|
|
2013-11-25 16:04:57 +00:00
|
|
|
dns_handle = new_create_dissector_handle (dissect_fcdns, proto_fcdns);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_fcdns (void)
|
|
|
|
{
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("fcct.server", FCCT_GSRVR_DNS, dns_handle);
|
|
|
|
dissector_add_uint("fcct.server", FCCT_GSRVR_UNS, dns_handle);
|
2003-01-14 01:17:44 +00:00
|
|
|
}
|
2014-09-28 23:25:09 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|