2 * Routines for FC Inter-switch link services
3 * Copyright 2001, Dinesh G Dutt <ddutt@cisco.com>
5 * $Id: packet-fcswils.c,v 1.5 2003/06/30 21:58:41 guy Exp $
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@ethereal.com>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 #ifdef HAVE_SYS_TYPES_H
35 # include <sys/types.h>
38 #ifdef HAVE_NETINET_IN_H
39 # include <netinet/in.h>
44 #ifdef NEED_SNPRINTF_H
45 # include "snprintf.h"
48 #include <epan/packet.h>
49 #include <epan/conversation.h>
51 #include "packet-fc.h"
52 #include "packet-fcswils.h"
54 #define FC_SWILS_RPLY 0x0
55 #define FC_SWILS_REQ 0x1
56 #define FC_SWILS_RSCN_DEVENTRY_SIZE 20
58 /* Zone name has the structure:
59 * name_len (1 byte), rsvd (3 bytes), name (m bytes), fill (n bytes)
60 * name_len excludes the 4 initial bytes before the name
62 #define ZONENAME_LEN(x, y) (tvb_get_guint8(x, y)+4)
64 /* Initialize the protocol and registered fields */
65 static int proto_fcswils = -1;
66 static int hf_swils_opcode = -1;
67 static int hf_swils_elp_rev = -1;
68 static int hf_swils_elp_flags = -1;
69 static int hf_swils_elp_r_a_tov = -1;
70 static int hf_swils_elp_e_d_tov = -1;
71 static int hf_swils_elp_req_epn = -1;
72 static int hf_swils_elp_req_esn = -1;
73 static int hf_swils_elp_clsf_svcp = -1;
74 static int hf_swils_elp_clsf_rcvsz = -1;
75 static int hf_swils_elp_clsf_conseq = -1;
76 static int hf_swils_elp_clsf_e2e = -1;
77 static int hf_swils_elp_clsf_openseq = -1;
78 static int hf_swils_elp_cls1_svcp = -1;
79 static int hf_swils_elp_cls1_rcvsz = -1;
80 static int hf_swils_elp_cls2_svcp = -1;
81 static int hf_swils_elp_cls2_rcvsz = -1;
82 static int hf_swils_elp_cls3_svcp = -1;
83 static int hf_swils_elp_cls3_rcvsz = -1;
84 static int hf_swils_elp_isl_fc_mode = -1;
85 static int hf_swils_elp_fcplen = -1;
86 static int hf_swils_elp_b2bcredit = -1;
87 static int hf_swils_elp_compat1 = -1;
88 static int hf_swils_elp_compat2 = -1;
89 static int hf_swils_elp_compat3 = -1;
90 static int hf_swils_elp_compat4 = -1;
91 static int hf_swils_efp_rec_type = -1;
92 static int hf_swils_efp_dom_id = -1;
93 static int hf_swils_efp_switch_name = -1;
94 static int hf_swils_efp_mcast_grpno = -1;
95 static int hf_swils_efp_alias_token = -1;
96 static int hf_swils_efp_payload_len = -1;
97 static int hf_swils_efp_pswitch_pri = -1;
98 static int hf_swils_efp_pswitch_name = -1;
99 static int hf_swils_dia_switch_name = -1;
100 static int hf_swils_rdi_payload_len = -1;
101 static int hf_swils_rdi_req_sname = -1;
102 static int hf_swils_fspfh_cmd = -1;
103 static int hf_swils_fspfh_rev = -1;
104 static int hf_swils_fspfh_ar_num = -1;
105 static int hf_swils_fspfh_auth_type = -1;
106 static int hf_swils_fspfh_dom_id = -1;
107 static int hf_swils_fspfh_auth = -1;
108 static int hf_swils_hlo_options = -1;
109 static int hf_swils_hlo_hloint = -1;
110 static int hf_swils_hlo_deadint = -1;
111 static int hf_swils_hlo_rcv_domid = -1;
112 static int hf_swils_hlo_orig_pidx = -1;
113 static int hf_swils_ldrec_linkid = -1;
114 static int hf_swils_ldrec_out_pidx = -1;
115 static int hf_swils_ldrec_nbr_pidx = -1;
116 static int hf_swils_ldrec_link_type = -1;
117 static int hf_swils_ldrec_link_cost = -1;
118 static int hf_swils_lsrh_lsr_type = -1;
119 static int hf_swils_lsrh_lsid = -1;
120 static int hf_swils_lsrh_adv_domid = -1;
121 static int hf_swils_lsrh_ls_incid = -1;
122 static int hf_swils_esc_pdesc_vendorid = -1;
123 static int hf_swils_esc_swvendorid = -1;
124 static int hf_swils_esc_protocolid = -1;
125 static int hf_swils_rscn_evtype = -1;
126 static int hf_swils_rscn_addrfmt = -1;
127 static int hf_swils_rscn_detectfn = -1;
128 static int hf_swils_rscn_affectedport = -1;
129 static int hf_swils_rscn_portstate = -1;
130 static int hf_swils_rscn_portid = -1;
131 static int hf_swils_rscn_pwwn = -1;
132 static int hf_swils_rscn_nwwn = -1;
133 static int hf_swils_zone_activezonenm = -1;
134 static int hf_swils_zone_objname = -1;
135 static int hf_swils_zone_objtype = -1;
136 static int hf_swils_zone_mbrtype = -1;
137 static int hf_swils_zone_protocol = -1;
138 static int hf_swils_zone_mbrid = -1;
139 static int hf_swils_zone_status = -1;
140 static int hf_swils_zone_reason = -1;
141 static int hf_swils_aca_domainid = -1;
142 static int hf_swils_sfc_opcode = -1;
143 static int hf_swils_sfc_zonenm = -1;
144 static int hf_swils_rjt = -1;
145 static int hf_swils_rjtdet = -1;
146 static int hf_swils_rjtvendor = -1;
147 static int hf_swils_zone_mbrid_lun = -1;
149 /* Initialize the subtree pointers */
150 static gint ett_fcswils = -1;
151 static gint ett_fcswils_swacc = -1;
152 static gint ett_fcswils_swrjt = -1;
153 static gint ett_fcswils_elp = -1;
154 static gint ett_fcswils_efp = -1;
155 static gint ett_fcswils_efplist = -1;
156 static gint ett_fcswils_dia = -1;
157 static gint ett_fcswils_rdi = -1;
158 static gint ett_fcswils_fspfhdr = -1;
159 static gint ett_fcswils_hlo = -1;
160 static gint ett_fcswils_lsrec = -1;
161 static gint ett_fcswils_lsrechdr = -1;
162 static gint ett_fcswils_ldrec = -1;
163 static gint ett_fcswils_lsu = -1;
164 static gint ett_fcswils_lsa = -1;
165 static gint ett_fcswils_bf = -1;
166 static gint ett_fcswils_rcf = -1;
167 static gint ett_fcswils_rscn = -1;
168 static gint ett_fcswils_rscn_dev = -1;
169 static gint ett_fcswils_drlir = -1;
170 static gint ett_fcswils_mr = -1;
171 static gint ett_fcswils_zoneobjlist = -1;
172 static gint ett_fcswils_zoneobj = -1;
173 static gint ett_fcswils_zonembr = -1;
174 static gint ett_fcswils_aca = -1;
175 static gint ett_fcswils_rca = -1;
176 static gint ett_fcswils_sfc = -1;
177 static gint ett_fcswils_ufc = -1;
178 static gint ett_fcswils_esc = -1;
179 static gint ett_fcswils_esc_pdesc = -1;
181 static const value_string fc_swils_opcode_key_val[] = {
182 {FC_SWILS_SWRJT , "SW_RJT"},
183 {FC_SWILS_SWACC , "SW_ACC"},
184 {FC_SWILS_ELP , "ELP"},
185 {FC_SWILS_EFP , "EFP"},
186 {FC_SWILS_DIA , "DIA"},
187 {FC_SWILS_RDI , "RDI"},
188 {FC_SWILS_HLO , "HLO"},
189 {FC_SWILS_LSU , "LSU"},
190 {FC_SWILS_LSA , "LSA"},
191 {FC_SWILS_BF , "BF"},
192 {FC_SWILS_RCF , "RCF"},
193 {FC_SWILS_RSCN , "SW_RSCN"},
194 {FC_SWILS_DRLIR , "DRLIR"},
195 {FC_SWILS_DSCN , "DSCN"},
196 {FC_SWILS_LOOPD , "LOOPD"},
197 {FC_SWILS_MR , "MR"},
198 {FC_SWILS_ACA , "ACA"},
199 {FC_SWILS_RCA , "RCA"},
200 {FC_SWILS_SFC , "SFC"},
201 {FC_SWILS_UFC , "UFC"},
202 {FC_SWILS_ESC , "ESC"},
206 static const value_string fc_swils_rjt_val [] = {
207 {FC_SWILS_RJT_INVCODE , "Invalid Cmd Code"},
208 {FC_SWILS_RJT_INVVER , "Invalid Revision"},
209 {FC_SWILS_RJT_LOGERR , "Logical Error"},
210 {FC_SWILS_RJT_INVSIZE , "Invalid Size"},
211 {FC_SWILS_RJT_LOGBSY , "Logical Busy"},
212 {FC_SWILS_RJT_PROTERR , "Protocol Error"},
213 {FC_SWILS_RJT_GENFAIL , "Unable to Perform"},
214 {FC_SWILS_RJT_CMDNOTSUPP, "Unsupported Cmd"},
215 {FC_SWILS_RJT_VENDUNIQ , "Vendor Unique Err"},
219 static const value_string fc_swils_deterr_val [] = {
220 {FC_SWILS_RJT_NODET , "No Additional Details"},
221 {FC_SWILS_RJT_CLSF_ERR , "Class F Svc Param Err"},
222 {FC_SWILS_RJT_CLSN_ERR , "Class N Svc Param Err"},
223 {FC_SWILS_RJT_INVFC_CODE , "Unknown Flow Ctrl Code"},
224 {FC_SWILS_RJT_INVFC_PARM , "Invalid Flow Ctrl Parm"},
225 {FC_SWILS_RJT_INV_PNAME , "Invalid Port Name"},
226 {FC_SWILS_RJT_INV_SNAME , "Invalid Switch Name"},
227 {FC_SWILS_RJT_TOV_MSMTCH , "R_A_/E_D_TOV Mismatch"},
228 {FC_SWILS_RJT_INV_DIDLST, "Invalid Domain ID List"},
229 {FC_SWILS_RJT_CMD_INPROG , "Cmd Already in Progress"},
230 {FC_SWILS_RJT_OORSRC , "Insufficient Resources"},
231 {FC_SWILS_RJT_NO_DID , "Domain ID Unavailable"},
232 {FC_SWILS_RJT_INV_DID, "Invalid Domain ID"},
233 {FC_SWILS_RJT_NO_REQ , "Request Not Supported"},
234 {FC_SWILS_RJT_NOLNK_PARM , "Link Parm Not Estd."},
235 {FC_SWILS_RJT_NO_REQDID , "Group of Domain IDs Unavail"},
236 {FC_SWILS_RJT_EP_ISOL , "E_Port Isolated"},
240 static const value_string fcswils_elp_fc_val[] = {
241 {FC_SWILS_ELP_FC_VENDOR, "Vendor Unique"},
242 {FC_SWILS_ELP_FC_RRDY, "R_RDY Flow Ctrl"},
246 static const value_string fcswils_rectype_val[] = {
247 {FC_SWILS_LRECTYPE_DOMAIN, "Domain ID List Rec"},
248 {FC_SWILS_LRECTYPE_MCAST, "Multicast ID List Rec"},
252 static const value_string fc_swils_link_type_val[] = {
254 {0xF0, "Vendor Specific"},
255 {0xF1, "Vendor Specific"},
256 {0xF2, "Vendor Specific"},
257 {0xF3, "Vendor Specific"},
258 {0xF4, "Vendor Specific"},
259 {0xF5, "Vendor Specific"},
260 {0xF6, "Vendor Specific"},
261 {0xF7, "Vendor Specific"},
262 {0xF8, "Vendor Specific"},
263 {0xF9, "Vendor Specific"},
264 {0xFA, "Vendor Specific"},
265 {0xFB, "Vendor Specific"},
266 {0xFC, "Vendor Specific"},
267 {0xFD, "Vendor Specific"},
268 {0xFE, "Vendor Specific"},
269 {0xFF, "Vendor Specific"},
273 static const value_string fc_swils_fspf_linkrec_val[] = {
274 {FC_SWILS_LSR_SLR, "Switch Link Record"},
275 {FC_SWILS_LSR_ARS, "AR Summary Record"},
279 static const value_string fc_swils_fspf_lsrflags_val[] = {
280 {0x0, "LSR is for a Topology Update"},
281 {0x1, "LSR is for Initial DB Sync | Not the last seq in DB sync"},
282 {0x2, "Last Seq in DB Sync. LSU has no LSRs"},
283 {0x3, "LSR is for Initial DB Sync | Last Seq in DB Sync"},
287 static const value_string fc_swils_rscn_portstate_val[] = {
288 {0, "No Additional Info"},
289 {1, "Port is online"},
290 {2, "Port is offline"},
294 static const value_string fc_swils_rscn_addrfmt_val[] = {
295 {0, "Port Addr Format"},
296 {1, "Area Addr Format"},
297 {2, "Domain Addr Format"},
298 {3, "Fabric Addr Format"},
301 static const value_string fc_swils_rscn_detectfn_val[] = {
302 {1, "Fabric Detected"},
303 {2, "N_Port Detected"},
307 static const value_string fc_swils_esc_protocol_val[] = {
309 {1, "FSPF-Backbone Protocol"},
310 {2, "FSPF Protocol"},
314 static const value_string fc_swils_zoneobj_type_val[] = {
316 {FC_SWILS_ZONEOBJ_ZONESET , "Zone Set"},
317 {FC_SWILS_ZONEOBJ_ZONE , "Zone"},
318 {FC_SWILS_ZONEOBJ_ZONEALIAS, "Zone Alias"},
322 const value_string fc_swils_zonembr_type_val[] = {
324 {FC_SWILS_ZONEMBR_WWN, "WWN"},
325 {FC_SWILS_ZONEMBR_DP, "Domain/Physical Port (0x00ddpppp)"},
326 {FC_SWILS_ZONEMBR_FCID, "FC Address"},
327 {FC_SWILS_ZONEMBR_ALIAS, "Zone Alias"},
328 {FC_SWILS_ZONEMBR_WWN_LUN, "WWN+LUN"},
329 {FC_SWILS_ZONEMBR_DP_LUN, "Domain/Physical Port+LUN"},
330 {FC_SWILS_ZONEMBR_FCID_LUN, "FCID+LUN"},
334 static const value_string fc_swils_mr_rsp_val[] = {
341 static const value_string fc_swils_mr_reason_val[] = {
343 {0x1, "Invalid Data Length"},
344 {0x2, "Unsupported Command"},
346 {0x4, "Not Authorized"},
347 {0x5, "Invalid Request"},
348 {0x6, "Fabric Changing"},
349 {0x7, "Update Not Staged"},
350 {0x8, "Invalid Zone Set Format"},
351 {0x9, "Invalid Data"},
352 {0xA, "Cannot Merge"},
356 static const value_string fc_swils_sfc_op_val[] = {
360 {3, "Activate Zone Set"},
361 {4, "Deactivate Zone Set"},
365 typedef struct _zonename {
372 typedef struct _fcswils_conv_key {
374 } fcswils_conv_key_t;
376 typedef struct _fcswils_conv_data {
378 } fcswils_conv_data_t;
380 GHashTable *fcswils_req_hash = NULL;
381 GMemChunk *fcswils_req_keys = NULL;
382 GMemChunk *fcswils_req_vals = NULL;
383 guint32 fcswils_init_count = 25;
385 static dissector_handle_t data_handle;
387 static gint get_zoneobj_len (tvbuff_t *tvb, gint offset);
393 fcswils_equal(gconstpointer v, gconstpointer w)
395 fcswils_conv_key_t *v1 = (fcswils_conv_key_t *)v;
396 fcswils_conv_key_t *v2 = (fcswils_conv_key_t *)w;
398 return (v1->conv_idx == v2->conv_idx);
402 fcswils_hash (gconstpointer v)
404 fcswils_conv_key_t *key = (fcswils_conv_key_t *)v;
413 * Protocol initialization
416 fcswils_init_protocol(void)
418 if (fcswils_req_keys)
419 g_mem_chunk_destroy (fcswils_req_keys);
420 if (fcswils_req_vals)
421 g_mem_chunk_destroy (fcswils_req_vals);
422 if (fcswils_req_hash)
423 g_hash_table_destroy (fcswils_req_hash);
425 fcswils_req_hash = g_hash_table_new(fcswils_hash, fcswils_equal);
426 fcswils_req_keys = g_mem_chunk_new("fcswils_req_keys",
427 sizeof(fcswils_conv_key_t),
428 fcswils_init_count * sizeof(fcswils_conv_key_t),
430 fcswils_req_vals = g_mem_chunk_new("fcswils_req_vals",
431 sizeof(fcswils_conv_data_t),
432 fcswils_init_count * sizeof(fcswils_conv_data_t),
437 zonenm_to_str (tvbuff_t *tvb, gint offset)
439 int len = tvb_get_guint8 (tvb, offset);
440 return ((gchar *)tvb_get_ptr (tvb, offset+4, len));
443 /* Offset points to the start of the zone object */
445 get_zoneobj_len (tvbuff_t *tvb, gint offset)
447 gint numrec, numrec1;
451 /* zone object structure is:
452 * type (1 byte), protocol (1 byte), rsvd (2 bytes), obj name (x bytes),
453 * num of zone mbrs (4 bytes ), list of zone members (each member if of
456 * zone member structure is:
457 * type (1 byte), rsvd (1 byte), flags (1 byte), id_len (1 byte),
460 objtype = tvb_get_guint8 (tvb, offset);
461 len = 4 + ZONENAME_LEN (tvb, offset+4); /* length upto num_of_mbrs field */
462 numrec = tvb_get_ntohl (tvb, offset+len); /* gets us num of zone mbrs */
464 len += 4; /* + num_mbrs */
465 for (i = 0; i < numrec; i++) {
466 if (objtype == FC_SWILS_ZONEOBJ_ZONESET) {
467 len += 4 + ZONENAME_LEN (tvb, offset+4+len); /* length upto num_of_mbrs field */
468 numrec1 = tvb_get_ntohl (tvb, offset+len);
471 for (j = 0; j < numrec1; j++) {
472 len += 4 + tvb_get_guint8 (tvb, offset+3+len);
475 else if (objtype == FC_SWILS_ZONEOBJ_ZONE) {
476 len += 4 + tvb_get_guint8 (tvb, offset+3+len);
484 dissect_swils_elp (tvbuff_t *tvb, proto_tree *elp_tree, guint8 isreq _U_)
487 /* Set up structures needed to add the protocol subtree and manage it */
493 /* Response i.e. SW_ACC for an ELP has the same format as the request */
494 /* We skip the initial 4 bytes as we don't care about the opcode */
495 tvb_memcpy (tvb, (guint8 *)&elp, 4, FC_SWILS_ELP_SIZE);
497 elp.r_a_tov = ntohl (elp.r_a_tov);
498 elp.e_d_tov = ntohl (elp.e_d_tov);
499 elp.isl_flwctrl_mode = ntohs (elp.isl_flwctrl_mode);
500 elp.flw_ctrl_parmlen = ntohs (elp.flw_ctrl_parmlen);
504 proto_tree_add_item (elp_tree, hf_swils_elp_rev, tvb, offset++, 1, 0);
505 proto_tree_add_item (elp_tree, hf_swils_elp_flags, tvb, offset, 2, 0);
507 proto_tree_add_uint_format (elp_tree, hf_swils_elp_r_a_tov, tvb, offset, 4,
508 elp.r_a_tov, "R_A_TOV: %d msecs", elp.r_a_tov);
510 proto_tree_add_uint_format (elp_tree, hf_swils_elp_e_d_tov, tvb, offset, 4,
511 elp.e_d_tov, "E_D_TOV: %d msecs", elp.e_d_tov);
513 proto_tree_add_string (elp_tree, hf_swils_elp_req_epn, tvb, offset, 8,
514 fcwwn_to_str (elp.req_epname));
516 proto_tree_add_string (elp_tree, hf_swils_elp_req_esn, tvb, offset, 8,
517 fcwwn_to_str (elp.req_sname));
521 if (elp.clsf_svcparm[0] & 0x80) {
522 strcpy (flags, "Class F Valid");
524 if (elp.clsf_svcparm[4] & 0x20) {
525 strcpy (&flags[13], " | X_ID Interlock");
528 strcpy (&flags[13], " | No X_ID Interlk");
532 strcpy (flags, "Class F Invld");
534 proto_tree_add_bytes_format (elp_tree, hf_swils_elp_clsf_svcp, tvb, offset, 6,
535 &elp.clsf_svcparm[0], "Class F Svc Parameters: (%s)", flags);
538 proto_tree_add_item (elp_tree, hf_swils_elp_clsf_rcvsz, tvb, offset, 2, 0);
540 proto_tree_add_item (elp_tree, hf_swils_elp_clsf_conseq, tvb, offset, 2, 0);
542 proto_tree_add_item (elp_tree, hf_swils_elp_clsf_e2e, tvb, offset, 2, 0);
544 proto_tree_add_item (elp_tree, hf_swils_elp_clsf_openseq, tvb, offset, 2, 0);
549 if (elp.cls1_svcparm[0] & 0x80) {
550 strcpy (&flags[stroff], "Class 1 Valid");
552 if (elp.cls1_svcparm[0] & 0x40) {
553 strcpy (&flags[stroff], " | IMX");
556 if (elp.cls1_svcparm[0] & 0x20) {
557 strcpy (&flags[stroff], " | XPS");
560 if (elp.cls1_svcparm[0] & 0x10) {
561 strcpy (&flags[stroff], " | LKS");
565 strcpy (&flags[0], "Class 1 Invalid");
568 proto_tree_add_bytes_format (elp_tree, hf_swils_elp_cls1_svcp, tvb, offset, 2,
569 tvb_get_ptr (tvb, offset, 2),
570 "Class 1 Svc Parameters: (%s)", flags);
572 if (elp.cls1_svcparm[0] & 0x80) {
573 proto_tree_add_item (elp_tree, hf_swils_elp_cls1_rcvsz, tvb, offset, 2, 0);
578 if (elp.cls2_svcparm[0] & 0x80) {
579 strcpy (flags, "Class 2 Valid");
581 if (elp.cls2_svcparm[0] & 0x08) {
582 strcpy (&flags[13], " | Seq Delivery");
585 strcpy (&flags[13], " | No Seq Delivery");
589 strcpy (flags, "Class 2 Invld");
592 proto_tree_add_bytes_format (elp_tree, hf_swils_elp_cls2_svcp, tvb, offset, 2,
593 &elp.cls2_svcparm[0],
594 "Class 2 Svc Parameters: (%s)", flags);
597 if (elp.cls2_svcparm[0] & 0x80) {
598 proto_tree_add_item (elp_tree, hf_swils_elp_cls2_rcvsz, tvb, offset, 2, 0);
603 if (elp.cls3_svcparm[0] & 0x80) {
604 strcpy (flags, "Class 3 Valid");
606 if (elp.cls3_svcparm[0] & 0x08) {
607 strcpy (&flags[13], " | Seq Delivery");
610 strcpy (&flags[13], " | No Seq Delivery");
614 strcpy (flags, "Class 3 Invld");
616 proto_tree_add_bytes_format (elp_tree, hf_swils_elp_cls3_svcp, tvb, offset, 2,
617 &elp.cls3_svcparm[0],
618 "Class 3 Svc Parameters: (%s)", flags);
621 if (elp.cls3_svcparm[0] & 0x80) {
622 proto_tree_add_item (elp_tree, hf_swils_elp_cls3_rcvsz, tvb, offset, 2, 0);
626 proto_tree_add_string (elp_tree, hf_swils_elp_isl_fc_mode, tvb, offset, 2,
627 val_to_str (elp.isl_flwctrl_mode, fcswils_elp_fc_val, "Vendor Unique"));
629 proto_tree_add_item (elp_tree, hf_swils_elp_fcplen, tvb, offset, 2, 0);
631 proto_tree_add_item (elp_tree, hf_swils_elp_b2bcredit, tvb, offset, 4, 0);
633 proto_tree_add_item (elp_tree, hf_swils_elp_compat1, tvb, offset, 4, 0);
635 proto_tree_add_item (elp_tree, hf_swils_elp_compat2, tvb, offset, 4, 0);
637 proto_tree_add_item (elp_tree, hf_swils_elp_compat3, tvb, offset, 4, 0);
639 proto_tree_add_item (elp_tree, hf_swils_elp_compat4, tvb, offset, 4, 0);
645 dissect_swils_efp (tvbuff_t *tvb, proto_tree *efp_tree, guint8 isreq _U_)
648 /* Set up structures needed to add the protocol subtree and manage it */
650 proto_tree *lrec_tree;
654 fcswils_efp_listrec *lrec;
656 tvb_memcpy (tvb, (guint8 *)&efp, offset, FC_SWILS_EFP_SIZE);
657 efp.payload_len = ntohs (efp.payload_len);
658 efp.listrec = (fcswils_efp_listrec *)tvb_get_ptr (tvb, FC_SWILS_EFP_SIZE,
659 efp.payload_len - FC_SWILS_EFP_SIZE);
663 proto_tree_add_item (efp_tree, hf_swils_efp_payload_len, tvb, offset, 2, 0);
665 proto_tree_add_item (efp_tree, hf_swils_efp_pswitch_pri, tvb,
667 proto_tree_add_string (efp_tree, hf_swils_efp_pswitch_name, tvb, offset,
668 8, fcwwn_to_str (efp.pswitch_name));
671 /* Add List Records now */
673 num_listrec = (efp.payload_len - FC_SWILS_EFP_SIZE)/efp.reclen;
679 while (num_listrec--) {
680 lrec = (fcswils_efp_listrec *)tvb_get_ptr (tvb, offset, efp.reclen);
682 if (lrec->didrec.rec_type == FC_SWILS_LRECTYPE_DOMAIN) {
683 subti = proto_tree_add_text (efp_tree, tvb, offset,
684 (efp.payload_len - FC_SWILS_EFP_SIZE),
686 lrec_tree = proto_item_add_subtree (subti, ett_fcswils_efplist);
687 proto_tree_add_item (lrec_tree, hf_swils_efp_dom_id, tvb, offset+1, 1, 0);
688 proto_tree_add_string (lrec_tree, hf_swils_efp_switch_name, tvb, offset+8, 8,
689 fcwwn_to_str (lrec->didrec.sname));
691 else if (lrec->didrec.rec_type == FC_SWILS_LRECTYPE_MCAST) {
692 subti = proto_tree_add_text (efp_tree, tvb, offset,
693 (efp.payload_len - FC_SWILS_EFP_SIZE),
694 "Multicast ID Record");
695 lrec_tree = proto_item_add_subtree (subti, ett_fcswils_efplist);
696 proto_tree_add_item (lrec_tree, hf_swils_efp_mcast_grpno, tvb, offset+1, 1, 0);
698 offset += efp.reclen;
705 dissect_swils_dia (tvbuff_t *tvb, proto_tree *dia_tree, guint8 isreq _U_)
707 /* Set up structures needed to add the protocol subtree and manage it */
711 proto_tree_add_string (dia_tree, hf_swils_dia_switch_name, tvb, offset+4,
712 8, fcwwn_to_str (tvb_get_ptr (tvb, offset+4, 8)));
717 dissect_swils_rdi (tvbuff_t *tvb, proto_tree *rdi_tree, guint8 isreq)
719 /* Set up structures needed to add the protocol subtree and manage it */
724 plen = tvb_get_ntohs (tvb, offset+2);
726 proto_tree_add_item (rdi_tree, hf_swils_rdi_payload_len, tvb, offset+2, 2, 0);
727 proto_tree_add_string (rdi_tree, hf_swils_rdi_req_sname, tvb, offset+4,
728 8, fcwwn_to_str (tvb_get_ptr (tvb, offset+4, 8)));
730 /* 12 is the length of the initial header and 4 is the size of each
731 * domain request record.
733 numrec = (plen - 12)/4;
735 for (i = 0; i < numrec; i++) {
737 proto_tree_add_text (rdi_tree, tvb, offset+3, 1,
738 "Requested Domain ID: %d",
739 tvb_get_guint8 (tvb, offset+3));
742 proto_tree_add_text (rdi_tree, tvb, offset+3, 1,
743 "Granted Domain ID: %d",
744 tvb_get_guint8 (tvb, offset+3));
752 dissect_swils_fspf_hdr (tvbuff_t *tvb, proto_tree *tree, int offset)
755 proto_tree *fspfh_tree;
758 /* 20 is the size of FSPF header */
759 subti = proto_tree_add_text (tree, tvb, offset, 20, "FSPF Header");
760 fspfh_tree = proto_item_add_subtree (subti, ett_fcswils_fspfhdr);
762 proto_tree_add_item (fspfh_tree, hf_swils_fspfh_rev, tvb, offset+4,
764 proto_tree_add_item (fspfh_tree, hf_swils_fspfh_ar_num, tvb,
766 proto_tree_add_item (fspfh_tree, hf_swils_fspfh_auth_type, tvb,
768 proto_tree_add_item (fspfh_tree, hf_swils_fspfh_dom_id, tvb, offset+11,
770 proto_tree_add_item (fspfh_tree, hf_swils_fspfh_auth, tvb, offset+12,
776 dissect_swils_fspf_lsrechdr (tvbuff_t *tvb, proto_tree *tree, int offset)
778 proto_tree_add_item (tree, hf_swils_lsrh_lsr_type, tvb, offset, 1, 0);
779 proto_tree_add_text (tree, tvb, offset+2, 2, "LSR Age: %d secs",
780 tvb_get_ntohs (tvb, offset+2));
781 proto_tree_add_text (tree, tvb, offset+4, 4, "Options : 0x%x",
782 tvb_get_ntohl (tvb, offset+4));
783 proto_tree_add_item (tree, hf_swils_lsrh_lsid, tvb, offset+11, 1, 0);
784 proto_tree_add_item (tree, hf_swils_lsrh_adv_domid, tvb, offset+15, 1, 0);
785 proto_tree_add_item (tree, hf_swils_lsrh_ls_incid, tvb, offset+16, 4, 0);
786 proto_tree_add_text (tree, tvb, offset+20, 2, "Checksum: 0x%x",
787 tvb_get_ntohs (tvb, offset+20));
788 proto_tree_add_text (tree, tvb, offset+22, 2, "LSR Length: %d",
789 tvb_get_ntohs (tvb, offset+22));
793 dissect_swils_fspf_ldrec (tvbuff_t *tvb, proto_tree *tree, int offset)
795 proto_tree_add_string (tree, hf_swils_ldrec_linkid, tvb, offset, 4,
796 fc_to_str (tvb_get_ptr (tvb, offset+1, 3)));
797 proto_tree_add_item (tree, hf_swils_ldrec_out_pidx, tvb, offset+5, 3, 0);
798 proto_tree_add_item (tree, hf_swils_ldrec_nbr_pidx, tvb, offset+9, 3, 0);
799 proto_tree_add_item (tree, hf_swils_ldrec_link_type, tvb, offset+12, 1, 0);
800 proto_tree_add_item (tree, hf_swils_ldrec_link_cost, tvb, offset+14, 2, 0);
804 dissect_swils_fspf_lsrec (tvbuff_t *tvb, proto_tree *tree, int offset,
808 proto_item *subti1, *subti;
809 proto_tree *lsrec_tree, *ldrec_tree, *lsrechdr_tree;
812 for (j = 0; j < num_lsrec; j++) {
813 num_ldrec = tvb_get_ntohs (tvb, offset+26);
814 subti = proto_tree_add_text (tree, tvb, offset, (28+num_ldrec*16),
815 "Link State Record %d (Domain %d)", j,
816 tvb_get_guint8 (tvb, offset+15));
817 lsrec_tree = proto_item_add_subtree (subti, ett_fcswils_lsrec);
819 subti = proto_tree_add_text (lsrec_tree, tvb, offset, 24,
820 "Link State Record Header");
821 lsrechdr_tree = proto_item_add_subtree (subti,
822 ett_fcswils_lsrechdr);
824 dissect_swils_fspf_lsrechdr (tvb, lsrechdr_tree, offset);
825 proto_tree_add_text (tree, tvb, offset+26, 2, "Number of Links: %d",
829 for (i = 0; i < num_ldrec; i++) {
830 subti1 = proto_tree_add_text (lsrec_tree, tvb, offset, 16,
831 "Link Descriptor %d "
832 "(Neighbor domain %d)", i,
833 tvb_get_guint8 (tvb, offset+3));
834 ldrec_tree = proto_item_add_subtree (subti1, ett_fcswils_ldrec);
835 dissect_swils_fspf_ldrec (tvb, ldrec_tree, offset);
843 dissect_swils_hello (tvbuff_t *tvb, proto_tree *hlo_tree, guint8 isreq _U_)
845 /* Set up structures needed to add the protocol subtree and manage it */
849 dissect_swils_fspf_hdr (tvb, hlo_tree, offset);
851 proto_tree_add_item (hlo_tree, hf_swils_hlo_options, tvb, offset+20, 4, 0);
852 proto_tree_add_item (hlo_tree, hf_swils_hlo_hloint, tvb, offset+24, 4, 0);
853 proto_tree_add_item (hlo_tree, hf_swils_hlo_deadint, tvb, offset+28, 4, 0);
854 proto_tree_add_item (hlo_tree, hf_swils_hlo_rcv_domid, tvb, offset+35, 1, 0);
855 proto_tree_add_item (hlo_tree, hf_swils_hlo_orig_pidx, tvb, offset+37, 3, 0);
860 dissect_swils_lsupdate (tvbuff_t *tvb, proto_tree *lsu_tree, guint8 isreq _U_)
862 /* Set up structures needed to add the protocol subtree and manage it */
867 dissect_swils_fspf_hdr (tvb, lsu_tree, offset);
869 proto_tree_add_text (lsu_tree, tvb, offset+23, 1, "Flags : %s",
870 val_to_str (tvb_get_guint8 (tvb, offset+23),
871 fc_swils_fspf_lsrflags_val, "0x%x"));
872 num_lsrec = tvb_get_ntohl (tvb, offset+24);
874 proto_tree_add_text (lsu_tree, tvb, offset+24, 4, "Num of LSRs: %d",
878 dissect_swils_fspf_lsrec (tvb, lsu_tree, offset, num_lsrec);
883 dissect_swils_lsack (tvbuff_t *tvb, proto_tree *lsa_tree, guint8 isreq _U_)
885 /* Set up structures needed to add the protocol subtree and manage it */
889 proto_tree *lsrechdr_tree;
892 dissect_swils_fspf_hdr (tvb, lsa_tree, offset);
894 proto_tree_add_text (lsa_tree, tvb, offset+23, 1, "Flags : %s",
895 val_to_str (tvb_get_guint8 (tvb, offset+23),
896 fc_swils_fspf_lsrflags_val, "0x%x"));
897 num_lsrechdr = tvb_get_ntohl (tvb, offset+24);
899 proto_tree_add_text (lsa_tree, tvb, offset+24, 4, "Num of LSR Headers: %d",
904 for (i = 0; i < num_lsrechdr; i++) {
905 subti = proto_tree_add_text (lsa_tree, tvb, offset, 24,
906 "Link State Record Header (Domain %d)",
907 tvb_get_guint8 (tvb, offset+15));
908 lsrechdr_tree = proto_item_add_subtree (subti,
909 ett_fcswils_lsrechdr);
910 dissect_swils_fspf_lsrechdr (tvb, lsrechdr_tree, offset);
917 dissect_swils_rscn (tvbuff_t *tvb, proto_tree *rscn_tree, guint8 isreq)
919 /* Set up structures needed to add the protocol subtree and manage it */
921 proto_tree *dev_tree;
930 evtype = tvb_get_guint8 (tvb, offset+4);
931 addrfmt = evtype & 0x0F;
932 evtype = evtype >> 4;
934 proto_tree_add_item (rscn_tree, hf_swils_rscn_evtype, tvb, offset+4,
936 proto_tree_add_item (rscn_tree, hf_swils_rscn_addrfmt, tvb, offset+4,
938 proto_tree_add_string (rscn_tree, hf_swils_rscn_affectedport, tvb,
939 offset+5, 3, fc_to_str (tvb_get_ptr (tvb,
941 proto_tree_add_item (rscn_tree, hf_swils_rscn_detectfn, tvb,
943 numrec = tvb_get_ntohl (tvb, offset+12);
945 if (!tvb_bytes_exist (tvb, offset+16, FC_SWILS_RSCN_DEVENTRY_SIZE*numrec)) {
946 /* Some older devices do not include device entry information. */
950 proto_tree_add_text (rscn_tree, tvb, offset+12, 4, "Num Entries: %d",
954 for (i = 0; i < numrec; i++) {
955 subti = proto_tree_add_text (rscn_tree, tvb, offset, 20,
956 "Device Entry %d", i);
957 dev_tree = proto_item_add_subtree (rscn_tree, ett_fcswils_rscn_dev);
959 proto_tree_add_item (dev_tree, hf_swils_rscn_portstate, tvb, offset, 1, 0);
960 proto_tree_add_string (dev_tree, hf_swils_rscn_portid, tvb, offset+1, 3,
961 fc_to_str (tvb_get_ptr (tvb, offset+1, 3)));
962 proto_tree_add_string (dev_tree, hf_swils_rscn_pwwn, tvb, offset+4, 8,
963 fcwwn_to_str (tvb_get_ptr (tvb, offset+4, 8)));
964 proto_tree_add_string (dev_tree, hf_swils_rscn_nwwn, tvb, offset+4, 8,
965 fcwwn_to_str (tvb_get_ptr (tvb, offset+4, 8)));
972 * Merge Request contains zoning objects organized in the following format:
976 * +---------------- Zone Object
978 * +-- +---------------- Zone Member
982 * So the decoding of the zone merge request is based on this structure
986 dissect_swils_zone_mbr (tvbuff_t *tvb, proto_tree *zmbr_tree, int offset)
988 int mbrlen = 4 + tvb_get_guint8 (tvb, offset+3);
990 proto_tree_add_item (zmbr_tree, hf_swils_zone_mbrtype, tvb,
992 proto_tree_add_text (zmbr_tree, tvb, offset+2, 1, "Flags: 0x%x",
993 tvb_get_guint8 (tvb, offset+2));
994 proto_tree_add_text (zmbr_tree, tvb, offset+3, 1,
995 "Identifier Length: %d",
996 tvb_get_guint8 (tvb, offset+3));
997 switch (tvb_get_guint8 (tvb, offset)) {
998 case FC_SWILS_ZONEMBR_WWN:
999 proto_tree_add_string (zmbr_tree, hf_swils_zone_mbrid, tvb,
1001 fcwwn_to_str (tvb_get_ptr (tvb,
1005 case FC_SWILS_ZONEMBR_DP:
1006 proto_tree_add_string_format (zmbr_tree,
1007 hf_swils_zone_mbrid,
1008 tvb, offset+4, 4, " ",
1013 case FC_SWILS_ZONEMBR_FCID:
1014 proto_tree_add_string (zmbr_tree, hf_swils_zone_mbrid, tvb,
1016 fc_to_str (tvb_get_ptr (tvb,
1020 case FC_SWILS_ZONEMBR_ALIAS:
1021 proto_tree_add_string (zmbr_tree, hf_swils_zone_mbrid, tvb,
1023 tvb_get_guint8 (tvb, offset+3),
1024 zonenm_to_str (tvb, offset+4));
1026 case FC_SWILS_ZONEMBR_WWN_LUN:
1027 proto_tree_add_string (zmbr_tree, hf_swils_zone_mbrid, tvb,
1029 fcwwn_to_str (tvb_get_ptr (tvb,
1032 proto_tree_add_item (zmbr_tree, hf_swils_zone_mbrid_lun, tvb,
1035 case FC_SWILS_ZONEMBR_DP_LUN:
1036 proto_tree_add_string_format (zmbr_tree,
1037 hf_swils_zone_mbrid,
1038 tvb, offset+4, 4, " ",
1042 proto_tree_add_item (zmbr_tree, hf_swils_zone_mbrid_lun, tvb,
1045 case FC_SWILS_ZONEMBR_FCID_LUN:
1046 proto_tree_add_string (zmbr_tree, hf_swils_zone_mbrid, tvb,
1048 fc_to_str (tvb_get_ptr (tvb,
1051 proto_tree_add_item (zmbr_tree, hf_swils_zone_mbrid_lun, tvb,
1055 proto_tree_add_string (zmbr_tree, hf_swils_zone_mbrid, tvb,
1057 "Unknown member type format");
1063 dissect_swils_zone_obj (tvbuff_t *tvb, proto_tree *zobj_tree, int offset)
1065 proto_tree *zmbr_tree;
1066 int mbrlen, numrec, i, objtype;
1069 objtype = tvb_get_guint8 (tvb, offset);
1071 proto_tree_add_item (zobj_tree, hf_swils_zone_objtype, tvb, offset,
1073 proto_tree_add_item (zobj_tree, hf_swils_zone_protocol, tvb,
1075 proto_tree_add_string (zobj_tree, hf_swils_zone_objname, tvb,
1076 offset+4, ZONENAME_LEN (tvb, offset+4),
1077 zonenm_to_str (tvb, offset+4));
1079 numrec = tvb_get_ntohl (tvb, offset+4+ZONENAME_LEN (tvb, offset+4));
1080 proto_tree_add_text (zobj_tree, tvb,
1081 offset+4+ZONENAME_LEN (tvb, offset+4), 4,
1082 "Number of Zone Members: %d", numrec);
1084 offset += 8 + ZONENAME_LEN (tvb, offset+4);
1085 for (i = 0; i < numrec; i++) {
1086 if (objtype == FC_SWILS_ZONEOBJ_ZONESET) {
1087 dissect_swils_zone_obj (tvb, zobj_tree, offset);
1088 offset += get_zoneobj_len (tvb, offset);
1091 mbrlen = 4 + tvb_get_guint8 (tvb, offset+3);
1092 subti = proto_tree_add_text (zobj_tree, tvb, offset, mbrlen,
1093 "Zone Member %d", i);
1094 zmbr_tree = proto_item_add_subtree (zobj_tree,
1095 ett_fcswils_zonembr);
1096 dissect_swils_zone_mbr (tvb, zmbr_tree, offset);
1103 dissect_swils_mergereq (tvbuff_t *tvb, proto_tree *mr_tree, guint8 isreq)
1105 /* Set up structures needed to add the protocol subtree and manage it */
1107 proto_tree *zobjlist_tree, *zobj_tree;
1108 int numrec, i, zonesetlen, objlistlen, objlen;
1113 /* zonesetlen is the size of the zoneset including the zone name */
1114 zonesetlen = tvb_get_ntohs (tvb, offset+2);
1115 proto_tree_add_text (mr_tree, tvb, offset+2, 2,
1116 "Active ZoneSet Length: %d", zonesetlen);
1119 proto_tree_add_string (mr_tree, hf_swils_zone_activezonenm, tvb,
1120 offset+4, ZONENAME_LEN (tvb, offset+4),
1121 zonenm_to_str (tvb, offset+4));
1123 /* objlistlen gives the size of the active zoneset object list */
1124 objlistlen = zonesetlen - ZONENAME_LEN (tvb, offset+4);
1125 /* Offset = start of the active zoneset zoning object list */
1126 offset = offset + (4 + ZONENAME_LEN (tvb, offset+4));
1127 numrec = tvb_get_ntohl (tvb, offset);
1129 subti = proto_tree_add_text (mr_tree, tvb, offset, objlistlen,
1131 zobjlist_tree = proto_item_add_subtree (subti,
1132 ett_fcswils_zoneobjlist);
1134 proto_tree_add_text (zobjlist_tree, tvb, offset, 4,
1135 "Number of zoning objects: %d", numrec);
1138 for (i = 0; i < numrec; i++) {
1139 objlen = get_zoneobj_len (tvb, offset);
1140 subti = proto_tree_add_text (zobjlist_tree, tvb, offset+4,
1141 objlen, "Zone Object %d", i);
1142 zobj_tree = proto_item_add_subtree (subti, ett_fcswils_zoneobj);
1143 dissect_swils_zone_obj (tvb, zobj_tree, offset);
1151 zonesetlen = tvb_get_ntohl (tvb, offset);
1152 proto_tree_add_text (mr_tree, tvb, offset, 4,
1153 "Full Zone Set Length: %d", zonesetlen);
1156 objlistlen = zonesetlen;
1157 /* Offset = start of the active zoneset zoning object list */
1159 numrec = tvb_get_ntohl (tvb, offset);
1161 subti = proto_tree_add_text (mr_tree, tvb, offset, objlistlen,
1164 zobjlist_tree = proto_item_add_subtree (subti,
1165 ett_fcswils_zoneobjlist);
1166 proto_tree_add_text (zobjlist_tree, tvb, offset, 4,
1167 "Number of zoning objects: %d", numrec);
1169 for (i = 0; i < numrec; i++) {
1170 objlen = get_zoneobj_len (tvb, offset);
1171 subti = proto_tree_add_text (zobjlist_tree, tvb, offset,
1172 objlen, "Zone Object %d", i);
1173 zobj_tree = proto_item_add_subtree (subti, ett_fcswils_zoneobj);
1174 dissect_swils_zone_obj (tvb, zobj_tree, offset);
1180 proto_tree_add_item (mr_tree, hf_swils_zone_status, tvb,
1182 proto_tree_add_item (mr_tree, hf_swils_zone_reason, tvb,
1184 proto_tree_add_text (mr_tree, tvb, offset+7, 1,
1185 "Vendor Unique: 0x%x",
1186 tvb_get_guint8 (tvb, offset+7));
1192 dissect_swils_aca (tvbuff_t *tvb, proto_tree *aca_tree, guint8 isreq)
1194 /* Set up structures needed to add the protocol subtree and manage it */
1196 int numrec, plen, i;
1200 plen = tvb_get_ntohs (tvb, offset+2);
1201 proto_tree_add_text (aca_tree, tvb, offset+2, 2,
1202 "Domain ID List Length: %d", plen);
1206 for (i = 0; i < numrec; i++) {
1207 proto_tree_add_uint_format (aca_tree, hf_swils_aca_domainid,
1209 tvb_get_guint8 (tvb, offset+3),
1210 "Domain ID %d: %d", i,
1211 tvb_get_guint8 (tvb, offset+3));
1216 proto_tree_add_item (aca_tree, hf_swils_zone_status, tvb,
1218 proto_tree_add_item (aca_tree, hf_swils_zone_reason, tvb,
1220 proto_tree_add_text (aca_tree, tvb, offset+7, 1,
1221 "Vendor Unique: 0x%x",
1222 tvb_get_guint8 (tvb, offset+7));
1228 dissect_swils_rca (tvbuff_t *tvb, proto_tree *rca_tree, guint8 isreq)
1230 /* Set up structures needed to add the protocol subtree and manage it */
1235 proto_tree_add_item (rca_tree, hf_swils_zone_status, tvb,
1237 proto_tree_add_item (rca_tree, hf_swils_zone_reason, tvb,
1239 proto_tree_add_text (rca_tree, tvb, offset+7, 1,
1240 "Vendor Unique: 0x%x",
1241 tvb_get_guint8 (tvb, offset+7));
1247 dissect_swils_sfc (tvbuff_t *tvb, proto_tree *sfc_tree, guint8 isreq)
1249 /* Set up structures needed to add the protocol subtree and manage it */
1251 proto_tree *zobjlist_tree, *zobj_tree;
1252 int numrec, i, zonesetlen, objlistlen, objlen;
1257 proto_tree_add_item (sfc_tree, hf_swils_sfc_opcode, tvb, offset+1, 1, 0);
1259 zonesetlen = tvb_get_ntohs (tvb, offset+2);
1260 proto_tree_add_text (sfc_tree, tvb, offset+2, 2,
1261 "ZoneSet Length: %d", zonesetlen);
1264 proto_tree_add_string (sfc_tree, hf_swils_sfc_zonenm, tvb,
1265 offset+4, ZONENAME_LEN (tvb, offset+4),
1266 zonenm_to_str (tvb, offset+4));
1268 /* objlistlen gives the size of the active zoneset object list */
1269 objlistlen = zonesetlen - ZONENAME_LEN (tvb, offset+4);
1270 /* Offset = start of the active zoneset zoning object list */
1271 offset = offset + (4 + ZONENAME_LEN (tvb, offset+4));
1272 numrec = tvb_get_ntohl (tvb, offset);
1274 subti = proto_tree_add_text (sfc_tree, tvb, offset, objlistlen,
1276 zobjlist_tree = proto_item_add_subtree (subti,
1277 ett_fcswils_zoneobjlist);
1279 proto_tree_add_text (zobjlist_tree, tvb, offset, 4,
1280 "Number of zoning objects: %d", numrec);
1283 for (i = 0; i < numrec; i++) {
1284 objlen = get_zoneobj_len (tvb, offset);
1285 subti = proto_tree_add_text (zobjlist_tree, tvb, offset,
1286 objlen, "Zone Object %d", i);
1287 zobj_tree = proto_item_add_subtree (subti, ett_fcswils_zoneobj);
1288 dissect_swils_zone_obj (tvb, zobj_tree, offset);
1296 zonesetlen = tvb_get_ntohl (tvb, offset);
1297 proto_tree_add_text (sfc_tree, tvb, offset, 4,
1298 "Full Zone Set Length: %d", zonesetlen);
1301 objlistlen = zonesetlen;
1302 /* Offset = start of the active zoneset zoning object list */
1304 numrec = tvb_get_ntohl (tvb, offset);
1306 subti = proto_tree_add_text (sfc_tree, tvb, offset, objlistlen,
1309 zobjlist_tree = proto_item_add_subtree (subti,
1310 ett_fcswils_zoneobjlist);
1311 proto_tree_add_text (zobjlist_tree, tvb, offset, 4,
1312 "Number of zoning objects: %d", numrec);
1314 for (i = 0; i < numrec; i++) {
1315 objlen = get_zoneobj_len (tvb, offset);
1316 subti = proto_tree_add_text (zobjlist_tree, tvb, offset,
1317 objlen, "Zone Object %d", i);
1318 zobj_tree = proto_item_add_subtree (subti, ett_fcswils_zoneobj);
1319 dissect_swils_zone_obj (tvb, zobj_tree, offset);
1325 proto_tree_add_item (sfc_tree, hf_swils_zone_status, tvb,
1327 proto_tree_add_item (sfc_tree, hf_swils_zone_reason, tvb,
1329 proto_tree_add_text (sfc_tree, tvb, offset+7, 1,
1330 "Vendor Unique: 0x%x",
1331 tvb_get_guint8 (tvb, offset+7));
1337 dissect_swils_ufc (tvbuff_t *tvb, proto_tree *ufc_tree, guint8 isreq)
1339 /* Set up structures needed to add the protocol subtree and manage it */
1344 proto_tree_add_item (ufc_tree, hf_swils_zone_status, tvb,
1346 proto_tree_add_item (ufc_tree, hf_swils_zone_reason, tvb,
1348 proto_tree_add_text (ufc_tree, tvb, offset+7, 1,
1349 "Vendor Unique: 0x%x",
1350 tvb_get_guint8 (tvb, offset+7));
1356 dissect_swils_esc (tvbuff_t *tvb, proto_tree *esc_tree, guint8 isreq)
1358 /* Set up structures needed to add the protocol subtree and manage it */
1360 int i, numrec, plen;
1361 proto_tree *pdesc_tree;
1366 plen = tvb_get_ntohs (tvb, offset+2);
1367 proto_tree_add_text (esc_tree, tvb, offset+2, 2,
1368 "Payload Length: %d", plen);
1369 proto_tree_add_item (esc_tree, hf_swils_esc_swvendorid, tvb,
1371 numrec = (plen - 12)/12;
1374 for (i = 0; i < numrec; i++) {
1375 subti = proto_tree_add_text (esc_tree, tvb, offset, 12,
1376 "Protocol Descriptor %d", i);
1377 pdesc_tree = proto_item_add_subtree (subti,
1378 ett_fcswils_esc_pdesc);
1379 proto_tree_add_item (pdesc_tree, hf_swils_esc_pdesc_vendorid, tvb,
1381 proto_tree_add_item (pdesc_tree, hf_swils_esc_protocolid,
1382 tvb, offset+10, 2, 0);
1387 proto_tree_add_item (esc_tree, hf_swils_esc_swvendorid, tvb,
1389 subti = proto_tree_add_text (esc_tree, tvb, offset+12, 12,
1390 "Accepted Protocol Descriptor");
1391 pdesc_tree = proto_item_add_subtree (subti, ett_fcswils_esc_pdesc);
1393 proto_tree_add_item (pdesc_tree, hf_swils_esc_pdesc_vendorid, tvb,
1395 proto_tree_add_item (pdesc_tree, hf_swils_esc_protocolid,
1396 tvb, offset+22, 2, 0);
1402 dissect_swils_drlir (tvbuff_t *tvb _U_, proto_tree *drlir_tree _U_,
1405 /* Set up structures needed to add the protocol subtree and manage it */
1410 dissect_swils_swrjt (tvbuff_t *tvb, proto_tree *swrjt_tree)
1412 /* Set up structures needed to add the protocol subtree and manage it */
1416 proto_tree_add_item (swrjt_tree, hf_swils_rjt, tvb, offset+5, 1, 0);
1417 proto_tree_add_item (swrjt_tree, hf_swils_rjtdet, tvb, offset+6, 1, 0);
1418 proto_tree_add_item (swrjt_tree, hf_swils_rjtvendor, tvb, offset+7,
1423 /* Code to actually dissect the packets */
1425 dissect_fcswils (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1427 proto_item *ti = NULL;
1431 conversation_t *conversation;
1432 fcswils_conv_data_t *cdata;
1433 fcswils_conv_key_t ckey, *req_key;
1434 proto_tree *swils_tree = NULL;
1435 guint8 isreq = FC_SWILS_REQ;
1438 /* Make entries in Protocol column and Info column on summary display */
1439 if (check_col(pinfo->cinfo, COL_PROTOCOL))
1440 col_set_str(pinfo->cinfo, COL_PROTOCOL, "SW_ILS");
1442 /* decoding of this is done by each individual opcode handler */
1443 opcode = tvb_get_guint8 (tvb, 0);
1446 ti = proto_tree_add_protocol_format (tree, proto_fcswils, tvb, 0,
1447 tvb_length (tvb), "SW_ILS");
1448 swils_tree = proto_item_add_subtree (ti, ett_fcswils);
1451 /* Register conversation if this is not a response */
1452 if ((opcode != FC_SWILS_SWACC) && (opcode != FC_SWILS_SWRJT)) {
1453 conversation = find_conversation (&pinfo->src, &pinfo->dst,
1454 pinfo->ptype, pinfo->oxid,
1455 pinfo->rxid, NO_PORT2);
1456 if (!conversation) {
1457 conversation = conversation_new (&pinfo->src, &pinfo->dst,
1458 pinfo->ptype, pinfo->oxid,
1459 pinfo->rxid, NO_PORT2);
1462 ckey.conv_idx = conversation->index;
1464 cdata = (fcswils_conv_data_t *)g_hash_table_lookup (fcswils_req_hash,
1467 /* Since we never free the memory used by an exchange, this maybe a
1468 * case of another request using the same exchange as a previous
1471 cdata->opcode = opcode;
1474 req_key = g_mem_chunk_alloc (fcswils_req_keys);
1475 req_key->conv_idx = conversation->index;
1477 cdata = g_mem_chunk_alloc (fcswils_req_vals);
1478 cdata->opcode = opcode;
1480 g_hash_table_insert (fcswils_req_hash, req_key, cdata);
1484 /* Opcode is ACC or RJT */
1485 conversation = find_conversation (&pinfo->src, &pinfo->dst,
1486 pinfo->ptype, pinfo->oxid,
1487 pinfo->rxid, NO_PORT2);
1488 isreq = FC_SWILS_RPLY;
1489 if (!conversation) {
1490 if (tree && (opcode == FC_SWILS_SWACC)) {
1491 /* No record of what this accept is for. Can't decode */
1492 proto_tree_add_text (swils_tree, tvb, 0, tvb_length (tvb),
1493 "No record of Exchg. Unable to decode SW_ACC");
1498 ckey.conv_idx = conversation->index;
1500 cdata = (fcswils_conv_data_t *)g_hash_table_lookup (fcswils_req_hash, &ckey);
1502 if (cdata != NULL) {
1503 if (opcode == FC_SWILS_SWACC)
1504 opcode = cdata->opcode;
1506 failed_opcode = cdata->opcode;
1510 if ((cdata == NULL) && (opcode != FC_SWILS_SWRJT)) {
1511 /* No record of what this accept is for. Can't decode */
1512 proto_tree_add_text (swils_tree, tvb, 0, tvb_length (tvb),
1513 "No record of SW_ILS Req. Unable to decode SW_ACC");
1520 if (check_col (pinfo->cinfo, COL_INFO)) {
1521 if (isreq == FC_SWILS_REQ) {
1522 col_add_str (pinfo->cinfo, COL_INFO,
1523 val_to_str (opcode, fc_swils_opcode_key_val, "0x%x"));
1525 else if (opcode == FC_SWILS_SWRJT) {
1526 col_add_fstr (pinfo->cinfo, COL_INFO, "SW_RJT (%s)",
1527 val_to_str (failed_opcode, fc_swils_opcode_key_val, "0x%x"));
1530 col_add_fstr (pinfo->cinfo, COL_INFO, "SW_ACC (%s)",
1531 val_to_str (opcode, fc_swils_opcode_key_val, "0x%x"));
1536 proto_tree_add_item (swils_tree, hf_swils_opcode, tvb, offset, 1, 0);
1540 case FC_SWILS_SWRJT:
1541 dissect_swils_swrjt (tvb, swils_tree);
1544 dissect_swils_elp (tvb, swils_tree, isreq);
1547 dissect_swils_efp (tvb, swils_tree, isreq);
1550 dissect_swils_dia (tvb, swils_tree, isreq);
1553 dissect_swils_rdi (tvb, swils_tree, isreq);
1556 dissect_swils_hello (tvb, swils_tree, isreq);
1559 dissect_swils_lsupdate (tvb, swils_tree, isreq);
1562 dissect_swils_lsack (tvb, swils_tree, isreq);
1566 /* Nothing to be displayed for these two commands */
1569 dissect_swils_rscn (tvb, swils_tree, isreq);
1571 case FC_SWILS_DRLIR:
1572 dissect_swils_drlir (tvb, swils_tree, isreq);
1575 dissect_swils_mergereq (tvb, swils_tree, isreq);
1578 dissect_swils_aca (tvb, swils_tree, isreq);
1581 dissect_swils_rca (tvb, swils_tree, isreq);
1584 dissect_swils_sfc (tvb, swils_tree, isreq);
1587 dissect_swils_ufc (tvb, swils_tree, isreq);
1590 dissect_swils_esc (tvb, swils_tree, isreq);
1593 next_tvb = tvb_new_subset (tvb, offset+4, -1, -1);
1594 call_dissector (data_handle, next_tvb, pinfo, tree);
1599 /* Register the protocol with Ethereal */
1601 /* this format is require because a script is used to build the C function
1602 that calls all the protocol registration.
1606 proto_register_fcswils (void)
1608 /* Setup list of header fields See Section 1.6.1 for details*/
1609 static hf_register_info hf[] = {
1611 {"Cmd Code", "swils.opcode", FT_UINT8, BASE_HEX,
1612 VALS (fc_swils_opcode_key_val), 0x0, "", HFILL}},
1613 { &hf_swils_elp_rev,
1614 {"Revision", "swils.elp.rev", FT_UINT8, BASE_DEC, NULL,
1616 { &hf_swils_elp_flags,
1617 {"Flag", "swils.elp.flag", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}},
1618 { &hf_swils_elp_r_a_tov,
1619 {"R_A_TOV", "swils.elp.ratov", FT_UINT32, BASE_DEC, NULL,
1621 { &hf_swils_elp_e_d_tov,
1622 {"E_D_TOV", "swils.elp.edtov", FT_UINT32, BASE_DEC, NULL, 0x0, "",
1624 { &hf_swils_elp_req_epn,
1625 {"Req Eport Name", "swils.elp.reqepn", FT_STRING, BASE_HEX, NULL, 0x0,
1627 { &hf_swils_elp_req_esn,
1628 {"Req Switch Name", "swils.elp.reqesn", FT_STRING, BASE_HEX, NULL, 0x0,
1630 { &hf_swils_elp_clsf_svcp,
1631 {"Class F Svc Param", "swils.elp.clsfp", FT_BYTES, BASE_NONE, NULL, 0x0,
1633 { &hf_swils_elp_clsf_rcvsz,
1634 {"Max Class F Frame Size", "swils.elp.clsfrsz", FT_UINT16, BASE_DEC,
1635 NULL, 0x0, "", HFILL}},
1636 { &hf_swils_elp_clsf_conseq,
1637 {"Class F Max Concurrent Seq", "swils.elp.clsfcs", FT_UINT16, BASE_DEC,
1638 NULL, 0x0, "", HFILL}},
1639 { &hf_swils_elp_clsf_e2e,
1640 {"Class F E2E Credit", "swils.elp.cfe2e", FT_UINT16, BASE_DEC, NULL,
1642 { &hf_swils_elp_clsf_openseq,
1643 {"Class F Max Open Seq", "swils.elp.oseq", FT_UINT16, BASE_DEC, NULL,
1645 { &hf_swils_elp_cls1_svcp,
1646 {"Class 1 Svc Param", "swils.elp.cls1p", FT_BYTES, BASE_NONE, NULL, 0x0,
1648 { &hf_swils_elp_cls1_rcvsz,
1649 {"Class 1 Frame Size", "swils.elp.cls1rsz", FT_UINT16, BASE_DEC, NULL,
1651 { &hf_swils_elp_cls2_svcp,
1652 {"Class 2 Svc Param", "swils.elp.cls2p", FT_BYTES, BASE_HEX, NULL, 0x0,
1654 { &hf_swils_elp_cls2_rcvsz,
1655 {"Class 2 Frame Size", "swils.elp.cls1rsz", FT_UINT16, BASE_DEC, NULL,
1657 { &hf_swils_elp_cls3_svcp,
1658 {"Class 3 Svc Param", "swils.elp.cls3p", FT_BYTES, BASE_HEX, NULL, 0x0,
1660 { &hf_swils_elp_cls3_rcvsz,
1661 {"Class 3 Frame Size", "swils.elp.cls1rsz", FT_UINT16, BASE_DEC, NULL,
1663 { &hf_swils_elp_isl_fc_mode,
1664 {"ISL Flow Ctrl Mode", "swils.elp.fcmode", FT_STRING, BASE_HEX, NULL,
1666 { &hf_swils_elp_fcplen,
1667 {"Flow Ctrl Param Len", "swils.elp.fcplen", FT_UINT16, BASE_DEC, NULL,
1669 { &hf_swils_elp_b2bcredit,
1670 {"B2B Credit", "swils.elp.b2b", FT_UINT32, BASE_DEC, NULL, 0x0, "",
1672 { &hf_swils_elp_compat1,
1673 {"Compatability Param 1", "swils.elp.compat1", FT_UINT32, BASE_DEC, NULL,
1675 { &hf_swils_elp_compat2,
1676 {"Compatability Param 2", "swils.elp.compat2", FT_UINT32, BASE_DEC, NULL,
1678 { &hf_swils_elp_compat3,
1679 {"Compatability Param 3", "swils.elp.compat3", FT_UINT32, BASE_DEC, NULL,
1681 { &hf_swils_elp_compat4,
1682 {"Compatability Param 4", "swils.elp.compat4", FT_UINT32, BASE_DEC, NULL,
1684 { &hf_swils_efp_rec_type,
1685 {"Record Type", "swils.efp.rectype", FT_UINT8, BASE_HEX,
1686 VALS (fcswils_rectype_val), 0x0, "", HFILL}},
1687 { &hf_swils_efp_dom_id,
1688 {"Domain ID", "swils.efp.domid", FT_UINT8, BASE_HEX, NULL, 0x0,
1690 { &hf_swils_efp_switch_name,
1691 {"Switch Name", "swils.efp.sname", FT_STRING, BASE_HEX, NULL, 0x0,
1693 { &hf_swils_efp_mcast_grpno,
1694 {"Mcast Grp#", "swils.efp.mcastno", FT_UINT8, BASE_HEX, NULL, 0x0,
1696 { &hf_swils_efp_alias_token,
1697 {"Alias Token", "swils.efp.aliastok", FT_BYTES, BASE_HEX, NULL, 0x0,
1699 { &hf_swils_efp_payload_len,
1700 {"Payload Len", "swils.efp.payloadlen", FT_UINT16, BASE_DEC, NULL, 0x0,
1702 { &hf_swils_efp_pswitch_pri,
1703 {"Principal Switch Priority", "swils.efp.psprio", FT_UINT8, BASE_DEC,
1704 NULL, 0x0, "", HFILL}},
1705 { &hf_swils_efp_pswitch_name,
1706 {"Principal Switch Name", "swils.efp.psname", FT_STRING, BASE_HEX, NULL,
1708 { &hf_swils_dia_switch_name,
1709 {"Switch Name", "swils.dia.sname", FT_STRING, BASE_HEX, NULL, 0x0,
1711 { &hf_swils_rdi_payload_len,
1712 {"Payload Len", "swils.rdi.len", FT_UINT16, BASE_DEC, NULL, 0x0, "",
1714 { &hf_swils_rdi_req_sname,
1715 {"Req Switch Name", "swils.rdi.reqsn", FT_STRING, BASE_HEX, NULL, 0x0,
1717 { &hf_swils_fspfh_cmd,
1718 {"Command: ", "swils.fspf.cmd", FT_UINT8, BASE_HEX, NULL, 0x0,
1720 { &hf_swils_fspfh_rev,
1721 {"Version", "swils.fspf.ver", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}},
1722 { &hf_swils_fspfh_ar_num,
1723 {"AR Number", "swils.fspf.arnum", FT_UINT8, BASE_HEX, NULL, 0x0, "",
1725 { &hf_swils_fspfh_auth_type,
1726 {"Authentication Type", "swils.fspf.authtype", FT_UINT8, BASE_HEX, NULL,
1728 { &hf_swils_fspfh_dom_id,
1729 {"Originating Domain ID", "swils.fspf.origdomid", FT_UINT8, BASE_DEC,
1730 NULL, 0x0, "", HFILL}},
1731 { &hf_swils_fspfh_auth,
1732 {"Authentication", "swils.fspf.auth", FT_BYTES, BASE_HEX, NULL, 0x0,
1734 { &hf_swils_hlo_options,
1735 {"Options", "swils.hlo.options", FT_BYTES, BASE_HEX, NULL, 0x0,
1737 { &hf_swils_hlo_hloint,
1738 {"Hello Interval (secs)", "swils.hlo.hloint", FT_UINT32, BASE_DEC,
1739 NULL, 0x0, "", HFILL}},
1740 { &hf_swils_hlo_deadint,
1741 {"Dead Interval (secs)", "swils.hlo.deadint", FT_UINT32, BASE_DEC,
1742 NULL, 0x0, "", HFILL}},
1743 { &hf_swils_hlo_rcv_domid,
1744 {"Recipient Domain ID", "swils.hlo.rcvdomid", FT_UINT8, BASE_DEC,
1745 NULL, 0x0, "", HFILL}},
1746 { &hf_swils_hlo_orig_pidx,
1747 {"Originating Port Idx", "swils.hlo.origpidx", FT_UINT24, BASE_HEX,
1748 NULL, 0x0, "", HFILL}},
1749 { &hf_swils_lsrh_lsr_type,
1750 {"LSR Type", "swils.lsr.type", FT_UINT8, BASE_HEX,
1751 VALS (fc_swils_fspf_linkrec_val), 0x0, "", HFILL}},
1752 { &hf_swils_lsrh_lsid,
1753 {"Link State Id", "swils.ls.id", FT_UINT8, BASE_DEC, NULL, 0x0,
1755 { &hf_swils_lsrh_adv_domid,
1756 {"Advertising Domain Id", "swils.lsr.advdomid", FT_UINT8, BASE_DEC,
1757 NULL, 0x0, "", HFILL}},
1758 { &hf_swils_lsrh_ls_incid,
1759 {"LS Incarnation Number", "swils.lsr.incid", FT_UINT32, BASE_DEC,
1760 NULL, 0x0, "", HFILL}},
1761 { &hf_swils_ldrec_linkid,
1762 {"Link ID", "swils.ldr.linkid", FT_STRING, BASE_HEX, NULL, 0x0,
1764 { &hf_swils_ldrec_out_pidx,
1765 {"Output Port Idx", "swils.ldr.out_portidx", FT_UINT24, BASE_HEX, NULL,
1767 { &hf_swils_ldrec_nbr_pidx,
1768 {"Neighbor Port Idx", "swils.ldr.nbr_portidx", FT_UINT24, BASE_HEX,
1769 NULL, 0x0, "", HFILL}},
1770 { &hf_swils_ldrec_link_type,
1771 {"Link Type", "swils.ldr.linktype", FT_UINT8, BASE_HEX,
1772 VALS (fc_swils_link_type_val), 0x0, "", HFILL}},
1773 { &hf_swils_ldrec_link_cost,
1774 {"Link Cost", "swils.ldr.linkcost", FT_UINT16, BASE_DEC, NULL, 0x0,
1776 { &hf_swils_rscn_evtype,
1777 {"Event Type", "swils.rscn.evtype", FT_UINT8, BASE_DEC,
1778 VALS (fc_swils_rscn_portstate_val), 0xF0, "", HFILL}},
1779 { &hf_swils_rscn_addrfmt,
1780 {"Address Format", "swils.rscn.addrfmt", FT_UINT8, BASE_DEC,
1781 VALS (fc_swils_rscn_addrfmt_val), 0x0F, "", HFILL}},
1782 { &hf_swils_rscn_affectedport,
1783 {"Affected Port ID", "swils.rscn.affectedport", FT_STRING, BASE_HEX,
1784 NULL, 0x0, "", HFILL}},
1785 { &hf_swils_rscn_detectfn,
1786 {"Detection Function", "swils.rscn.detectfn", FT_UINT32, BASE_HEX,
1787 VALS (fc_swils_rscn_detectfn_val), 0x0, "", HFILL}},
1788 { &hf_swils_rscn_portstate,
1789 {"Port State", "swils.rscn.portstate", FT_UINT8, BASE_HEX, NULL, 0x0,
1791 { &hf_swils_rscn_portid,
1792 {"Port Id", "swils.rscn.portid", FT_STRING, BASE_HEX, NULL, 0x0, "",
1794 { &hf_swils_rscn_pwwn,
1795 {"Port WWN", "swils.rscn.pwwn", FT_STRING, BASE_HEX, NULL, 0x0, "",
1797 { &hf_swils_rscn_nwwn,
1798 {"Node WWN", "swils.rscn.nwwn", FT_STRING, BASE_HEX, NULL, 0x0, "",
1800 { &hf_swils_esc_swvendorid,
1801 {"Switch Vendor ID", "swils.esc.swvendor", FT_STRING, BASE_HEX, NULL,
1803 { &hf_swils_esc_pdesc_vendorid,
1804 {"Vendor ID", "swils.esc.vendorid", FT_STRING, BASE_HEX, NULL, 0x0,
1806 { &hf_swils_esc_protocolid,
1807 {"Protocol ID", "swils.esc.protocol", FT_UINT16, BASE_HEX,
1808 VALS (fc_swils_esc_protocol_val), 0x0, "", HFILL}},
1809 { &hf_swils_zone_activezonenm,
1810 {"Active Zoneset Name", "swils.mr.activezonesetname", FT_STRING,
1811 BASE_HEX, NULL, 0x0, "", HFILL}},
1812 { &hf_swils_zone_objname,
1813 {"Zone Object Name", "swils.zone.zoneobjname", FT_STRING, BASE_HEX,
1814 NULL, 0x0, "", HFILL}},
1815 { &hf_swils_zone_objtype,
1816 {"Zone Object Type", "swils.zone.zoneobjtype", FT_UINT8, BASE_HEX,
1817 VALS (fc_swils_zoneobj_type_val), 0x0, "", HFILL}},
1818 { &hf_swils_zone_mbrtype,
1819 {"Zone Member Type", "swils.zone.mbrtype", FT_UINT8, BASE_HEX,
1820 VALS (fc_swils_zonembr_type_val), 0x0, "", HFILL}},
1821 { &hf_swils_zone_protocol,
1822 {"Zone Protocol", "swils.zone.protocol", FT_UINT8, BASE_HEX, NULL,
1824 { &hf_swils_zone_mbrid,
1825 {"Member Identifier", "swils.zone.mbrid", FT_STRING, BASE_HEX, NULL,
1827 { &hf_swils_zone_status,
1828 {"Zone Command Status", "swils.zone.status", FT_UINT8, BASE_HEX,
1829 VALS (fc_swils_mr_rsp_val), 0x0, "Applies to MR, ACA, RCA, SFC, UFC",
1831 { &hf_swils_zone_reason,
1832 {"Zone Command Reason Code", "swils.zone.reason", FT_UINT8, BASE_HEX,
1833 VALS (fc_swils_mr_reason_val), 0x0, "Applies to MR, ACA, RCA, SFC, UFC",
1835 { &hf_swils_aca_domainid,
1836 {"Known Domain ID", "swils.aca.domainid", FT_UINT8, BASE_HEX, NULL,
1838 { &hf_swils_sfc_opcode,
1839 {"Operation Request", "swils.sfc.opcode", FT_UINT8, BASE_HEX,
1840 VALS (fc_swils_sfc_op_val), 0x0, "", HFILL}},
1841 { &hf_swils_sfc_zonenm,
1842 {"Zone Set Name", "swils.sfc.zonename", FT_STRING, BASE_HEX, NULL,
1845 {"Reason Code", "swils.rjt.reason", FT_UINT8, BASE_HEX,
1846 VALS (fc_swils_rjt_val), 0x0, "", HFILL}},
1848 {"Reason Code Explanantion", "swils.rjt.reasonexpl", FT_UINT8,
1849 BASE_HEX, VALS (fc_swils_deterr_val), 0x0, "", HFILL}},
1850 { &hf_swils_rjtvendor,
1851 {"Vendor Unique Error Code", "swils.rjt.vendor", FT_UINT8, BASE_HEX,
1852 NULL, 0x0, "", HFILL}},
1853 { &hf_swils_zone_mbrid_lun,
1854 {"LUN", "swils.zone.lun", FT_BYTES, BASE_HEX, NULL, 0x0, "",
1858 /* Setup protocol subtree array */
1859 static gint *ett[] = {
1865 &ett_fcswils_efplist,
1868 &ett_fcswils_fspfhdr,
1871 &ett_fcswils_lsrechdr,
1878 &ett_fcswils_rscn_dev,
1881 &ett_fcswils_zoneobjlist,
1882 &ett_fcswils_zoneobj,
1883 &ett_fcswils_zonembr,
1889 &ett_fcswils_esc_pdesc,
1892 /* Register the protocol name and description */
1893 proto_fcswils = proto_register_protocol("Fibre Channel SW_ILS", "FC-SWILS", "swils");
1895 /* Required function calls to register the header fields and subtrees used */
1896 proto_register_field_array(proto_fcswils, hf, array_length(hf));
1897 proto_register_subtree_array(ett, array_length(ett));
1898 register_init_routine(&fcswils_init_protocol);
1901 /* If this dissector uses sub-dissector registration add a registration routine.
1902 This format is required because a script is used to find these routines and
1903 create the code that calls these routines.
1906 proto_reg_handoff_fcswils (void)
1908 dissector_handle_t swils_handle;
1910 swils_handle = create_dissector_handle (dissect_fcswils, proto_fcswils);
1911 dissector_add("fc.ftype", FC_FTYPE_SWILS, swils_handle);
1913 data_handle = find_dissector ("data");