2 * Routines for FC Inter-switch link services
3 * Copyright 2001, Dinesh G Dutt <ddutt@cisco.com>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #include <epan/packet.h>
27 #include <epan/expert.h>
28 #include <epan/to_str.h>
29 #include "packet-fc.h"
30 #include "packet-fcswils.h"
31 #include "packet-fcct.h"
33 void proto_register_fcswils(void);
34 void proto_reg_handoff_fcswils(void);
37 * See the FC-SW specifications.
40 #define FC_SWILS_RPLY 0x0
41 #define FC_SWILS_REQ 0x1
42 #define FC_SWILS_RSCN_DEVENTRY_SIZE 20
44 /* Zone name has the structure:
45 * name_len (1 byte), rsvd (3 bytes), name (m bytes), fill (n bytes)
46 * name_len excludes the 4 initial bytes before the name
48 #define ZONENAME_LEN(x, y) (tvb_get_guint8(x, y)+4)
50 /* Initialize the protocol and registered fields */
51 static int proto_fcswils = -1;
52 static int hf_swils_opcode = -1;
53 static int hf_swils_elp_rev = -1;
54 static int hf_swils_elp_flags = -1;
55 static int hf_swils_elp_r_a_tov = -1;
56 static int hf_swils_elp_e_d_tov = -1;
57 static int hf_swils_elp_req_epn = -1;
58 static int hf_swils_elp_req_esn = -1;
59 static int hf_swils_elp_clsf_svcp = -1;
60 static int hf_swils_elp_clsf_rcvsz = -1;
61 static int hf_swils_elp_clsf_conseq = -1;
62 static int hf_swils_elp_clsf_e2e = -1;
63 static int hf_swils_elp_clsf_openseq = -1;
64 static int hf_swils_elp_cls1_svcp = -1;
65 static int hf_swils_elp_cls1_rcvsz = -1;
66 static int hf_swils_elp_cls2_svcp = -1;
67 static int hf_swils_elp_cls2_rcvsz = -1;
68 static int hf_swils_elp_cls3_svcp = -1;
69 static int hf_swils_elp_cls3_rcvsz = -1;
70 static int hf_swils_elp_isl_fc_mode = -1;
71 static int hf_swils_elp_fcplen = -1;
72 static int hf_swils_elp_b2bcredit = -1;
73 static int hf_swils_elp_compat1 = -1;
74 static int hf_swils_elp_compat2 = -1;
75 static int hf_swils_elp_compat3 = -1;
76 static int hf_swils_elp_compat4 = -1;
77 static int hf_swils_efp_rec_type = -1;
78 static int hf_swils_efp_dom_id = -1;
79 static int hf_swils_efp_switch_name = -1;
80 static int hf_swils_efp_mcast_grpno = -1;
81 /* static int hf_swils_efp_alias_token = -1; */
82 static int hf_swils_efp_record_len = -1;
83 static int hf_swils_efp_payload_len = -1;
84 static int hf_swils_efp_pswitch_pri = -1;
85 static int hf_swils_efp_pswitch_name = -1;
86 static int hf_swils_dia_switch_name = -1;
87 static int hf_swils_rdi_payload_len = -1;
88 static int hf_swils_rdi_req_sname = -1;
89 /* static int hf_swils_fspfh_cmd = -1; */
90 static int hf_swils_fspfh_rev = -1;
91 static int hf_swils_fspfh_ar_num = -1;
92 static int hf_swils_fspfh_auth_type = -1;
93 static int hf_swils_fspfh_dom_id = -1;
94 static int hf_swils_fspfh_auth = -1;
95 static int hf_swils_hlo_options = -1;
96 static int hf_swils_hlo_hloint = -1;
97 static int hf_swils_hlo_deadint = -1;
98 static int hf_swils_hlo_rcv_domid = -1;
99 static int hf_swils_hlo_orig_pidx = -1;
100 static int hf_swils_ldrec_linkid = -1;
101 static int hf_swils_ldrec_out_pidx = -1;
102 static int hf_swils_ldrec_nbr_pidx = -1;
103 static int hf_swils_ldrec_link_type = -1;
104 static int hf_swils_ldrec_link_cost = -1;
105 static int hf_swils_lsrh_lsr_type = -1;
106 static int hf_swils_lsrh_lsid = -1;
107 static int hf_swils_lsrh_adv_domid = -1;
108 static int hf_swils_lsrh_ls_incid = -1;
109 static int hf_swils_esc_pdesc_vendorid = -1;
110 static int hf_swils_esc_swvendorid = -1;
111 static int hf_swils_esc_protocolid = -1;
112 static int hf_swils_rscn_evtype = -1;
113 static int hf_swils_rscn_addrfmt = -1;
114 static int hf_swils_rscn_detectfn = -1;
115 static int hf_swils_rscn_affectedport = -1;
116 static int hf_swils_rscn_portstate = -1;
117 static int hf_swils_rscn_portid = -1;
118 static int hf_swils_rscn_pwwn = -1;
119 static int hf_swils_rscn_nwwn = -1;
120 static int hf_swils_zone_activezonenm = -1;
121 static int hf_swils_zone_objname = -1;
122 static int hf_swils_zone_objtype = -1;
123 static int hf_swils_zone_mbrtype = -1;
124 static int hf_swils_zone_protocol = -1;
125 static int hf_swils_zone_mbrid = -1;
126 static int hf_swils_zone_status = -1;
127 static int hf_swils_zone_reason = -1;
128 static int hf_swils_aca_domainid = -1;
129 static int hf_swils_sfc_opcode = -1;
130 static int hf_swils_sfc_zonenm = -1;
131 static int hf_swils_rjt = -1;
132 static int hf_swils_rjtdet = -1;
133 static int hf_swils_rjtvendor = -1;
134 static int hf_swils_zone_mbrid_lun = -1;
135 static int hf_swils_ess_rev = -1;
136 static int hf_swils_ess_len = -1;
137 static int hf_swils_ess_numobj = -1;
138 static int hf_swils_interconnect_list_len = -1;
139 static int hf_swils_ess_vendorname = -1;
140 static int hf_swils_ess_modelname = -1;
141 static int hf_swils_ess_relcode = -1;
142 static int hf_swils_ess_vendorspecific = -1;
143 static int hf_swils_ess_cap_type = -1;
144 static int hf_swils_ess_cap_subtype = -1;
145 static int hf_swils_ess_cap_numentries = -1;
146 static int hf_swils_ess_cap_svc = -1;
147 static int hf_swils_ess_dns_obj0h = -1;
148 static int hf_swils_ess_dns_obj1h = -1;
149 static int hf_swils_ess_dns_obj2h = -1;
150 static int hf_swils_ess_dns_obj3h = -1;
151 static int hf_swils_ess_dns_zlacc = -1;
152 static int hf_swils_ess_dns_vendor = -1;
153 static int hf_swils_ess_fctlr_rscn = -1;
154 static int hf_swils_ess_fctlr_vendor = -1;
155 static int hf_swils_ess_fcs_basic = -1;
156 static int hf_swils_ess_fcs_platform = -1;
157 static int hf_swils_ess_fcs_topology = -1;
158 static int hf_swils_ess_fcs_enhanced = -1;
159 static int hf_swils_ess_fzs_enh_supp = -1;
160 static int hf_swils_ess_fzs_enh_ena = -1;
161 static int hf_swils_ess_fzs_mr = -1;
162 static int hf_swils_ess_fzs_zsdb_supp = -1;
163 static int hf_swils_ess_fzs_zsdb_ena = -1;
164 static int hf_swils_ess_fzs_adc_supp = -1;
165 static int hf_swils_ess_fzs_hardzone = -1;
166 static int hf_swils_mrra_rev = -1;
167 static int hf_swils_mrra_size = -1;
168 static int hf_swils_mrra_vendorid = -1;
169 static int hf_swils_mrra_reply = -1;
170 static int hf_swils_mrra_reply_size = -1;
171 static int hf_swils_mrra_waittime = -1;
172 static int hf_swils_ess_cap_t10 = -1;
173 static int hf_swils_ess_cap_vendorobj = -1;
174 static int hf_swils_ess_fzs_defzone = -1;
175 static int hf_swils_ess_cap_len = -1;
176 static int hf_swils_mrra_vendorinfo = -1;
178 /* Generated from convert_proto_tree_add_text.pl */
179 static int hf_swils_lsrh_lsr_age = -1;
180 static int hf_swils_zone_full_zone_set_length = -1;
181 static int hf_swils_zone_num_zoning_objects = -1;
182 static int hf_swils_lsrec_number_of_links = -1;
183 static int hf_swils_sfc_zoneset_length = -1;
184 static int hf_swils_zone_vendor_unique = -1;
185 static int hf_swils_zone_num_members = -1;
186 static int hf_swils_zone_active_zoneset_length = -1;
187 static int hf_swils_lsack_num_of_lsr_headers = -1;
188 static int hf_swils_lsrh_lsr_length = -1;
189 static int hf_swils_esc_payload_length = -1;
190 static int hf_swils_lsupdate_num_of_lsrs = -1;
191 static int hf_swils_zone_mbr_identifier_length = -1;
192 static int hf_swils_zone_mbrflags = -1;
193 static int hf_swils_lsrh_options = -1;
194 static int hf_swils_domain_id_list_length = -1;
195 static int hf_swils_lsack_flags = -1;
196 static int hf_swils_rscn_num_entries = -1;
197 static int hf_swils_requested_domain_id = -1;
198 static int hf_swils_lsrh_checksum = -1;
199 static int hf_swils_granted_domain_id = -1;
200 static int hf_swils_lsupdate_flags = -1;
203 static expert_field ei_swils_efp_record_len = EI_INIT;
204 static expert_field ei_swils_no_exchange = EI_INIT;
206 /* Initialize the subtree pointers */
207 static gint ett_fcswils = -1;
208 static gint ett_fcswils_swacc = -1;
209 static gint ett_fcswils_swrjt = -1;
210 static gint ett_fcswils_elp = -1;
211 static gint ett_fcswils_efp = -1;
212 static gint ett_fcswils_efplist = -1;
213 static gint ett_fcswils_dia = -1;
214 static gint ett_fcswils_rdi = -1;
215 static gint ett_fcswils_fspfhdr = -1;
216 static gint ett_fcswils_hlo = -1;
217 static gint ett_fcswils_lsrec = -1;
218 static gint ett_fcswils_lsrechdr = -1;
219 static gint ett_fcswils_ldrec = -1;
220 static gint ett_fcswils_lsu = -1;
221 static gint ett_fcswils_lsa = -1;
222 static gint ett_fcswils_bf = -1;
223 static gint ett_fcswils_rcf = -1;
224 static gint ett_fcswils_rscn = -1;
225 static gint ett_fcswils_rscn_dev = -1;
226 static gint ett_fcswils_drlir = -1;
227 static gint ett_fcswils_mr = -1;
228 static gint ett_fcswils_zoneobjlist = -1;
229 static gint ett_fcswils_zoneobj = -1;
230 static gint ett_fcswils_zonembr = -1;
231 static gint ett_fcswils_aca = -1;
232 static gint ett_fcswils_rca = -1;
233 static gint ett_fcswils_sfc = -1;
234 static gint ett_fcswils_ufc = -1;
235 static gint ett_fcswils_esc = -1;
236 static gint ett_fcswils_esc_pdesc = -1;
237 static gint ett_fcswils_ieinfo = -1;
238 static gint ett_fcswils_capinfo = -1;
240 static const value_string fc_swils_opcode_key_val[] = {
241 {FC_SWILS_SWRJT , "SW_RJT"},
242 {FC_SWILS_SWACC , "SW_ACC"},
243 {FC_SWILS_ELP , "ELP"},
244 {FC_SWILS_EFP , "EFP"},
245 {FC_SWILS_DIA , "DIA"},
246 {FC_SWILS_RDI , "RDI"},
247 {FC_SWILS_HLO , "HLO"},
248 {FC_SWILS_LSU , "LSU"},
249 {FC_SWILS_LSA , "LSA"},
250 {FC_SWILS_BF , "BF"},
251 {FC_SWILS_RCF , "RCF"},
252 {FC_SWILS_RSCN , "SW_RSCN"},
253 {FC_SWILS_DRLIR , "DRLIR"},
254 {FC_SWILS_DSCN , "DSCN"},
255 {FC_SWILS_LOOPD , "LOOPD"},
256 {FC_SWILS_MR , "MR"},
257 {FC_SWILS_ACA , "ACA"},
258 {FC_SWILS_RCA , "RCA"},
259 {FC_SWILS_SFC , "SFC"},
260 {FC_SWILS_UFC , "UFC"},
261 {FC_SWILS_ESC , "ESC"},
262 {FC_SWILS_ESS , "ESS"},
263 {FC_SWILS_MRRA , "MRRA"},
264 {FC_SWILS_AUTH_ILS, "AUTH_ILS"},
268 static const value_string fc_swils_rjt_val [] = {
269 {FC_SWILS_RJT_INVCODE , "Invalid Cmd Code"},
270 {FC_SWILS_RJT_INVVER , "Invalid Revision"},
271 {FC_SWILS_RJT_LOGERR , "Logical Error"},
272 {FC_SWILS_RJT_INVSIZE , "Invalid Size"},
273 {FC_SWILS_RJT_LOGBSY , "Logical Busy"},
274 {FC_SWILS_RJT_PROTERR , "Protocol Error"},
275 {FC_SWILS_RJT_GENFAIL , "Unable to Perform"},
276 {FC_SWILS_RJT_CMDNOTSUPP, "Unsupported Cmd"},
277 {FC_SWILS_RJT_VENDUNIQ , "Vendor Unique Err"},
281 static const value_string fc_swils_deterr_val [] = {
282 {FC_SWILS_RJT_NODET , "No Additional Details"},
283 {FC_SWILS_RJT_CLSF_ERR , "Class F Svc Param Err"},
284 {FC_SWILS_RJT_CLSN_ERR , "Class N Svc Param Err"},
285 {FC_SWILS_RJT_INVFC_CODE, "Unknown Flow Ctrl Code"},
286 {FC_SWILS_RJT_INVFC_PARM, "Invalid Flow Ctrl Parm"},
287 {FC_SWILS_RJT_INV_PNAME , "Invalid Port Name"},
288 {FC_SWILS_RJT_INV_SNAME , "Invalid Switch Name"},
289 {FC_SWILS_RJT_TOV_MSMTCH, "R_A_/E_D_TOV Mismatch"},
290 {FC_SWILS_RJT_INV_DIDLST, "Invalid Domain ID List"},
291 {FC_SWILS_RJT_CMD_INPROG, "Cmd Already in Progress"},
292 {FC_SWILS_RJT_OORSRC , "Insufficient Resources"},
293 {FC_SWILS_RJT_NO_DID , "Domain ID Unavailable"},
294 {FC_SWILS_RJT_INV_DID , "Invalid Domain ID"},
295 {FC_SWILS_RJT_NO_REQ , "Request Not Supported"},
296 {FC_SWILS_RJT_NOLNK_PARM, "Link Parm Not Estd."},
297 {FC_SWILS_RJT_NO_REQDID , "Group of Domain IDs Unavail"},
298 {FC_SWILS_RJT_EP_ISOL , "E_Port Isolated"},
302 static const value_string fcswils_elp_fc_val[] = {
303 {FC_SWILS_ELP_FC_VENDOR, "Vendor Unique"},
304 {FC_SWILS_ELP_FC_RRDY , "R_RDY Flow Ctrl"},
308 static const value_string fcswils_rectype_val[] = {
309 {FC_SWILS_LRECTYPE_DOMAIN, "Domain ID Record"},
310 {FC_SWILS_LRECTYPE_MCAST , "Multicast ID Record"},
314 static const value_string fc_swils_link_type_val[] = {
316 {0xF0, "Vendor Specific"},
317 {0xF1, "Vendor Specific"},
318 {0xF2, "Vendor Specific"},
319 {0xF3, "Vendor Specific"},
320 {0xF4, "Vendor Specific"},
321 {0xF5, "Vendor Specific"},
322 {0xF6, "Vendor Specific"},
323 {0xF7, "Vendor Specific"},
324 {0xF8, "Vendor Specific"},
325 {0xF9, "Vendor Specific"},
326 {0xFA, "Vendor Specific"},
327 {0xFB, "Vendor Specific"},
328 {0xFC, "Vendor Specific"},
329 {0xFD, "Vendor Specific"},
330 {0xFE, "Vendor Specific"},
331 {0xFF, "Vendor Specific"},
335 static const value_string fc_swils_fspf_linkrec_val[] = {
336 {FC_SWILS_LSR_SLR, "Switch Link Record"},
337 {FC_SWILS_LSR_ARS, "AR Summary Record"},
341 static const value_string fc_swils_fspf_lsrflags_val[] = {
342 {0x0, "LSR is for a Topology Update"},
343 {0x1, "LSR is for Initial DB Sync | Not the last seq in DB sync"},
344 {0x2, "Last Seq in DB Sync. LSU has no LSRs"},
345 {0x3, "LSR is for Initial DB Sync | Last Seq in DB Sync"},
349 static const value_string fc_swils_rscn_portstate_val[] = {
350 {0, "No Additional Info"},
351 {1, "Port is online"},
352 {2, "Port is offline"},
356 static const value_string fc_swils_rscn_addrfmt_val[] = {
357 {0, "Port Addr Format"},
358 {1, "Area Addr Format"},
359 {2, "Domain Addr Format"},
360 {3, "Fabric Addr Format"},
364 static const value_string fc_swils_rscn_detectfn_val[] = {
365 {1, "Fabric Detected"},
366 {2, "N_Port Detected"},
370 static const value_string fc_swils_esc_protocol_val[] = {
372 {1, "FSPF-Backbone Protocol"},
373 {2, "FSPF Protocol"},
377 static const value_string fc_swils_zoneobj_type_val[] = {
379 {FC_SWILS_ZONEOBJ_ZONESET , "Zone Set"},
380 {FC_SWILS_ZONEOBJ_ZONE , "Zone"},
381 {FC_SWILS_ZONEOBJ_ZONEALIAS, "Zone Alias"},
385 const value_string fc_swils_zonembr_type_val[] = {
387 {FC_SWILS_ZONEMBR_WWN , "WWN"},
388 {FC_SWILS_ZONEMBR_DP , "Domain/Physical Port (0x00ddpppp)"},
389 {FC_SWILS_ZONEMBR_FCID , "FC Address"},
390 {FC_SWILS_ZONEMBR_ALIAS , "Zone Alias"},
391 {FC_SWILS_ZONEMBR_WWN_LUN , "WWN+LUN"},
392 {FC_SWILS_ZONEMBR_DP_LUN , "Domain/Physical Port+LUN"},
393 {FC_SWILS_ZONEMBR_FCID_LUN, "FCID+LUN"},
397 static const value_string fc_swils_mr_rsp_val[] = {
404 static const value_string fc_swils_mr_reason_val[] = {
406 {0x1, "Invalid Data Length"},
407 {0x2, "Unsupported Command"},
409 {0x4, "Not Authorized"},
410 {0x5, "Invalid Request"},
411 {0x6, "Fabric Changing"},
412 {0x7, "Update Not Staged"},
413 {0x8, "Invalid Zone Set Format"},
414 {0x9, "Invalid Data"},
415 {0xA, "Cannot Merge"},
419 static const value_string fc_swils_sfc_op_val[] = {
423 {3, "Activate Zone Set"},
424 {4, "Deactivate Zone Set"},
428 typedef struct _zonename {
435 typedef struct _fcswils_conv_key {
437 } fcswils_conv_key_t;
439 typedef struct _fcswils_conv_data {
441 } fcswils_conv_data_t;
443 static GHashTable *fcswils_req_hash = NULL;
445 /* list of commands for each commandset */
446 typedef void (*fcswils_dissector_t)(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, guint8 isreq);
448 typedef struct _fcswils_func_table_t {
449 fcswils_dissector_t func;
450 } fcswils_func_table_t;
452 static dissector_handle_t data_handle, fcsp_handle;
454 static gint get_zoneobj_len(tvbuff_t *tvb, gint offset);
460 fcswils_equal(gconstpointer v, gconstpointer w)
462 const fcswils_conv_key_t *v1 = (const fcswils_conv_key_t *)v;
463 const fcswils_conv_key_t *v2 = (const fcswils_conv_key_t *)w;
465 return (v1->conv_idx == v2->conv_idx);
469 fcswils_hash(gconstpointer v)
471 const fcswils_conv_key_t *key = (const fcswils_conv_key_t *)v;
480 * Protocol initialization
483 fcswils_init_protocol(void)
485 if (fcswils_req_hash)
486 g_hash_table_destroy(fcswils_req_hash);
488 fcswils_req_hash = g_hash_table_new(fcswils_hash, fcswils_equal);
493 zonenm_to_str(tvbuff_t *tvb, gint offset)
495 int len = tvb_get_guint8(tvb, offset);
496 return tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, len, ENC_ASCII);
499 /* Offset points to the start of the zone object */
501 get_zoneobj_len(tvbuff_t *tvb, gint offset)
503 gint numrec, numrec1;
507 /* zone object structure is:
508 * type (1 byte), protocol (1 byte), rsvd (2 bytes), obj name (x bytes),
509 * num of zone mbrs (4 bytes ), list of zone members (each member if of
512 * zone member structure is:
513 * type (1 byte), rsvd (1 byte), flags (1 byte), id_len (1 byte),
516 objtype = tvb_get_guint8(tvb, offset);
517 len = 4 + ZONENAME_LEN(tvb, offset+4); /* length upto num_of_mbrs field */
518 numrec = tvb_get_ntohl(tvb, offset+len); /* gets us num of zone mbrs */
520 len += 4; /* + num_mbrs */
521 for (i = 0; i < numrec; i++) {
522 if (objtype == FC_SWILS_ZONEOBJ_ZONESET) {
523 len += 4 + ZONENAME_LEN(tvb, offset+4+len); /* length upto num_of_mbrs field */
524 numrec1 = tvb_get_ntohl(tvb, offset+len);
527 for (j = 0; j < numrec1; j++) {
528 len += 4 + tvb_get_guint8(tvb, offset+3+len);
532 len += 4 + tvb_get_guint8(tvb, offset+3+len);
539 #define MAX_INTERCONNECT_ELEMENT_INFO_LEN 252
541 dissect_swils_interconnect_element_info(tvbuff_t *tvb, proto_tree *tree, int offset)
544 int len, max_len = MAX_INTERCONNECT_ELEMENT_INFO_LEN;
547 proto_tree_add_item(tree, hf_swils_interconnect_list_len, tvb, offset+3, 1, ENC_BIG_ENDIAN);
548 len = tvb_strsize(tvb, offset+4);
549 proto_tree_add_item(tree, hf_swils_ess_vendorname, tvb, offset+4, len, ENC_ASCII|ENC_NA);
552 len = tvb_strsize(tvb, offset);
553 proto_tree_add_item(tree, hf_swils_ess_modelname, tvb, offset, len, ENC_ASCII|ENC_NA);
556 len = tvb_strsize(tvb, offset);
557 proto_tree_add_item(tree, hf_swils_ess_relcode, tvb, offset, len, ENC_ASCII|ENC_NA);
560 while (max_len > 0) {
561 /* Vendor specific field is a set of one or more null-terminated
564 len = tvb_strsize(tvb, offset);
565 proto_tree_add_item(tree, hf_swils_ess_vendorspecific, tvb, offset, len, ENC_ASCII|ENC_NA);
575 dissect_swils_ess_capability(tvbuff_t *tvb, proto_tree *tree, int offset,
581 proto_tree_add_item(tree, hf_swils_ess_dns_zlacc, tvb, offset+3,
583 proto_tree_add_item(tree, hf_swils_ess_dns_obj3h, tvb, offset+3,
585 proto_tree_add_item(tree, hf_swils_ess_dns_obj2h, tvb, offset+3,
587 proto_tree_add_item(tree, hf_swils_ess_dns_obj1h, tvb, offset+3,
589 proto_tree_add_item(tree, hf_swils_ess_dns_obj0h, tvb, offset+3,
591 proto_tree_add_item(tree, hf_swils_ess_dns_vendor, tvb,
592 offset+4, 4, ENC_BIG_ENDIAN);
594 case FCCT_GSRVR_FCTLR:
595 proto_tree_add_item(tree, hf_swils_ess_fctlr_rscn, tvb,
596 offset+3, 1, ENC_BIG_ENDIAN);
597 proto_tree_add_item(tree, hf_swils_ess_fctlr_vendor, tvb,
598 offset+4, 4, ENC_BIG_ENDIAN);
601 proto_tree_add_item(tree, hf_swils_ess_fcs_basic, tvb,
602 offset+3, 1, ENC_BIG_ENDIAN);
603 proto_tree_add_item(tree, hf_swils_ess_fcs_platform, tvb,
604 offset+3, 1, ENC_BIG_ENDIAN);
605 proto_tree_add_item(tree, hf_swils_ess_fcs_topology, tvb,
606 offset+3, 1, ENC_BIG_ENDIAN);
607 proto_tree_add_item(tree, hf_swils_ess_fcs_enhanced, tvb,
608 offset+3, 1, ENC_BIG_ENDIAN);
611 proto_tree_add_item(tree, hf_swils_ess_fzs_enh_supp, tvb,
612 offset+3, 1, ENC_BIG_ENDIAN);
613 proto_tree_add_item(tree, hf_swils_ess_fzs_enh_ena, tvb,
614 offset+3, 1, ENC_BIG_ENDIAN);
615 proto_tree_add_item(tree, hf_swils_ess_fzs_mr, tvb, offset+3,
617 proto_tree_add_item(tree, hf_swils_ess_fzs_defzone, tvb,
618 offset+3, 1, ENC_BIG_ENDIAN);
619 proto_tree_add_item(tree, hf_swils_ess_fzs_zsdb_supp, tvb,
620 offset+3, 1, ENC_BIG_ENDIAN);
621 proto_tree_add_item(tree, hf_swils_ess_fzs_zsdb_ena, tvb,
622 offset+3, 1, ENC_BIG_ENDIAN);
623 proto_tree_add_item(tree, hf_swils_ess_fzs_adc_supp, tvb,
624 offset+3, 1, ENC_BIG_ENDIAN);
625 proto_tree_add_item(tree, hf_swils_ess_fzs_hardzone, tvb,
626 offset+3, 1, ENC_BIG_ENDIAN);
637 dissect_swils_ess_capability_obj(tvbuff_t *tvb, proto_tree *tree, int offset)
639 int i = 0, num_entries = 0, len = 0, total_len = 0;
640 guint8 type, subtype, srvr_type;
641 proto_tree *capinfo_tree = NULL;
645 * Structure of capability object is: WK type (2B), WK subtype(2),
646 * rsvd (1), num_cap_entries (1), entry_1 (8) ... entry_n (8)
648 /* Compute length first to create subtree of cap object */
649 type = tvb_get_guint8(tvb, offset);
650 if (type != FCCT_GSTYPE_VENDOR) {
651 num_entries = tvb_get_guint8(tvb, offset+3);
652 total_len = 4 + (num_entries*8);
653 capinfo_tree = proto_tree_add_subtree_format(tree, tvb, offset,
654 total_len, ett_fcswils_capinfo, NULL, "Capability Object (%s)",
655 val_to_str(type, fc_ct_gstype_vals,
658 i = tvb_get_guint8(tvb, offset+3);
661 capinfo_tree = proto_tree_add_subtree_format(tree, tvb, offset,
662 i, ett_fcswils_capinfo, NULL, "Capability Object (Vendor-specific 0x%x)",
666 proto_tree_add_item(capinfo_tree, hf_swils_ess_cap_type, tvb, offset, 1, ENC_BIG_ENDIAN);
667 proto_tree_add_item(capinfo_tree, hf_swils_ess_cap_subtype, tvb, offset+1,
669 subtype = tvb_get_guint8(tvb, offset+1);
671 if (type != FCCT_GSTYPE_VENDOR) {
672 srvr_type = get_gs_server(type, subtype);
673 proto_tree_add_uint(capinfo_tree, hf_swils_ess_cap_svc, tvb, offset, 2,
675 proto_tree_add_item(capinfo_tree, hf_swils_ess_cap_numentries, tvb,
676 offset+3, 1, ENC_BIG_ENDIAN);
680 while ((num_entries > 0) && tvb_bytes_exist(tvb, offset, 8)) {
681 dissect_swils_ess_capability(tvb, capinfo_tree, offset, srvr_type);
687 /* Those damn T11 guys defined another format for
688 * Vendor-specific objects.
690 proto_tree_add_item(capinfo_tree, hf_swils_ess_cap_len, tvb, offset+3,
692 proto_tree_add_item(capinfo_tree, hf_swils_ess_cap_t10, tvb, offset+4,
693 8, ENC_ASCII|ENC_NA);
694 i -= 8; /* reduce length by t10 object size */
698 while ((i > 0) && tvb_bytes_exist(tvb, offset, 8)) {
699 proto_tree_add_item(capinfo_tree, hf_swils_ess_cap_vendorobj,
700 tvb, offset, 8, ENC_NA);
711 dissect_swils_nullpayload(tvbuff_t *tvb _U_, packet_info* pinfo _U_, proto_tree *tree _U_,
714 /* Common dissector for those ILSs without a payload */
719 dissect_swils_elp(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *elp_tree, guint8 isreq _U_)
722 /* Set up structures needed to add the protocol subtree and manage it */
723 /* Response i.e. SW_ACC for an ELP has the same format as the request */
724 /* We skip the initial 4 bytes as we don't care about the opcode */
729 guint16 isl_flwctrl_mode;
730 guint8 clsf_svcparm[6], cls1_svcparm[2], cls2_svcparm[2], cls3_svcparm[2];
734 proto_tree_add_item(elp_tree, hf_swils_elp_rev, tvb, offset++, 1, ENC_BIG_ENDIAN);
735 proto_tree_add_item(elp_tree, hf_swils_elp_flags, tvb, offset, 2, ENC_NA);
737 r_a_tov = tvb_get_ntohl(tvb, offset);
738 proto_tree_add_uint_format_value(elp_tree, hf_swils_elp_r_a_tov, tvb, offset, 4,
739 r_a_tov, "%d msecs", r_a_tov);
741 e_d_tov = tvb_get_ntohl(tvb, offset);
742 proto_tree_add_uint_format_value(elp_tree, hf_swils_elp_e_d_tov, tvb, offset, 4,
743 e_d_tov, "%d msecs", e_d_tov);
745 proto_tree_add_item(elp_tree, hf_swils_elp_req_epn, tvb, offset, 8, ENC_NA);
747 proto_tree_add_item(elp_tree, hf_swils_elp_req_esn, tvb, offset, 8, ENC_NA);
750 tvb_memcpy(tvb, clsf_svcparm, offset, 6);
751 if (clsf_svcparm[0] & 0x80) {
752 if (clsf_svcparm[4] & 0x20) {
753 flags="Class F Valid | X_ID Interlock";
755 flags="Class F Valid | No X_ID Interlk";
758 flags="Class F Invld";
760 proto_tree_add_bytes_format_value(elp_tree, hf_swils_elp_clsf_svcp, tvb, offset, 6,
761 clsf_svcparm, "(%s)", flags);
764 proto_tree_add_item(elp_tree, hf_swils_elp_clsf_rcvsz, tvb, offset, 2, ENC_BIG_ENDIAN);
766 proto_tree_add_item(elp_tree, hf_swils_elp_clsf_conseq, tvb, offset, 2, ENC_BIG_ENDIAN);
768 proto_tree_add_item(elp_tree, hf_swils_elp_clsf_e2e, tvb, offset, 2, ENC_BIG_ENDIAN);
770 proto_tree_add_item(elp_tree, hf_swils_elp_clsf_openseq, tvb, offset, 2, ENC_BIG_ENDIAN);
773 tvb_memcpy(tvb, cls1_svcparm, offset, 2);
774 if (cls1_svcparm[0] & 0x80) {
775 #define MAX_FLAGS_LEN 40
777 gint stroff, returned_length;
779 flagsbuf=(char *)wmem_alloc(wmem_packet_scope(), MAX_FLAGS_LEN);
782 returned_length = g_snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff,
784 stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff);
785 if (cls1_svcparm[0] & 0x40) {
786 returned_length = g_snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | IMX");
787 stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff);
789 if (cls1_svcparm[0] & 0x20) {
790 returned_length = g_snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | IPS");
791 stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff);
793 if (cls1_svcparm[0] & 0x10) {
794 /*returned_length =*/ g_snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | LKS");
799 flags="Class 1 Invalid";
802 proto_tree_add_bytes_format_value(elp_tree, hf_swils_elp_cls1_svcp, tvb, offset, 2,
803 NULL, "(%s)", flags);
805 if (cls1_svcparm[0] & 0x80) {
806 proto_tree_add_item(elp_tree, hf_swils_elp_cls1_rcvsz, tvb, offset, 2, ENC_BIG_ENDIAN);
810 tvb_memcpy(tvb, cls2_svcparm, offset, 2);
811 if (cls2_svcparm[0] & 0x80) {
812 if (cls2_svcparm[0] & 0x08) {
813 flags="Class 2 Valid | Seq Delivery";
816 flags="Class 2 Valid | No Seq Delivery";
820 flags="Class 2 Invld";
823 proto_tree_add_bytes_format_value(elp_tree, hf_swils_elp_cls2_svcp, tvb, offset, 2,
828 if (cls2_svcparm[0] & 0x80) {
829 proto_tree_add_item(elp_tree, hf_swils_elp_cls2_rcvsz, tvb, offset, 2, ENC_BIG_ENDIAN);
833 tvb_memcpy(tvb, cls3_svcparm, offset, 2);
834 if (cls3_svcparm[0] & 0x80) {
835 if (cls3_svcparm[0] & 0x08) {
836 flags="Class 3 Valid | Seq Delivery";
839 flags="Class 3 Valid | No Seq Delivery";
843 flags="Class 3 Invld";
845 proto_tree_add_bytes_format_value(elp_tree, hf_swils_elp_cls3_svcp, tvb, offset, 2,
850 if (cls3_svcparm[0] & 0x80) {
851 proto_tree_add_item(elp_tree, hf_swils_elp_cls3_rcvsz, tvb, offset, 2, ENC_BIG_ENDIAN);
855 isl_flwctrl_mode = tvb_get_ntohs(tvb, offset);
856 proto_tree_add_string(elp_tree, hf_swils_elp_isl_fc_mode, tvb, offset, 2,
857 val_to_str_const(isl_flwctrl_mode, fcswils_elp_fc_val, "Vendor Unique"));
859 proto_tree_add_item(elp_tree, hf_swils_elp_fcplen, tvb, offset, 2, ENC_BIG_ENDIAN);
861 proto_tree_add_item(elp_tree, hf_swils_elp_b2bcredit, tvb, offset, 4, ENC_BIG_ENDIAN);
863 proto_tree_add_item(elp_tree, hf_swils_elp_compat1, tvb, offset, 4, ENC_BIG_ENDIAN);
865 proto_tree_add_item(elp_tree, hf_swils_elp_compat2, tvb, offset, 4, ENC_BIG_ENDIAN);
867 proto_tree_add_item(elp_tree, hf_swils_elp_compat3, tvb, offset, 4, ENC_BIG_ENDIAN);
869 proto_tree_add_item(elp_tree, hf_swils_elp_compat4, tvb, offset, 4, ENC_BIG_ENDIAN);
875 dissect_swils_efp(tvbuff_t *tvb, packet_info* pinfo, proto_tree *efp_tree, guint8 isreq _U_)
878 /* Set up structures needed to add the protocol subtree and manage it */
879 proto_tree *lrec_tree;
880 proto_item *rec_item;
882 int offset = 1; /* Skip opcode */
887 reclen = tvb_get_guint8(tvb, offset);
888 rec_item = proto_tree_add_uint(efp_tree, hf_swils_efp_record_len, tvb, offset, 1, reclen);
890 payload_len = tvb_get_ntohs(tvb, offset);
891 if (payload_len < FC_SWILS_EFP_SIZE) {
892 proto_tree_add_uint_format_value(efp_tree, hf_swils_efp_payload_len,
893 tvb, offset, 2, payload_len,
894 "%u (bogus, must be >= %u)",
895 payload_len, FC_SWILS_EFP_SIZE);
898 proto_tree_add_item(efp_tree, hf_swils_efp_payload_len, tvb, offset, 2, ENC_BIG_ENDIAN);
899 offset += 5; /* skip 3 reserved bytes, too */
900 proto_tree_add_item(efp_tree, hf_swils_efp_pswitch_pri, tvb,
901 offset, 1, ENC_BIG_ENDIAN);
903 proto_tree_add_item(efp_tree, hf_swils_efp_pswitch_name, tvb, offset, 8, ENC_NA);
907 expert_add_info(pinfo, rec_item, &ei_swils_efp_record_len);
910 /* Add List Records now */
912 num_listrec = (payload_len - FC_SWILS_EFP_SIZE)/reclen;
913 while (num_listrec-- > 0) {
914 rec_type = tvb_get_guint8(tvb, offset);
915 lrec_tree = proto_tree_add_subtree(efp_tree, tvb, offset, -1,
916 ett_fcswils_efplist, NULL,
919 "Unknown record type (0x%02x)"));
920 proto_tree_add_uint(lrec_tree, hf_swils_efp_rec_type, tvb, offset, 1,
924 case FC_SWILS_LRECTYPE_DOMAIN:
925 proto_tree_add_item(lrec_tree, hf_swils_efp_dom_id, tvb, offset+1, 1, ENC_BIG_ENDIAN);
926 proto_tree_add_item(lrec_tree, hf_swils_efp_switch_name, tvb, offset+8, 8, ENC_NA);
929 case FC_SWILS_LRECTYPE_MCAST:
930 proto_tree_add_item(lrec_tree, hf_swils_efp_mcast_grpno, tvb, offset+1, 1, ENC_BIG_ENDIAN);
939 dissect_swils_dia(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *dia_tree, guint8 isreq _U_)
941 /* Set up structures needed to add the protocol subtree and manage it */
945 proto_tree_add_item(dia_tree, hf_swils_dia_switch_name, tvb, offset+4,
951 dissect_swils_rdi(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *rdi_tree, guint8 isreq)
953 /* Set up structures needed to add the protocol subtree and manage it */
958 plen = tvb_get_ntohs(tvb, offset+2);
960 proto_tree_add_item(rdi_tree, hf_swils_rdi_payload_len, tvb, offset+2, 2, ENC_BIG_ENDIAN);
961 proto_tree_add_item(rdi_tree, hf_swils_rdi_req_sname, tvb, offset+4, 8, ENC_NA);
963 /* 12 is the length of the initial header and 4 is the size of each
964 * domain request record.
966 numrec = (plen - 12)/4;
968 for (i = 0; i < numrec; i++) {
970 proto_tree_add_item(rdi_tree, hf_swils_requested_domain_id, tvb, offset+3, 1, ENC_BIG_ENDIAN);
973 proto_tree_add_item(rdi_tree, hf_swils_granted_domain_id, tvb, offset+3, 1, ENC_BIG_ENDIAN);
981 dissect_swils_fspf_hdr(tvbuff_t *tvb, proto_tree *tree, int offset)
983 proto_tree *fspfh_tree;
986 /* 20 is the size of FSPF header */
987 fspfh_tree = proto_tree_add_subtree(tree, tvb, offset, 20, ett_fcswils_fspfhdr, NULL, "FSPF Header");
989 proto_tree_add_item(fspfh_tree, hf_swils_fspfh_rev, tvb, offset+4,
991 proto_tree_add_item(fspfh_tree, hf_swils_fspfh_ar_num, tvb,
992 offset+5, 1, ENC_BIG_ENDIAN);
993 proto_tree_add_item(fspfh_tree, hf_swils_fspfh_auth_type, tvb,
994 offset+6, 1, ENC_BIG_ENDIAN);
995 proto_tree_add_item(fspfh_tree, hf_swils_fspfh_dom_id, tvb, offset+11,
997 proto_tree_add_item(fspfh_tree, hf_swils_fspfh_auth, tvb, offset+12,
1003 dissect_swils_fspf_lsrechdr(tvbuff_t *tvb, proto_tree *tree, int offset)
1005 proto_tree_add_item(tree, hf_swils_lsrh_lsr_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1006 proto_tree_add_uint_format_value(tree, hf_swils_lsrh_lsr_age, tvb, offset+2, 2,
1007 tvb_get_ntohs(tvb, offset+2), "%d secs", tvb_get_ntohs(tvb, offset+2));
1008 proto_tree_add_item(tree, hf_swils_lsrh_options, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1009 proto_tree_add_item(tree, hf_swils_lsrh_lsid, tvb, offset+11, 1, ENC_BIG_ENDIAN);
1010 proto_tree_add_item(tree, hf_swils_lsrh_adv_domid, tvb, offset+15, 1, ENC_BIG_ENDIAN);
1011 proto_tree_add_item(tree, hf_swils_lsrh_ls_incid, tvb, offset+16, 4, ENC_BIG_ENDIAN);
1012 proto_tree_add_item(tree, hf_swils_lsrh_checksum, tvb, offset+20, 2, ENC_BIG_ENDIAN);
1013 proto_tree_add_item(tree, hf_swils_lsrh_lsr_length, tvb, offset+22, 2, ENC_BIG_ENDIAN);
1017 dissect_swils_fspf_ldrec(tvbuff_t *tvb, proto_tree *tree, int offset)
1019 proto_tree_add_string(tree, hf_swils_ldrec_linkid, tvb, offset, 4,
1020 tvb_fc_to_str(tvb, offset+1));
1021 proto_tree_add_item(tree, hf_swils_ldrec_out_pidx, tvb, offset+5, 3, ENC_BIG_ENDIAN);
1022 proto_tree_add_item(tree, hf_swils_ldrec_nbr_pidx, tvb, offset+9, 3, ENC_BIG_ENDIAN);
1023 proto_tree_add_item(tree, hf_swils_ldrec_link_type, tvb, offset+12, 1, ENC_BIG_ENDIAN);
1024 proto_tree_add_item(tree, hf_swils_ldrec_link_cost, tvb, offset+14, 2, ENC_BIG_ENDIAN);
1028 dissect_swils_fspf_lsrec(tvbuff_t *tvb, proto_tree *tree, int offset,
1031 int i, j, num_ldrec;
1032 proto_tree *lsrec_tree, *ldrec_tree, *lsrechdr_tree;
1035 for (j = 0; j < num_lsrec; j++) {
1036 num_ldrec = tvb_get_ntohs(tvb, offset+26);
1037 lsrec_tree = proto_tree_add_subtree_format(tree, tvb, offset, (28+num_ldrec*16),
1038 ett_fcswils_lsrec, NULL, "Link State Record %d (Domain %d)", j,
1039 tvb_get_guint8(tvb, offset+15));
1041 lsrechdr_tree = proto_tree_add_subtree(lsrec_tree, tvb, offset, 24,
1042 ett_fcswils_lsrechdr, NULL, "Link State Record Header");
1044 dissect_swils_fspf_lsrechdr(tvb, lsrechdr_tree, offset);
1045 proto_tree_add_item(tree, hf_swils_lsrec_number_of_links, tvb, offset+26, 2, ENC_BIG_ENDIAN);
1048 for (i = 0; i < num_ldrec; i++) {
1049 ldrec_tree = proto_tree_add_subtree_format(lsrec_tree, tvb, offset, 16,
1050 ett_fcswils_ldrec, NULL, "Link Descriptor %d "
1051 "(Neighbor domain %d)", i,
1052 tvb_get_guint8(tvb, offset+3));
1053 dissect_swils_fspf_ldrec(tvb, ldrec_tree, offset);
1061 dissect_swils_hello(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *hlo_tree, guint8 isreq _U_)
1063 /* Set up structures needed to add the protocol subtree and manage it */
1067 dissect_swils_fspf_hdr(tvb, hlo_tree, offset);
1069 proto_tree_add_item(hlo_tree, hf_swils_hlo_options, tvb, offset+20, 4, ENC_NA);
1070 proto_tree_add_item(hlo_tree, hf_swils_hlo_hloint, tvb, offset+24, 4, ENC_BIG_ENDIAN);
1071 proto_tree_add_item(hlo_tree, hf_swils_hlo_deadint, tvb, offset+28, 4, ENC_BIG_ENDIAN);
1072 proto_tree_add_item(hlo_tree, hf_swils_hlo_rcv_domid, tvb, offset+35, 1, ENC_BIG_ENDIAN);
1073 proto_tree_add_item(hlo_tree, hf_swils_hlo_orig_pidx, tvb, offset+37, 3, ENC_BIG_ENDIAN);
1078 dissect_swils_lsupdate(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *lsu_tree, guint8 isreq _U_)
1080 /* Set up structures needed to add the protocol subtree and manage it */
1085 dissect_swils_fspf_hdr(tvb, lsu_tree, offset);
1087 proto_tree_add_item(lsu_tree, hf_swils_lsupdate_flags, tvb, offset+23, 1, ENC_BIG_ENDIAN);
1088 num_lsrec = tvb_get_ntohl(tvb, offset+24);
1090 proto_tree_add_item(lsu_tree, hf_swils_lsupdate_num_of_lsrs, tvb, offset+24, 4, ENC_BIG_ENDIAN);
1093 dissect_swils_fspf_lsrec(tvb, lsu_tree, offset, num_lsrec);
1098 dissect_swils_lsack(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *lsa_tree, guint8 isreq _U_)
1100 /* Set up structures needed to add the protocol subtree and manage it */
1102 int num_lsrechdr, i;
1103 proto_tree *lsrechdr_tree;
1106 dissect_swils_fspf_hdr(tvb, lsa_tree, offset);
1108 proto_tree_add_item(lsa_tree, hf_swils_lsack_flags, tvb, offset+23, 1, ENC_BIG_ENDIAN);
1109 num_lsrechdr = tvb_get_ntohl(tvb, offset+24);
1111 proto_tree_add_item(lsa_tree, hf_swils_lsack_num_of_lsr_headers, tvb, offset+24, 4, ENC_BIG_ENDIAN);
1115 for (i = 0; i < num_lsrechdr; i++) {
1116 lsrechdr_tree = proto_tree_add_subtree_format(lsa_tree, tvb, offset, 24,
1117 ett_fcswils_lsrechdr, NULL, "Link State Record Header (Domain %d)",
1118 tvb_get_guint8(tvb, offset+15));
1119 dissect_swils_fspf_lsrechdr(tvb, lsrechdr_tree, offset);
1126 dissect_swils_rscn(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *rscn_tree, guint8 isreq)
1128 /* Set up structures needed to add the protocol subtree and manage it */
1130 proto_tree *dev_tree;
1137 proto_tree_add_item(rscn_tree, hf_swils_rscn_evtype, tvb, offset+4,
1139 proto_tree_add_item(rscn_tree, hf_swils_rscn_addrfmt, tvb, offset+4,
1141 proto_tree_add_string(rscn_tree, hf_swils_rscn_affectedport, tvb,
1142 offset+5, 3, tvb_fc_to_str(tvb, offset+5));
1143 proto_tree_add_item(rscn_tree, hf_swils_rscn_detectfn, tvb,
1144 offset+8, 4, ENC_BIG_ENDIAN);
1145 numrec = tvb_get_ntohl(tvb, offset+12);
1147 if (!tvb_bytes_exist(tvb, offset+16, FC_SWILS_RSCN_DEVENTRY_SIZE*numrec)) {
1148 /* Some older devices do not include device entry information. */
1152 proto_tree_add_item(rscn_tree, hf_swils_rscn_num_entries, tvb, offset+12, 4, ENC_BIG_ENDIAN);
1155 for (i = 0; i < numrec; i++) {
1156 dev_tree = proto_tree_add_subtree_format(rscn_tree, tvb, offset, 20,
1157 ett_fcswils_rscn_dev, NULL, "Device Entry %d", i);
1159 proto_tree_add_item(dev_tree, hf_swils_rscn_portstate, tvb, offset, 1, ENC_BIG_ENDIAN);
1160 proto_tree_add_string(dev_tree, hf_swils_rscn_portid, tvb, offset+1, 3,
1161 tvb_fc_to_str(tvb, offset+1));
1162 proto_tree_add_item(dev_tree, hf_swils_rscn_pwwn, tvb, offset+4, 8, ENC_NA);
1163 proto_tree_add_item(dev_tree, hf_swils_rscn_nwwn, tvb, offset+12, 8, ENC_NA);
1170 * Merge Request contains zoning objects organized in the following format:
1174 * +---------------- Zone Object
1176 * +-- +---------------- Zone Member
1180 * So the decoding of the zone merge request is based on this structure
1184 dissect_swils_zone_mbr(tvbuff_t *tvb, proto_tree *zmbr_tree, int offset)
1191 mbrtype = tvb_get_guint8(tvb, offset);
1192 proto_tree_add_uint(zmbr_tree, hf_swils_zone_mbrtype, tvb,
1193 offset, 1, mbrtype);
1194 proto_tree_add_item(zmbr_tree, hf_swils_zone_mbrflags, tvb, offset+2, 1, ENC_BIG_ENDIAN);
1195 idlen = tvb_get_guint8(tvb, offset+3);
1196 proto_tree_add_item(zmbr_tree, hf_swils_zone_mbr_identifier_length, tvb, offset+3, 1, ENC_BIG_ENDIAN);
1198 case FC_SWILS_ZONEMBR_WWN:
1199 proto_tree_add_string(zmbr_tree, hf_swils_zone_mbrid, tvb,
1201 tvb_fcwwn_to_str(tvb, offset+4));
1203 case FC_SWILS_ZONEMBR_DP:
1204 g_snprintf(dpbuf, sizeof(dpbuf), "0x%08x", tvb_get_ntohl(tvb, offset+4));
1205 proto_tree_add_string(zmbr_tree, hf_swils_zone_mbrid, tvb,
1206 offset+4, 4, dpbuf);
1208 case FC_SWILS_ZONEMBR_FCID:
1209 proto_tree_add_string(zmbr_tree, hf_swils_zone_mbrid, tvb,
1211 tvb_fc_to_str(tvb, offset+5));
1213 case FC_SWILS_ZONEMBR_ALIAS:
1214 str = zonenm_to_str(tvb, offset+4);
1215 proto_tree_add_string(zmbr_tree, hf_swils_zone_mbrid, tvb,
1216 offset+4, idlen, str);
1218 case FC_SWILS_ZONEMBR_WWN_LUN:
1219 proto_tree_add_string(zmbr_tree, hf_swils_zone_mbrid, tvb,
1221 tvb_fcwwn_to_str(tvb, offset+4));
1222 proto_tree_add_item(zmbr_tree, hf_swils_zone_mbrid_lun, tvb,
1223 offset+12, 8, ENC_NA);
1225 case FC_SWILS_ZONEMBR_DP_LUN:
1226 g_snprintf(dpbuf, sizeof(dpbuf), "0x%08x", tvb_get_ntohl(tvb, offset+4));
1227 proto_tree_add_string(zmbr_tree, hf_swils_zone_mbrid, tvb,
1228 offset+4, 4, dpbuf);
1229 proto_tree_add_item(zmbr_tree, hf_swils_zone_mbrid_lun, tvb,
1230 offset+8, 8, ENC_NA);
1232 case FC_SWILS_ZONEMBR_FCID_LUN:
1233 proto_tree_add_string(zmbr_tree, hf_swils_zone_mbrid, tvb,
1235 tvb_fc_to_str(tvb, offset+5));
1236 proto_tree_add_item(zmbr_tree, hf_swils_zone_mbrid_lun, tvb,
1237 offset+8, 8, ENC_NA);
1240 proto_tree_add_string(zmbr_tree, hf_swils_zone_mbrid, tvb,
1242 "Unknown member type format");
1248 dissect_swils_zone_obj(tvbuff_t *tvb, proto_tree *zobj_tree, int offset)
1250 proto_tree *zmbr_tree;
1251 int mbrlen, numrec, i, objtype;
1254 objtype = tvb_get_guint8(tvb, offset);
1256 proto_tree_add_item(zobj_tree, hf_swils_zone_objtype, tvb, offset,
1258 proto_tree_add_item(zobj_tree, hf_swils_zone_protocol, tvb,
1259 offset+1, 1, ENC_BIG_ENDIAN);
1260 str = zonenm_to_str(tvb, offset+4);
1261 proto_tree_add_string(zobj_tree, hf_swils_zone_objname, tvb,
1262 offset+4, ZONENAME_LEN(tvb, offset+4), str);
1264 numrec = tvb_get_ntohl(tvb, offset+4+ZONENAME_LEN(tvb, offset+4));
1265 proto_tree_add_item(zobj_tree, hf_swils_zone_num_members, tvb, offset+4+ZONENAME_LEN(tvb,offset+4), 4, ENC_BIG_ENDIAN);
1267 offset += 8 + ZONENAME_LEN(tvb, offset+4);
1268 for (i = 0; i < numrec; i++) {
1269 if (objtype == FC_SWILS_ZONEOBJ_ZONESET) {
1270 dissect_swils_zone_obj(tvb, zobj_tree, offset);
1271 offset += get_zoneobj_len(tvb, offset);
1274 mbrlen = 4 + tvb_get_guint8(tvb, offset+3);
1275 zmbr_tree = proto_tree_add_subtree_format(zobj_tree, tvb, offset, mbrlen,
1276 ett_fcswils_zonembr, NULL, "Zone Member %d", i);
1277 dissect_swils_zone_mbr(tvb, zmbr_tree, offset);
1284 dissect_swils_mergereq(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *mr_tree, guint8 isreq)
1286 /* Set up structures needed to add the protocol subtree and manage it */
1288 proto_tree *zobjlist_tree, *zobj_tree;
1289 int numrec, i, zonesetlen, objlistlen, objlen;
1294 /* zonesetlen is the size of the zoneset including the zone name */
1295 zonesetlen = tvb_get_ntohs(tvb, offset+2);
1296 proto_tree_add_item(mr_tree, hf_swils_zone_active_zoneset_length, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1299 str = zonenm_to_str(tvb, offset+4);
1300 proto_tree_add_string(mr_tree, hf_swils_zone_activezonenm, tvb,
1301 offset+4, ZONENAME_LEN(tvb, offset+4),
1304 /* objlistlen gives the size of the active zoneset object list */
1305 objlistlen = zonesetlen - ZONENAME_LEN(tvb, offset+4);
1306 /* Offset = start of the active zoneset zoning object list */
1307 offset = offset + (4 + ZONENAME_LEN(tvb, offset+4));
1308 numrec = tvb_get_ntohl(tvb, offset);
1310 zobjlist_tree = proto_tree_add_subtree(mr_tree, tvb, offset, objlistlen,
1311 ett_fcswils_zoneobjlist, NULL, "Active Zone Set");
1313 proto_tree_add_item(zobjlist_tree, hf_swils_zone_num_zoning_objects, tvb, offset, 4, ENC_BIG_ENDIAN);
1316 for (i = 0; i < numrec; i++) {
1317 objlen = get_zoneobj_len(tvb, offset);
1318 zobj_tree = proto_tree_add_subtree_format(zobjlist_tree, tvb, offset+4, objlen,
1319 ett_fcswils_zoneobj, NULL, "Zone Object %d", i);
1320 dissect_swils_zone_obj(tvb, zobj_tree, offset);
1328 zonesetlen = tvb_get_ntohl(tvb, offset);
1329 proto_tree_add_item(mr_tree, hf_swils_zone_full_zone_set_length, tvb, offset, 4, ENC_BIG_ENDIAN);
1332 objlistlen = zonesetlen;
1333 /* Offset = start of the active zoneset zoning object list */
1335 numrec = tvb_get_ntohl(tvb, offset);
1337 zobjlist_tree = proto_tree_add_subtree(mr_tree, tvb, offset, objlistlen,
1338 ett_fcswils_zoneobjlist, NULL, "Full Zone Set");
1340 proto_tree_add_item(zobjlist_tree, hf_swils_zone_num_zoning_objects, tvb, offset, 4, ENC_BIG_ENDIAN);
1342 for (i = 0; i < numrec; i++) {
1343 objlen = get_zoneobj_len(tvb, offset);
1344 zobj_tree = proto_tree_add_subtree_format(zobjlist_tree, tvb, offset,
1345 objlen, ett_fcswils_zoneobj, NULL, "Zone Object %d", i);
1346 dissect_swils_zone_obj(tvb, zobj_tree, offset);
1352 proto_tree_add_item(mr_tree, hf_swils_zone_status, tvb,
1353 offset+5, 1, ENC_BIG_ENDIAN);
1354 proto_tree_add_item(mr_tree, hf_swils_zone_reason, tvb,
1355 offset+6, 1, ENC_BIG_ENDIAN);
1356 proto_tree_add_item(mr_tree, hf_swils_zone_vendor_unique, tvb, offset+7, 1, ENC_BIG_ENDIAN);
1362 dissect_swils_aca(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *aca_tree, guint8 isreq)
1364 /* Set up structures needed to add the protocol subtree and manage it */
1366 int numrec, plen, i;
1370 plen = tvb_get_ntohs(tvb, offset+2);
1371 proto_tree_add_item(aca_tree, hf_swils_domain_id_list_length, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1375 for (i = 0; i < numrec; i++) {
1376 proto_tree_add_uint_format(aca_tree, hf_swils_aca_domainid,
1378 tvb_get_guint8(tvb, offset+3),
1379 "Domain ID %d: %d", i,
1380 tvb_get_guint8(tvb, offset+3));
1385 proto_tree_add_item(aca_tree, hf_swils_zone_status, tvb,
1386 offset+5, 1, ENC_BIG_ENDIAN);
1387 proto_tree_add_item(aca_tree, hf_swils_zone_reason, tvb,
1388 offset+6, 1, ENC_BIG_ENDIAN);
1389 proto_tree_add_item(aca_tree, hf_swils_zone_vendor_unique, tvb, offset+7, 1, ENC_BIG_ENDIAN);
1395 dissect_swils_rca(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *rca_tree, guint8 isreq)
1397 /* Set up structures needed to add the protocol subtree and manage it */
1402 proto_tree_add_item(rca_tree, hf_swils_zone_status, tvb,
1403 offset+5, 1, ENC_BIG_ENDIAN);
1404 proto_tree_add_item(rca_tree, hf_swils_zone_reason, tvb,
1405 offset+6, 1, ENC_BIG_ENDIAN);
1406 proto_tree_add_item(rca_tree, hf_swils_zone_vendor_unique, tvb, offset+7, 1, ENC_BIG_ENDIAN);
1412 dissect_swils_sfc(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *sfc_tree, guint8 isreq)
1414 /* Set up structures needed to add the protocol subtree and manage it */
1416 proto_tree *zobjlist_tree, *zobj_tree;
1417 int numrec, i, zonesetlen, objlistlen, objlen;
1422 proto_tree_add_item(sfc_tree, hf_swils_sfc_opcode, tvb, offset+1, 1, ENC_BIG_ENDIAN);
1424 zonesetlen = tvb_get_ntohs(tvb, offset+2);
1425 proto_tree_add_item(sfc_tree, hf_swils_sfc_zoneset_length, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1428 str = zonenm_to_str(tvb, offset+4);
1429 proto_tree_add_string(sfc_tree, hf_swils_sfc_zonenm, tvb,
1430 offset+4, ZONENAME_LEN(tvb, offset+4),
1433 /* objlistlen gives the size of the active zoneset object list */
1434 objlistlen = zonesetlen - ZONENAME_LEN(tvb, offset+4);
1435 /* Offset = start of the active zoneset zoning object list */
1436 offset = offset + (4 + ZONENAME_LEN(tvb, offset+4));
1437 numrec = tvb_get_ntohl(tvb, offset);
1439 zobjlist_tree = proto_tree_add_subtree(sfc_tree, tvb, offset, objlistlen,
1440 ett_fcswils_zoneobjlist, NULL, "Zone Set");
1442 proto_tree_add_item(zobjlist_tree, hf_swils_zone_num_zoning_objects, tvb, offset, 4, ENC_BIG_ENDIAN);
1445 for (i = 0; i < numrec; i++) {
1446 objlen = get_zoneobj_len(tvb, offset);
1447 zobj_tree = proto_tree_add_subtree_format(zobjlist_tree, tvb, offset, objlen,
1448 ett_fcswils_zoneobj, NULL, "Zone Object %d", i);
1449 dissect_swils_zone_obj(tvb, zobj_tree, offset);
1457 zonesetlen = tvb_get_ntohl(tvb, offset);
1458 proto_tree_add_item(sfc_tree, hf_swils_zone_full_zone_set_length, tvb, offset, 4, ENC_BIG_ENDIAN);
1461 objlistlen = zonesetlen;
1462 /* Offset = start of the active zoneset zoning object list */
1464 numrec = tvb_get_ntohl(tvb, offset);
1466 zobjlist_tree = proto_tree_add_subtree(sfc_tree, tvb, offset, objlistlen,
1467 ett_fcswils_zoneobjlist, NULL, "Full Zone Set");
1469 proto_tree_add_item(zobjlist_tree, hf_swils_zone_num_zoning_objects, tvb, offset, 4, ENC_BIG_ENDIAN);
1471 for (i = 0; i < numrec; i++) {
1472 objlen = get_zoneobj_len(tvb, offset);
1473 zobj_tree = proto_tree_add_subtree_format(zobjlist_tree, tvb, offset, objlen,
1474 ett_fcswils_zoneobj, NULL, "Zone Object %d", i);
1475 dissect_swils_zone_obj(tvb, zobj_tree, offset);
1481 proto_tree_add_item(sfc_tree, hf_swils_zone_status, tvb,
1482 offset+5, 1, ENC_BIG_ENDIAN);
1483 proto_tree_add_item(sfc_tree, hf_swils_zone_reason, tvb,
1484 offset+6, 1, ENC_BIG_ENDIAN);
1485 proto_tree_add_item(sfc_tree, hf_swils_zone_vendor_unique, tvb, offset+7, 1, ENC_BIG_ENDIAN);
1491 dissect_swils_ufc(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *ufc_tree, guint8 isreq)
1493 /* Set up structures needed to add the protocol subtree and manage it */
1498 proto_tree_add_item(ufc_tree, hf_swils_zone_status, tvb,
1499 offset+5, 1, ENC_BIG_ENDIAN);
1500 proto_tree_add_item(ufc_tree, hf_swils_zone_reason, tvb,
1501 offset+6, 1, ENC_BIG_ENDIAN);
1502 proto_tree_add_item(ufc_tree, hf_swils_zone_vendor_unique, tvb, offset+7, 1, ENC_BIG_ENDIAN);
1508 dissect_swils_esc(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *esc_tree, guint8 isreq)
1510 /* Set up structures needed to add the protocol subtree and manage it */
1512 int i, numrec, plen;
1513 proto_tree *pdesc_tree;
1517 plen = tvb_get_ntohs(tvb, offset+2);
1518 proto_tree_add_item(esc_tree, hf_swils_esc_payload_length, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1519 proto_tree_add_item(esc_tree, hf_swils_esc_swvendorid, tvb,
1520 offset+4, 8, ENC_ASCII|ENC_NA);
1521 numrec = (plen - 12)/12;
1524 for (i = 0; i < numrec; i++) {
1525 pdesc_tree = proto_tree_add_subtree_format(esc_tree, tvb, offset, 12,
1526 ett_fcswils_esc_pdesc, NULL, "Protocol Descriptor %d", i);
1527 proto_tree_add_item(pdesc_tree, hf_swils_esc_pdesc_vendorid, tvb,
1528 offset, 8, ENC_ASCII|ENC_NA);
1529 proto_tree_add_item(pdesc_tree, hf_swils_esc_protocolid,
1530 tvb, offset+10, 2, ENC_BIG_ENDIAN);
1535 proto_tree_add_item(esc_tree, hf_swils_esc_swvendorid, tvb,
1536 offset+4, 8, ENC_ASCII|ENC_NA);
1537 pdesc_tree = proto_tree_add_subtree(esc_tree, tvb, offset+12, 12,
1538 ett_fcswils_esc_pdesc, NULL, "Accepted Protocol Descriptor");
1540 proto_tree_add_item(pdesc_tree, hf_swils_esc_pdesc_vendorid, tvb,
1541 offset+12, 8, ENC_ASCII|ENC_NA);
1542 proto_tree_add_item(pdesc_tree, hf_swils_esc_protocolid,
1543 tvb, offset+22, 2, ENC_BIG_ENDIAN);
1549 dissect_swils_drlir(tvbuff_t *tvb _U_, packet_info* pinfo _U_, proto_tree *drlir_tree _U_,
1552 /* Set up structures needed to add the protocol subtree and manage it */
1557 dissect_swils_swrjt(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *swrjt_tree, guint8 isreq _U_)
1559 /* Set up structures needed to add the protocol subtree and manage it */
1563 proto_tree_add_item(swrjt_tree, hf_swils_rjt, tvb, offset+5, 1, ENC_BIG_ENDIAN);
1564 proto_tree_add_item(swrjt_tree, hf_swils_rjtdet, tvb, offset+6, 1, ENC_BIG_ENDIAN);
1565 proto_tree_add_item(swrjt_tree, hf_swils_rjtvendor, tvb, offset+7,
1571 dissect_swils_ess(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *ess_tree, guint8 isreq _U_)
1574 gint16 numcapobj = 0;
1577 proto_tree *ieinfo_tree;
1583 proto_tree_add_item(ess_tree, hf_swils_ess_rev, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1584 proto_tree_add_item(ess_tree, hf_swils_ess_len, tvb, offset+8, 4, ENC_BIG_ENDIAN);
1585 len = tvb_get_ntohl(tvb, offset+8);
1587 ieinfo_tree = proto_tree_add_subtree(ess_tree, tvb, offset+12,
1588 MAX_INTERCONNECT_ELEMENT_INFO_LEN+4,
1589 ett_fcswils_ieinfo, NULL, "Interconnect Element Info");
1590 dissect_swils_interconnect_element_info(tvb, ieinfo_tree, offset+12);
1591 len -= 256; /* the interconnect obj above is 256 bytes */
1594 proto_tree_add_item(ess_tree, hf_swils_ess_numobj, tvb, offset, 2, ENC_BIG_ENDIAN);
1595 numcapobj = tvb_get_ntohs(tvb, offset);
1597 len -= 4; /* 2B numcapobj + 2B rsvd */
1600 while ((len > 0) && (numcapobj > 0)) {
1601 capobjlen = dissect_swils_ess_capability_obj(tvb, ess_tree, offset);
1604 offset += capobjlen;
1609 dissect_swils_mrra(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, guint8 isreq)
1619 proto_tree_add_item(tree, hf_swils_mrra_rev, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1620 proto_tree_add_item(tree, hf_swils_mrra_size, tvb, offset+8, 4, ENC_BIG_ENDIAN);
1621 proto_tree_add_item(tree, hf_swils_mrra_vendorid, tvb, offset+12, 8, ENC_ASCII|ENC_NA);
1622 proto_tree_add_item(tree, hf_swils_mrra_vendorinfo, tvb, offset+20,
1625 proto_tree_add_item(tree, hf_swils_mrra_vendorid, tvb, offset+4,
1626 8, ENC_ASCII|ENC_NA);
1627 proto_tree_add_item(tree, hf_swils_mrra_reply, tvb, offset+12,
1629 proto_tree_add_item(tree, hf_swils_mrra_reply_size, tvb, offset+16,
1631 proto_tree_add_item(tree, hf_swils_mrra_waittime, tvb, offset+20,
1638 static fcswils_func_table_t fcswils_func_table[FC_SWILS_MAXCODE] = {
1640 /* 0x01 */ {dissect_swils_swrjt},
1655 /* 0x10 */ {dissect_swils_elp},
1656 /* 0x11 */ {dissect_swils_efp},
1657 /* 0x12 */ {dissect_swils_dia},
1658 /* 0x13 */ {dissect_swils_rdi},
1659 /* 0x14 */ {dissect_swils_hello},
1660 /* 0x15 */ {dissect_swils_lsupdate},
1661 /* 0x16 */ {dissect_swils_lsack},
1662 /* 0x17 */ {dissect_swils_nullpayload},
1663 /* 0x18 */ {dissect_swils_nullpayload},
1666 /* 0x1b */ {dissect_swils_rscn},
1669 /* 0x1e */ {dissect_swils_drlir},
1671 /* 0x20 */ {NULL /*dissect_swils_dscn*/},
1672 /* 0x21 */ {NULL /*dissect_swils_loopd*/},
1673 /* 0x22 */ {dissect_swils_mergereq},
1674 /* 0x23 */ {dissect_swils_aca},
1675 /* 0x24 */ {dissect_swils_rca},
1676 /* 0x25 */ {dissect_swils_sfc},
1677 /* 0x26 */ {dissect_swils_ufc},
1687 /* 0x30 */ {dissect_swils_esc},
1688 /* 0x31 */ {dissect_swils_ess},
1691 /* 0x34 */ {dissect_swils_mrra}
1694 /* Code to actually dissect the packets */
1696 dissect_fcswils(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
1698 proto_item *ti = NULL;
1700 guint8 failed_opcode = 0;
1702 conversation_t *conversation;
1703 fcswils_conv_data_t *cdata;
1704 fcswils_conv_key_t ckey, *req_key;
1705 proto_tree *swils_tree = NULL;
1706 guint8 isreq = FC_SWILS_REQ;
1710 /* Reject the packet if data is NULL */
1713 fchdr = (fc_hdr *)data;
1715 /* Make entries in Protocol column and Info column on summary display */
1716 col_set_str(pinfo->cinfo, COL_PROTOCOL, "SW_ILS");
1718 /* decoding of this is done by each individual opcode handler */
1719 opcode = tvb_get_guint8(tvb, 0);
1721 ti = proto_tree_add_protocol_format(tree, proto_fcswils, tvb, 0, -1, "SW_ILS");
1722 swils_tree = proto_item_add_subtree(ti, ett_fcswils);
1724 /* Register conversation if this is not a response */
1725 if ((opcode != FC_SWILS_SWACC) && (opcode != FC_SWILS_SWRJT)) {
1726 conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
1727 pinfo->ptype, fchdr->oxid,
1728 fchdr->rxid, NO_PORT2);
1729 if (!conversation) {
1730 conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst,
1731 pinfo->ptype, fchdr->oxid,
1732 fchdr->rxid, NO_PORT2);
1735 ckey.conv_idx = conversation->index;
1737 cdata = (fcswils_conv_data_t *)g_hash_table_lookup(fcswils_req_hash,
1740 /* Since we never free the memory used by an exchange, this maybe a
1741 * case of another request using the same exchange as a previous
1744 cdata->opcode = opcode;
1747 req_key = wmem_new(wmem_file_scope(), fcswils_conv_key_t);
1748 req_key->conv_idx = conversation->index;
1750 cdata = wmem_new(wmem_file_scope(), fcswils_conv_data_t);
1751 cdata->opcode = opcode;
1753 g_hash_table_insert(fcswils_req_hash, req_key, cdata);
1757 /* Opcode is ACC or RJT */
1758 conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
1759 pinfo->ptype, fchdr->oxid,
1760 fchdr->rxid, NO_PORT2);
1761 isreq = FC_SWILS_RPLY;
1762 if (!conversation) {
1763 if (tree && (opcode == FC_SWILS_SWACC)) {
1764 /* No record of what this accept is for. Can't decode */
1765 proto_tree_add_expert_format(swils_tree, pinfo, &ei_swils_no_exchange, tvb, 0, -1, "No record of Exchg. Unable to decode SW_ACC");
1770 ckey.conv_idx = conversation->index;
1772 cdata = (fcswils_conv_data_t *)g_hash_table_lookup(fcswils_req_hash, &ckey);
1774 if (cdata != NULL) {
1775 if (opcode == FC_SWILS_SWACC)
1776 opcode = cdata->opcode;
1778 failed_opcode = cdata->opcode;
1782 if ((cdata == NULL) && (opcode != FC_SWILS_SWRJT)) {
1783 /* No record of what this accept is for. Can't decode */
1784 proto_tree_add_expert_format(swils_tree, pinfo, &ei_swils_no_exchange, tvb, 0, -1, "No record of SW_ILS Req. Unable to decode SW_ACC");
1791 if (isreq == FC_SWILS_REQ) {
1792 col_add_str(pinfo->cinfo, COL_INFO,
1793 val_to_str(opcode, fc_swils_opcode_key_val, "0x%x"));
1795 else if (opcode == FC_SWILS_SWRJT) {
1796 col_add_fstr(pinfo->cinfo, COL_INFO, "SW_RJT (%s)",
1797 val_to_str(failed_opcode, fc_swils_opcode_key_val, "0x%x"));
1800 col_add_fstr(pinfo->cinfo, COL_INFO, "SW_ACC (%s)",
1801 val_to_str(opcode, fc_swils_opcode_key_val, "0x%x"));
1804 proto_tree_add_item(swils_tree, hf_swils_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1806 if ((opcode < FC_SWILS_MAXCODE) && fcswils_func_table[opcode].func) {
1807 fcswils_func_table[opcode].func(tvb, pinfo, swils_tree, isreq);
1808 } else if (opcode == FC_SWILS_AUTH_ILS) {
1809 /* This is treated differently */
1810 if (isreq && fcsp_handle)
1811 call_dissector(fcsp_handle, tvb, pinfo, swils_tree);
1813 /* data dissector */
1814 next_tvb = tvb_new_subset_remaining(tvb, offset+4);
1815 call_dissector(data_handle, next_tvb, pinfo, tree);
1818 return tvb_length(tvb);
1821 /* Register the protocol with Wireshark */
1824 proto_register_fcswils(void)
1826 static hf_register_info hf[] = {
1828 {"Cmd Code", "swils.opcode",
1829 FT_UINT8, BASE_HEX, VALS(fc_swils_opcode_key_val), 0x0,
1832 { &hf_swils_elp_rev,
1833 {"Revision", "swils.elp.rev",
1834 FT_UINT8, BASE_DEC, NULL, 0x0,
1837 { &hf_swils_elp_flags,
1838 {"Flag", "swils.elp.flag",
1839 FT_BYTES, BASE_NONE, NULL, 0x0,
1842 { &hf_swils_elp_r_a_tov,
1843 {"R_A_TOV", "swils.elp.ratov",
1844 FT_UINT32, BASE_DEC, NULL, 0x0,
1847 { &hf_swils_elp_e_d_tov,
1848 {"E_D_TOV", "swils.elp.edtov",
1849 FT_UINT32, BASE_DEC, NULL, 0x0,
1852 { &hf_swils_elp_req_epn,
1853 {"Req Eport Name", "swils.elp.reqepn",
1854 FT_FCWWN, BASE_NONE, NULL, 0x0,
1857 { &hf_swils_elp_req_esn,
1858 {"Req Switch Name", "swils.elp.reqesn",
1859 FT_FCWWN, BASE_NONE, NULL, 0x0,
1862 { &hf_swils_elp_clsf_svcp,
1863 {"Class F Svc Parameters", "swils.elp.clsfp",
1864 FT_BYTES, BASE_NONE, NULL, 0x0,
1867 { &hf_swils_elp_clsf_rcvsz,
1868 {"Max Class F Frame Size", "swils.elp.clsfrsz",
1869 FT_UINT16, BASE_DEC, NULL, 0x0,
1872 { &hf_swils_elp_clsf_conseq,
1873 {"Class F Max Concurrent Seq", "swils.elp.clsfcs",
1874 FT_UINT16, BASE_DEC, NULL, 0x0,
1877 { &hf_swils_elp_clsf_e2e,
1878 {"Class F E2E Credit", "swils.elp.cfe2e",
1879 FT_UINT16, BASE_DEC, NULL, 0x0,
1882 { &hf_swils_elp_clsf_openseq,
1883 {"Class F Max Open Seq", "swils.elp.oseq",
1884 FT_UINT16, BASE_DEC, NULL, 0x0,
1887 { &hf_swils_elp_cls1_svcp,
1888 {"Class 1 Svc Parameters", "swils.elp.cls1p",
1889 FT_BYTES, BASE_NONE, NULL, 0x0,
1892 { &hf_swils_elp_cls1_rcvsz,
1893 {"Class 1 Frame Size", "swils.elp.cls1rsz",
1894 FT_UINT16, BASE_DEC, NULL, 0x0,
1897 { &hf_swils_elp_cls2_svcp,
1898 {"Class 2 Svc Parameters", "swils.elp.cls2p",
1899 FT_BYTES, BASE_NONE, NULL, 0x0,
1902 { &hf_swils_elp_cls2_rcvsz,
1903 {"Class 2 Frame Size", "swils.elp.cls2rsz",
1904 FT_UINT16, BASE_DEC, NULL, 0x0,
1907 { &hf_swils_elp_cls3_svcp,
1908 {"Class 3 Svc Parameters", "swils.elp.cls3p",
1909 FT_BYTES, BASE_NONE, NULL, 0x0,
1912 { &hf_swils_elp_cls3_rcvsz,
1913 {"Class 3 Frame Size", "swils.elp.cls3rsz",
1914 FT_UINT16, BASE_DEC, NULL, 0x0,
1917 { &hf_swils_elp_isl_fc_mode,
1918 {"ISL Flow Ctrl Mode", "swils.elp.fcmode",
1919 FT_STRING, BASE_NONE, NULL, 0x0,
1922 { &hf_swils_elp_fcplen,
1923 {"Flow Ctrl Param Len", "swils.elp.fcplen",
1924 FT_UINT16, BASE_DEC, NULL, 0x0,
1927 { &hf_swils_elp_b2bcredit,
1928 {"B2B Credit", "swils.elp.b2b",
1929 FT_UINT32, BASE_DEC, NULL, 0x0,
1932 { &hf_swils_elp_compat1,
1933 {"Compatibility Param 1", "swils.elp.compat1",
1934 FT_UINT32, BASE_DEC, NULL, 0x0,
1937 { &hf_swils_elp_compat2,
1938 {"Compatibility Param 2", "swils.elp.compat2",
1939 FT_UINT32, BASE_DEC, NULL, 0x0,
1942 { &hf_swils_elp_compat3,
1943 {"Compatibility Param 3", "swils.elp.compat3",
1944 FT_UINT32, BASE_DEC, NULL, 0x0,
1947 { &hf_swils_elp_compat4,
1948 {"Compatibility Param 4", "swils.elp.compat4",
1949 FT_UINT32, BASE_DEC, NULL, 0x0,
1952 { &hf_swils_efp_rec_type,
1953 {"Record Type", "swils.efp.rectype",
1954 FT_UINT8, BASE_HEX, VALS(fcswils_rectype_val), 0x0,
1957 { &hf_swils_efp_dom_id,
1958 {"Domain ID", "swils.efp.domid",
1959 FT_UINT8, BASE_HEX, NULL, 0x0,
1962 { &hf_swils_efp_switch_name,
1963 {"Switch Name", "swils.efp.sname",
1964 FT_FCWWN, BASE_NONE, NULL, 0x0,
1967 { &hf_swils_efp_mcast_grpno,
1968 {"Mcast Grp#", "swils.efp.mcastno",
1969 FT_UINT8, BASE_HEX, NULL, 0x0,
1973 { &hf_swils_efp_alias_token,
1974 {"Alias Token", "swils.efp.aliastok",
1975 FT_BYTES, BASE_NONE, NULL, 0x0,
1979 { &hf_swils_efp_record_len,
1980 {"Record Len", "swils.efp.recordlen",
1981 FT_UINT8, BASE_DEC, NULL, 0x0,
1984 { &hf_swils_efp_payload_len,
1985 {"Payload Len", "swils.efp.payloadlen",
1986 FT_UINT16, BASE_DEC, NULL, 0x0,
1989 { &hf_swils_efp_pswitch_pri,
1990 {"Principal Switch Priority", "swils.efp.psprio",
1991 FT_UINT8, BASE_DEC, NULL, 0x0,
1994 { &hf_swils_efp_pswitch_name,
1995 {"Principal Switch Name", "swils.efp.psname",
1996 FT_FCWWN, BASE_NONE, NULL, 0x0,
1999 { &hf_swils_dia_switch_name,
2000 {"Switch Name", "swils.dia.sname",
2001 FT_FCWWN, BASE_NONE, NULL, 0x0,
2004 { &hf_swils_rdi_payload_len,
2005 {"Payload Len", "swils.rdi.len",
2006 FT_UINT16, BASE_DEC, NULL, 0x0,
2009 { &hf_swils_rdi_req_sname,
2010 {"Req Switch Name", "swils.rdi.reqsn",
2011 FT_FCWWN, BASE_NONE, NULL, 0x0,
2015 { &hf_swils_fspfh_cmd,
2016 {"Command:", "swils.fspf.cmd",
2017 FT_UINT8, BASE_HEX, NULL, 0x0,
2021 { &hf_swils_fspfh_rev,
2022 {"Version", "swils.fspf.ver",
2023 FT_UINT8, BASE_HEX, NULL, 0x0,
2026 { &hf_swils_fspfh_ar_num,
2027 {"AR Number", "swils.fspf.arnum",
2028 FT_UINT8, BASE_HEX, NULL, 0x0,
2031 { &hf_swils_fspfh_auth_type,
2032 {"Authentication Type", "swils.fspf.authtype",
2033 FT_UINT8, BASE_HEX, NULL, 0x0,
2036 { &hf_swils_fspfh_dom_id,
2037 {"Originating Domain ID", "swils.fspf.origdomid",
2038 FT_UINT8, BASE_DEC, NULL, 0x0,
2041 { &hf_swils_fspfh_auth,
2042 {"Authentication", "swils.fspf.auth",
2043 FT_BYTES, BASE_NONE, NULL, 0x0,
2046 { &hf_swils_hlo_options,
2047 {"Options", "swils.hlo.options",
2048 FT_BYTES, BASE_NONE, NULL, 0x0,
2051 { &hf_swils_hlo_hloint,
2052 {"Hello Interval (secs)", "swils.hlo.hloint",
2053 FT_UINT32, BASE_DEC, NULL, 0x0,
2056 { &hf_swils_hlo_deadint,
2057 {"Dead Interval (secs)", "swils.hlo.deadint",
2058 FT_UINT32, BASE_DEC, NULL, 0x0,
2061 { &hf_swils_hlo_rcv_domid,
2062 {"Recipient Domain ID", "swils.hlo.rcvdomid",
2063 FT_UINT8, BASE_DEC, NULL, 0x0,
2066 { &hf_swils_hlo_orig_pidx,
2067 {"Originating Port Idx", "swils.hlo.origpidx",
2068 FT_UINT24, BASE_HEX, NULL, 0x0,
2071 { &hf_swils_lsrh_lsr_type,
2072 {"LSR Type", "swils.lsr.type",
2073 FT_UINT8, BASE_HEX, VALS(fc_swils_fspf_linkrec_val), 0x0,
2076 { &hf_swils_lsrh_lsid,
2077 {"Link State Id", "swils.ls.id",
2078 FT_UINT8, BASE_DEC, NULL, 0x0,
2081 { &hf_swils_lsrh_adv_domid,
2082 {"Advertising Domain Id", "swils.lsr.advdomid",
2083 FT_UINT8, BASE_DEC, NULL, 0x0,
2086 { &hf_swils_lsrh_ls_incid,
2087 {"LS Incarnation Number", "swils.lsr.incid",
2088 FT_UINT32, BASE_DEC, NULL, 0x0,
2091 { &hf_swils_ldrec_linkid,
2092 {"Link ID", "swils.ldr.linkid",
2093 FT_STRING, BASE_NONE, NULL, 0x0,
2096 { &hf_swils_ldrec_out_pidx,
2097 {"Output Port Idx", "swils.ldr.out_portidx",
2098 FT_UINT24, BASE_HEX, NULL, 0x0,
2101 { &hf_swils_ldrec_nbr_pidx,
2102 {"Neighbor Port Idx", "swils.ldr.nbr_portidx",
2103 FT_UINT24, BASE_HEX, NULL, 0x0,
2106 { &hf_swils_ldrec_link_type,
2107 {"Link Type", "swils.ldr.linktype",
2108 FT_UINT8, BASE_HEX, VALS(fc_swils_link_type_val), 0x0,
2111 { &hf_swils_ldrec_link_cost,
2112 {"Link Cost", "swils.ldr.linkcost",
2113 FT_UINT16, BASE_DEC, NULL, 0x0,
2116 { &hf_swils_rscn_evtype,
2117 {"Event Type", "swils.rscn.evtype",
2118 FT_UINT8, BASE_DEC, VALS(fc_swils_rscn_portstate_val), 0xF0,
2121 { &hf_swils_rscn_addrfmt,
2122 {"Address Format", "swils.rscn.addrfmt",
2123 FT_UINT8, BASE_DEC, VALS(fc_swils_rscn_addrfmt_val), 0x0F,
2126 { &hf_swils_rscn_affectedport,
2127 {"Affected Port ID", "swils.rscn.affectedport",
2128 FT_STRING, BASE_NONE, NULL, 0x0,
2131 { &hf_swils_rscn_detectfn,
2132 {"Detection Function", "swils.rscn.detectfn",
2133 FT_UINT32, BASE_HEX, VALS(fc_swils_rscn_detectfn_val), 0x0,
2136 { &hf_swils_rscn_portstate,
2137 {"Port State", "swils.rscn.portstate",
2138 FT_UINT8, BASE_HEX, NULL, 0x0,
2141 { &hf_swils_rscn_portid,
2142 {"Port Id", "swils.rscn.portid",
2143 FT_STRING, BASE_NONE, NULL, 0x0,
2146 { &hf_swils_rscn_pwwn,
2147 {"Port WWN", "swils.rscn.pwwn",
2148 FT_FCWWN, BASE_NONE, NULL, 0x0,
2151 { &hf_swils_rscn_nwwn,
2152 {"Node WWN", "swils.rscn.nwwn",
2153 FT_FCWWN, BASE_NONE, NULL, 0x0,
2156 { &hf_swils_esc_swvendorid,
2157 {"Switch Vendor ID", "swils.esc.swvendor",
2158 FT_STRING, BASE_NONE, NULL, 0x0,
2161 { &hf_swils_esc_pdesc_vendorid,
2162 {"Vendor ID", "swils.esc.vendorid",
2163 FT_STRING, BASE_NONE, NULL, 0x0,
2166 { &hf_swils_esc_protocolid,
2167 {"Protocol ID", "swils.esc.protocol",
2168 FT_UINT16, BASE_HEX, VALS(fc_swils_esc_protocol_val), 0x0,
2171 { &hf_swils_zone_activezonenm,
2172 {"Active Zoneset Name", "swils.mr.activezonesetname",
2173 FT_STRING, BASE_NONE, NULL, 0x0,
2176 { &hf_swils_zone_objname,
2177 {"Zone Object Name", "swils.zone.zoneobjname",
2178 FT_STRING, BASE_NONE, NULL, 0x0,
2181 { &hf_swils_zone_objtype,
2182 {"Zone Object Type", "swils.zone.zoneobjtype",
2183 FT_UINT8, BASE_HEX, VALS(fc_swils_zoneobj_type_val), 0x0,
2186 { &hf_swils_zone_mbrtype,
2187 {"Zone Member Type", "swils.zone.mbrtype",
2188 FT_UINT8, BASE_HEX, VALS(fc_swils_zonembr_type_val), 0x0,
2191 { &hf_swils_zone_protocol,
2192 {"Zone Protocol", "swils.zone.protocol",
2193 FT_UINT8, BASE_HEX, NULL, 0x0,
2196 { &hf_swils_zone_mbrid,
2197 {"Member Identifier", "swils.zone.mbrid",
2198 FT_STRING, BASE_NONE, NULL, 0x0,
2201 { &hf_swils_zone_status,
2202 {"Zone Command Status", "swils.zone.status",
2203 FT_UINT8, BASE_HEX, VALS(fc_swils_mr_rsp_val), 0x0,
2204 "Applies to MR, ACA, RCA, SFC, UFC", HFILL}},
2206 { &hf_swils_zone_reason,
2207 {"Zone Command Reason Code", "swils.zone.reason",
2208 FT_UINT8, BASE_HEX, VALS(fc_swils_mr_reason_val), 0x0,
2209 "Applies to MR, ACA, RCA, SFC, UFC", HFILL}},
2211 { &hf_swils_aca_domainid,
2212 {"Known Domain ID", "swils.aca.domainid",
2213 FT_UINT8, BASE_HEX, NULL, 0x0,
2216 { &hf_swils_sfc_opcode,
2217 {"Operation Request", "swils.sfc.opcode",
2218 FT_UINT8, BASE_HEX, VALS(fc_swils_sfc_op_val), 0x0,
2221 { &hf_swils_sfc_zonenm,
2222 {"Zone Set Name", "swils.sfc.zonename",
2223 FT_STRING, BASE_NONE, NULL, 0x0,
2227 {"Reason Code", "swils.rjt.reason",
2228 FT_UINT8, BASE_HEX, VALS(fc_swils_rjt_val), 0x0,
2232 {"Reason Code Explanantion", "swils.rjt.reasonexpl",
2233 FT_UINT8, BASE_HEX, VALS(fc_swils_deterr_val), 0x0,
2236 { &hf_swils_rjtvendor,
2237 {"Vendor Unique Error Code", "swils.rjt.vendor",
2238 FT_UINT8, BASE_HEX, NULL, 0x0,
2241 { &hf_swils_zone_mbrid_lun,
2242 {"LUN", "swils.zone.lun",
2243 FT_BYTES, BASE_NONE, NULL, 0x0,
2246 { &hf_swils_ess_rev,
2247 {"Revision", "swils.ess.revision",
2248 FT_UINT32, BASE_DEC, NULL, 0x0,
2251 { &hf_swils_ess_len,
2252 {"Payload Length", "swils.ess.leb",
2253 FT_UINT32, BASE_DEC, NULL, 0x0,
2256 { &hf_swils_ess_numobj,
2257 {"Number of Capability Objects", "swils.ess.numobj",
2258 FT_UINT16, BASE_DEC, NULL, 0x0,
2261 { &hf_swils_interconnect_list_len,
2262 {"List Length", "swils.ess.listlen",
2263 FT_UINT8, BASE_DEC, NULL, 0x0,
2266 { &hf_swils_ess_vendorname,
2267 {"Vendor Name", "swils.ess.vendorname",
2268 FT_STRING, BASE_NONE, NULL, 0x0,
2271 { &hf_swils_ess_modelname,
2272 {"Model Name", "swils.ess.modelname",
2273 FT_STRING, BASE_NONE, NULL, 0x0,
2276 { &hf_swils_ess_relcode,
2277 {"Release Code", "swils.ess.relcode",
2278 FT_STRING, BASE_NONE, NULL, 0x0,
2281 { &hf_swils_ess_vendorspecific,
2282 {"Vendor Specific", "swils.ess.vendorspecific",
2283 FT_STRING, BASE_NONE, NULL, 0x0,
2286 { &hf_swils_ess_cap_type,
2287 {"Type", "swils.ess.capability.type",
2288 FT_UINT8, BASE_DEC, VALS(fc_ct_gstype_vals), 0x0,
2291 { &hf_swils_ess_cap_subtype,
2292 {"Subtype", "swils.ess.capability.subtype",
2293 FT_UINT8, BASE_DEC, NULL, 0x0,
2296 { &hf_swils_ess_cap_numentries,
2297 {"Number of Entries", "swils.ess.capability.numentries",
2298 FT_UINT8, BASE_DEC, NULL, 0x0,
2301 { &hf_swils_ess_cap_svc,
2302 {"Service Name", "swils.ess.capability.service",
2303 FT_UINT8, BASE_DEC, VALS(fc_ct_gsserver_vals), 0x0,
2306 { &hf_swils_ess_dns_obj0h,
2307 {"Name Server Entry Object 00h Support", "swils.ess.capability.dns.obj0h",
2308 FT_BOOLEAN, 8, NULL, 0x1,
2311 { &hf_swils_ess_dns_obj1h,
2312 {"Name Server Entry Object 01h Support", "swils.ess.capability.dns.obj1h",
2313 FT_BOOLEAN, 8, NULL, 0x2,
2316 { &hf_swils_ess_dns_obj2h,
2317 {"Name Server Entry Object 02h Support", "swils.ess.capability.dns.obj2h",
2318 FT_BOOLEAN, 8, NULL, 0x4,
2321 { &hf_swils_ess_dns_obj3h,
2322 {"Name Server Entry Object 03h Support", "swils.ess.capability.dns.obj3h",
2323 FT_BOOLEAN, 8, NULL, 0x8,
2326 { &hf_swils_ess_dns_zlacc,
2327 {"GE_PT Zero Length Accepted", "swils.ess.capability.dns.zlacc",
2328 FT_BOOLEAN, 8, NULL, 0x10,
2331 { &hf_swils_ess_dns_vendor,
2332 {"Vendor Specific Flags", "swils.ess.capability.dns.vendor",
2333 FT_UINT32, BASE_HEX, NULL, 0x0,
2336 { &hf_swils_ess_fctlr_rscn,
2337 {"SW_RSCN Supported", "swils.ess.capability.fctlr.rscn",
2338 FT_BOOLEAN, 8, NULL, 0x1,
2341 { &hf_swils_ess_fctlr_vendor,
2342 {"Vendor Specific Flags", "swils.ess.capability.fctlr.vendor",
2343 FT_UINT32, BASE_HEX, NULL, 0x0,
2346 { &hf_swils_ess_fcs_basic,
2347 {"Basic Configuration Services", "swils.ess.capability.fcs.basic",
2348 FT_BOOLEAN, 8, NULL, 0x1,
2351 { &hf_swils_ess_fcs_platform,
2352 {"Platform Configuration Services", "swils.ess.capability.fcs.platform",
2353 FT_BOOLEAN, 8, NULL, 0x2,
2356 { &hf_swils_ess_fcs_topology,
2357 {"Topology Discovery Services", "swils.ess.capability.fcs.topology",
2358 FT_BOOLEAN, 8, NULL, 0x4,
2361 { &hf_swils_ess_fcs_enhanced,
2362 {"Enhanced Configuration Services", "swils.ess.capability.fcs.enhanced",
2363 FT_BOOLEAN, 8, NULL, 0x8,
2366 { &hf_swils_ess_fzs_enh_supp,
2367 {"Enhanced Zoning Supported", "swils.ess.capability.fzs.ezonesupp",
2368 FT_BOOLEAN, 8, NULL, 0x1,
2371 { &hf_swils_ess_fzs_enh_ena,
2372 {"Enhanced Zoning Enabled", "swils.ess.capability.fzs.ezoneena",
2373 FT_BOOLEAN, 8, NULL, 0x2,
2376 { &hf_swils_ess_fzs_mr,
2377 {"Merge Control Setting", "swils.ess.capability.fzs.mr",
2378 FT_BOOLEAN, 8, NULL, 0x4,
2381 { &hf_swils_ess_fzs_defzone,
2382 {"Default Zone Setting", "swils.ess.capability.fzs.defzone",
2383 FT_BOOLEAN, 8, NULL, 0x8,
2386 { &hf_swils_ess_fzs_zsdb_supp,
2387 {"Zoneset Database Supported", "swils.ess.capability.fzs.zsdbsupp",
2388 FT_BOOLEAN, 8, NULL, 0x10,
2391 { &hf_swils_ess_fzs_zsdb_ena,
2392 {"Zoneset Database Enabled", "swils.ess.capability.fzs.zsdbena",
2393 FT_BOOLEAN, 8, NULL, 0x20,
2396 { &hf_swils_ess_fzs_adc_supp,
2397 {"Active Direct Command Supported", "swils.ess.capability.fzs.adcsupp",
2398 FT_BOOLEAN, 8, NULL, 0x40,
2401 { &hf_swils_ess_fzs_hardzone,
2402 {"Hard Zoning Supported", "swils.ess.capability.fzs.hardzone",
2403 FT_BOOLEAN, 8, NULL, 0x80,
2406 { &hf_swils_ess_cap_len,
2407 {"Length", "swils.ess.capability.length",
2408 FT_UINT8, BASE_DEC, NULL, 0x0,
2411 { &hf_swils_ess_cap_t10,
2412 {"T10 Vendor ID", "swils.ess.capability.t10id",
2413 FT_STRING, BASE_NONE, NULL, 0x0,
2416 { &hf_swils_ess_cap_vendorobj,
2417 {"Vendor-Specific Info", "swils.ess.capability.vendorobj",
2418 FT_BYTES, BASE_NONE, NULL, 0x0,
2421 { &hf_swils_mrra_rev,
2422 {"Revision", "swils.mrra.revision",
2423 FT_UINT32, BASE_DEC, NULL, 0x0,
2426 { &hf_swils_mrra_size,
2427 {"Merge Request Size", "swils.mrra.size",
2428 FT_UINT32, BASE_DEC, NULL, 0x0,
2431 { &hf_swils_mrra_vendorid,
2432 {"Vendor ID", "swils.mrra.vendorid",
2433 FT_STRING, BASE_NONE, NULL, 0x0,
2436 { &hf_swils_mrra_vendorinfo,
2437 {"Vendor-Specific Info", "swils.mrra.vendorinfo",
2438 FT_BYTES, BASE_NONE, NULL, 0x0,
2441 { &hf_swils_mrra_reply,
2442 {"MRRA Response", "swils.mrra.reply",
2443 FT_UINT32, BASE_DEC, NULL, 0x0,
2446 { &hf_swils_mrra_reply_size,
2447 {"Maximum Resources Available", "swils.mrra.replysize",
2448 FT_UINT32, BASE_DEC, NULL, 0x0,
2451 { &hf_swils_mrra_waittime,
2452 {"Waiting Period (secs)", "swils.mrra.waittime",
2453 FT_UINT32, BASE_DEC, NULL, 0x0,
2456 /* Generated from convert_proto_tree_add_text.pl */
2457 { &hf_swils_requested_domain_id, { "Requested Domain ID", "swils.requested_domain_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2458 { &hf_swils_granted_domain_id, { "Granted Domain ID", "swils.granted_domain_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2459 { &hf_swils_lsrh_lsr_age, { "LSR Age", "swils.lsr.age", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2460 { &hf_swils_lsrh_options, { "Options", "swils.lsr.options", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2461 { &hf_swils_lsrh_checksum, { "Checksum", "swils.lsr.checksum", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2462 { &hf_swils_lsrh_lsr_length, { "LSR Length", "swils.lsr.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2463 { &hf_swils_lsrec_number_of_links, { "Number of Links", "swils.lsr.number_of_links", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2464 { &hf_swils_lsupdate_flags, { "Flags", "swils.lsupdate.flags", FT_UINT8, BASE_HEX, VALS(fc_swils_fspf_lsrflags_val), 0x0, NULL, HFILL }},
2465 { &hf_swils_lsupdate_num_of_lsrs, { "Num of LSRs", "swils.lsupdate.num_of_lsrs", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2466 { &hf_swils_lsack_flags, { "Flags", "swils.lsack.flags", FT_UINT8, BASE_HEX, VALS(fc_swils_fspf_lsrflags_val), 0x0, NULL, HFILL }},
2467 { &hf_swils_lsack_num_of_lsr_headers, { "Num of LSR Headers", "swils.lsack.num_of_lsr_headers", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2468 { &hf_swils_rscn_num_entries, { "Num Entries", "swils.rscn.num_entries", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2469 { &hf_swils_zone_mbrflags, { "Flags", "swils.zone.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2470 { &hf_swils_zone_mbr_identifier_length, { "Identifier Length", "swils.zone.identifier_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2471 { &hf_swils_zone_num_members, { "4", "swils.zone.num_members", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2472 { &hf_swils_zone_active_zoneset_length, { "Active ZoneSet Length", "swils.zone.active_zoneset_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2473 { &hf_swils_zone_num_zoning_objects, { "Number of zoning objects", "swils.zone.num_zoning_objects", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2474 { &hf_swils_zone_full_zone_set_length, { "Full Zone Set Length", "swils.zone.full_zone_set_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2475 { &hf_swils_zone_vendor_unique, { "Vendor Unique", "swils.zone.vendor_unique", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2476 { &hf_swils_domain_id_list_length, { "Domain ID List Length", "swils.aca.domain_id_list_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2477 { &hf_swils_sfc_zoneset_length, { "ZoneSet Length", "swils.sfc.zoneset_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2478 { &hf_swils_esc_payload_length, { "Payload Length", "swils.esc.payload_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2481 static gint *ett[] = {
2487 &ett_fcswils_efplist,
2490 &ett_fcswils_fspfhdr,
2493 &ett_fcswils_lsrechdr,
2500 &ett_fcswils_rscn_dev,
2503 &ett_fcswils_zoneobjlist,
2504 &ett_fcswils_zoneobj,
2505 &ett_fcswils_zonembr,
2511 &ett_fcswils_esc_pdesc,
2512 &ett_fcswils_ieinfo,
2513 &ett_fcswils_capinfo
2516 static ei_register_info ei[] = {
2517 { &ei_swils_efp_record_len, { "swils.efp.recordlen.zero", PI_UNDECODED, PI_NOTE, "Record length is zero", EXPFILL }},
2518 { &ei_swils_no_exchange, { "swils.no_exchange", PI_UNDECODED, PI_WARN, "No record of Exchg. Unable to decode", EXPFILL }},
2521 expert_module_t* expert_fcswils;
2523 proto_fcswils = proto_register_protocol("Fibre Channel SW_ILS", "FC-SWILS", "swils");
2525 proto_register_field_array(proto_fcswils, hf, array_length(hf));
2526 proto_register_subtree_array(ett, array_length(ett));
2527 expert_fcswils = expert_register_protocol(proto_fcswils);
2528 expert_register_field_array(expert_fcswils, ei, array_length(ei));
2529 register_init_routine(&fcswils_init_protocol);
2533 proto_reg_handoff_fcswils(void)
2535 dissector_handle_t swils_handle;
2537 swils_handle = new_create_dissector_handle(dissect_fcswils, proto_fcswils);
2538 dissector_add_uint("fc.ftype", FC_FTYPE_SWILS, swils_handle);
2540 data_handle = find_dissector("data");
2541 fcsp_handle = find_dissector("fcsp");
2545 * Editor modelines - http://www.wireshark.org/tools/modelines.html
2550 * indent-tabs-mode: nil
2553 * vi: set shiftwidth=4 tabstop=8 expandtab:
2554 * :indentSize=4:tabSize=8:noTabs=true: