2 * Routines for FC Fabric Zone Server
3 * Copyright 2001, Dinesh G Dutt <ddutt@andiamo.com>
5 * $Id: packet-fcfzs.c,v 1.1 2003/01/14 01:17:44 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 */
163 * Zone name (len, name, pad), num zone mbrs
165 * zone mbr id type, zone mbr id (len, name, pad)
168 numzones = tvb_get_ntohl (tvb, offset);
169 proto_tree_add_item (tree, hf_fcfzs_numzonesetattrs, tvb, offset, 4, 0);
172 for (i = 0; i < numzones; i++) {
173 len = tvb_get_guint8 (tvb, offset);
174 proto_tree_add_item (tree, hf_fcfzs_zonenmlen, tvb, offset,
176 proto_tree_add_item (tree, hf_fcfzs_zonename, tvb, offset+1,
180 nummbrs = tvb_get_guint8 (tvb, offset);
181 proto_tree_add_item (tree, hf_fcfzs_nummbrentries, tvb, offset,
185 for (j = 0; j < nummbrs; j++) {
186 proto_tree_add_item (tree, hf_fcfzs_mbrtype, tvb, offset, 1, 0);
188 switch (tvb_get_guint8 (tvb, offset)) {
189 case FC_FZS_ZONEMBR_PWWN:
190 case FC_FZS_ZONEMBR_NWWN:
191 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
193 fcwwn_to_str (tvb_get_ptr (tvb,
197 case FC_FZS_ZONEMBR_DP:
198 proto_tree_add_string_format (tree,
200 tvb, offset+4, 3, " ",
205 case FC_FZS_ZONEMBR_FCID:
206 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
208 fc_to_str (tvb_get_ptr (tvb,
212 case FC_FZS_ZONEMBR_PWWN_LUN:
213 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
215 fcwwn_to_str (tvb_get_ptr (tvb,
218 proto_tree_add_item (tree, hf_fcfzs_mbrid_lun, tvb,
221 case FC_FZS_ZONEMBR_DP_LUN:
222 proto_tree_add_string_format (tree,
224 tvb, offset+4, 3, " ",
228 proto_tree_add_item (tree, hf_fcfzs_mbrid_lun, tvb,
231 case FC_FZS_ZONEMBR_FCID_LUN:
232 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
234 fc_to_str (tvb_get_ptr (tvb,
237 proto_tree_add_item (tree, hf_fcfzs_mbrid_lun, tvb,
241 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
243 "Unknown member type format");
252 dissect_fcfzs_gzc (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
256 int offset = 16; /* past the fc_ct header */
261 flags = tvb_get_guint8 (tvb, offset);
263 /* Disect the flags field */
266 strcpy (str, "Hard Zones, ");
271 strcpy (&str[stroff], "Soft Zones Supported, ");
276 strcpy (&str[stroff], "ZoneSet Database Available");
280 proto_tree_add_uint_format (tree, hf_fcfzs_gzc_flags, tvb, offset,
281 1, flags, "Capabilities: 0x%x (%s)",
283 proto_tree_add_item (tree, hf_fcfzs_gzc_vendor, tvb, offset+4, 4, 0);
289 dissect_fcfzs_gest (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
293 int offset = 16; /* past the fc_ct header */
298 flags = tvb_get_guint8 (tvb, offset);
301 /* dissect the flags field */
303 strcpy (str, "Soft Zone Set Enforced, ");
308 strcpy (str, "Hard Zone Set Enforced");
312 proto_tree_add_uint_format (tree, hf_fcfzs_zone_state, tvb, offset,
313 1, flags, "Zone State: 0x%x (%s)",
315 proto_tree_add_item (tree, hf_fcfzs_gest_vendor, tvb, offset+4, 4, 0);
321 dissect_fcfzs_gzsn (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
324 int offset = 16; /* past the fc_ct header */
328 numrec = tvb_get_ntohl (tvb, offset);
330 proto_tree_add_item (tree, hf_fcfzs_numzonesetattrs, tvb, offset,
334 for (i = 0; i < numrec; i++) {
335 len = tvb_get_guint8 (tvb, offset);
336 proto_tree_add_item (tree, hf_fcfzs_zonesetnmlen, tvb, offset,
338 proto_tree_add_item (tree, hf_fcfzs_zonesetname, tvb, offset+1,
340 offset += len + 1 + (len % 4);
341 proto_tree_add_item (tree, hf_fcfzs_numzones, tvb, offset,
350 dissect_fcfzs_gzd (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
353 int offset = 16; /* past the fc_ct header */
357 len = tvb_get_guint8 (tvb, offset);
358 proto_tree_add_item (tree, hf_fcfzs_zonesetnmlen, tvb, offset,
360 proto_tree_add_item (tree, hf_fcfzs_zonesetname, tvb, offset+1,
364 numrec = tvb_get_ntohl (tvb, offset);
366 proto_tree_add_item (tree, hf_fcfzs_numzoneattrs, tvb, offset,
370 for (i = 0; i < numrec; i++) {
371 len = tvb_get_guint8 (tvb, offset);
372 proto_tree_add_item (tree, hf_fcfzs_zonenmlen, tvb, offset,
374 proto_tree_add_item (tree, hf_fcfzs_zonename, tvb, offset+1,
376 offset += len + 1 + (len % 4);
377 proto_tree_add_item (tree, hf_fcfzs_nummbrs, tvb, offset,
386 dissect_fcfzs_gzm (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
389 int offset = 16; /* past the fc_ct header */
393 len = tvb_get_guint8 (tvb, offset);
394 proto_tree_add_item (tree, hf_fcfzs_zonenmlen, tvb, offset,
396 proto_tree_add_item (tree, hf_fcfzs_zonename, tvb, offset+1,
400 numrec = tvb_get_ntohl (tvb, offset);
402 proto_tree_add_item (tree, hf_fcfzs_nummbrentries, tvb, offset,
405 for (i = 0; i < numrec; i++) {
406 proto_tree_add_item (tree, hf_fcfzs_mbrtype, tvb, offset, 1, 0);
407 switch (tvb_get_guint8 (tvb, offset)) {
408 case FC_FZS_ZONEMBR_PWWN:
409 case FC_FZS_ZONEMBR_NWWN:
410 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
412 fcwwn_to_str (tvb_get_ptr (tvb,
416 case FC_FZS_ZONEMBR_DP:
417 proto_tree_add_string_format (tree,
419 tvb, offset+4, 3, " ",
424 case FC_FZS_ZONEMBR_FCID:
425 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
427 fc_to_str (tvb_get_ptr (tvb,
432 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
434 "Unknown member type format");
443 dissect_fcfzs_gazs (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
445 int offset = 16; /* past the fc_ct header */
450 len = tvb_get_guint8 (tvb, offset);
451 proto_tree_add_item (tree, hf_fcfzs_zonesetnmlen, tvb, offset,
453 proto_tree_add_item (tree, hf_fcfzs_zonesetname, tvb, offset+4,
455 offset += (len + (len % 4));
457 dissect_fcfzs_zoneset (tvb, tree, offset);
463 dissect_fcfzs_gzs (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
465 int offset = 16; /* past the fc_ct header */
470 len = tvb_get_guint8 (tvb, offset);
471 proto_tree_add_item (tree, hf_fcfzs_zonesetnmlen, tvb, offset,
473 proto_tree_add_item (tree, hf_fcfzs_zonesetname, tvb, offset+4,
477 len = tvb_get_guint8 (tvb, offset);
478 proto_tree_add_item (tree, hf_fcfzs_zonesetnmlen, tvb, offset,
480 proto_tree_add_item (tree, hf_fcfzs_zonesetname, tvb, offset+4,
482 offset += (len + (len % 4));
484 dissect_fcfzs_zoneset (tvb, tree, offset);
490 dissect_fcfzs_adzs (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
492 int offset = 16; /* past the fc_ct header */
497 len = tvb_get_guint8 (tvb, offset);
498 proto_tree_add_item (tree, hf_fcfzs_zonesetnmlen, tvb, offset,
500 proto_tree_add_item (tree, hf_fcfzs_zonesetname, tvb, offset+4,
502 offset += (len + (len % 4));
504 dissect_fcfzs_zoneset (tvb, tree, offset);
510 dissect_fcfzs_azsd (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
512 int offset = 16; /* past the fc_ct header */
517 len = tvb_get_guint8 (tvb, offset);
518 proto_tree_add_item (tree, hf_fcfzs_zonesetnmlen, tvb, offset,
520 proto_tree_add_item (tree, hf_fcfzs_zonesetname, tvb, offset+4,
522 offset += (len + (len % 4));
524 dissect_fcfzs_zoneset (tvb, tree, offset);
530 dissect_fcfzs_arzs (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
532 int offset = 16; /* past the fc_ct header */
537 len = tvb_get_guint8 (tvb, offset);
538 proto_tree_add_item (tree, hf_fcfzs_zonesetnmlen, tvb, offset,
540 proto_tree_add_item (tree, hf_fcfzs_zonesetname, tvb, offset+4,
547 dissect_fcfzs_dzs (tvbuff_t *tvb _U_, proto_tree *tree _U_, guint8 isreq _U_)
549 /* Both req & successful response contain just the FC_CT header */
554 dissect_fcfzs_arzm (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
556 int numrec, i, len, plen;
557 int offset = 16; /* past the fc_ct header */
561 len = tvb_get_guint8 (tvb, offset);
562 proto_tree_add_item (tree, hf_fcfzs_zonenmlen, tvb, offset,
564 proto_tree_add_item (tree, hf_fcfzs_zonename, tvb, offset+1,
568 plen = tvb_length (tvb) - offset - len;
570 numrec = plen/12; /* each mbr rec is 12 bytes long */
573 for (i = 0; i < numrec; i++) {
574 proto_tree_add_item (tree, hf_fcfzs_mbrtype, tvb, offset, 1, 0);
575 switch (tvb_get_guint8 (tvb, offset)) {
576 case FC_FZS_ZONEMBR_PWWN:
577 case FC_FZS_ZONEMBR_NWWN:
578 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
580 fcwwn_to_str (tvb_get_ptr (tvb,
584 case FC_FZS_ZONEMBR_DP:
585 proto_tree_add_string_format (tree,
587 tvb, offset+4, 3, " ",
592 case FC_FZS_ZONEMBR_FCID:
593 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
595 fc_to_str (tvb_get_ptr (tvb,
600 proto_tree_add_string (tree, hf_fcfzs_mbrid, tvb,
602 "Unknown member type format");
611 dissect_fcfzs_arzd (tvbuff_t *tvb, proto_tree *tree, guint8 isreq)
613 int offset = 16; /* past the fc_ct header */
618 len = tvb_get_guint8 (tvb, offset);
619 proto_tree_add_item (tree, hf_fcfzs_zonesetnmlen, tvb, offset,
621 proto_tree_add_item (tree, hf_fcfzs_zonesetname, tvb, offset+4,
626 len = tvb_get_guint8 (tvb, offset);
627 proto_tree_add_item (tree, hf_fcfzs_zonenmlen, tvb, offset, 1, 0);
628 proto_tree_add_item (tree, hf_fcfzs_zonename, tvb, offset+4,
635 dissect_fcfzs_rjt (tvbuff_t *tvb, proto_tree *tree)
640 proto_tree_add_item (tree, hf_fcfzs_reason, tvb, offset+13, 1, 0);
641 proto_tree_add_item (tree, hf_fcfzs_rjtdetail, tvb, offset+14, 1, 0);
642 proto_tree_add_item (tree, hf_fcfzs_rjtvendor, tvb, offset+15, 1, 0);
647 dissect_fcfzs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
650 /* Set up structures needed to add the protocol subtree and manage it */
652 proto_tree *fcfzs_tree = NULL;
654 fc_ct_preamble cthdr;
657 conversation_t *conversation;
658 fcfzs_conv_data_t *cdata;
659 fcfzs_conv_key_t ckey, *req_key;
662 /* Make entries in Protocol column and Info column on summary display */
663 if (check_col(pinfo->cinfo, COL_PROTOCOL))
664 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Zone Server");
667 tvb_memcpy (tvb, (guint8 *)&cthdr, offset, FCCT_PRMBL_SIZE);
668 cthdr.revision = tvb_get_guint8 (tvb, offset+1);
669 cthdr.in_id = tvb_get_ntoh24 (tvb, offset);
670 cthdr.opcode = ntohs (cthdr.opcode);
671 opcode = cthdr.opcode;
672 cthdr.maxres_size = ntohs (cthdr.maxres_size);
675 ti = proto_tree_add_protocol_format (tree, proto_fcfzs, tvb, 0,
678 fcfzs_tree = proto_item_add_subtree (ti, ett_fcfzs);
679 proto_tree_add_item (fcfzs_tree, hf_fcfzs_opcode, tvb, offset+8, 2, 0);
680 proto_tree_add_item (fcfzs_tree, hf_fcfzs_maxres_size, tvb, offset+10,
684 if ((opcode != FCCT_MSG_ACC) && (opcode != FCCT_MSG_RJT)) {
685 conversation = find_conversation (&pinfo->src, &pinfo->dst,
686 pinfo->ptype, pinfo->oxid,
687 pinfo->rxid, NO_PORT2);
689 conversation = conversation_new (&pinfo->src, &pinfo->dst,
690 pinfo->ptype, pinfo->oxid,
691 pinfo->rxid, NO_PORT2);
694 ckey.conv_idx = conversation->index;
696 cdata = (fcfzs_conv_data_t *)g_hash_table_lookup (fcfzs_req_hash,
699 /* Since we never free the memory used by an exchange, this maybe a
700 * case of another request using the same exchange as a previous
703 cdata->opcode = opcode;
706 req_key = g_mem_chunk_alloc (fcfzs_req_keys);
707 req_key->conv_idx = conversation->index;
709 cdata = g_mem_chunk_alloc (fcfzs_req_vals);
710 cdata->opcode = opcode;
712 g_hash_table_insert (fcfzs_req_hash, req_key, cdata);
714 if (check_col (pinfo->cinfo, COL_INFO)) {
715 col_set_str (pinfo->cinfo, COL_INFO, val_to_str (opcode, fc_fzs_opcode_val,
720 /* Opcode is ACC or RJT */
721 conversation = find_conversation (&pinfo->src, &pinfo->dst,
722 pinfo->ptype, pinfo->oxid,
723 pinfo->rxid, NO_PORT2);
726 if (tree && (opcode == FCCT_MSG_ACC)) {
727 if (check_col (pinfo->cinfo, COL_INFO)) {
728 col_set_str (pinfo->cinfo, COL_INFO,
729 val_to_str (opcode, fc_fzs_opcode_val,
732 /* No record of what this accept is for. Can't decode */
733 proto_tree_add_text (fcfzs_tree, tvb, 0, tvb_length (tvb),
734 "No record of Exchg. Unable to decode MSG_ACC");
739 ckey.conv_idx = conversation->index;
741 cdata = (fcfzs_conv_data_t *)g_hash_table_lookup (fcfzs_req_hash, &ckey);
744 if (opcode == FCCT_MSG_ACC)
745 opcode = cdata->opcode;
747 failed_opcode = cdata->opcode;
750 if (check_col (pinfo->cinfo, COL_INFO)) {
751 if (opcode != FCCT_MSG_RJT) {
752 col_add_fstr (pinfo->cinfo, COL_INFO, "MSG_ACC (%s)",
754 fc_fzs_opcode_val, "0x%x"));
757 col_add_fstr (pinfo->cinfo, COL_INFO, "MSG_RJT (%s)",
758 val_to_str (failed_opcode,
759 fc_fzs_opcode_val, "0x%x"));
764 if ((cdata == NULL) && (opcode != FCCT_MSG_RJT)) {
765 /* No record of what this accept is for. Can't decode */
766 proto_tree_add_text (fcfzs_tree, tvb, 0, tvb_length (tvb),
767 "No record of Exchg. Unable to decode MSG_ACC/RJT");
776 dissect_fcfzs_rjt (tvb, fcfzs_tree);
779 dissect_fcfzs_gzc (tvb, fcfzs_tree, isreq);
782 dissect_fcfzs_gest (tvb, fcfzs_tree, isreq);
785 dissect_fcfzs_gzsn (tvb, fcfzs_tree, isreq);
788 dissect_fcfzs_gzd (tvb, fcfzs_tree, isreq);
791 dissect_fcfzs_gzm (tvb, fcfzs_tree, isreq);
794 dissect_fcfzs_gazs (tvb, fcfzs_tree, isreq);
797 dissect_fcfzs_gzs (tvb, fcfzs_tree, isreq);
800 dissect_fcfzs_adzs (tvb, fcfzs_tree, isreq);
803 dissect_fcfzs_azsd (tvb, fcfzs_tree, isreq);
806 dissect_fcfzs_arzs (tvb, fcfzs_tree, isreq);
809 dissect_fcfzs_dzs (tvb, fcfzs_tree, isreq);
812 dissect_fcfzs_arzm (tvb, fcfzs_tree, isreq);
815 dissect_fcfzs_arzd (tvb, fcfzs_tree, isreq);
818 dissect_fcfzs_arzm (tvb, fcfzs_tree, isreq);
821 dissect_fcfzs_arzd (tvb, fcfzs_tree, isreq);
824 dissect_fcfzs_arzs (tvb, fcfzs_tree, isreq);
827 call_dissector (data_handle, tvb, pinfo, tree);
832 /* Register the protocol with Ethereal */
834 /* this format is require because a script is used to build the C function
835 that calls all the protocol registration.
839 proto_register_fcfzs(void)
842 /* Setup list of header fields See Section 1.6.1 for details*/
843 static hf_register_info hf[] = {
845 {"Opcode", "fcfzs.opcode", FT_UINT16, BASE_HEX,
846 VALS (fc_fzs_opcode_val), 0x0, "", HFILL}},
847 { &hf_fcfzs_gzc_flags,
848 {"Capabilities", "fcfzs.gzc.flags", FT_UINT8, BASE_HEX, NULL, 0x0,
850 { &hf_fcfzs_gzc_vendor,
851 {"Vendor Specific Flags", "fcfzs.gzc.vendor", FT_UINT32, BASE_HEX,
852 NULL, 0x0, "", HFILL}},
853 { &hf_fcfzs_zone_state,
854 {"Zone State", "fcfzs.zone.state", FT_UINT8, BASE_HEX, NULL, 0x0,
856 { &hf_fcfzs_gest_vendor,
857 {"Vendor Specific State", "fcfzs.gest.vendor", FT_UINT32, BASE_HEX,
858 NULL, 0x0, "", HFILL}},
859 { &hf_fcfzs_numzoneattrs,
860 {"Number of Zone Attribute Entries", "fcfzs.zone.numattrs",
861 FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}},
862 { &hf_fcfzs_zonesetnmlen,
863 {"Zone Set Name Length", "fcfzs.zoneset.namelen", FT_UINT8, BASE_DEC,
864 NULL, 0x0, "", HFILL}},
865 { &hf_fcfzs_zonesetname,
866 {"Zone Set Name", "fcfzs.zoneset.name", FT_STRING, BASE_HEX, NULL,
868 { &hf_fcfzs_numzones,
869 {"Number of Zones", "fcfzs.zoneset.numzones", FT_UINT32, BASE_DEC,
870 NULL, 0x0, "", HFILL}},
871 { &hf_fcfzs_numzonesetattrs,
872 {"Number of Zone Set Attribute Entries", "fcfzs.zoneset.numattrs",
873 FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}},
874 { &hf_fcfzs_zonenmlen,
875 {"Zone Name Length", "fcfzs.zone.namelen", FT_UINT8, BASE_DEC, NULL,
877 { &hf_fcfzs_zonename,
878 {"Zone Name", "fcfzs.zone.name", FT_STRING, BASE_HEX, NULL, 0x0, "",
881 {"Number of Zone Members", "fcfzs.zone.nummbrs", FT_UINT32, BASE_DEC,
882 NULL, 0x0, "", HFILL}},
883 { &hf_fcfzs_nummbrentries,
884 {"Number of Zone Member Attribute Entries", "fcfzs.zonembr.numattrs",
885 FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}},
887 {"Zone Member Identifier Type", "fcfzs.zonembr.idtype", FT_UINT8,
888 BASE_HEX, VALS (fc_fzs_zonembr_type_val), 0x0, "", HFILL}},
889 { &hf_fcfzs_mbridlen,
890 {"Zone Member Identifier Length", "fcfzs.zonembr.idlen", FT_UINT8,
891 BASE_DEC, NULL, 0x0, "", HFILL}},
893 {"Zone Member Identifier", "fcfzs.zone.mbrid", FT_STRING, BASE_HEX,
894 NULL, 0x0, "", HFILL}},
896 {"Reason Code", "fcfzs.reason", FT_UINT8, BASE_HEX,
897 VALS (fc_ct_rjt_code_vals), 0x0, "", HFILL}},
898 { &hf_fcfzs_rjtdetail,
899 {"Reason Code Explanation", "fcfzs.rjtdetail", FT_UINT8, BASE_HEX,
900 VALS (fc_fzs_rjt_code_val), 0x0, "", HFILL}},
901 { &hf_fcfzs_rjtvendor,
902 {"Vendor Specific Reason", "fcfzs.rjtvendor", FT_UINT8, BASE_HEX,
903 NULL, 0x0, "", HFILL}},
904 { &hf_fcfzs_maxres_size,
905 {"Maximum/Residual Size", "fcfzs.maxres_size", FT_UINT16, BASE_DEC,
906 NULL, 0x0, "", HFILL}},
907 { &hf_fcfzs_mbrid_lun,
908 {"LUN", "fcfzs.zone.lun", FT_BYTES, BASE_HEX, NULL, 0x0, "",
912 /* Setup protocol subtree array */
913 static gint *ett[] = {
917 /* Register the protocol name and description */
918 proto_fcfzs = proto_register_protocol("Fibre Channel Fabric Zone Server", "FC FZS", "FZS");
920 /* Required function calls to register the header fields and subtrees used */
921 proto_register_field_array(proto_fcfzs, hf, array_length(hf));
922 proto_register_subtree_array(ett, array_length(ett));
923 register_init_routine (&fcfzs_init_protocol);
927 /* If this dissector uses sub-dissector registration add a registration routine.
928 This format is required because a script is used to find these routines and
929 create the code that calls these routines.
932 proto_reg_handoff_fcfzs (void)
934 dissector_handle_t fzs_handle;
936 fzs_handle = create_dissector_handle (dissect_fcfzs, proto_fcfzs);
937 dissector_add("fcct.server", FCCT_GSRVR_FZS, fzs_handle);
939 data_handle = find_dissector ("data");