2 * Routines for FC Fabric Zone Server
3 * Copyright 2001, Dinesh G Dutt <ddutt@andiamo.com>
5 * $Id: packet-fcfzs.c,v 1.2 2003/12/02 06:06:30 guy Exp $
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@ethereal.com>
9 * Copyright 1998 Gerald Combs
11 * Copied from WHATEVER_FILE_YOU_USED (where "WHATEVER_FILE_YOU_USED"
12 * is a dissector file; if you just copied this from README.developer,
13 * don't bother with the "Copied from" - you don't even need to put
14 * in a "Copied from" if you copied an existing dissector, especially
15 * if the bulk of the code in the new dissector is your code)
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version 2
20 * of the License, or (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
40 #ifdef HAVE_SYS_TYPES_H
41 # include <sys/types.h>
44 #ifdef HAVE_NETINET_IN_H
45 # include <netinet/in.h>
50 #ifdef NEED_SNPRINTF_H
51 # include "snprintf.h"
54 #include <epan/packet.h>
55 #include <epan/conversation.h>
57 #include "packet-fc.h"
58 #include "packet-fcct.h"
59 #include "packet-fcfzs.h"
61 /* Initialize the protocol and registered fields */
62 static int proto_fcfzs = -1;
63 static int hf_fcfzs_opcode = -1;
64 static int hf_fcfzs_gzc_flags = -1;
65 static int hf_fcfzs_gzc_vendor = -1;
66 static int hf_fcfzs_zone_state = -1;
67 static int hf_fcfzs_gest_vendor = -1;
68 static int hf_fcfzs_numzoneattrs = -1;
69 static int hf_fcfzs_zonesetnmlen = -1;
70 static int hf_fcfzs_zonesetname = -1;
71 static int hf_fcfzs_numzones = -1;
72 static int hf_fcfzs_numzonesetattrs = -1;
73 static int hf_fcfzs_zonenmlen = -1;
74 static int hf_fcfzs_zonename = -1;
75 static int hf_fcfzs_nummbrs = -1;
76 static int hf_fcfzs_nummbrentries = -1;
77 static int hf_fcfzs_mbrid = -1;
78 static int hf_fcfzs_mbridlen = -1;
79 static int hf_fcfzs_mbrtype = -1;
80 static int hf_fcfzs_reason = -1;
81 static int hf_fcfzs_rjtdetail = -1;
82 static int hf_fcfzs_rjtvendor = -1;
83 static int hf_fcfzs_maxres_size = -1;
84 static int hf_fcfzs_mbrid_lun = -1;
87 /* Initialize the subtree pointers */
88 static gint ett_fcfzs = -1;
90 typedef struct _fcfzs_conv_key {
94 typedef struct _fcfzs_conv_data {
98 GHashTable *fcfzs_req_hash = NULL;
99 GMemChunk *fcfzs_req_keys = NULL;
100 GMemChunk *fcfzs_req_vals = NULL;
101 guint32 fcfzs_init_count = 25;
103 static dissector_handle_t data_handle;
109 fcfzs_equal(gconstpointer v, gconstpointer w)
111 fcfzs_conv_key_t *v1 = (fcfzs_conv_key_t *)v;
112 fcfzs_conv_key_t *v2 = (fcfzs_conv_key_t *)w;
114 return (v1->conv_idx == v2->conv_idx);
118 fcfzs_hash (gconstpointer v)
120 fcfzs_conv_key_t *key = (fcfzs_conv_key_t *)v;
129 * Protocol initialization
132 fcfzs_init_protocol(void)
135 g_mem_chunk_destroy (fcfzs_req_keys);
137 g_mem_chunk_destroy (fcfzs_req_vals);
139 g_hash_table_destroy (fcfzs_req_hash);
141 fcfzs_req_hash = g_hash_table_new (fcfzs_hash, fcfzs_equal);
142 fcfzs_req_keys = g_mem_chunk_new ("fcfzs_req_keys",
143 sizeof(fcfzs_conv_key_t),
145 sizeof(fcfzs_conv_key_t),
147 fcfzs_req_vals = g_mem_chunk_new ("fcfzs_req_vals",
148 sizeof(fcfzs_conv_data_t),
150 sizeof(fcfzs_conv_data_t),
154 /* Code to actually dissect the packets */
156 dissect_fcfzs_zoneset (tvbuff_t *tvb, proto_tree *tree, int offset)
158 int numzones, nummbrs, i, j, len;
160 /* The zoneset structure has the following format */
161 /* zoneset name (len[not including pad], name, pad),
164 * Zone name (len[not including pad], name, pad), num zone mbrs
166 * zone mbr id type, zone mbr id (len, name, pad)
171 len = tvb_get_guint8 (tvb, offset);
172 proto_tree_add_item (tree, hf_fcfzs_zonesetnmlen, tvb, offset,
174 proto_tree_add_item (tree, hf_fcfzs_zonesetname, tvb, offset+4,
176 offset += 4 + len + (4-(len % 4));
179 /* Number of zones */
180 numzones = tvb_get_ntohl (tvb, offset);
181 proto_tree_add_item (tree, hf_fcfzs_numzones, tvb, offset, 4, 0);
184 /* For each zone... */
185 for (i = 0; i < numzones; i++) {
186 len = tvb_get_guint8 (tvb, offset);
187 proto_tree_add_item (tree, hf_fcfzs_zonenmlen, tvb, offset,
189 proto_tree_add_item (tree, hf_fcfzs_zonename, tvb, offset+4,
191 offset += 4 + len + (4-(len % 4));
193 nummbrs = tvb_get_ntohl (tvb, offset);
194 proto_tree_add_item (tree, hf_fcfzs_nummbrentries, tvb, offset,
198 for (j = 0; j < nummbrs; j++) {
199 proto_tree_add_item (tree, hf_fcfzs_mbrtype, tvb, offset, 1, 0);
201 switch (tvb_get_guint8 (tvb, offset)) {
202 case FC_FZS_ZONEMBR_PWWN:
203 case FC_FZS_ZONEMBR_NWWN:
204 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
206 fcwwn_to_str (tvb_get_ptr (tvb,
210 case FC_FZS_ZONEMBR_DP:
211 proto_tree_add_string_format (tree,
213 tvb, offset+4, 3, " ",
218 case FC_FZS_ZONEMBR_FCID:
219 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
221 fc_to_str (tvb_get_ptr (tvb,
225 case FC_FZS_ZONEMBR_PWWN_LUN:
226 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
228 fcwwn_to_str (tvb_get_ptr (tvb,
231 proto_tree_add_item (tree, hf_fcfzs_mbrid_lun, tvb,
234 case FC_FZS_ZONEMBR_DP_LUN:
235 proto_tree_add_string_format (tree,
237 tvb, offset+4, 3, " ",
241 proto_tree_add_item (tree, hf_fcfzs_mbrid_lun, tvb,
244 case FC_FZS_ZONEMBR_FCID_LUN:
245 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
247 fc_to_str (tvb_get_ptr (tvb,
250 proto_tree_add_item (tree, hf_fcfzs_mbrid_lun, tvb,
254 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
256 "Unknown member type format");
265 dissect_fcfzs_gzc (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
269 int offset = 16; /* past the fc_ct header */
274 flags = tvb_get_guint8 (tvb, offset);
276 /* Disect the flags field */
279 strcpy (str, "Hard Zones, ");
284 strcpy (&str[stroff], "Soft Zones Supported, ");
289 strcpy (&str[stroff], "ZoneSet Database Available");
293 proto_tree_add_uint_format (tree, hf_fcfzs_gzc_flags, tvb, offset,
294 1, flags, "Capabilities: 0x%x (%s)",
296 proto_tree_add_item (tree, hf_fcfzs_gzc_vendor, tvb, offset+4, 4, 0);
302 dissect_fcfzs_gest (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
306 int offset = 16; /* past the fc_ct header */
311 flags = tvb_get_guint8 (tvb, offset);
314 /* dissect the flags field */
316 strcpy (str, "Soft Zone Set Enforced, ");
321 strcpy (str, "Hard Zone Set Enforced");
325 proto_tree_add_uint_format (tree, hf_fcfzs_zone_state, tvb, offset,
326 1, flags, "Zone State: 0x%x (%s)",
328 proto_tree_add_item (tree, hf_fcfzs_gest_vendor, tvb, offset+4, 4, 0);
334 dissect_fcfzs_gzsn (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
337 int offset = 16; /* past the fc_ct header */
341 numrec = tvb_get_ntohl (tvb, offset);
343 proto_tree_add_item (tree, hf_fcfzs_numzonesetattrs, tvb, offset,
347 for (i = 0; i < numrec; i++) {
348 len = tvb_get_guint8 (tvb, offset);
349 proto_tree_add_item (tree, hf_fcfzs_zonesetnmlen, tvb, offset,
351 proto_tree_add_item (tree, hf_fcfzs_zonesetname, tvb, offset+1,
353 offset += len + 1 + (len % 4);
354 proto_tree_add_item (tree, hf_fcfzs_numzones, tvb, offset,
363 dissect_fcfzs_gzd (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
366 int offset = 16; /* past the fc_ct header */
370 len = tvb_get_guint8 (tvb, offset);
371 proto_tree_add_item (tree, hf_fcfzs_zonesetnmlen, tvb, offset,
373 proto_tree_add_item (tree, hf_fcfzs_zonesetname, tvb, offset+1,
377 numrec = tvb_get_ntohl (tvb, offset);
379 proto_tree_add_item (tree, hf_fcfzs_numzoneattrs, tvb, offset,
383 for (i = 0; i < numrec; i++) {
384 len = tvb_get_guint8 (tvb, offset);
385 proto_tree_add_item (tree, hf_fcfzs_zonenmlen, tvb, offset,
387 proto_tree_add_item (tree, hf_fcfzs_zonename, tvb, offset+1,
389 offset += len + 1 + (len % 4);
390 proto_tree_add_item (tree, hf_fcfzs_nummbrs, tvb, offset,
399 dissect_fcfzs_gzm (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
402 int offset = 16; /* past the fc_ct header */
406 len = tvb_get_guint8 (tvb, offset);
407 proto_tree_add_item (tree, hf_fcfzs_zonenmlen, tvb, offset,
409 proto_tree_add_item (tree, hf_fcfzs_zonename, tvb, offset+1,
413 numrec = tvb_get_ntohl (tvb, offset);
415 proto_tree_add_item (tree, hf_fcfzs_nummbrentries, tvb, offset,
418 for (i = 0; i < numrec; i++) {
419 proto_tree_add_item (tree, hf_fcfzs_mbrtype, tvb, offset, 1, 0);
420 switch (tvb_get_guint8 (tvb, offset)) {
421 case FC_FZS_ZONEMBR_PWWN:
422 case FC_FZS_ZONEMBR_NWWN:
423 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
425 fcwwn_to_str (tvb_get_ptr (tvb,
429 case FC_FZS_ZONEMBR_DP:
430 proto_tree_add_string_format (tree,
432 tvb, offset+4, 3, " ",
437 case FC_FZS_ZONEMBR_FCID:
438 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
440 fc_to_str (tvb_get_ptr (tvb,
445 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
447 "Unknown member type format");
456 dissect_fcfzs_gazs (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
458 int offset = 16; /* past the fc_ct header */
462 dissect_fcfzs_zoneset (tvb, tree, offset);
468 dissect_fcfzs_gzs (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
470 int offset = 16; /* past the fc_ct header */
475 len = tvb_get_guint8 (tvb, offset);
476 proto_tree_add_item (tree, hf_fcfzs_zonesetnmlen, tvb, offset,
478 proto_tree_add_item (tree, hf_fcfzs_zonesetname, tvb, offset+4,
482 dissect_fcfzs_zoneset (tvb, tree, offset);
488 dissect_fcfzs_adzs (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
490 int offset = 16; /* past the fc_ct header */
494 dissect_fcfzs_zoneset (tvb, tree, offset);
500 dissect_fcfzs_azsd (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
502 int offset = 16; /* past the fc_ct header */
506 dissect_fcfzs_zoneset (tvb, tree, offset);
512 dissect_fcfzs_arzs (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
514 int offset = 16; /* past the fc_ct header */
519 len = tvb_get_guint8 (tvb, offset);
520 proto_tree_add_item (tree, hf_fcfzs_zonesetnmlen, tvb, offset,
522 proto_tree_add_item (tree, hf_fcfzs_zonesetname, tvb, offset+4,
529 dissect_fcfzs_dzs (tvbuff_t *tvb _U_, proto_tree *tree _U_, guint8 isreq _U_)
531 /* Both req & successful response contain just the FC_CT header */
536 dissect_fcfzs_arzm (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
538 int numrec, i, len, plen;
539 int offset = 16; /* past the fc_ct header */
543 len = tvb_get_guint8 (tvb, offset);
544 proto_tree_add_item (tree, hf_fcfzs_zonenmlen, tvb, offset,
546 proto_tree_add_item (tree, hf_fcfzs_zonename, tvb, offset+1,
550 plen = tvb_length (tvb) - offset - len;
552 numrec = plen/12; /* each mbr rec is 12 bytes long */
555 for (i = 0; i < numrec; i++) {
556 proto_tree_add_item (tree, hf_fcfzs_mbrtype, tvb, offset, 1, 0);
557 switch (tvb_get_guint8 (tvb, offset)) {
558 case FC_FZS_ZONEMBR_PWWN:
559 case FC_FZS_ZONEMBR_NWWN:
560 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
562 fcwwn_to_str (tvb_get_ptr (tvb,
566 case FC_FZS_ZONEMBR_DP:
567 proto_tree_add_string_format (tree,
569 tvb, offset+4, 3, " ",
574 case FC_FZS_ZONEMBR_FCID:
575 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
577 fc_to_str (tvb_get_ptr (tvb,
582 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
584 "Unknown member type format");
593 dissect_fcfzs_arzd (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
595 int offset = 16; /* past the fc_ct header */
600 len = tvb_get_guint8 (tvb, offset);
601 proto_tree_add_item (tree, hf_fcfzs_zonesetnmlen, tvb, offset,
603 proto_tree_add_item (tree, hf_fcfzs_zonesetname, tvb, offset+4,
608 len = tvb_get_guint8 (tvb, offset);
609 proto_tree_add_item (tree, hf_fcfzs_zonenmlen, tvb, offset, 1, 0);
610 proto_tree_add_item (tree, hf_fcfzs_zonename, tvb, offset+4,
617 dissect_fcfzs_rjt (tvbuff_t *tvb, proto_tree *tree)
622 proto_tree_add_item (tree, hf_fcfzs_reason, tvb, offset+13, 1, 0);
623 proto_tree_add_item (tree, hf_fcfzs_rjtdetail, tvb, offset+14, 1, 0);
624 proto_tree_add_item (tree, hf_fcfzs_rjtvendor, tvb, offset+15, 1, 0);
629 dissect_fcfzs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
632 /* Set up structures needed to add the protocol subtree and manage it */
634 proto_tree *fcfzs_tree = NULL;
636 fc_ct_preamble cthdr;
639 conversation_t *conversation;
640 fcfzs_conv_data_t *cdata;
641 fcfzs_conv_key_t ckey, *req_key;
644 /* Make entries in Protocol column and Info column on summary display */
645 if (check_col(pinfo->cinfo, COL_PROTOCOL))
646 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Zone Server");
649 tvb_memcpy (tvb, (guint8 *)&cthdr, offset, FCCT_PRMBL_SIZE);
650 cthdr.revision = tvb_get_guint8 (tvb, offset+1);
651 cthdr.in_id = tvb_get_ntoh24 (tvb, offset);
652 cthdr.opcode = ntohs (cthdr.opcode);
653 opcode = cthdr.opcode;
654 cthdr.maxres_size = ntohs (cthdr.maxres_size);
657 ti = proto_tree_add_protocol_format (tree, proto_fcfzs, tvb, 0,
660 fcfzs_tree = proto_item_add_subtree (ti, ett_fcfzs);
661 proto_tree_add_item (fcfzs_tree, hf_fcfzs_opcode, tvb, offset+8, 2, 0);
662 proto_tree_add_item (fcfzs_tree, hf_fcfzs_maxres_size, tvb, offset+10,
666 if ((opcode != FCCT_MSG_ACC) && (opcode != FCCT_MSG_RJT)) {
667 conversation = find_conversation (&pinfo->src, &pinfo->dst,
668 pinfo->ptype, pinfo->oxid,
669 pinfo->rxid, NO_PORT2);
671 conversation = conversation_new (&pinfo->src, &pinfo->dst,
672 pinfo->ptype, pinfo->oxid,
673 pinfo->rxid, NO_PORT2);
676 ckey.conv_idx = conversation->index;
678 cdata = (fcfzs_conv_data_t *)g_hash_table_lookup (fcfzs_req_hash,
681 /* Since we never free the memory used by an exchange, this maybe a
682 * case of another request using the same exchange as a previous
685 cdata->opcode = opcode;
688 req_key = g_mem_chunk_alloc (fcfzs_req_keys);
689 req_key->conv_idx = conversation->index;
691 cdata = g_mem_chunk_alloc (fcfzs_req_vals);
692 cdata->opcode = opcode;
694 g_hash_table_insert (fcfzs_req_hash, req_key, cdata);
696 if (check_col (pinfo->cinfo, COL_INFO)) {
697 col_set_str (pinfo->cinfo, COL_INFO, val_to_str (opcode, fc_fzs_opcode_val,
702 /* Opcode is ACC or RJT */
703 conversation = find_conversation (&pinfo->src, &pinfo->dst,
704 pinfo->ptype, pinfo->oxid,
705 pinfo->rxid, NO_PORT2);
708 if (tree && (opcode == FCCT_MSG_ACC)) {
709 if (check_col (pinfo->cinfo, COL_INFO)) {
710 col_set_str (pinfo->cinfo, COL_INFO,
711 val_to_str (opcode, fc_fzs_opcode_val,
714 /* No record of what this accept is for. Can't decode */
715 proto_tree_add_text (fcfzs_tree, tvb, 0, tvb_length (tvb),
716 "No record of Exchg. Unable to decode MSG_ACC");
721 ckey.conv_idx = conversation->index;
723 cdata = (fcfzs_conv_data_t *)g_hash_table_lookup (fcfzs_req_hash, &ckey);
726 if (opcode == FCCT_MSG_ACC)
727 opcode = cdata->opcode;
729 failed_opcode = cdata->opcode;
732 if (check_col (pinfo->cinfo, COL_INFO)) {
733 if (opcode != FCCT_MSG_RJT) {
734 col_add_fstr (pinfo->cinfo, COL_INFO, "MSG_ACC (%s)",
736 fc_fzs_opcode_val, "0x%x"));
739 col_add_fstr (pinfo->cinfo, COL_INFO, "MSG_RJT (%s)",
740 val_to_str (failed_opcode,
741 fc_fzs_opcode_val, "0x%x"));
746 if ((cdata == NULL) && (opcode != FCCT_MSG_RJT)) {
747 /* No record of what this accept is for. Can't decode */
748 proto_tree_add_text (fcfzs_tree, tvb, 0, tvb_length (tvb),
749 "No record of Exchg. Unable to decode MSG_ACC/RJT");
758 dissect_fcfzs_rjt (tvb, fcfzs_tree);
761 dissect_fcfzs_gzc (tvb, fcfzs_tree, isreq);
764 dissect_fcfzs_gest (tvb, fcfzs_tree, isreq);
767 dissect_fcfzs_gzsn (tvb, fcfzs_tree, isreq);
770 dissect_fcfzs_gzd (tvb, fcfzs_tree, isreq);
773 dissect_fcfzs_gzm (tvb, fcfzs_tree, isreq);
776 dissect_fcfzs_gazs (tvb, fcfzs_tree, isreq);
779 dissect_fcfzs_gzs (tvb, fcfzs_tree, isreq);
782 dissect_fcfzs_adzs (tvb, fcfzs_tree, isreq);
785 dissect_fcfzs_azsd (tvb, fcfzs_tree, isreq);
788 dissect_fcfzs_arzs (tvb, fcfzs_tree, isreq);
791 dissect_fcfzs_dzs (tvb, fcfzs_tree, isreq);
794 dissect_fcfzs_arzm (tvb, fcfzs_tree, isreq);
797 dissect_fcfzs_arzd (tvb, fcfzs_tree, isreq);
800 dissect_fcfzs_arzm (tvb, fcfzs_tree, isreq);
803 dissect_fcfzs_arzd (tvb, fcfzs_tree, isreq);
806 dissect_fcfzs_arzs (tvb, fcfzs_tree, isreq);
809 call_dissector (data_handle, tvb, pinfo, tree);
814 /* Register the protocol with Ethereal */
816 /* this format is require because a script is used to build the C function
817 that calls all the protocol registration.
821 proto_register_fcfzs(void)
824 /* Setup list of header fields See Section 1.6.1 for details*/
825 static hf_register_info hf[] = {
827 {"Opcode", "fcfzs.opcode", FT_UINT16, BASE_HEX,
828 VALS (fc_fzs_opcode_val), 0x0, "", HFILL}},
829 { &hf_fcfzs_gzc_flags,
830 {"Capabilities", "fcfzs.gzc.flags", FT_UINT8, BASE_HEX, NULL, 0x0,
832 { &hf_fcfzs_gzc_vendor,
833 {"Vendor Specific Flags", "fcfzs.gzc.vendor", FT_UINT32, BASE_HEX,
834 NULL, 0x0, "", HFILL}},
835 { &hf_fcfzs_zone_state,
836 {"Zone State", "fcfzs.zone.state", FT_UINT8, BASE_HEX, NULL, 0x0,
838 { &hf_fcfzs_gest_vendor,
839 {"Vendor Specific State", "fcfzs.gest.vendor", FT_UINT32, BASE_HEX,
840 NULL, 0x0, "", HFILL}},
841 { &hf_fcfzs_numzoneattrs,
842 {"Number of Zone Attribute Entries", "fcfzs.zone.numattrs",
843 FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}},
844 { &hf_fcfzs_zonesetnmlen,
845 {"Zone Set Name Length", "fcfzs.zoneset.namelen", FT_UINT8, BASE_DEC,
846 NULL, 0x0, "", HFILL}},
847 { &hf_fcfzs_zonesetname,
848 {"Zone Set Name", "fcfzs.zoneset.name", FT_STRING, BASE_HEX, NULL,
850 { &hf_fcfzs_numzones,
851 {"Number of Zones", "fcfzs.zoneset.numzones", FT_UINT32, BASE_DEC,
852 NULL, 0x0, "", HFILL}},
853 { &hf_fcfzs_numzonesetattrs,
854 {"Number of Zone Set Attribute Entries", "fcfzs.zoneset.numattrs",
855 FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}},
856 { &hf_fcfzs_zonenmlen,
857 {"Zone Name Length", "fcfzs.zone.namelen", FT_UINT8, BASE_DEC, NULL,
859 { &hf_fcfzs_zonename,
860 {"Zone Name", "fcfzs.zone.name", FT_STRING, BASE_HEX, NULL, 0x0, "",
863 {"Number of Zone Members", "fcfzs.zone.nummbrs", FT_UINT32, BASE_DEC,
864 NULL, 0x0, "", HFILL}},
865 { &hf_fcfzs_nummbrentries,
866 {"Number of Zone Member Attribute Entries", "fcfzs.zonembr.numattrs",
867 FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}},
869 {"Zone Member Identifier Type", "fcfzs.zonembr.idtype", FT_UINT8,
870 BASE_HEX, VALS (fc_fzs_zonembr_type_val), 0x0, "", HFILL}},
871 { &hf_fcfzs_mbridlen,
872 {"Zone Member Identifier Length", "fcfzs.zonembr.idlen", FT_UINT8,
873 BASE_DEC, NULL, 0x0, "", HFILL}},
875 {"Zone Member Identifier", "fcfzs.zone.mbrid", FT_STRING, BASE_HEX,
876 NULL, 0x0, "", HFILL}},
878 {"Reason Code", "fcfzs.reason", FT_UINT8, BASE_HEX,
879 VALS (fc_ct_rjt_code_vals), 0x0, "", HFILL}},
880 { &hf_fcfzs_rjtdetail,
881 {"Reason Code Explanation", "fcfzs.rjtdetail", FT_UINT8, BASE_HEX,
882 VALS (fc_fzs_rjt_code_val), 0x0, "", HFILL}},
883 { &hf_fcfzs_rjtvendor,
884 {"Vendor Specific Reason", "fcfzs.rjtvendor", FT_UINT8, BASE_HEX,
885 NULL, 0x0, "", HFILL}},
886 { &hf_fcfzs_maxres_size,
887 {"Maximum/Residual Size", "fcfzs.maxres_size", FT_UINT16, BASE_DEC,
888 NULL, 0x0, "", HFILL}},
889 { &hf_fcfzs_mbrid_lun,
890 {"LUN", "fcfzs.zone.lun", FT_BYTES, BASE_HEX, NULL, 0x0, "",
894 /* Setup protocol subtree array */
895 static gint *ett[] = {
899 /* Register the protocol name and description */
900 proto_fcfzs = proto_register_protocol("Fibre Channel Fabric Zone Server", "FC FZS", "FZS");
902 /* Required function calls to register the header fields and subtrees used */
903 proto_register_field_array(proto_fcfzs, hf, array_length(hf));
904 proto_register_subtree_array(ett, array_length(ett));
905 register_init_routine (&fcfzs_init_protocol);
909 /* If this dissector uses sub-dissector registration add a registration routine.
910 This format is required because a script is used to find these routines and
911 create the code that calls these routines.
914 proto_reg_handoff_fcfzs (void)
916 dissector_handle_t fzs_handle;
918 fzs_handle = create_dissector_handle (dissect_fcfzs, proto_fcfzs);
919 dissector_add("fcct.server", FCCT_GSRVR_FZS, fzs_handle);
921 data_handle = find_dissector ("data");