Coverage Report

Created: 2026-01-02 06:13

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-fcswils.c
Line
Count
Source
1
/* packet-fcswils.c
2
 * Routines for FC Inter-switch link services
3
 * Copyright 2001, Dinesh G Dutt <ddutt@cisco.com>
4
 *
5
 * Wireshark - Network traffic analyzer
6
 * By Gerald Combs <gerald@wireshark.org>
7
 * Copyright 1998 Gerald Combs
8
 *
9
 * SPDX-License-Identifier: GPL-2.0-or-later
10
 */
11
12
#include "config.h"
13
14
#include <epan/packet.h>
15
#include <epan/expert.h>
16
#include <epan/unit_strings.h>
17
18
#include "packet-fc.h"
19
#include "packet-fcswils.h"
20
#include "packet-fcct.h"
21
22
void proto_register_fcswils(void);
23
void proto_reg_handoff_fcswils(void);
24
25
static dissector_handle_t swils_handle;
26
27
/*
28
 * See the FC-SW specifications.
29
 */
30
31
5
#define FC_SWILS_RPLY               0x0
32
390
#define FC_SWILS_REQ                0x1
33
0
#define FC_SWILS_RSCN_DEVENTRY_SIZE 20
34
35
/* Zone name has the structure:
36
 * name_len (1 byte), rsvd (3 bytes), name (m bytes), fill (n bytes)
37
 * name_len excludes the 4 initial bytes before the name
38
 */
39
776
#define ZONENAME_LEN(x, y)  (tvb_get_uint8(x, y)+4)
40
41
/* Initialize the protocol and registered fields */
42
static int proto_fcswils;
43
static int hf_swils_opcode;
44
static int hf_swils_elp_rev;
45
static int hf_swils_elp_flags;
46
static int hf_swils_elp_r_a_tov;
47
static int hf_swils_elp_e_d_tov;
48
static int hf_swils_elp_req_epn;
49
static int hf_swils_elp_req_esn;
50
static int hf_swils_elp_clsf_svcp;
51
static int hf_swils_elp_clsf_rcvsz;
52
static int hf_swils_elp_clsf_conseq;
53
static int hf_swils_elp_clsf_e2e;
54
static int hf_swils_elp_clsf_openseq;
55
static int hf_swils_elp_cls1_svcp;
56
static int hf_swils_elp_cls1_rcvsz;
57
static int hf_swils_elp_cls2_svcp;
58
static int hf_swils_elp_cls2_rcvsz;
59
static int hf_swils_elp_cls3_svcp;
60
static int hf_swils_elp_cls3_rcvsz;
61
static int hf_swils_elp_isl_fc_mode;
62
static int hf_swils_elp_fcplen;
63
static int hf_swils_elp_b2bcredit;
64
static int hf_swils_elp_compat1;
65
static int hf_swils_elp_compat2;
66
static int hf_swils_elp_compat3;
67
static int hf_swils_elp_compat4;
68
static int hf_swils_efp_rec_type;
69
static int hf_swils_efp_dom_id;
70
static int hf_swils_efp_switch_name;
71
static int hf_swils_efp_mcast_grpno;
72
/* static int hf_swils_efp_alias_token; */
73
static int hf_swils_efp_record_len;
74
static int hf_swils_efp_payload_len;
75
static int hf_swils_efp_pswitch_pri;
76
static int hf_swils_efp_pswitch_name;
77
static int hf_swils_dia_switch_name;
78
static int hf_swils_rdi_payload_len;
79
static int hf_swils_rdi_req_sname;
80
/* static int hf_swils_fspfh_cmd; */
81
static int hf_swils_fspfh_rev;
82
static int hf_swils_fspfh_ar_num;
83
static int hf_swils_fspfh_auth_type;
84
static int hf_swils_fspfh_dom_id;
85
static int hf_swils_fspfh_auth;
86
static int hf_swils_hlo_options;
87
static int hf_swils_hlo_hloint;
88
static int hf_swils_hlo_deadint;
89
static int hf_swils_hlo_rcv_domid;
90
static int hf_swils_hlo_orig_pidx;
91
static int hf_swils_ldrec_linkid;
92
static int hf_swils_ldrec_out_pidx;
93
static int hf_swils_ldrec_nbr_pidx;
94
static int hf_swils_ldrec_link_type;
95
static int hf_swils_ldrec_link_cost;
96
static int hf_swils_lsrh_lsr_type;
97
static int hf_swils_lsrh_lsid;
98
static int hf_swils_lsrh_adv_domid;
99
static int hf_swils_lsrh_ls_incid;
100
static int hf_swils_esc_pdesc_vendorid;
101
static int hf_swils_esc_swvendorid;
102
static int hf_swils_esc_protocolid;
103
static int hf_swils_rscn_evtype;
104
static int hf_swils_rscn_addrfmt;
105
static int hf_swils_rscn_detectfn;
106
static int hf_swils_rscn_affectedport;
107
static int hf_swils_rscn_portstate;
108
static int hf_swils_rscn_portid;
109
static int hf_swils_rscn_pwwn;
110
static int hf_swils_rscn_nwwn;
111
static int hf_swils_zone_activezonenm;
112
static int hf_swils_zone_objname;
113
static int hf_swils_zone_objtype;
114
static int hf_swils_zone_mbrtype;
115
static int hf_swils_zone_protocol;
116
static int hf_swils_zone_mbrid;
117
static int hf_swils_zone_mbrid_fcwwn;
118
static int hf_swils_zone_mbrid_fc;
119
static int hf_swils_zone_mbrid_uint;
120
static int hf_swils_zone_status;
121
static int hf_swils_zone_reason;
122
static int hf_swils_aca_domainid;
123
static int hf_swils_sfc_opcode;
124
static int hf_swils_sfc_zonenm;
125
static int hf_swils_rjt;
126
static int hf_swils_rjtdet;
127
static int hf_swils_rjtvendor;
128
static int hf_swils_zone_mbrid_lun;
129
static int hf_swils_ess_rev;
130
static int hf_swils_ess_len;
131
static int hf_swils_ess_numobj;
132
static int hf_swils_interconnect_list_len;
133
static int hf_swils_ess_vendorname;
134
static int hf_swils_ess_modelname;
135
static int hf_swils_ess_relcode;
136
static int hf_swils_ess_vendorspecific;
137
static int hf_swils_ess_cap_type;
138
static int hf_swils_ess_cap_subtype;
139
static int hf_swils_ess_cap_numentries;
140
static int hf_swils_ess_cap_svc;
141
static int hf_swils_ess_dns_obj0h;
142
static int hf_swils_ess_dns_obj1h;
143
static int hf_swils_ess_dns_obj2h;
144
static int hf_swils_ess_dns_obj3h;
145
static int hf_swils_ess_dns_zlacc;
146
static int hf_swils_ess_dns_vendor;
147
static int hf_swils_ess_fctlr_rscn;
148
static int hf_swils_ess_fctlr_vendor;
149
static int hf_swils_ess_fcs_basic;
150
static int hf_swils_ess_fcs_platform;
151
static int hf_swils_ess_fcs_topology;
152
static int hf_swils_ess_fcs_enhanced;
153
static int hf_swils_ess_fzs_enh_supp;
154
static int hf_swils_ess_fzs_enh_ena;
155
static int hf_swils_ess_fzs_mr;
156
static int hf_swils_ess_fzs_zsdb_supp;
157
static int hf_swils_ess_fzs_zsdb_ena;
158
static int hf_swils_ess_fzs_adc_supp;
159
static int hf_swils_ess_fzs_hardzone;
160
static int hf_swils_mrra_rev;
161
static int hf_swils_mrra_size;
162
static int hf_swils_mrra_vendorid;
163
static int hf_swils_mrra_reply;
164
static int hf_swils_mrra_reply_size;
165
static int hf_swils_mrra_waittime;
166
static int hf_swils_ess_cap_t10;
167
static int hf_swils_ess_cap_vendorobj;
168
static int hf_swils_ess_fzs_defzone;
169
static int hf_swils_ess_cap_len;
170
static int hf_swils_mrra_vendorinfo;
171
172
/* Generated from convert_proto_tree_add_text.pl */
173
static int hf_swils_lsrh_lsr_age;
174
static int hf_swils_zone_full_zone_set_length;
175
static int hf_swils_zone_num_zoning_objects;
176
static int hf_swils_lsrec_number_of_links;
177
static int hf_swils_sfc_zoneset_length;
178
static int hf_swils_zone_vendor_unique;
179
static int hf_swils_zone_num_members;
180
static int hf_swils_zone_active_zoneset_length;
181
static int hf_swils_lsack_num_of_lsr_headers;
182
static int hf_swils_lsrh_lsr_length;
183
static int hf_swils_esc_payload_length;
184
static int hf_swils_lsupdate_num_of_lsrs;
185
static int hf_swils_zone_mbr_identifier_length;
186
static int hf_swils_zone_mbrflags;
187
static int hf_swils_lsrh_options;
188
static int hf_swils_domain_id_list_length;
189
static int hf_swils_lsack_flags;
190
static int hf_swils_rscn_num_entries;
191
static int hf_swils_requested_domain_id;
192
static int hf_swils_lsrh_checksum;
193
static int hf_swils_granted_domain_id;
194
static int hf_swils_lsupdate_flags;
195
196
197
static expert_field ei_swils_efp_record_len;
198
static expert_field ei_swils_no_exchange;
199
static expert_field ei_swils_zone_mbrid;
200
201
/* Initialize the subtree pointers */
202
static int ett_fcswils;
203
static int ett_fcswils_swacc;
204
static int ett_fcswils_swrjt;
205
static int ett_fcswils_elp;
206
static int ett_fcswils_efp;
207
static int ett_fcswils_efplist;
208
static int ett_fcswils_dia;
209
static int ett_fcswils_rdi;
210
static int ett_fcswils_fspfhdr;
211
static int ett_fcswils_hlo;
212
static int ett_fcswils_lsrec;
213
static int ett_fcswils_lsrechdr;
214
static int ett_fcswils_ldrec;
215
static int ett_fcswils_lsu;
216
static int ett_fcswils_lsa;
217
static int ett_fcswils_bf;
218
static int ett_fcswils_rcf;
219
static int ett_fcswils_rscn;
220
static int ett_fcswils_rscn_dev;
221
static int ett_fcswils_drlir;
222
static int ett_fcswils_mr;
223
static int ett_fcswils_zoneobjlist;
224
static int ett_fcswils_zoneobj;
225
static int ett_fcswils_zonembr;
226
static int ett_fcswils_aca;
227
static int ett_fcswils_rca;
228
static int ett_fcswils_sfc;
229
static int ett_fcswils_ufc;
230
static int ett_fcswils_esc;
231
static int ett_fcswils_esc_pdesc;
232
static int ett_fcswils_ieinfo;
233
static int ett_fcswils_capinfo;
234
235
static const value_string fc_swils_opcode_key_val[] = {
236
    {FC_SWILS_SWRJT   , "SW_RJT"},
237
    {FC_SWILS_SWACC   , "SW_ACC"},
238
    {FC_SWILS_ELP     , "ELP"},
239
    {FC_SWILS_EFP     , "EFP"},
240
    {FC_SWILS_DIA     , "DIA"},
241
    {FC_SWILS_RDI     , "RDI"},
242
    {FC_SWILS_HLO     , "HLO"},
243
    {FC_SWILS_LSU     , "LSU"},
244
    {FC_SWILS_LSA     , "LSA"},
245
    {FC_SWILS_BF      , "BF"},
246
    {FC_SWILS_RCF     , "RCF"},
247
    {FC_SWILS_RSCN    , "SW_RSCN"},
248
    {FC_SWILS_DRLIR   , "DRLIR"},
249
    {FC_SWILS_DSCN    , "DSCN"},
250
    {FC_SWILS_LOOPD   , "LOOPD"},
251
    {FC_SWILS_MR      , "MR"},
252
    {FC_SWILS_ACA     , "ACA"},
253
    {FC_SWILS_RCA     , "RCA"},
254
    {FC_SWILS_SFC     , "SFC"},
255
    {FC_SWILS_UFC     , "UFC"},
256
    {FC_SWILS_ESC     , "ESC"},
257
    {FC_SWILS_ESS     , "ESS"},
258
    {FC_SWILS_MRRA    , "MRRA"},
259
    {FC_SWILS_AUTH_ILS, "AUTH_ILS"},
260
    {0, NULL},
261
};
262
263
static const value_string fc_swils_rjt_val [] = {
264
    {FC_SWILS_RJT_INVCODE   , "Invalid Cmd Code"},
265
    {FC_SWILS_RJT_INVVER    , "Invalid Revision"},
266
    {FC_SWILS_RJT_LOGERR    , "Logical Error"},
267
    {FC_SWILS_RJT_INVSIZE   , "Invalid Size"},
268
    {FC_SWILS_RJT_LOGBSY    , "Logical Busy"},
269
    {FC_SWILS_RJT_PROTERR   , "Protocol Error"},
270
    {FC_SWILS_RJT_GENFAIL   , "Unable to Perform"},
271
    {FC_SWILS_RJT_CMDNOTSUPP, "Unsupported Cmd"},
272
    {FC_SWILS_RJT_VENDUNIQ  , "Vendor Unique Err"},
273
    {0, NULL},
274
};
275
276
static const value_string fc_swils_deterr_val [] = {
277
    {FC_SWILS_RJT_NODET     , "No Additional Details"},
278
    {FC_SWILS_RJT_CLSF_ERR  , "Class F Svc Param Err"},
279
    {FC_SWILS_RJT_CLSN_ERR  , "Class N Svc Param Err"},
280
    {FC_SWILS_RJT_INVFC_CODE, "Unknown Flow Ctrl Code"},
281
    {FC_SWILS_RJT_INVFC_PARM, "Invalid Flow Ctrl Parm"},
282
    {FC_SWILS_RJT_INV_PNAME , "Invalid Port Name"},
283
    {FC_SWILS_RJT_INV_SNAME , "Invalid Switch Name"},
284
    {FC_SWILS_RJT_TOV_MSMTCH, "R_A_/E_D_TOV Mismatch"},
285
    {FC_SWILS_RJT_INV_DIDLST, "Invalid Domain ID List"},
286
    {FC_SWILS_RJT_CMD_INPROG, "Cmd Already in Progress"},
287
    {FC_SWILS_RJT_OORSRC    , "Insufficient Resources"},
288
    {FC_SWILS_RJT_NO_DID    , "Domain ID Unavailable"},
289
    {FC_SWILS_RJT_INV_DID   , "Invalid Domain ID"},
290
    {FC_SWILS_RJT_NO_REQ    , "Request Not Supported"},
291
    {FC_SWILS_RJT_NOLNK_PARM, "Link Parm Not Estd."},
292
    {FC_SWILS_RJT_NO_REQDID , "Group of Domain IDs Unavail"},
293
    {FC_SWILS_RJT_EP_ISOL   , "E_Port Isolated"},
294
    {0, NULL}
295
};
296
297
static const value_string fcswils_elp_fc_val[] = {
298
    {FC_SWILS_ELP_FC_VENDOR, "Vendor Unique"},
299
    {FC_SWILS_ELP_FC_RRDY  , "R_RDY Flow Ctrl"},
300
    {0, NULL},
301
};
302
303
static const value_string fcswils_rectype_val[] = {
304
    {FC_SWILS_LRECTYPE_DOMAIN, "Domain ID Record"},
305
    {FC_SWILS_LRECTYPE_MCAST , "Multicast ID Record"},
306
    {0, NULL},
307
};
308
309
static const value_string fc_swils_link_type_val[] = {
310
    {0x01, "P2P Link"},
311
    {0xF0, "Vendor Specific"},
312
    {0xF1, "Vendor Specific"},
313
    {0xF2, "Vendor Specific"},
314
    {0xF3, "Vendor Specific"},
315
    {0xF4, "Vendor Specific"},
316
    {0xF5, "Vendor Specific"},
317
    {0xF6, "Vendor Specific"},
318
    {0xF7, "Vendor Specific"},
319
    {0xF8, "Vendor Specific"},
320
    {0xF9, "Vendor Specific"},
321
    {0xFA, "Vendor Specific"},
322
    {0xFB, "Vendor Specific"},
323
    {0xFC, "Vendor Specific"},
324
    {0xFD, "Vendor Specific"},
325
    {0xFE, "Vendor Specific"},
326
    {0xFF, "Vendor Specific"},
327
    {0, NULL},
328
};
329
330
static const value_string fc_swils_fspf_linkrec_val[] = {
331
    {FC_SWILS_LSR_SLR, "Switch Link Record"},
332
    {FC_SWILS_LSR_ARS, "AR Summary Record"},
333
    {0, NULL},
334
};
335
336
static const value_string fc_swils_fspf_lsrflags_val[] = {
337
    {0x0, "LSR is for a Topology Update"},
338
    {0x1, "LSR is for Initial DB Sync | Not the last seq in DB sync"},
339
    {0x2, "Last Seq in DB Sync. LSU has no LSRs"},
340
    {0x3, "LSR is for Initial DB Sync | Last Seq in DB Sync"},
341
    {0, NULL},
342
};
343
344
static const value_string fc_swils_rscn_portstate_val[] = {
345
    {0, "No Additional Info"},
346
    {1, "Port is online"},
347
    {2, "Port is offline"},
348
    {0, NULL},
349
};
350
351
static const value_string fc_swils_rscn_addrfmt_val[] = {
352
    {0, "Port Addr Format"},
353
    {1, "Area Addr Format"},
354
    {2, "Domain Addr Format"},
355
    {3, "Fabric Addr Format"},
356
    {0, NULL},
357
};
358
359
static const value_string fc_swils_rscn_detectfn_val[] = {
360
    {1, "Fabric Detected"},
361
    {2, "N_Port Detected"},
362
    {0, NULL},
363
};
364
365
static const value_string fc_swils_esc_protocol_val[] = {
366
    {0, "Reserved"},
367
    {1, "FSPF-Backbone Protocol"},
368
    {2, "FSPF Protocol"},
369
    {0, NULL},
370
};
371
372
static const value_string fc_swils_zoneobj_type_val[] = {
373
    {0, "Reserved"},
374
    {FC_SWILS_ZONEOBJ_ZONESET  , "Zone Set"},
375
    {FC_SWILS_ZONEOBJ_ZONE     , "Zone"},
376
    {FC_SWILS_ZONEOBJ_ZONEALIAS, "Zone Alias"},
377
    {0, NULL},
378
};
379
380
const value_string fc_swils_zonembr_type_val[] = {
381
    {0                        , "Reserved"},
382
    {FC_SWILS_ZONEMBR_WWN     , "WWN"},
383
    {FC_SWILS_ZONEMBR_DP      , "Domain/Physical Port (0x00ddpppp)"},
384
    {FC_SWILS_ZONEMBR_FCID    , "FC Address"},
385
    {FC_SWILS_ZONEMBR_ALIAS   , "Zone Alias"},
386
    {FC_SWILS_ZONEMBR_WWN_LUN , "WWN+LUN"},
387
    {FC_SWILS_ZONEMBR_DP_LUN  , "Domain/Physical Port+LUN"},
388
    {FC_SWILS_ZONEMBR_FCID_LUN, "FCID+LUN"},
389
    {0, NULL},
390
};
391
392
static const value_string fc_swils_mr_rsp_val[] = {
393
    {0, "Successful"},
394
    {1, "Fabric Busy"},
395
    {2, "Failed"},
396
    {0, NULL},
397
};
398
399
static const value_string fc_swils_mr_reason_val[] = {
400
    {0x0, "No Reason"},
401
    {0x1, "Invalid Data Length"},
402
    {0x2, "Unsupported Command"},
403
    {0x3, "Reserved"},
404
    {0x4, "Not Authorized"},
405
    {0x5, "Invalid Request"},
406
    {0x6, "Fabric Changing"},
407
    {0x7, "Update Not Staged"},
408
    {0x8, "Invalid Zone Set Format"},
409
    {0x9, "Invalid Data"},
410
    {0xA, "Cannot Merge"},
411
    {0, NULL},
412
};
413
414
static const value_string fc_swils_sfc_op_val[] = {
415
    {0, "Reserved"},
416
    {1, "Reserved"},
417
    {2, "Reserved"},
418
    {3, "Activate Zone Set"},
419
    {4, "Deactivate Zone Set"},
420
    {0, NULL},
421
};
422
423
typedef struct _zonename {
424
    uint32_t namelen:8,
425
        rsvd:24;
426
    char    *name;
427
    char    *pad;
428
} zonename_t;
429
430
typedef struct _fcswils_conv_key {
431
    uint32_t conv_idx;
432
} fcswils_conv_key_t;
433
434
typedef struct _fcswils_conv_data {
435
    uint32_t opcode;
436
} fcswils_conv_data_t;
437
438
static wmem_map_t *fcswils_req_hash;
439
440
/* list of commands for each commandset */
441
typedef void (*fcswils_dissector_t)(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, uint8_t isreq);
442
443
typedef struct _fcswils_func_table_t {
444
    fcswils_dissector_t func;
445
} fcswils_func_table_t;
446
447
static dissector_handle_t fcsp_handle;
448
449
static int get_zoneobj_len(tvbuff_t *tvb, int offset);
450
451
/*
452
 * Hash Functions
453
 */
454
static int
455
fcswils_equal(const void *v, const void *w)
456
160
{
457
160
    const fcswils_conv_key_t *v1 = (const fcswils_conv_key_t *)v;
458
160
    const fcswils_conv_key_t *v2 = (const fcswils_conv_key_t *)w;
459
460
160
    return (v1->conv_idx == v2->conv_idx);
461
160
}
462
463
static unsigned
464
fcswils_hash(const void *v)
465
222
{
466
222
    const fcswils_conv_key_t *key = (const fcswils_conv_key_t *)v;
467
222
    unsigned val;
468
469
222
    val = key->conv_idx;
470
471
222
    return val;
472
222
}
473
474
static char *
475
zonenm_to_str(wmem_allocator_t *scope, tvbuff_t *tvb, int offset)
476
162
{
477
162
    int len = tvb_get_uint8(tvb, offset);
478
162
    return (char*)tvb_get_string_enc(scope, tvb, offset+4, len, ENC_ASCII);
479
162
}
480
481
/* Offset points to the start of the zone object */
482
static int
483
get_zoneobj_len(tvbuff_t *tvb, int offset)
484
159
{
485
159
    int    numrec, numrec1;
486
159
    uint8_t objtype;
487
159
    int    i, j, len;
488
489
    /* zone object structure is:
490
     * type (1 byte), protocol (1 byte), rsvd (2 bytes), obj name (x bytes),
491
     * num of zone mbrs (4 bytes ), list of zone members (each member if of
492
     * variable length).
493
     *
494
     * zone member structure is:
495
     * type (1 byte), rsvd (1 byte), flags (1 byte), id_len (1 byte),
496
     * id (id_len bytes)
497
     */
498
159
    objtype = tvb_get_uint8(tvb, offset);
499
159
    len = 4 + ZONENAME_LEN(tvb, offset+4); /* length up to num_of_mbrs field */
500
159
    numrec = tvb_get_ntohl(tvb, offset+len); /* gets us num of zone mbrs */
501
502
159
    len += 4;                   /* + num_mbrs */
503
453
    for (i = 0; i < numrec; i++) {
504
294
        if (objtype == FC_SWILS_ZONEOBJ_ZONESET) {
505
19
            len += 4 + ZONENAME_LEN(tvb, offset+4+len); /* length up to num_of_mbrs field */
506
19
            numrec1 = tvb_get_ntohl(tvb, offset+len);
507
508
19
            len += 4;
509
44
            for (j = 0; j < numrec1; j++) {
510
25
                len += 4 + tvb_get_uint8(tvb, offset+3+len);
511
25
            }
512
19
        }
513
275
        else {
514
275
            len += 4 + tvb_get_uint8(tvb, offset+3+len);
515
275
        }
516
294
    }
517
518
159
    return len;
519
159
}
520
521
50
#define MAX_INTERCONNECT_ELEMENT_INFO_LEN  252
522
static int
523
dissect_swils_interconnect_element_info(tvbuff_t *tvb, proto_tree *tree, int offset)
524
25
{
525
526
25
    int len, max_len = MAX_INTERCONNECT_ELEMENT_INFO_LEN;
527
528
25
    if (tree) {
529
25
        proto_tree_add_item(tree, hf_swils_interconnect_list_len, tvb, offset+3, 1, ENC_BIG_ENDIAN);
530
25
        len = tvb_strsize(tvb, offset+4);
531
25
        proto_tree_add_item(tree, hf_swils_ess_vendorname, tvb, offset+4, len, ENC_ASCII);
532
25
        offset += (4 + len);
533
25
        max_len -= len;
534
25
        len = tvb_strsize(tvb, offset);
535
25
        proto_tree_add_item(tree, hf_swils_ess_modelname, tvb, offset, len, ENC_ASCII);
536
25
        offset += len;
537
25
        max_len -= len;
538
25
        len = tvb_strsize(tvb, offset);
539
25
        proto_tree_add_item(tree, hf_swils_ess_relcode, tvb, offset, len, ENC_ASCII);
540
25
        offset += len;
541
25
        max_len -= len;
542
1.68k
        while (max_len > 0) {
543
            /* Vendor specific field is a set of one or more null-terminated
544
             * strings
545
             */
546
1.65k
            len = tvb_strsize(tvb, offset);
547
1.65k
            proto_tree_add_item(tree, hf_swils_ess_vendorspecific, tvb, offset, len, ENC_ASCII);
548
1.65k
            offset += len;
549
1.65k
            max_len -= len;
550
1.65k
        }
551
25
    }
552
553
25
    return true;
554
25
}
555
556
static void
557
dissect_swils_ess_capability(tvbuff_t *tvb, proto_tree *tree, int offset,
558
                             uint8_t srvr_type)
559
225
{
560
225
    if (tree) {
561
225
        switch (srvr_type) {
562
0
        case FCCT_GSRVR_DNS:
563
0
            proto_tree_add_item(tree, hf_swils_ess_dns_zlacc, tvb, offset+3,
564
0
                                1, ENC_BIG_ENDIAN);
565
0
            proto_tree_add_item(tree, hf_swils_ess_dns_obj3h, tvb, offset+3,
566
0
                                1, ENC_BIG_ENDIAN);
567
0
            proto_tree_add_item(tree, hf_swils_ess_dns_obj2h, tvb, offset+3,
568
0
                                1, ENC_BIG_ENDIAN);
569
0
            proto_tree_add_item(tree, hf_swils_ess_dns_obj1h, tvb, offset+3,
570
0
                                1, ENC_BIG_ENDIAN);
571
0
            proto_tree_add_item(tree, hf_swils_ess_dns_obj0h, tvb, offset+3,
572
0
                                1, ENC_BIG_ENDIAN);
573
0
            proto_tree_add_item(tree, hf_swils_ess_dns_vendor, tvb,
574
0
                                offset+4, 4, ENC_BIG_ENDIAN);
575
0
            break;
576
33
        case FCCT_GSRVR_FCTLR:
577
33
            proto_tree_add_item(tree, hf_swils_ess_fctlr_rscn, tvb,
578
33
                                offset+3, 1, ENC_BIG_ENDIAN);
579
33
            proto_tree_add_item(tree, hf_swils_ess_fctlr_vendor, tvb,
580
33
                                offset+4, 4, ENC_BIG_ENDIAN);
581
33
            break;
582
0
        case FCCT_GSRVR_FCS:
583
0
            proto_tree_add_item(tree, hf_swils_ess_fcs_basic, tvb,
584
0
                                offset+3, 1, ENC_BIG_ENDIAN);
585
0
            proto_tree_add_item(tree, hf_swils_ess_fcs_platform, tvb,
586
0
                                offset+3, 1, ENC_BIG_ENDIAN);
587
0
            proto_tree_add_item(tree, hf_swils_ess_fcs_topology, tvb,
588
0
                                offset+3, 1, ENC_BIG_ENDIAN);
589
0
            proto_tree_add_item(tree, hf_swils_ess_fcs_enhanced, tvb,
590
0
                                offset+3, 1, ENC_BIG_ENDIAN);
591
0
            break;
592
0
        case FCCT_GSRVR_FZS:
593
0
            proto_tree_add_item(tree, hf_swils_ess_fzs_enh_supp, tvb,
594
0
                                offset+3, 1, ENC_BIG_ENDIAN);
595
0
            proto_tree_add_item(tree, hf_swils_ess_fzs_enh_ena, tvb,
596
0
                                offset+3, 1, ENC_BIG_ENDIAN);
597
0
            proto_tree_add_item(tree, hf_swils_ess_fzs_mr, tvb, offset+3,
598
0
                                1, ENC_BIG_ENDIAN);
599
0
            proto_tree_add_item(tree, hf_swils_ess_fzs_defzone, tvb,
600
0
                                offset+3, 1, ENC_BIG_ENDIAN);
601
0
            proto_tree_add_item(tree, hf_swils_ess_fzs_zsdb_supp, tvb,
602
0
                                offset+3, 1, ENC_BIG_ENDIAN);
603
0
            proto_tree_add_item(tree, hf_swils_ess_fzs_zsdb_ena, tvb,
604
0
                                offset+3, 1, ENC_BIG_ENDIAN);
605
0
            proto_tree_add_item(tree, hf_swils_ess_fzs_adc_supp, tvb,
606
0
                                offset+3, 1, ENC_BIG_ENDIAN);
607
0
            proto_tree_add_item(tree, hf_swils_ess_fzs_hardzone, tvb,
608
0
                                offset+3, 1, ENC_BIG_ENDIAN);
609
0
            break;
610
192
        default:
611
192
            break;
612
225
        }
613
225
    }
614
615
225
    return;
616
225
}
617
618
static int
619
dissect_swils_ess_capability_obj(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset)
620
88
{
621
88
    int         i = 0, num_entries = 0, len = 0, total_len = 0;
622
88
    uint8_t     type, subtype, srvr_type;
623
88
    proto_tree *capinfo_tree = NULL;
624
625
88
    if (tree) {
626
        /*
627
         * Structure of capability object is: WK type (1B), WK subtype(1),
628
         * rsvd (1), num_cap_entries (1), entry_1 (8) ... entry_n (8)
629
         */
630
        /* Compute length first to create subtree of cap object */
631
88
        type = tvb_get_uint8(tvb, offset);
632
88
        if (type != FCCT_GSTYPE_VENDOR) {
633
80
            num_entries = tvb_get_uint8(tvb, offset+3);
634
80
            total_len = 4 + (num_entries*8);
635
80
            capinfo_tree = proto_tree_add_subtree_format(tree, tvb, offset,
636
80
                                     total_len, ett_fcswils_capinfo, NULL, "Capability Object (%s)",
637
80
                                     val_to_str(pinfo->pool, type, fc_ct_gstype_vals,
638
80
                                                "Unknown (0x%x)"));
639
80
        } else {
640
8
            i = tvb_get_uint8(tvb, offset+3);
641
8
            i += 12;
642
643
8
            capinfo_tree = proto_tree_add_subtree_format(tree, tvb, offset,
644
8
                                     i, ett_fcswils_capinfo, NULL, "Capability Object (Vendor-specific 0x%x)",
645
8
                                     type);
646
8
        }
647
648
88
        proto_tree_add_item(capinfo_tree, hf_swils_ess_cap_type, tvb, offset, 1, ENC_BIG_ENDIAN);
649
88
        proto_tree_add_item(capinfo_tree, hf_swils_ess_cap_subtype, tvb, offset+1,
650
88
                            1, ENC_BIG_ENDIAN);
651
88
        subtype = tvb_get_uint8(tvb, offset+1);
652
653
88
        if (type != FCCT_GSTYPE_VENDOR) {
654
72
            srvr_type = get_gs_server(type, subtype);
655
72
            proto_tree_add_uint(capinfo_tree, hf_swils_ess_cap_svc, tvb, offset, 2,
656
72
                                srvr_type);
657
72
            proto_tree_add_item(capinfo_tree, hf_swils_ess_cap_numentries, tvb,
658
72
                                offset+3, 1, ENC_BIG_ENDIAN);
659
72
            offset += 4;
660
72
            len += 4;
661
662
297
            while ((num_entries > 0) && tvb_bytes_exist(tvb, offset, 8)) {
663
225
                dissect_swils_ess_capability(tvb, capinfo_tree, offset, srvr_type);
664
225
                num_entries--;
665
225
                offset += 8;
666
225
                len += 8;
667
225
            }
668
72
        } else {
669
            /* Those damn T11 guys defined another format for
670
             * Vendor-specific objects.
671
             */
672
16
            proto_tree_add_item(capinfo_tree, hf_swils_ess_cap_len, tvb, offset+3,
673
16
                                1, ENC_BIG_ENDIAN);
674
16
            proto_tree_add_item(capinfo_tree, hf_swils_ess_cap_t10, tvb, offset+4,
675
16
                                8, ENC_ASCII);
676
16
            i -= 8;          /* reduce length by t10 object size */
677
16
            offset += 12;
678
16
            len += 12;
679
680
16
            while ((i > 0) && tvb_bytes_exist(tvb, offset, 8)) {
681
0
                proto_tree_add_item(capinfo_tree, hf_swils_ess_cap_vendorobj,
682
0
                                    tvb, offset, 8, ENC_NA);
683
0
                i -= 8;
684
0
                offset += 8;
685
0
                len += 12;
686
0
            }
687
16
        }
688
88
    }
689
88
    return len;
690
88
}
691
692
static void
693
dissect_swils_nullpayload(tvbuff_t *tvb _U_, packet_info* pinfo _U_, proto_tree *tree _U_,
694
                          uint8_t isreq _U_)
695
0
{
696
    /* Common dissector for those ILSs without a payload */
697
0
    return;
698
0
}
699
700
static void
701
dissect_swils_elp(tvbuff_t *tvb, packet_info* pinfo, proto_tree *elp_tree, uint8_t isreq _U_)
702
9
{
703
704
    /* Set up structures needed to add the protocol subtree and manage it */
705
    /* Response i.e. SW_ACC for an ELP has the same format as the request */
706
    /* We skip the initial 4 bytes as we don't care about the opcode */
707
9
    int          offset = 4;
708
9
    const char *flags;
709
9
    uint16_t isl_flwctrl_mode;
710
9
    uint8_t clsf_svcparm[6], cls1_svcparm[2], cls2_svcparm[2], cls3_svcparm[2];
711
712
9
    if (elp_tree) {
713
9
        offset += 4;
714
9
        proto_tree_add_item(elp_tree, hf_swils_elp_rev, tvb, offset++, 1, ENC_BIG_ENDIAN);
715
9
        proto_tree_add_item(elp_tree, hf_swils_elp_flags, tvb, offset, 2, ENC_NA);
716
9
        offset += 3;
717
9
        proto_tree_add_item(elp_tree, hf_swils_elp_r_a_tov, tvb, offset, 4, ENC_BIG_ENDIAN);
718
9
        offset += 4;
719
9
        proto_tree_add_item(elp_tree, hf_swils_elp_e_d_tov, tvb, offset, 4, ENC_BIG_ENDIAN);
720
9
        offset += 4;
721
9
        proto_tree_add_item(elp_tree, hf_swils_elp_req_epn, tvb, offset, 8, ENC_NA);
722
9
        offset += 8;
723
9
        proto_tree_add_item(elp_tree, hf_swils_elp_req_esn, tvb, offset, 8, ENC_NA);
724
9
        offset += 8;
725
726
9
        tvb_memcpy(tvb, clsf_svcparm, offset, 6);
727
9
        if (clsf_svcparm[0] & 0x80) {
728
6
            if (clsf_svcparm[4] & 0x20) {
729
2
                flags="Class F Valid | X_ID Interlock";
730
4
            } else {
731
4
                flags="Class F Valid | No X_ID Interlk";
732
4
            }
733
6
        } else {
734
3
            flags="Class F Invld";
735
3
        }
736
9
        proto_tree_add_bytes_format_value(elp_tree, hf_swils_elp_clsf_svcp, tvb, offset, 6,
737
9
                                    clsf_svcparm, "(%s)", flags);
738
9
        offset += 6;
739
740
9
        proto_tree_add_item(elp_tree, hf_swils_elp_clsf_rcvsz, tvb, offset, 2, ENC_BIG_ENDIAN);
741
9
        offset += 2;
742
9
        proto_tree_add_item(elp_tree, hf_swils_elp_clsf_conseq, tvb, offset, 2, ENC_BIG_ENDIAN);
743
9
        offset += 2;
744
9
        proto_tree_add_item(elp_tree, hf_swils_elp_clsf_e2e, tvb, offset, 2, ENC_BIG_ENDIAN);
745
9
        offset += 2;
746
9
        proto_tree_add_item(elp_tree, hf_swils_elp_clsf_openseq, tvb, offset, 2, ENC_BIG_ENDIAN);
747
9
        offset += 4;
748
749
9
        tvb_memcpy(tvb, cls1_svcparm, offset, 2);
750
9
        if (cls1_svcparm[0] & 0x80) {
751
1
#define MAX_FLAGS_LEN 40
752
1
            char *flagsbuf;
753
1
            int stroff, returned_length;
754
755
1
            flagsbuf=(char *)wmem_alloc(pinfo->pool, MAX_FLAGS_LEN);
756
1
            stroff = 0;
757
758
1
            returned_length = snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff,
759
1
                                         "Class 1 Valid");
760
1
            stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff);
761
1
            if (cls1_svcparm[0] & 0x40) {
762
0
                returned_length = snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | IMX");
763
0
                stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff);
764
0
            }
765
1
            if (cls1_svcparm[0] & 0x20) {
766
1
                returned_length = snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | IPS");
767
1
                stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff);
768
1
            }
769
1
            if (cls1_svcparm[0] & 0x10) {
770
1
                /*returned_length =*/ snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | LKS");
771
1
            }
772
1
            flags=flagsbuf;
773
1
        }
774
8
        else {
775
8
            flags="Class 1 Invalid";
776
8
        }
777
778
9
        proto_tree_add_bytes_format_value(elp_tree, hf_swils_elp_cls1_svcp, tvb, offset, 2,
779
9
                                    NULL, "(%s)", flags);
780
9
        offset += 2;
781
9
        if (cls1_svcparm[0] & 0x80) {
782
1
            proto_tree_add_item(elp_tree, hf_swils_elp_cls1_rcvsz, tvb, offset, 2, ENC_BIG_ENDIAN);
783
1
        }
784
9
        offset += 2;
785
786
9
        tvb_memcpy(tvb, cls2_svcparm, offset, 2);
787
9
        if (cls2_svcparm[0] & 0x80) {
788
0
            if (cls2_svcparm[0] & 0x08) {
789
0
                flags="Class 2 Valid | Seq Delivery";
790
0
            }
791
0
            else {
792
0
                flags="Class 2 Valid | No Seq Delivery";
793
0
            }
794
0
        }
795
9
        else {
796
9
            flags="Class 2 Invld";
797
9
        }
798
799
9
        proto_tree_add_bytes_format_value(elp_tree, hf_swils_elp_cls2_svcp, tvb, offset, 2,
800
9
                                    cls2_svcparm,
801
9
                                    "(%s)", flags);
802
9
        offset += 2;
803
804
9
        if (cls2_svcparm[0] & 0x80) {
805
0
            proto_tree_add_item(elp_tree, hf_swils_elp_cls2_rcvsz, tvb, offset, 2, ENC_BIG_ENDIAN);
806
0
        }
807
9
        offset += 2;
808
809
9
        tvb_memcpy(tvb, cls3_svcparm, offset, 2);
810
9
        if (cls3_svcparm[0] & 0x80) {
811
3
            if (cls3_svcparm[0] & 0x08) {
812
3
                flags="Class 3 Valid | Seq Delivery";
813
3
            }
814
0
            else {
815
0
                flags="Class 3 Valid | No Seq Delivery";
816
0
            }
817
3
        }
818
6
        else {
819
6
            flags="Class 3 Invld";
820
6
        }
821
9
        proto_tree_add_bytes_format_value(elp_tree, hf_swils_elp_cls3_svcp, tvb, offset, 2,
822
9
                                    cls3_svcparm,
823
9
                                    "(%s)", flags);
824
9
        offset += 2;
825
826
9
        if (cls3_svcparm[0] & 0x80) {
827
3
            proto_tree_add_item(elp_tree, hf_swils_elp_cls3_rcvsz, tvb, offset, 2, ENC_BIG_ENDIAN);
828
3
        }
829
9
        offset += 22;
830
831
9
        isl_flwctrl_mode = tvb_get_ntohs(tvb, offset);
832
9
        proto_tree_add_string(elp_tree, hf_swils_elp_isl_fc_mode, tvb, offset, 2,
833
9
                              val_to_str_const(isl_flwctrl_mode, fcswils_elp_fc_val, "Vendor Unique"));
834
9
        offset += 2;
835
9
        proto_tree_add_item(elp_tree, hf_swils_elp_fcplen, tvb, offset, 2, ENC_BIG_ENDIAN);
836
9
        offset += 2;
837
9
        proto_tree_add_item(elp_tree, hf_swils_elp_b2bcredit, tvb, offset, 4, ENC_BIG_ENDIAN);
838
9
        offset += 4;
839
9
        proto_tree_add_item(elp_tree, hf_swils_elp_compat1, tvb, offset, 4, ENC_BIG_ENDIAN);
840
9
        offset += 4;
841
9
        proto_tree_add_item(elp_tree, hf_swils_elp_compat2, tvb, offset, 4, ENC_BIG_ENDIAN);
842
9
        offset += 4;
843
9
        proto_tree_add_item(elp_tree, hf_swils_elp_compat3, tvb, offset, 4, ENC_BIG_ENDIAN);
844
9
        offset += 4;
845
9
        proto_tree_add_item(elp_tree, hf_swils_elp_compat4, tvb, offset, 4, ENC_BIG_ENDIAN);
846
9
    }
847
848
9
}
849
850
static void
851
dissect_swils_efp(tvbuff_t *tvb, packet_info* pinfo, proto_tree *efp_tree, uint8_t isreq _U_)
852
18
{
853
854
/* Set up structures needed to add the protocol subtree and manage it */
855
18
    proto_tree  *lrec_tree;
856
18
    proto_item  *rec_item;
857
18
    int          num_listrec = 0;
858
18
    int          offset      = 1; /* Skip opcode */
859
18
    uint8_t      reclen;
860
18
    uint16_t     payload_len;
861
18
    uint8_t      rec_type;
862
863
18
    reclen = tvb_get_uint8(tvb, offset);
864
18
    rec_item = proto_tree_add_uint(efp_tree, hf_swils_efp_record_len, tvb, offset, 1, reclen);
865
18
    offset += 1;
866
18
    payload_len = tvb_get_ntohs(tvb, offset);
867
18
    if (payload_len < FC_SWILS_EFP_SIZE) {
868
1
        proto_tree_add_uint_format_value(efp_tree, hf_swils_efp_payload_len,
869
1
                                       tvb, offset, 2, payload_len,
870
1
                                       "%u (bogus, must be >= %u)",
871
1
                                       payload_len, FC_SWILS_EFP_SIZE);
872
1
        return;
873
1
    }
874
17
    proto_tree_add_item(efp_tree, hf_swils_efp_payload_len, tvb, offset, 2, ENC_BIG_ENDIAN);
875
17
    offset += 5;       /* skip 3 reserved bytes, too */
876
17
    proto_tree_add_item(efp_tree, hf_swils_efp_pswitch_pri, tvb,
877
17
                            offset, 1, ENC_BIG_ENDIAN);
878
17
    offset += 1;
879
17
    proto_tree_add_item(efp_tree, hf_swils_efp_pswitch_name, tvb, offset, 8, ENC_NA);
880
17
    offset += 8;
881
882
17
    if (reclen == 0) {
883
0
        expert_add_info(pinfo, rec_item, &ei_swils_efp_record_len);
884
0
        return;
885
0
    }
886
    /* Add List Records now */
887
17
    if (efp_tree) {
888
16
        num_listrec = (payload_len - FC_SWILS_EFP_SIZE)/reclen;
889
528
        while (num_listrec-- > 0) {
890
527
            rec_type = tvb_get_uint8(tvb, offset);
891
527
            lrec_tree = proto_tree_add_subtree(efp_tree, tvb, offset, -1,
892
527
                                        ett_fcswils_efplist, NULL,
893
527
                                        val_to_str(pinfo->pool, rec_type,
894
527
                                                   fcswils_rectype_val,
895
527
                                                   "Unknown record type (0x%02x)"));
896
527
            proto_tree_add_uint(lrec_tree, hf_swils_efp_rec_type, tvb, offset, 1,
897
527
                                rec_type);
898
527
            switch (rec_type) {
899
900
41
            case FC_SWILS_LRECTYPE_DOMAIN:
901
41
                proto_tree_add_item(lrec_tree, hf_swils_efp_dom_id, tvb, offset+1, 1, ENC_BIG_ENDIAN);
902
41
                proto_tree_add_item(lrec_tree, hf_swils_efp_switch_name, tvb, offset+8, 8, ENC_NA);
903
41
                break;
904
905
24
            case FC_SWILS_LRECTYPE_MCAST:
906
24
                proto_tree_add_item(lrec_tree, hf_swils_efp_mcast_grpno, tvb, offset+1, 1, ENC_BIG_ENDIAN);
907
24
                break;
908
527
            }
909
512
            offset += reclen;
910
512
        }
911
16
    }
912
17
}
913
914
static void
915
dissect_swils_dia(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *dia_tree, uint8_t isreq _U_)
916
2
{
917
    /* Set up structures needed to add the protocol subtree and manage it */
918
2
    int offset = 0;
919
920
2
    if (dia_tree) {
921
2
        proto_tree_add_item(dia_tree, hf_swils_dia_switch_name, tvb, offset+4,
922
2
                              8, ENC_NA);
923
2
    }
924
2
}
925
926
static void
927
dissect_swils_rdi(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *rdi_tree, uint8_t isreq)
928
1
{
929
    /* Set up structures needed to add the protocol subtree and manage it */
930
1
    int offset = 0;
931
1
    int i, plen, numrec;
932
933
1
    if (rdi_tree) {
934
1
        plen = tvb_get_ntohs(tvb, offset+2);
935
936
1
        proto_tree_add_item(rdi_tree, hf_swils_rdi_payload_len, tvb, offset+2, 2, ENC_BIG_ENDIAN);
937
1
        proto_tree_add_item(rdi_tree, hf_swils_rdi_req_sname, tvb, offset+4, 8, ENC_NA);
938
939
        /* 12 is the length of the initial header and 4 is the size of each
940
         * domain request record.
941
         */
942
1
        numrec = (plen - 12)/4;
943
1
        offset = 12;
944
45
        for (i = 0; i < numrec; i++) {
945
44
            if (isreq) {
946
44
                proto_tree_add_item(rdi_tree, hf_swils_requested_domain_id, tvb, offset+3, 1, ENC_BIG_ENDIAN);
947
44
            }
948
0
            else {
949
0
                proto_tree_add_item(rdi_tree, hf_swils_granted_domain_id, tvb, offset+3, 1, ENC_BIG_ENDIAN);
950
0
            }
951
44
            offset += 4;
952
44
        }
953
1
    }
954
1
}
955
956
static void
957
dissect_swils_fspf_hdr(tvbuff_t *tvb, proto_tree *tree, int offset)
958
30
{
959
30
    proto_tree *fspfh_tree;
960
961
30
    if (tree) {
962
        /* 20 is the size of FSPF header */
963
30
        fspfh_tree = proto_tree_add_subtree(tree, tvb, offset, 20, ett_fcswils_fspfhdr, NULL, "FSPF Header");
964
965
30
        proto_tree_add_item(fspfh_tree, hf_swils_fspfh_rev, tvb, offset+4,
966
30
                            1, ENC_BIG_ENDIAN);
967
30
        proto_tree_add_item(fspfh_tree, hf_swils_fspfh_ar_num, tvb,
968
30
                            offset+5, 1, ENC_BIG_ENDIAN);
969
30
        proto_tree_add_item(fspfh_tree, hf_swils_fspfh_auth_type, tvb,
970
30
                            offset+6, 1, ENC_BIG_ENDIAN);
971
30
        proto_tree_add_item(fspfh_tree, hf_swils_fspfh_dom_id, tvb, offset+11,
972
30
                            1, ENC_BIG_ENDIAN);
973
30
        proto_tree_add_item(fspfh_tree, hf_swils_fspfh_auth, tvb, offset+12,
974
30
                            8, ENC_NA);
975
30
    }
976
30
}
977
978
static void
979
dissect_swils_fspf_lsrechdr(tvbuff_t *tvb, proto_tree *tree, int offset)
980
34
{
981
34
    proto_tree_add_item(tree, hf_swils_lsrh_lsr_type, tvb, offset, 1, ENC_BIG_ENDIAN);
982
34
    proto_tree_add_item(tree, hf_swils_lsrh_lsr_age, tvb, offset+2, 2, ENC_BIG_ENDIAN);
983
34
    proto_tree_add_item(tree, hf_swils_lsrh_options, tvb, offset+4, 4, ENC_BIG_ENDIAN);
984
34
    proto_tree_add_item(tree, hf_swils_lsrh_lsid, tvb, offset+11, 1, ENC_BIG_ENDIAN);
985
34
    proto_tree_add_item(tree, hf_swils_lsrh_adv_domid, tvb, offset+15, 1, ENC_BIG_ENDIAN);
986
34
    proto_tree_add_item(tree, hf_swils_lsrh_ls_incid, tvb, offset+16, 4, ENC_BIG_ENDIAN);
987
34
    proto_tree_add_checksum(tree, tvb, offset+20, hf_swils_lsrh_checksum, -1, NULL, NULL, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS);
988
34
    proto_tree_add_item(tree, hf_swils_lsrh_lsr_length, tvb, offset+22, 2, ENC_BIG_ENDIAN);
989
34
}
990
991
static void
992
dissect_swils_fspf_ldrec(tvbuff_t *tvb, proto_tree *tree, int offset)
993
159
{
994
159
    proto_tree_add_item(tree, hf_swils_ldrec_linkid, tvb, offset+1, 3, ENC_NA);
995
159
    proto_tree_add_item(tree, hf_swils_ldrec_out_pidx, tvb, offset+5, 3, ENC_BIG_ENDIAN);
996
159
    proto_tree_add_item(tree, hf_swils_ldrec_nbr_pidx, tvb, offset+9, 3, ENC_BIG_ENDIAN);
997
159
    proto_tree_add_item(tree, hf_swils_ldrec_link_type, tvb, offset+12, 1, ENC_BIG_ENDIAN);
998
159
    proto_tree_add_item(tree, hf_swils_ldrec_link_cost, tvb, offset+14, 2, ENC_BIG_ENDIAN);
999
159
}
1000
1001
static void
1002
dissect_swils_fspf_lsrec(tvbuff_t *tvb, proto_tree *tree, int offset,
1003
                         int num_lsrec)
1004
22
{
1005
22
    int         i, j, num_ldrec;
1006
22
    proto_tree *lsrec_tree, *ldrec_tree, *lsrechdr_tree;
1007
1008
22
    if (tree) {
1009
39
        for (j = 0; j < num_lsrec; j++) {
1010
17
            num_ldrec = tvb_get_ntohs(tvb, offset+26);
1011
17
            lsrec_tree = proto_tree_add_subtree_format(tree, tvb, offset, (28+num_ldrec*16),
1012
17
                                        ett_fcswils_lsrec, NULL, "Link State Record %d (Domain %d)", j,
1013
17
                                        tvb_get_uint8(tvb, offset+15));
1014
1015
17
            lsrechdr_tree = proto_tree_add_subtree(lsrec_tree, tvb, offset, 24,
1016
17
                                        ett_fcswils_lsrechdr, NULL, "Link State Record Header");
1017
1018
17
            dissect_swils_fspf_lsrechdr(tvb, lsrechdr_tree, offset);
1019
17
            proto_tree_add_item(tree, hf_swils_lsrec_number_of_links, tvb, offset+26, 2, ENC_BIG_ENDIAN);
1020
17
            offset += 28;
1021
1022
177
            for (i = 0; i < num_ldrec; i++) {
1023
160
                ldrec_tree = proto_tree_add_subtree_format(lsrec_tree, tvb, offset, 16,
1024
160
                                             ett_fcswils_ldrec, NULL, "Link Descriptor %d "
1025
160
                                             "(Neighbor domain %d)", i,
1026
160
                                             tvb_get_uint8(tvb, offset+3));
1027
160
                dissect_swils_fspf_ldrec(tvb, ldrec_tree, offset);
1028
160
                offset += 16;
1029
160
            }
1030
17
        }
1031
22
    }
1032
22
}
1033
1034
static void
1035
dissect_swils_hello(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *hlo_tree, uint8_t isreq _U_)
1036
0
{
1037
    /* Set up structures needed to add the protocol subtree and manage it */
1038
0
    int offset = 0;
1039
1040
0
    if (hlo_tree) {
1041
0
        dissect_swils_fspf_hdr(tvb, hlo_tree, offset);
1042
1043
0
        proto_tree_add_item(hlo_tree, hf_swils_hlo_options, tvb, offset+20, 4, ENC_NA);
1044
0
        proto_tree_add_item(hlo_tree, hf_swils_hlo_hloint, tvb, offset+24, 4, ENC_BIG_ENDIAN);
1045
0
        proto_tree_add_item(hlo_tree, hf_swils_hlo_deadint, tvb, offset+28, 4, ENC_BIG_ENDIAN);
1046
0
        proto_tree_add_item(hlo_tree, hf_swils_hlo_rcv_domid, tvb, offset+35, 1, ENC_BIG_ENDIAN);
1047
0
        proto_tree_add_item(hlo_tree, hf_swils_hlo_orig_pidx, tvb, offset+37, 3, ENC_BIG_ENDIAN);
1048
0
    }
1049
0
}
1050
1051
static void
1052
dissect_swils_lsupdate(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *lsu_tree, uint8_t isreq _U_)
1053
24
{
1054
    /* Set up structures needed to add the protocol subtree and manage it */
1055
24
    int offset = 0;
1056
24
    int num_lsrec;
1057
1058
24
    if (lsu_tree) {
1059
24
        dissect_swils_fspf_hdr(tvb, lsu_tree, offset);
1060
1061
24
        proto_tree_add_item(lsu_tree, hf_swils_lsupdate_flags, tvb, offset+23, 1, ENC_BIG_ENDIAN);
1062
24
        num_lsrec = tvb_get_ntohl(tvb, offset+24);
1063
1064
24
        proto_tree_add_item(lsu_tree, hf_swils_lsupdate_num_of_lsrs, tvb, offset+24, 4, ENC_BIG_ENDIAN);
1065
1066
24
        offset = 28;
1067
24
        dissect_swils_fspf_lsrec(tvb, lsu_tree, offset, num_lsrec);
1068
24
    }
1069
24
}
1070
1071
static void
1072
dissect_swils_lsack(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *lsa_tree, uint8_t isreq _U_)
1073
6
{
1074
    /* Set up structures needed to add the protocol subtree and manage it */
1075
6
    int         offset = 0;
1076
6
    int         num_lsrechdr, i;
1077
6
    proto_tree *lsrechdr_tree;
1078
1079
6
    if (lsa_tree) {
1080
6
        dissect_swils_fspf_hdr(tvb, lsa_tree, offset);
1081
1082
6
        proto_tree_add_item(lsa_tree, hf_swils_lsack_flags, tvb, offset+23, 1, ENC_BIG_ENDIAN);
1083
6
        num_lsrechdr = tvb_get_ntohl(tvb, offset+24);
1084
1085
6
        proto_tree_add_item(lsa_tree, hf_swils_lsack_num_of_lsr_headers, tvb, offset+24, 4, ENC_BIG_ENDIAN);
1086
1087
6
        offset = 28;
1088
1089
29
        for (i = 0; i < num_lsrechdr; i++) {
1090
23
            lsrechdr_tree = proto_tree_add_subtree_format(lsa_tree, tvb, offset, 24,
1091
23
                                        ett_fcswils_lsrechdr, NULL, "Link State Record Header (Domain %d)",
1092
23
                                        tvb_get_uint8(tvb, offset+15));
1093
23
            dissect_swils_fspf_lsrechdr(tvb, lsrechdr_tree, offset);
1094
23
            offset += 24;
1095
23
        }
1096
6
    }
1097
6
}
1098
1099
static void
1100
dissect_swils_rscn(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *rscn_tree, uint8_t isreq)
1101
0
{
1102
    /* Set up structures needed to add the protocol subtree and manage it */
1103
0
    int         offset = 0;
1104
0
    proto_tree *dev_tree;
1105
0
    int         numrec, i;
1106
1107
0
    if (rscn_tree) {
1108
0
        if (!isreq)
1109
0
            return;
1110
1111
0
        proto_tree_add_item(rscn_tree, hf_swils_rscn_evtype, tvb, offset+4,
1112
0
                            1, ENC_BIG_ENDIAN);
1113
0
        proto_tree_add_item(rscn_tree, hf_swils_rscn_addrfmt, tvb, offset+4,
1114
0
                            1, ENC_BIG_ENDIAN);
1115
0
        proto_tree_add_item(rscn_tree, hf_swils_rscn_affectedport, tvb,
1116
0
                              offset+5, 3, ENC_NA);
1117
0
        proto_tree_add_item(rscn_tree, hf_swils_rscn_detectfn, tvb,
1118
0
                            offset+8, 4, ENC_BIG_ENDIAN);
1119
0
        numrec = tvb_get_ntohl(tvb, offset+12);
1120
1121
0
        if (!tvb_bytes_exist(tvb, offset+16, FC_SWILS_RSCN_DEVENTRY_SIZE*numrec)) {
1122
            /* Some older devices do not include device entry information. */
1123
0
            return;
1124
0
        }
1125
1126
0
        proto_tree_add_item(rscn_tree, hf_swils_rscn_num_entries, tvb, offset+12, 4, ENC_BIG_ENDIAN);
1127
1128
0
        offset = 16;
1129
0
        for (i = 0; i < numrec; i++) {
1130
0
            dev_tree = proto_tree_add_subtree_format(rscn_tree, tvb, offset, 20,
1131
0
                                        ett_fcswils_rscn_dev, NULL, "Device Entry %d", i);
1132
1133
0
            proto_tree_add_item(dev_tree, hf_swils_rscn_portstate, tvb, offset, 1, ENC_BIG_ENDIAN);
1134
0
            proto_tree_add_item(dev_tree, hf_swils_rscn_portid, tvb, offset+1, 3, ENC_NA);
1135
0
            proto_tree_add_item(dev_tree, hf_swils_rscn_pwwn, tvb, offset+4, 8, ENC_NA);
1136
0
            proto_tree_add_item(dev_tree, hf_swils_rscn_nwwn, tvb, offset+12, 8, ENC_NA);
1137
0
            offset += 20;
1138
0
        }
1139
0
    }
1140
0
}
1141
1142
/*
1143
 * Merge Request contains zoning objects organized in the following format:
1144
 *
1145
 * Zone Set Object
1146
 *      |
1147
 *      +---------------- Zone Object
1148
 *      |                      |
1149
 *      +--                    +---------------- Zone Member
1150
 *      |                      |                     |
1151
 *      +--                    +----                 +-----
1152
 *
1153
 * So the decoding of the zone merge request is based on this structure
1154
 */
1155
1156
static void
1157
dissect_swils_zone_mbr(tvbuff_t *tvb, packet_info* pinfo, proto_tree *zmbr_tree, int offset)
1158
27
{
1159
27
    uint8_t mbrtype;
1160
27
    int     idlen;
1161
27
    proto_item* ti;
1162
1163
27
    mbrtype = tvb_get_uint8(tvb, offset);
1164
27
    ti = proto_tree_add_uint(zmbr_tree, hf_swils_zone_mbrtype, tvb,
1165
27
                        offset, 1, mbrtype);
1166
27
    proto_tree_add_item(zmbr_tree, hf_swils_zone_mbrflags, tvb, offset+2, 1, ENC_BIG_ENDIAN);
1167
27
    idlen = tvb_get_uint8(tvb, offset+3);
1168
27
    proto_tree_add_item(zmbr_tree, hf_swils_zone_mbr_identifier_length, tvb, offset+3, 1, ENC_BIG_ENDIAN);
1169
27
    switch (mbrtype) {
1170
0
    case FC_SWILS_ZONEMBR_WWN:
1171
0
        proto_tree_add_item(zmbr_tree, hf_swils_zone_mbrid_fcwwn, tvb,
1172
0
                              offset+4, 8, ENC_NA);
1173
0
        break;
1174
2
    case FC_SWILS_ZONEMBR_DP:
1175
2
        proto_tree_add_item(zmbr_tree, hf_swils_zone_mbrid_uint, tvb,
1176
2
                              offset+4, 4, ENC_BIG_ENDIAN);
1177
2
        break;
1178
1
    case FC_SWILS_ZONEMBR_FCID:
1179
1
        proto_tree_add_item(zmbr_tree, hf_swils_zone_mbrid_fc, tvb,
1180
1
                              offset+4, 3, ENC_NA);
1181
1
        break;
1182
0
    case FC_SWILS_ZONEMBR_ALIAS:
1183
0
        proto_tree_add_string(zmbr_tree, hf_swils_zone_mbrid, tvb,
1184
0
                              offset+4, idlen, zonenm_to_str(pinfo->pool, tvb, offset+4));
1185
0
        break;
1186
0
    case FC_SWILS_ZONEMBR_WWN_LUN:
1187
0
        proto_tree_add_item(zmbr_tree, hf_swils_zone_mbrid_fcwwn, tvb,
1188
0
                              offset+4, 8, ENC_NA);
1189
0
        proto_tree_add_item(zmbr_tree, hf_swils_zone_mbrid_lun, tvb,
1190
0
                            offset+12, 8, ENC_NA);
1191
0
        break;
1192
0
    case FC_SWILS_ZONEMBR_DP_LUN:
1193
0
        proto_tree_add_item(zmbr_tree, hf_swils_zone_mbrid_uint, tvb,
1194
0
                              offset+4, 4, ENC_BIG_ENDIAN);
1195
0
        proto_tree_add_item(zmbr_tree, hf_swils_zone_mbrid_lun, tvb,
1196
0
                            offset+8, 8, ENC_NA);
1197
0
        break;
1198
0
    case FC_SWILS_ZONEMBR_FCID_LUN:
1199
0
        proto_tree_add_item(zmbr_tree, hf_swils_zone_mbrid_fc, tvb,
1200
0
                              offset+4, 3, ENC_NA);
1201
0
        proto_tree_add_item(zmbr_tree, hf_swils_zone_mbrid_lun, tvb,
1202
0
                            offset+8, 8, ENC_NA);
1203
0
        break;
1204
24
    default:
1205
24
        expert_add_info(pinfo, ti, &ei_swils_zone_mbrid);
1206
1207
27
    }
1208
27
}
1209
1210
static void
1211
// NOLINTNEXTLINE(misc-no-recursion)
1212
dissect_swils_zone_obj(tvbuff_t *tvb, packet_info* pinfo, proto_tree *zobj_tree, int offset)
1213
112
{
1214
112
    proto_tree *zmbr_tree;
1215
112
    int         mbrlen, numrec, i, objtype;
1216
112
    char       *str;
1217
1218
112
    objtype = tvb_get_uint8(tvb, offset);
1219
1220
112
    proto_tree_add_item(zobj_tree, hf_swils_zone_objtype, tvb, offset,
1221
112
                        1, ENC_BIG_ENDIAN);
1222
112
    proto_tree_add_item(zobj_tree, hf_swils_zone_protocol, tvb,
1223
112
                        offset+1, 1, ENC_BIG_ENDIAN);
1224
112
    str = zonenm_to_str(pinfo->pool, tvb, offset+4);
1225
112
    proto_tree_add_string(zobj_tree, hf_swils_zone_objname, tvb,
1226
112
                          offset+4, ZONENAME_LEN(tvb, offset+4), str);
1227
1228
112
    numrec = tvb_get_ntohl(tvb, offset+4+ZONENAME_LEN(tvb, offset+4));
1229
112
    proto_tree_add_item(zobj_tree, hf_swils_zone_num_members, tvb, offset+4+ZONENAME_LEN(tvb,offset+4), 4, ENC_BIG_ENDIAN);
1230
1231
112
    offset += 8 + ZONENAME_LEN(tvb, offset+4);
1232
139
    for (i = 0; i < numrec; i++) {
1233
27
        if (objtype == FC_SWILS_ZONEOBJ_ZONESET) {
1234
            // We recurse here, but we'll run out of packet before we run out of stack.
1235
0
            dissect_swils_zone_obj(tvb, pinfo, zobj_tree, offset);
1236
0
            offset += get_zoneobj_len(tvb, offset);
1237
0
        }
1238
27
        else {
1239
27
            mbrlen = 4 + tvb_get_uint8(tvb, offset+3);
1240
27
            zmbr_tree = proto_tree_add_subtree_format(zobj_tree, tvb, offset, mbrlen,
1241
27
                                        ett_fcswils_zonembr, NULL, "Zone Member %d", i);
1242
27
            dissect_swils_zone_mbr(tvb, pinfo, zmbr_tree, offset);
1243
27
            offset += mbrlen;
1244
27
        }
1245
27
    }
1246
112
}
1247
1248
static void
1249
dissect_swils_mergereq(tvbuff_t *tvb, packet_info* pinfo, proto_tree *mr_tree, uint8_t isreq)
1250
38
{
1251
    /* Set up structures needed to add the protocol subtree and manage it */
1252
38
    int         offset = 0;
1253
38
    proto_tree *zobjlist_tree, *zobj_tree;
1254
38
    int         numrec, i, zonesetlen, objlistlen, objlen;
1255
38
    char       *str;
1256
1257
38
        if (isreq) {
1258
            /* zonesetlen is the size of the zoneset including the zone name */
1259
38
            zonesetlen = tvb_get_ntohs(tvb, offset+2);
1260
38
            proto_tree_add_item(mr_tree, hf_swils_zone_active_zoneset_length, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1261
1262
38
            if (zonesetlen) {
1263
35
                str = zonenm_to_str(pinfo->pool, tvb, offset+4);
1264
35
                proto_tree_add_string(mr_tree, hf_swils_zone_activezonenm, tvb,
1265
35
                                      offset+4, ZONENAME_LEN(tvb, offset+4),
1266
35
                                      str);
1267
1268
                /* objlistlen gives the size of the active zoneset object list */
1269
35
                objlistlen = zonesetlen - ZONENAME_LEN(tvb, offset+4);
1270
                /* Offset = start of the active zoneset zoning object list */
1271
35
                offset = offset + (4 + ZONENAME_LEN(tvb, offset+4));
1272
35
                numrec = tvb_get_ntohl(tvb, offset);
1273
1274
35
                zobjlist_tree = proto_tree_add_subtree(mr_tree, tvb, offset, objlistlen,
1275
35
                                            ett_fcswils_zoneobjlist, NULL, "Active Zone Set");
1276
1277
35
                proto_tree_add_item(zobjlist_tree, hf_swils_zone_num_zoning_objects, tvb, offset, 4, ENC_BIG_ENDIAN);
1278
1279
35
                offset += 4;
1280
82
                for (i = 0; i < numrec; i++) {
1281
47
                    objlen = get_zoneobj_len(tvb, offset);
1282
47
                    zobj_tree = proto_tree_add_subtree_format(zobjlist_tree, tvb, offset+4, objlen,
1283
47
                                                ett_fcswils_zoneobj, NULL, "Zone Object %d", i);
1284
47
                    dissect_swils_zone_obj(tvb, pinfo, zobj_tree, offset);
1285
47
                    offset += objlen;
1286
47
                }
1287
35
            }
1288
3
            else {
1289
3
                offset += 4;
1290
3
            }
1291
1292
38
            zonesetlen = tvb_get_ntohl(tvb, offset);
1293
38
            proto_tree_add_item(mr_tree, hf_swils_zone_full_zone_set_length, tvb, offset, 4, ENC_BIG_ENDIAN);
1294
1295
38
            if (zonesetlen) {
1296
17
                objlistlen = zonesetlen;
1297
                /* Offset = start of the active zoneset zoning object list */
1298
17
                offset += 4;
1299
17
                numrec = tvb_get_ntohl(tvb, offset);
1300
1301
17
                zobjlist_tree = proto_tree_add_subtree(mr_tree, tvb, offset, objlistlen,
1302
17
                                            ett_fcswils_zoneobjlist, NULL, "Full Zone Set");
1303
1304
17
                proto_tree_add_item(zobjlist_tree, hf_swils_zone_num_zoning_objects, tvb, offset, 4, ENC_BIG_ENDIAN);
1305
17
                offset += 4;
1306
88
                for (i = 0; i < numrec; i++) {
1307
71
                    objlen = get_zoneobj_len(tvb, offset);
1308
71
                    zobj_tree = proto_tree_add_subtree_format(zobjlist_tree, tvb, offset,
1309
71
                                                objlen, ett_fcswils_zoneobj, NULL, "Zone Object %d", i);
1310
71
                    dissect_swils_zone_obj(tvb, pinfo, zobj_tree, offset);
1311
71
                    offset += objlen;
1312
71
                }
1313
17
            }
1314
38
        }
1315
0
        else {
1316
0
            proto_tree_add_item(mr_tree, hf_swils_zone_status, tvb,
1317
0
                                offset+5, 1, ENC_BIG_ENDIAN);
1318
0
            proto_tree_add_item(mr_tree, hf_swils_zone_reason, tvb,
1319
0
                                offset+6, 1, ENC_BIG_ENDIAN);
1320
0
            proto_tree_add_item(mr_tree, hf_swils_zone_vendor_unique, tvb, offset+7, 1, ENC_BIG_ENDIAN);
1321
0
        }
1322
38
}
1323
1324
static void
1325
dissect_swils_aca(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *aca_tree, uint8_t isreq)
1326
7
{
1327
    /* Set up structures needed to add the protocol subtree and manage it */
1328
7
    int offset = 0;
1329
7
    int numrec, plen, i;
1330
1331
7
    if (aca_tree) {
1332
7
        if (isreq) {
1333
7
            plen = tvb_get_ntohs(tvb, offset+2);
1334
7
            proto_tree_add_item(aca_tree, hf_swils_domain_id_list_length, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1335
7
            numrec = plen/4;
1336
7
            offset = 4;
1337
1338
96
            for (i = 0; i < numrec; i++) {
1339
89
                proto_tree_add_uint_format(aca_tree, hf_swils_aca_domainid,
1340
89
                                           tvb, offset+3, 1,
1341
89
                                           tvb_get_uint8(tvb, offset+3),
1342
89
                                           "Domain ID %d: %d", i,
1343
89
                                           tvb_get_uint8(tvb, offset+3));
1344
89
                offset += 4;
1345
89
            }
1346
7
        }
1347
0
        else {
1348
0
            proto_tree_add_item(aca_tree, hf_swils_zone_status, tvb,
1349
0
                                offset+5, 1, ENC_BIG_ENDIAN);
1350
0
            proto_tree_add_item(aca_tree, hf_swils_zone_reason, tvb,
1351
0
                                offset+6, 1, ENC_BIG_ENDIAN);
1352
0
            proto_tree_add_item(aca_tree, hf_swils_zone_vendor_unique, tvb, offset+7, 1, ENC_BIG_ENDIAN);
1353
0
        }
1354
7
    }
1355
7
}
1356
1357
static void
1358
dissect_swils_rca(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *rca_tree, uint8_t isreq)
1359
4
{
1360
    /* Set up structures needed to add the protocol subtree and manage it */
1361
4
    int offset = 0;
1362
1363
4
    if (rca_tree) {
1364
4
        if (!isreq) {
1365
0
            proto_tree_add_item(rca_tree, hf_swils_zone_status, tvb,
1366
0
                                offset+5, 1, ENC_BIG_ENDIAN);
1367
0
            proto_tree_add_item(rca_tree, hf_swils_zone_reason, tvb,
1368
0
                                offset+6, 1, ENC_BIG_ENDIAN);
1369
0
            proto_tree_add_item(rca_tree, hf_swils_zone_vendor_unique, tvb, offset+7, 1, ENC_BIG_ENDIAN);
1370
0
        }
1371
4
    }
1372
4
}
1373
1374
static void
1375
dissect_swils_sfc(tvbuff_t *tvb, packet_info* pinfo, proto_tree *sfc_tree, uint8_t isreq)
1376
16
{
1377
    /* Set up structures needed to add the protocol subtree and manage it */
1378
16
    int         offset = 0;
1379
16
    proto_tree *zobjlist_tree, *zobj_tree;
1380
16
    int         numrec, i, zonesetlen, objlistlen, objlen;
1381
16
    char       *str;
1382
1383
16
        if (isreq) {
1384
16
            proto_tree_add_item(sfc_tree, hf_swils_sfc_opcode, tvb, offset+1, 1, ENC_BIG_ENDIAN);
1385
1386
16
            zonesetlen = tvb_get_ntohs(tvb, offset+2);
1387
16
            proto_tree_add_item(sfc_tree, hf_swils_sfc_zoneset_length, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1388
1389
16
            if (zonesetlen) {
1390
15
                str = zonenm_to_str(pinfo->pool, tvb, offset+4);
1391
15
                proto_tree_add_string(sfc_tree, hf_swils_sfc_zonenm, tvb,
1392
15
                                      offset+4, ZONENAME_LEN(tvb, offset+4),
1393
15
                                      str);
1394
1395
                /* objlistlen gives the size of the active zoneset object list */
1396
15
                objlistlen = zonesetlen - ZONENAME_LEN(tvb, offset+4);
1397
                /* Offset = start of the active zoneset zoning object list */
1398
15
                offset = offset + (4 + ZONENAME_LEN(tvb, offset+4));
1399
15
                numrec = tvb_get_ntohl(tvb, offset);
1400
1401
15
                zobjlist_tree = proto_tree_add_subtree(sfc_tree, tvb, offset, objlistlen,
1402
15
                                            ett_fcswils_zoneobjlist, NULL, "Zone Set");
1403
1404
15
                proto_tree_add_item(zobjlist_tree, hf_swils_zone_num_zoning_objects, tvb, offset, 4, ENC_BIG_ENDIAN);
1405
1406
15
                offset += 4;
1407
45
                for (i = 0; i < numrec; i++) {
1408
30
                    objlen = get_zoneobj_len(tvb, offset);
1409
30
                    zobj_tree = proto_tree_add_subtree_format(zobjlist_tree, tvb, offset, objlen,
1410
30
                                                ett_fcswils_zoneobj, NULL, "Zone Object %d", i);
1411
30
                    dissect_swils_zone_obj(tvb, pinfo, zobj_tree, offset);
1412
30
                    offset += objlen;
1413
30
                }
1414
15
            }
1415
1
            else {
1416
1
                offset += 4;
1417
1
            }
1418
1419
16
            zonesetlen = tvb_get_ntohl(tvb, offset);
1420
16
            proto_tree_add_item(sfc_tree, hf_swils_zone_full_zone_set_length, tvb, offset, 4, ENC_BIG_ENDIAN);
1421
1422
16
            if (zonesetlen) {
1423
6
                objlistlen = zonesetlen;
1424
                /* Offset = start of the active zoneset zoning object list */
1425
6
                offset += 4;
1426
6
                numrec = tvb_get_ntohl(tvb, offset);
1427
1428
6
                zobjlist_tree = proto_tree_add_subtree(sfc_tree, tvb, offset, objlistlen,
1429
6
                                            ett_fcswils_zoneobjlist, NULL, "Full Zone Set");
1430
1431
6
                proto_tree_add_item(zobjlist_tree, hf_swils_zone_num_zoning_objects, tvb, offset, 4, ENC_BIG_ENDIAN);
1432
6
                offset += 4;
1433
17
                for (i = 0; i < numrec; i++) {
1434
11
                    objlen = get_zoneobj_len(tvb, offset);
1435
11
                    zobj_tree = proto_tree_add_subtree_format(zobjlist_tree, tvb, offset, objlen,
1436
11
                                                ett_fcswils_zoneobj, NULL, "Zone Object %d", i);
1437
11
                    dissect_swils_zone_obj(tvb, pinfo, zobj_tree, offset);
1438
11
                    offset += objlen;
1439
11
                }
1440
6
            }
1441
16
        }
1442
0
        else {
1443
0
            proto_tree_add_item(sfc_tree, hf_swils_zone_status, tvb,
1444
0
                                offset+5, 1, ENC_BIG_ENDIAN);
1445
0
            proto_tree_add_item(sfc_tree, hf_swils_zone_reason, tvb,
1446
0
                                offset+6, 1, ENC_BIG_ENDIAN);
1447
0
            proto_tree_add_item(sfc_tree, hf_swils_zone_vendor_unique, tvb, offset+7, 1, ENC_BIG_ENDIAN);
1448
0
        }
1449
16
}
1450
1451
static void
1452
dissect_swils_ufc(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *ufc_tree, uint8_t isreq)
1453
0
{
1454
    /* Set up structures needed to add the protocol subtree and manage it */
1455
0
    int offset = 0;
1456
1457
0
    if (ufc_tree) {
1458
0
        if (!isreq) {
1459
0
            proto_tree_add_item(ufc_tree, hf_swils_zone_status, tvb,
1460
0
                                offset+5, 1, ENC_BIG_ENDIAN);
1461
0
            proto_tree_add_item(ufc_tree, hf_swils_zone_reason, tvb,
1462
0
                                offset+6, 1, ENC_BIG_ENDIAN);
1463
0
            proto_tree_add_item(ufc_tree, hf_swils_zone_vendor_unique, tvb, offset+7, 1, ENC_BIG_ENDIAN);
1464
0
        }
1465
0
    }
1466
0
}
1467
1468
static void
1469
dissect_swils_esc(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *esc_tree, uint8_t isreq)
1470
12
{
1471
    /* Set up structures needed to add the protocol subtree and manage it */
1472
12
    int         offset = 0;
1473
12
    int         i, numrec, plen;
1474
12
    proto_tree *pdesc_tree;
1475
1476
12
    if (esc_tree) {
1477
12
        if (isreq) {
1478
12
            plen = tvb_get_ntohs(tvb, offset+2);
1479
12
            proto_tree_add_item(esc_tree, hf_swils_esc_payload_length, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1480
12
            proto_tree_add_item(esc_tree, hf_swils_esc_swvendorid, tvb,
1481
12
                                offset+4, 8, ENC_ASCII);
1482
12
            numrec = (plen - 12)/12;
1483
12
            offset = 12;
1484
1485
80
            for (i = 0; i < numrec; i++) {
1486
68
                pdesc_tree = proto_tree_add_subtree_format(esc_tree, tvb, offset, 12,
1487
68
                                            ett_fcswils_esc_pdesc, NULL, "Protocol Descriptor %d", i);
1488
68
                proto_tree_add_item(pdesc_tree, hf_swils_esc_pdesc_vendorid, tvb,
1489
68
                                    offset, 8, ENC_ASCII);
1490
68
                proto_tree_add_item(pdesc_tree, hf_swils_esc_protocolid,
1491
68
                                    tvb, offset+10, 2, ENC_BIG_ENDIAN);
1492
68
                offset += 12;
1493
68
            }
1494
12
        }
1495
0
        else {
1496
0
            proto_tree_add_item(esc_tree, hf_swils_esc_swvendorid, tvb,
1497
0
                                offset+4, 8, ENC_ASCII);
1498
0
            pdesc_tree = proto_tree_add_subtree(esc_tree, tvb, offset+12, 12,
1499
0
                                        ett_fcswils_esc_pdesc, NULL, "Accepted Protocol Descriptor");
1500
1501
0
            proto_tree_add_item(pdesc_tree, hf_swils_esc_pdesc_vendorid, tvb,
1502
0
                                offset+12, 8, ENC_ASCII);
1503
0
            proto_tree_add_item(pdesc_tree, hf_swils_esc_protocolid,
1504
0
                                tvb, offset+22, 2, ENC_BIG_ENDIAN);
1505
0
        }
1506
12
    }
1507
12
}
1508
1509
static void
1510
dissect_swils_drlir(tvbuff_t *tvb _U_, packet_info* pinfo _U_, proto_tree *drlir_tree _U_,
1511
                    uint8_t isreq _U_)
1512
0
{
1513
    /* Set up structures needed to add the protocol subtree and manage it */
1514
0
    return;
1515
0
}
1516
1517
static void
1518
dissect_swils_swrjt(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *swrjt_tree, uint8_t isreq _U_)
1519
3
{
1520
    /* Set up structures needed to add the protocol subtree and manage it */
1521
3
    int offset = 0;
1522
1523
3
    if (swrjt_tree) {
1524
3
        proto_tree_add_item(swrjt_tree, hf_swils_rjt, tvb, offset+5, 1, ENC_BIG_ENDIAN);
1525
3
        proto_tree_add_item(swrjt_tree, hf_swils_rjtdet, tvb, offset+6, 1, ENC_BIG_ENDIAN);
1526
3
        proto_tree_add_item(swrjt_tree, hf_swils_rjtvendor, tvb, offset+7,
1527
3
                            1, ENC_BIG_ENDIAN);
1528
3
    }
1529
3
}
1530
1531
static void
1532
dissect_swils_ess(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *ess_tree, uint8_t isreq _U_)
1533
25
{
1534
25
    int         offset      = 0;
1535
25
    int16_t     numcapobj   = 0;
1536
25
    int         len         = 0;
1537
25
    int         capobjlen   = 0;
1538
25
    proto_tree *ieinfo_tree;
1539
1540
25
    if (!ess_tree) {
1541
0
        return;
1542
0
    }
1543
1544
25
    proto_tree_add_item(ess_tree, hf_swils_ess_rev, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1545
25
    proto_tree_add_item(ess_tree, hf_swils_ess_len, tvb, offset+8, 4, ENC_BIG_ENDIAN);
1546
25
    len = tvb_get_ntohl(tvb, offset+8);
1547
1548
25
    ieinfo_tree = proto_tree_add_subtree(ess_tree, tvb, offset+12,
1549
25
                             MAX_INTERCONNECT_ELEMENT_INFO_LEN+4,
1550
25
                             ett_fcswils_ieinfo, NULL, "Interconnect Element Info");
1551
25
    dissect_swils_interconnect_element_info(tvb, ieinfo_tree, offset+12);
1552
25
    len -= 256;                /* the interconnect obj above is 256 bytes */
1553
25
    offset += 268;
1554
1555
25
    proto_tree_add_item(ess_tree, hf_swils_ess_numobj, tvb, offset, 2, ENC_BIG_ENDIAN);
1556
25
    numcapobj = tvb_get_ntohs(tvb, offset);
1557
1558
25
    len -= 4;                  /* 2B numcapobj + 2B rsvd */
1559
25
    offset += 4;
1560
1561
113
    while ((len > 0) && (numcapobj > 0)) {
1562
88
        capobjlen = dissect_swils_ess_capability_obj(tvb, pinfo, ess_tree, offset);
1563
88
        numcapobj--;
1564
88
        len -= capobjlen;
1565
88
        offset += capobjlen;
1566
88
    }
1567
25
}
1568
1569
static void
1570
dissect_swils_mrra(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, uint8_t isreq)
1571
0
{
1572
1573
0
    int offset = 0;
1574
1575
0
    if (!tree) {
1576
0
        return;
1577
0
    }
1578
1579
0
    if (isreq) {
1580
0
        proto_tree_add_item(tree, hf_swils_mrra_rev, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1581
0
        proto_tree_add_item(tree, hf_swils_mrra_size, tvb, offset+8, 4, ENC_BIG_ENDIAN);
1582
0
        proto_tree_add_item(tree, hf_swils_mrra_vendorid, tvb, offset+12, 8, ENC_ASCII);
1583
0
        proto_tree_add_item(tree, hf_swils_mrra_vendorinfo, tvb, offset+20,
1584
0
                            8, ENC_NA);
1585
0
    } else {
1586
0
        proto_tree_add_item(tree, hf_swils_mrra_vendorid, tvb, offset+4,
1587
0
                            8, ENC_ASCII);
1588
0
        proto_tree_add_item(tree, hf_swils_mrra_reply, tvb, offset+12,
1589
0
                            4, ENC_BIG_ENDIAN);
1590
0
        proto_tree_add_item(tree, hf_swils_mrra_reply_size, tvb, offset+16,
1591
0
                            4, ENC_BIG_ENDIAN);
1592
0
        proto_tree_add_item(tree, hf_swils_mrra_waittime, tvb, offset+20,
1593
0
                            4, ENC_BIG_ENDIAN);
1594
0
    }
1595
1596
1597
0
}
1598
1599
static fcswils_func_table_t fcswils_func_table[FC_SWILS_MAXCODE] = {
1600
    /* 0x00 */ {NULL},
1601
    /* 0x01 */ {dissect_swils_swrjt},
1602
    /* 0x02 */ {NULL},
1603
    /* 0x03 */ {NULL},
1604
    /* 0x04 */ {NULL},
1605
    /* 0x05 */ {NULL},
1606
    /* 0x06 */ {NULL},
1607
    /* 0x07 */ {NULL},
1608
    /* 0x08 */ {NULL},
1609
    /* 0x09 */ {NULL},
1610
    /* 0x0a */ {NULL},
1611
    /* 0x0b */ {NULL},
1612
    /* 0x0c */ {NULL},
1613
    /* 0x0d */ {NULL},
1614
    /* 0x0e */ {NULL},
1615
    /* 0x0f */ {NULL},
1616
    /* 0x10 */ {dissect_swils_elp},
1617
    /* 0x11 */ {dissect_swils_efp},
1618
    /* 0x12 */ {dissect_swils_dia},
1619
    /* 0x13 */ {dissect_swils_rdi},
1620
    /* 0x14 */ {dissect_swils_hello},
1621
    /* 0x15 */ {dissect_swils_lsupdate},
1622
    /* 0x16 */ {dissect_swils_lsack},
1623
    /* 0x17 */ {dissect_swils_nullpayload},
1624
    /* 0x18 */ {dissect_swils_nullpayload},
1625
    /* 0x19 */ {NULL},
1626
    /* 0x1a */ {NULL},
1627
    /* 0x1b */ {dissect_swils_rscn},
1628
    /* 0x1c */ {NULL},
1629
    /* 0x1d */ {NULL},
1630
    /* 0x1e */ {dissect_swils_drlir},
1631
    /* 0x1f */ {NULL},
1632
    /* 0x20 */ {NULL /*dissect_swils_dscn*/},
1633
    /* 0x21 */ {NULL /*dissect_swils_loopd*/},
1634
    /* 0x22 */ {dissect_swils_mergereq},
1635
    /* 0x23 */ {dissect_swils_aca},
1636
    /* 0x24 */ {dissect_swils_rca},
1637
    /* 0x25 */ {dissect_swils_sfc},
1638
    /* 0x26 */ {dissect_swils_ufc},
1639
    /* 0x27 */ {NULL},
1640
    /* 0x28 */ {NULL},
1641
    /* 0x29 */ {NULL},
1642
    /* 0x2a */ {NULL},
1643
    /* 0x2b */ {NULL},
1644
    /* 0x2c */ {NULL},
1645
    /* 0x2d */ {NULL},
1646
    /* 0x2e */ {NULL},
1647
    /* 0x2f */ {NULL},
1648
    /* 0x30 */ {dissect_swils_esc},
1649
    /* 0x31 */ {dissect_swils_ess},
1650
    /* 0x32 */ {NULL},
1651
    /* 0x33 */ {NULL},
1652
    /* 0x34 */ {dissect_swils_mrra}
1653
};
1654
1655
/* Code to actually dissect the packets */
1656
static int
1657
dissect_fcswils(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
1658
196
{
1659
196
    proto_item          *ti            = NULL;
1660
196
    uint8_t              opcode;
1661
196
    uint8_t              failed_opcode = 0;
1662
196
    int                  offset        = 0;
1663
196
    conversation_t      *conversation;
1664
196
    fcswils_conv_data_t *cdata;
1665
196
    fcswils_conv_key_t   ckey, *req_key;
1666
196
    proto_tree          *swils_tree    = NULL;
1667
196
    uint8_t              isreq         = FC_SWILS_REQ;
1668
196
    tvbuff_t            *next_tvb;
1669
196
    fc_hdr *fchdr;
1670
1671
    /* Reject the packet if data is NULL */
1672
196
    if (data == NULL)
1673
0
        return 0;
1674
196
    fchdr = (fc_hdr *)data;
1675
1676
    /* Make entries in Protocol column and Info column on summary display */
1677
196
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "SW_ILS");
1678
1679
    /* decoding of this is done by each individual opcode handler */
1680
196
    opcode = tvb_get_uint8(tvb, 0);
1681
1682
196
    ti = proto_tree_add_protocol_format(tree, proto_fcswils, tvb, 0, -1, "SW_ILS");
1683
196
    swils_tree = proto_item_add_subtree(ti, ett_fcswils);
1684
1685
    /* Register conversation if this is not a response */
1686
196
    if ((opcode != FC_SWILS_SWACC) && (opcode != FC_SWILS_SWRJT)) {
1687
191
        conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
1688
191
                                         conversation_pt_to_conversation_type(pinfo->ptype), fchdr->oxid,
1689
191
                                         fchdr->rxid, NO_PORT_B);
1690
191
        if (!conversation) {
1691
32
            conversation = conversation_new(pinfo->num, &pinfo->src, &pinfo->dst,
1692
32
                                            conversation_pt_to_conversation_type(pinfo->ptype), fchdr->oxid,
1693
32
                                            fchdr->rxid, NO_PORT2);
1694
32
        }
1695
1696
191
        ckey.conv_idx = conversation->conv_index;
1697
1698
191
        cdata = (fcswils_conv_data_t *)wmem_map_lookup(fcswils_req_hash,
1699
191
                                                           &ckey);
1700
191
        if (cdata) {
1701
            /* Since we never free the memory used by an exchange, this maybe a
1702
             * case of another request using the same exchange as a previous
1703
             * req.
1704
             */
1705
159
            cdata->opcode = opcode;
1706
159
        }
1707
32
        else {
1708
32
            req_key = wmem_new(wmem_file_scope(), fcswils_conv_key_t);
1709
32
            req_key->conv_idx = conversation->conv_index;
1710
1711
32
            cdata = wmem_new(wmem_file_scope(), fcswils_conv_data_t);
1712
32
            cdata->opcode = opcode;
1713
1714
32
            wmem_map_insert(fcswils_req_hash, req_key, cdata);
1715
32
        }
1716
191
    }
1717
5
    else {
1718
        /* Opcode is ACC or RJT */
1719
5
        conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
1720
5
                                         conversation_pt_to_conversation_type(pinfo->ptype), fchdr->oxid,
1721
5
                                         fchdr->rxid, NO_PORT_B);
1722
5
        isreq = FC_SWILS_RPLY;
1723
5
        if (!conversation) {
1724
4
            if (tree && (opcode == FC_SWILS_SWACC)) {
1725
                /* No record of what this accept is for. Can't decode */
1726
2
                proto_tree_add_expert_format(swils_tree, pinfo, &ei_swils_no_exchange, tvb, 0, -1, "No record of Exchg. Unable to decode SW_ACC");
1727
2
                return 0;
1728
2
            }
1729
4
        }
1730
1
        else {
1731
1
            ckey.conv_idx = conversation->conv_index;
1732
1733
1
            cdata = (fcswils_conv_data_t *)wmem_map_lookup(fcswils_req_hash, &ckey);
1734
1735
1
            if (cdata != NULL) {
1736
1
                if (opcode == FC_SWILS_SWACC)
1737
0
                    opcode = cdata->opcode;
1738
1
                else
1739
1
                    failed_opcode = cdata->opcode;
1740
1
            }
1741
1742
1
            if (tree) {
1743
1
                if ((cdata == NULL) && (opcode != FC_SWILS_SWRJT)) {
1744
                    /* No record of what this accept is for. Can't decode */
1745
0
                    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");
1746
0
                    return 0;
1747
0
                }
1748
1
            }
1749
1
        }
1750
5
    }
1751
1752
194
    if (isreq == FC_SWILS_REQ) {
1753
191
        col_add_str(pinfo->cinfo, COL_INFO,
1754
191
                    val_to_str(pinfo->pool, opcode, fc_swils_opcode_key_val, "0x%x"));
1755
191
    }
1756
3
    else if (opcode == FC_SWILS_SWRJT) {
1757
3
        col_add_fstr(pinfo->cinfo, COL_INFO, "SW_RJT (%s)",
1758
3
                        val_to_str(pinfo->pool, failed_opcode, fc_swils_opcode_key_val, "0x%x"));
1759
3
    }
1760
0
    else {
1761
0
        col_add_fstr(pinfo->cinfo, COL_INFO, "SW_ACC (%s)",
1762
0
                        val_to_str(pinfo->pool, opcode, fc_swils_opcode_key_val, "0x%x"));
1763
0
    }
1764
1765
194
    proto_tree_add_item(swils_tree, hf_swils_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1766
1767
194
    if ((opcode < FC_SWILS_MAXCODE) && fcswils_func_table[opcode].func) {
1768
165
        fcswils_func_table[opcode].func(tvb, pinfo, swils_tree, isreq);
1769
165
    } else if (opcode == FC_SWILS_AUTH_ILS) {
1770
        /* This is treated differently */
1771
2
        if (isreq && fcsp_handle)
1772
2
            call_dissector(fcsp_handle, tvb, pinfo, swils_tree);
1773
27
    } else {
1774
        /* data dissector */
1775
27
        next_tvb = tvb_new_subset_remaining(tvb, offset+4);
1776
27
        call_data_dissector(next_tvb, pinfo, tree);
1777
27
    }
1778
1779
194
    return tvb_captured_length(tvb);
1780
196
}
1781
1782
/* Register the protocol with Wireshark */
1783
1784
void
1785
proto_register_fcswils(void)
1786
14
{
1787
14
    static hf_register_info hf[] = {
1788
14
        { &hf_swils_opcode,
1789
14
          {"Cmd Code", "swils.opcode",
1790
14
           FT_UINT8, BASE_HEX, VALS(fc_swils_opcode_key_val), 0x0,
1791
14
           NULL, HFILL}},
1792
1793
14
        { &hf_swils_elp_rev,
1794
14
          {"Revision", "swils.elp.rev",
1795
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
1796
14
           NULL, HFILL}},
1797
1798
14
        { &hf_swils_elp_flags,
1799
14
          {"Flag", "swils.elp.flag",
1800
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
1801
14
           NULL, HFILL}},
1802
1803
14
        { &hf_swils_elp_r_a_tov,
1804
14
          {"R_A_TOV", "swils.elp.ratov",
1805
14
           FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_milliseconds), 0x0,
1806
14
           NULL, HFILL}},
1807
1808
14
        { &hf_swils_elp_e_d_tov,
1809
14
          {"E_D_TOV", "swils.elp.edtov",
1810
14
           FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_milliseconds), 0x0,
1811
14
           NULL, HFILL}},
1812
1813
14
        { &hf_swils_elp_req_epn,
1814
14
          {"Req Eport Name", "swils.elp.reqepn",
1815
14
           FT_FCWWN, BASE_NONE, NULL, 0x0,
1816
14
           NULL, HFILL}},
1817
1818
14
        { &hf_swils_elp_req_esn,
1819
14
          {"Req Switch Name", "swils.elp.reqesn",
1820
14
           FT_FCWWN, BASE_NONE, NULL, 0x0,
1821
14
           NULL, HFILL}},
1822
1823
14
        { &hf_swils_elp_clsf_svcp,
1824
14
          {"Class F Svc Parameters", "swils.elp.clsfp",
1825
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
1826
14
           NULL, HFILL}},
1827
1828
14
        { &hf_swils_elp_clsf_rcvsz,
1829
14
          {"Max Class F Frame Size", "swils.elp.clsfrsz",
1830
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
1831
14
           NULL, HFILL}},
1832
1833
14
        { &hf_swils_elp_clsf_conseq,
1834
14
          {"Class F Max Concurrent Seq", "swils.elp.clsfcs",
1835
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
1836
14
           NULL, HFILL}},
1837
1838
14
        { &hf_swils_elp_clsf_e2e,
1839
14
          {"Class F E2E Credit", "swils.elp.cfe2e",
1840
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
1841
14
           NULL, HFILL}},
1842
1843
14
        { &hf_swils_elp_clsf_openseq,
1844
14
          {"Class F Max Open Seq", "swils.elp.oseq",
1845
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
1846
14
           NULL, HFILL}},
1847
1848
14
        { &hf_swils_elp_cls1_svcp,
1849
14
          {"Class 1 Svc Parameters", "swils.elp.cls1p",
1850
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
1851
14
           NULL, HFILL}},
1852
1853
14
        { &hf_swils_elp_cls1_rcvsz,
1854
14
          {"Class 1 Frame Size", "swils.elp.cls1rsz",
1855
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
1856
14
           NULL, HFILL}},
1857
1858
14
        { &hf_swils_elp_cls2_svcp,
1859
14
          {"Class 2 Svc Parameters", "swils.elp.cls2p",
1860
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
1861
14
           NULL, HFILL}},
1862
1863
14
        { &hf_swils_elp_cls2_rcvsz,
1864
14
          {"Class 2 Frame Size", "swils.elp.cls2rsz",
1865
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
1866
14
           NULL, HFILL}},
1867
1868
14
        { &hf_swils_elp_cls3_svcp,
1869
14
          {"Class 3 Svc Parameters", "swils.elp.cls3p",
1870
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
1871
14
           NULL, HFILL}},
1872
1873
14
        { &hf_swils_elp_cls3_rcvsz,
1874
14
          {"Class 3 Frame Size", "swils.elp.cls3rsz",
1875
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
1876
14
           NULL, HFILL}},
1877
1878
14
        { &hf_swils_elp_isl_fc_mode,
1879
14
          {"ISL Flow Ctrl Mode", "swils.elp.fcmode",
1880
14
           FT_STRING, BASE_NONE, NULL, 0x0,
1881
14
           NULL, HFILL}},
1882
1883
14
        { &hf_swils_elp_fcplen,
1884
14
          {"Flow Ctrl Param Len", "swils.elp.fcplen",
1885
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
1886
14
           NULL, HFILL}},
1887
1888
14
        { &hf_swils_elp_b2bcredit,
1889
14
          {"B2B Credit", "swils.elp.b2b",
1890
14
           FT_UINT32, BASE_DEC, NULL, 0x0,
1891
14
           NULL, HFILL}},
1892
1893
14
        { &hf_swils_elp_compat1,
1894
14
          {"Compatibility Param 1", "swils.elp.compat1",
1895
14
           FT_UINT32, BASE_DEC, NULL, 0x0,
1896
14
           NULL, HFILL}},
1897
1898
14
        { &hf_swils_elp_compat2,
1899
14
          {"Compatibility Param 2", "swils.elp.compat2",
1900
14
           FT_UINT32, BASE_DEC, NULL, 0x0,
1901
14
           NULL, HFILL}},
1902
1903
14
        { &hf_swils_elp_compat3,
1904
14
          {"Compatibility Param 3", "swils.elp.compat3",
1905
14
           FT_UINT32, BASE_DEC, NULL, 0x0,
1906
14
           NULL, HFILL}},
1907
1908
14
        { &hf_swils_elp_compat4,
1909
14
          {"Compatibility Param 4", "swils.elp.compat4",
1910
14
           FT_UINT32, BASE_DEC, NULL, 0x0,
1911
14
           NULL, HFILL}},
1912
1913
14
        { &hf_swils_efp_rec_type,
1914
14
          {"Record Type", "swils.efp.rectype",
1915
14
           FT_UINT8, BASE_HEX, VALS(fcswils_rectype_val), 0x0,
1916
14
           NULL, HFILL}},
1917
1918
14
        { &hf_swils_efp_dom_id,
1919
14
          {"Domain ID", "swils.efp.domid",
1920
14
           FT_UINT8, BASE_HEX, NULL, 0x0,
1921
14
           NULL, HFILL}},
1922
1923
14
        { &hf_swils_efp_switch_name,
1924
14
          {"Switch Name", "swils.efp.sname",
1925
14
           FT_FCWWN, BASE_NONE, NULL, 0x0,
1926
14
           NULL, HFILL}},
1927
1928
14
        { &hf_swils_efp_mcast_grpno,
1929
14
          {"Mcast Grp#", "swils.efp.mcastno",
1930
14
           FT_UINT8, BASE_HEX, NULL, 0x0,
1931
14
           NULL, HFILL}},
1932
1933
#if 0
1934
        { &hf_swils_efp_alias_token,
1935
          {"Alias Token", "swils.efp.aliastok",
1936
           FT_BYTES, BASE_NONE, NULL, 0x0,
1937
           NULL, HFILL}},
1938
#endif
1939
1940
14
        { &hf_swils_efp_record_len,
1941
14
          {"Record Len", "swils.efp.recordlen",
1942
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
1943
14
           NULL, HFILL}},
1944
1945
14
        { &hf_swils_efp_payload_len,
1946
14
          {"Payload Len", "swils.efp.payloadlen",
1947
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
1948
14
           NULL, HFILL}},
1949
1950
14
        { &hf_swils_efp_pswitch_pri,
1951
14
          {"Principal Switch Priority", "swils.efp.psprio",
1952
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
1953
14
           NULL, HFILL}},
1954
1955
14
        { &hf_swils_efp_pswitch_name,
1956
14
          {"Principal Switch Name", "swils.efp.psname",
1957
14
           FT_FCWWN, BASE_NONE, NULL, 0x0,
1958
14
           NULL, HFILL}},
1959
1960
14
        { &hf_swils_dia_switch_name,
1961
14
          {"Switch Name", "swils.dia.sname",
1962
14
           FT_FCWWN, BASE_NONE, NULL, 0x0,
1963
14
           NULL, HFILL}},
1964
1965
14
        { &hf_swils_rdi_payload_len,
1966
14
          {"Payload Len", "swils.rdi.len",
1967
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
1968
14
           NULL, HFILL}},
1969
1970
14
        { &hf_swils_rdi_req_sname,
1971
14
          {"Req Switch Name", "swils.rdi.reqsn",
1972
14
           FT_FCWWN, BASE_NONE, NULL, 0x0,
1973
14
           NULL, HFILL}},
1974
1975
#if 0
1976
        { &hf_swils_fspfh_cmd,
1977
          {"Command", "swils.fspf.cmd",
1978
           FT_UINT8, BASE_HEX, NULL, 0x0,
1979
           NULL, HFILL}},
1980
#endif
1981
1982
14
        { &hf_swils_fspfh_rev,
1983
14
          {"Version", "swils.fspf.ver",
1984
14
           FT_UINT8, BASE_HEX, NULL, 0x0,
1985
14
           NULL, HFILL}},
1986
1987
14
        { &hf_swils_fspfh_ar_num,
1988
14
          {"AR Number", "swils.fspf.arnum",
1989
14
           FT_UINT8, BASE_HEX, NULL, 0x0,
1990
14
           NULL, HFILL}},
1991
1992
14
        { &hf_swils_fspfh_auth_type,
1993
14
          {"Authentication Type", "swils.fspf.authtype",
1994
14
           FT_UINT8, BASE_HEX, NULL, 0x0,
1995
14
           NULL, HFILL}},
1996
1997
14
        { &hf_swils_fspfh_dom_id,
1998
14
          {"Originating Domain ID", "swils.fspf.origdomid",
1999
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
2000
14
           NULL, HFILL}},
2001
2002
14
        { &hf_swils_fspfh_auth,
2003
14
          {"Authentication", "swils.fspf.auth",
2004
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
2005
14
           NULL, HFILL}},
2006
2007
14
        { &hf_swils_hlo_options,
2008
14
          {"Options", "swils.hlo.options",
2009
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
2010
14
           NULL, HFILL}},
2011
2012
14
        { &hf_swils_hlo_hloint,
2013
14
          {"Hello Interval (secs)", "swils.hlo.hloint",
2014
14
           FT_UINT32, BASE_DEC, NULL, 0x0,
2015
14
           NULL, HFILL}},
2016
2017
14
        { &hf_swils_hlo_deadint,
2018
14
          {"Dead Interval (secs)", "swils.hlo.deadint",
2019
14
           FT_UINT32, BASE_DEC, NULL, 0x0,
2020
14
           NULL, HFILL}},
2021
2022
14
        { &hf_swils_hlo_rcv_domid,
2023
14
          {"Recipient Domain ID", "swils.hlo.rcvdomid",
2024
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
2025
14
           NULL, HFILL}},
2026
2027
14
        { &hf_swils_hlo_orig_pidx,
2028
14
          {"Originating Port Idx", "swils.hlo.origpidx",
2029
14
           FT_UINT24, BASE_HEX, NULL, 0x0,
2030
14
           NULL, HFILL}},
2031
2032
14
        { &hf_swils_lsrh_lsr_type,
2033
14
          {"LSR Type", "swils.lsr.type",
2034
14
           FT_UINT8, BASE_HEX, VALS(fc_swils_fspf_linkrec_val), 0x0,
2035
14
           NULL, HFILL}},
2036
2037
14
        { &hf_swils_lsrh_lsid,
2038
14
          {"Link State Id", "swils.ls.id",
2039
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
2040
14
           NULL, HFILL}},
2041
2042
14
        { &hf_swils_lsrh_adv_domid,
2043
14
          {"Advertising Domain Id", "swils.lsr.advdomid",
2044
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
2045
14
           NULL, HFILL}},
2046
2047
14
        { &hf_swils_lsrh_ls_incid,
2048
14
          {"LS Incarnation Number", "swils.lsr.incid",
2049
14
           FT_UINT32, BASE_DEC, NULL, 0x0,
2050
14
           NULL, HFILL}},
2051
2052
14
        { &hf_swils_ldrec_linkid,
2053
14
          {"Link ID", "swils.ldr.linkid",
2054
14
           FT_BYTES, SEP_DOT, NULL, 0x0,
2055
14
           NULL, HFILL}},
2056
2057
14
        { &hf_swils_ldrec_out_pidx,
2058
14
          {"Output Port Idx", "swils.ldr.out_portidx",
2059
14
           FT_UINT24, BASE_HEX, NULL, 0x0,
2060
14
           NULL, HFILL}},
2061
2062
14
        { &hf_swils_ldrec_nbr_pidx,
2063
14
          {"Neighbor Port Idx", "swils.ldr.nbr_portidx",
2064
14
           FT_UINT24, BASE_HEX, NULL, 0x0,
2065
14
           NULL, HFILL}},
2066
2067
14
        { &hf_swils_ldrec_link_type,
2068
14
          {"Link Type", "swils.ldr.linktype",
2069
14
           FT_UINT8, BASE_HEX, VALS(fc_swils_link_type_val), 0x0,
2070
14
           NULL, HFILL}},
2071
2072
14
        { &hf_swils_ldrec_link_cost,
2073
14
          {"Link Cost", "swils.ldr.linkcost",
2074
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
2075
14
           NULL, HFILL}},
2076
2077
14
        { &hf_swils_rscn_evtype,
2078
14
          {"Event Type", "swils.rscn.evtype",
2079
14
           FT_UINT8, BASE_DEC, VALS(fc_swils_rscn_portstate_val), 0xF0,
2080
14
           NULL, HFILL}},
2081
2082
14
        { &hf_swils_rscn_addrfmt,
2083
14
          {"Address Format", "swils.rscn.addrfmt",
2084
14
           FT_UINT8, BASE_DEC, VALS(fc_swils_rscn_addrfmt_val), 0x0F,
2085
14
           NULL, HFILL}},
2086
2087
14
        { &hf_swils_rscn_affectedport,
2088
14
          {"Affected Port ID", "swils.rscn.affectedport",
2089
14
           FT_BYTES, SEP_DOT, NULL, 0x0,
2090
14
           NULL, HFILL}},
2091
2092
14
        { &hf_swils_rscn_detectfn,
2093
14
          {"Detection Function", "swils.rscn.detectfn",
2094
14
           FT_UINT32, BASE_HEX, VALS(fc_swils_rscn_detectfn_val), 0x0,
2095
14
           NULL, HFILL}},
2096
2097
14
        { &hf_swils_rscn_portstate,
2098
14
          {"Port State", "swils.rscn.portstate",
2099
14
           FT_UINT8, BASE_HEX, NULL, 0x0,
2100
14
           NULL, HFILL}},
2101
2102
14
        { &hf_swils_rscn_portid,
2103
14
          {"Port Id", "swils.rscn.portid",
2104
14
           FT_BYTES, SEP_DOT, NULL, 0x0,
2105
14
           NULL, HFILL}},
2106
2107
14
        { &hf_swils_rscn_pwwn,
2108
14
          {"Port WWN", "swils.rscn.pwwn",
2109
14
           FT_FCWWN, BASE_NONE, NULL, 0x0,
2110
14
           NULL, HFILL}},
2111
2112
14
        { &hf_swils_rscn_nwwn,
2113
14
          {"Node WWN", "swils.rscn.nwwn",
2114
14
           FT_FCWWN, BASE_NONE, NULL, 0x0,
2115
14
           NULL, HFILL}},
2116
2117
14
        { &hf_swils_esc_swvendorid,
2118
14
          {"Switch Vendor ID", "swils.esc.swvendor",
2119
14
           FT_STRING, BASE_NONE, NULL, 0x0,
2120
14
           NULL, HFILL}},
2121
2122
14
        { &hf_swils_esc_pdesc_vendorid,
2123
14
          {"Vendor ID", "swils.esc.vendorid",
2124
14
           FT_STRING, BASE_NONE, NULL, 0x0,
2125
14
           NULL, HFILL}},
2126
2127
14
        { &hf_swils_esc_protocolid,
2128
14
          {"Protocol ID", "swils.esc.protocol",
2129
14
           FT_UINT16, BASE_HEX, VALS(fc_swils_esc_protocol_val), 0x0,
2130
14
           NULL, HFILL}},
2131
2132
14
        { &hf_swils_zone_activezonenm,
2133
14
          {"Active Zoneset Name", "swils.mr.activezonesetname",
2134
14
           FT_STRING, BASE_NONE, NULL, 0x0,
2135
14
           NULL, HFILL}},
2136
2137
14
        { &hf_swils_zone_objname,
2138
14
          {"Zone Object Name", "swils.zone.zoneobjname",
2139
14
           FT_STRING, BASE_NONE, NULL, 0x0,
2140
14
           NULL, HFILL}},
2141
2142
14
        { &hf_swils_zone_objtype,
2143
14
          {"Zone Object Type", "swils.zone.zoneobjtype",
2144
14
           FT_UINT8, BASE_HEX, VALS(fc_swils_zoneobj_type_val), 0x0,
2145
14
           NULL, HFILL}},
2146
2147
14
        { &hf_swils_zone_mbrtype,
2148
14
          {"Zone Member Type", "swils.zone.mbrtype",
2149
14
           FT_UINT8, BASE_HEX, VALS(fc_swils_zonembr_type_val), 0x0,
2150
14
           NULL, HFILL}},
2151
2152
14
        { &hf_swils_zone_protocol,
2153
14
          {"Zone Protocol", "swils.zone.protocol",
2154
14
           FT_UINT8, BASE_HEX, NULL, 0x0,
2155
14
           NULL, HFILL}},
2156
2157
14
        { &hf_swils_zone_mbrid,
2158
14
          {"Member Identifier", "swils.zone.mbrid",
2159
14
           FT_STRING, BASE_NONE, NULL, 0x0,
2160
14
           NULL, HFILL}},
2161
2162
14
        { &hf_swils_zone_mbrid_fcwwn,
2163
14
          {"Member Identifier", "swils.zone.mbrid.fcwwn",
2164
14
           FT_FCWWN, BASE_NONE, NULL, 0x0,
2165
14
           NULL, HFILL}},
2166
2167
14
        { &hf_swils_zone_mbrid_fc,
2168
14
          {"Member Identifier", "swils.zone.mbrid.fc",
2169
14
           FT_BYTES, SEP_DOT, NULL, 0x0,
2170
14
           NULL, HFILL}},
2171
2172
14
        { &hf_swils_zone_mbrid_uint,
2173
14
          {"Member Identifier", "swils.zone.mbrid.uint",
2174
14
           FT_UINT32, BASE_HEX, NULL, 0x0,
2175
14
           NULL, HFILL}},
2176
2177
14
        { &hf_swils_zone_status,
2178
14
          {"Zone Command Status", "swils.zone.status",
2179
14
           FT_UINT8, BASE_HEX, VALS(fc_swils_mr_rsp_val), 0x0,
2180
14
           "Applies to MR, ACA, RCA, SFC, UFC", HFILL}},
2181
2182
14
        { &hf_swils_zone_reason,
2183
14
          {"Zone Command Reason Code", "swils.zone.reason",
2184
14
           FT_UINT8, BASE_HEX, VALS(fc_swils_mr_reason_val), 0x0,
2185
14
           "Applies to MR, ACA, RCA, SFC, UFC", HFILL}},
2186
2187
14
        { &hf_swils_aca_domainid,
2188
14
          {"Known Domain ID", "swils.aca.domainid",
2189
14
           FT_UINT8, BASE_HEX, NULL, 0x0,
2190
14
           NULL, HFILL}},
2191
2192
14
        { &hf_swils_sfc_opcode,
2193
14
          {"Operation Request", "swils.sfc.opcode",
2194
14
           FT_UINT8, BASE_HEX, VALS(fc_swils_sfc_op_val), 0x0,
2195
14
           NULL, HFILL}},
2196
2197
14
        { &hf_swils_sfc_zonenm,
2198
14
          {"Zone Set Name", "swils.sfc.zonename",
2199
14
           FT_STRING, BASE_NONE, NULL, 0x0,
2200
14
           NULL, HFILL}},
2201
2202
14
        { &hf_swils_rjt,
2203
14
          {"Reason Code", "swils.rjt.reason",
2204
14
           FT_UINT8, BASE_HEX, VALS(fc_swils_rjt_val), 0x0,
2205
14
           NULL, HFILL}},
2206
2207
14
        { &hf_swils_rjtdet,
2208
14
          {"Reason Code Explanation", "swils.rjt.reasonexpl",
2209
14
           FT_UINT8, BASE_HEX, VALS(fc_swils_deterr_val), 0x0,
2210
14
           NULL, HFILL}},
2211
2212
14
        { &hf_swils_rjtvendor,
2213
14
          {"Vendor Unique Error Code", "swils.rjt.vendor",
2214
14
           FT_UINT8, BASE_HEX, NULL, 0x0,
2215
14
           NULL, HFILL}},
2216
2217
14
        { &hf_swils_zone_mbrid_lun,
2218
14
          {"LUN", "swils.zone.lun",
2219
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
2220
14
           NULL, HFILL}},
2221
2222
14
        { &hf_swils_ess_rev,
2223
14
          {"Revision", "swils.ess.revision",
2224
14
           FT_UINT32, BASE_DEC, NULL, 0x0,
2225
14
           NULL, HFILL}},
2226
2227
14
        { &hf_swils_ess_len,
2228
14
          {"Payload Length", "swils.ess.leb",
2229
14
           FT_UINT32, BASE_DEC, NULL, 0x0,
2230
14
           NULL, HFILL}},
2231
2232
14
        { &hf_swils_ess_numobj,
2233
14
          {"Number of Capability Objects", "swils.ess.numobj",
2234
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
2235
14
           NULL, HFILL}},
2236
2237
14
        { &hf_swils_interconnect_list_len,
2238
14
          {"List Length", "swils.ess.listlen",
2239
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
2240
14
           NULL, HFILL}},
2241
2242
14
        { &hf_swils_ess_vendorname,
2243
14
          {"Vendor Name", "swils.ess.vendorname",
2244
14
           FT_STRING, BASE_NONE, NULL, 0x0,
2245
14
           NULL, HFILL}},
2246
2247
14
        { &hf_swils_ess_modelname,
2248
14
          {"Model Name", "swils.ess.modelname",
2249
14
           FT_STRING, BASE_NONE, NULL, 0x0,
2250
14
           NULL, HFILL}},
2251
2252
14
        { &hf_swils_ess_relcode,
2253
14
          {"Release Code", "swils.ess.relcode",
2254
14
           FT_STRING, BASE_NONE, NULL, 0x0,
2255
14
           NULL, HFILL}},
2256
2257
14
        { &hf_swils_ess_vendorspecific,
2258
14
          {"Vendor Specific", "swils.ess.vendorspecific",
2259
14
           FT_STRING, BASE_NONE, NULL, 0x0,
2260
14
           NULL, HFILL}},
2261
2262
14
        { &hf_swils_ess_cap_type,
2263
14
          {"Type", "swils.ess.capability.type",
2264
14
           FT_UINT8, BASE_DEC, VALS(fc_ct_gstype_vals), 0x0,
2265
14
           NULL, HFILL}},
2266
2267
14
        { &hf_swils_ess_cap_subtype,
2268
14
          {"Subtype", "swils.ess.capability.subtype",
2269
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
2270
14
           NULL, HFILL}},
2271
2272
14
        { &hf_swils_ess_cap_numentries,
2273
14
          {"Number of Entries", "swils.ess.capability.numentries",
2274
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
2275
14
           NULL, HFILL}},
2276
2277
14
        { &hf_swils_ess_cap_svc,
2278
14
          {"Service Name", "swils.ess.capability.service",
2279
14
           FT_UINT8, BASE_DEC, VALS(fc_ct_gsserver_vals), 0x0,
2280
14
           NULL, HFILL}},
2281
2282
14
        { &hf_swils_ess_dns_obj0h,
2283
14
          {"Name Server Entry Object 00h Support", "swils.ess.capability.dns.obj0h",
2284
14
           FT_BOOLEAN, 8, NULL, 0x1,
2285
14
           NULL, HFILL}},
2286
2287
14
        { &hf_swils_ess_dns_obj1h,
2288
14
          {"Name Server Entry Object 01h Support", "swils.ess.capability.dns.obj1h",
2289
14
           FT_BOOLEAN, 8, NULL, 0x2,
2290
14
           NULL, HFILL}},
2291
2292
14
        { &hf_swils_ess_dns_obj2h,
2293
14
          {"Name Server Entry Object 02h Support", "swils.ess.capability.dns.obj2h",
2294
14
           FT_BOOLEAN, 8, NULL, 0x4,
2295
14
           NULL, HFILL}},
2296
2297
14
        { &hf_swils_ess_dns_obj3h,
2298
14
          {"Name Server Entry Object 03h Support", "swils.ess.capability.dns.obj3h",
2299
14
           FT_BOOLEAN, 8, NULL, 0x8,
2300
14
           NULL, HFILL}},
2301
2302
14
        { &hf_swils_ess_dns_zlacc,
2303
14
          {"GE_PT Zero Length Accepted", "swils.ess.capability.dns.zlacc",
2304
14
           FT_BOOLEAN, 8, NULL, 0x10,
2305
14
           NULL, HFILL}},
2306
2307
14
        { &hf_swils_ess_dns_vendor,
2308
14
          {"Vendor Specific Flags", "swils.ess.capability.dns.vendor",
2309
14
           FT_UINT32, BASE_HEX, NULL, 0x0,
2310
14
           NULL, HFILL}},
2311
2312
14
        { &hf_swils_ess_fctlr_rscn,
2313
14
          {"SW_RSCN Supported", "swils.ess.capability.fctlr.rscn",
2314
14
           FT_BOOLEAN, 8, NULL, 0x1,
2315
14
           NULL, HFILL}},
2316
2317
14
        { &hf_swils_ess_fctlr_vendor,
2318
14
          {"Vendor Specific Flags", "swils.ess.capability.fctlr.vendor",
2319
14
           FT_UINT32, BASE_HEX, NULL, 0x0,
2320
14
           NULL, HFILL}},
2321
2322
14
        { &hf_swils_ess_fcs_basic,
2323
14
          {"Basic Configuration Services", "swils.ess.capability.fcs.basic",
2324
14
           FT_BOOLEAN, 8, NULL, 0x1,
2325
14
           NULL, HFILL}},
2326
2327
14
        { &hf_swils_ess_fcs_platform,
2328
14
          {"Platform Configuration Services", "swils.ess.capability.fcs.platform",
2329
14
           FT_BOOLEAN, 8, NULL, 0x2,
2330
14
           NULL, HFILL}},
2331
2332
14
        { &hf_swils_ess_fcs_topology,
2333
14
          {"Topology Discovery Services", "swils.ess.capability.fcs.topology",
2334
14
           FT_BOOLEAN, 8, NULL, 0x4,
2335
14
           NULL, HFILL}},
2336
2337
14
        { &hf_swils_ess_fcs_enhanced,
2338
14
          {"Enhanced Configuration Services", "swils.ess.capability.fcs.enhanced",
2339
14
           FT_BOOLEAN, 8, NULL, 0x8,
2340
14
           NULL, HFILL}},
2341
2342
14
        { &hf_swils_ess_fzs_enh_supp,
2343
14
          {"Enhanced Zoning Supported", "swils.ess.capability.fzs.ezonesupp",
2344
14
           FT_BOOLEAN, 8, NULL, 0x1,
2345
14
           NULL, HFILL}},
2346
2347
14
        { &hf_swils_ess_fzs_enh_ena,
2348
14
          {"Enhanced Zoning Enabled", "swils.ess.capability.fzs.ezoneena",
2349
14
           FT_BOOLEAN, 8, NULL, 0x2,
2350
14
           NULL, HFILL}},
2351
2352
14
        { &hf_swils_ess_fzs_mr,
2353
14
          {"Merge Control Setting", "swils.ess.capability.fzs.mr",
2354
14
           FT_BOOLEAN, 8, NULL, 0x4,
2355
14
           NULL, HFILL}},
2356
2357
14
        { &hf_swils_ess_fzs_defzone,
2358
14
          {"Default Zone Setting", "swils.ess.capability.fzs.defzone",
2359
14
           FT_BOOLEAN, 8, NULL, 0x8,
2360
14
           NULL, HFILL}},
2361
2362
14
        { &hf_swils_ess_fzs_zsdb_supp,
2363
14
          {"Zoneset Database Supported", "swils.ess.capability.fzs.zsdbsupp",
2364
14
           FT_BOOLEAN, 8, NULL, 0x10,
2365
14
           NULL, HFILL}},
2366
2367
14
        { &hf_swils_ess_fzs_zsdb_ena,
2368
14
          {"Zoneset Database Enabled", "swils.ess.capability.fzs.zsdbena",
2369
14
           FT_BOOLEAN, 8, NULL, 0x20,
2370
14
           NULL, HFILL}},
2371
2372
14
        { &hf_swils_ess_fzs_adc_supp,
2373
14
          {"Active Direct Command Supported", "swils.ess.capability.fzs.adcsupp",
2374
14
           FT_BOOLEAN, 8, NULL, 0x40,
2375
14
           NULL, HFILL}},
2376
2377
14
        { &hf_swils_ess_fzs_hardzone,
2378
14
          {"Hard Zoning Supported", "swils.ess.capability.fzs.hardzone",
2379
14
           FT_BOOLEAN, 8, NULL, 0x80,
2380
14
           NULL, HFILL}},
2381
2382
14
        { &hf_swils_ess_cap_len,
2383
14
          {"Length", "swils.ess.capability.length",
2384
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
2385
14
           NULL, HFILL}},
2386
2387
14
        { &hf_swils_ess_cap_t10,
2388
14
          {"T10 Vendor ID", "swils.ess.capability.t10id",
2389
14
           FT_STRING, BASE_NONE, NULL, 0x0,
2390
14
           NULL, HFILL}},
2391
2392
14
        { &hf_swils_ess_cap_vendorobj,
2393
14
          {"Vendor-Specific Info", "swils.ess.capability.vendorobj",
2394
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
2395
14
           NULL, HFILL}},
2396
2397
14
        { &hf_swils_mrra_rev,
2398
14
          {"Revision", "swils.mrra.revision",
2399
14
           FT_UINT32, BASE_DEC, NULL, 0x0,
2400
14
           NULL, HFILL}},
2401
2402
14
        { &hf_swils_mrra_size,
2403
14
          {"Merge Request Size", "swils.mrra.size",
2404
14
           FT_UINT32, BASE_DEC, NULL, 0x0,
2405
14
           NULL, HFILL}},
2406
2407
14
        { &hf_swils_mrra_vendorid,
2408
14
          {"Vendor ID", "swils.mrra.vendorid",
2409
14
           FT_STRING, BASE_NONE, NULL, 0x0,
2410
14
           NULL, HFILL}},
2411
2412
14
        { &hf_swils_mrra_vendorinfo,
2413
14
          {"Vendor-Specific Info", "swils.mrra.vendorinfo",
2414
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
2415
14
           NULL, HFILL}},
2416
2417
14
        { &hf_swils_mrra_reply,
2418
14
          {"MRRA Response", "swils.mrra.reply",
2419
14
           FT_UINT32, BASE_DEC, NULL, 0x0,
2420
14
           NULL, HFILL}},
2421
2422
14
        { &hf_swils_mrra_reply_size,
2423
14
          {"Maximum Resources Available", "swils.mrra.replysize",
2424
14
           FT_UINT32, BASE_DEC, NULL, 0x0,
2425
14
           NULL, HFILL}},
2426
2427
14
        { &hf_swils_mrra_waittime,
2428
14
          {"Waiting Period (secs)", "swils.mrra.waittime",
2429
14
           FT_UINT32, BASE_DEC, NULL, 0x0,
2430
14
           NULL, HFILL}},
2431
2432
      /* Generated from convert_proto_tree_add_text.pl */
2433
14
      { &hf_swils_requested_domain_id, { "Requested Domain ID", "swils.requested_domain_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2434
14
      { &hf_swils_granted_domain_id, { "Granted Domain ID", "swils.granted_domain_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2435
14
      { &hf_swils_lsrh_lsr_age, { "LSR Age", "swils.lsr.age", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_seconds), 0x0, NULL, HFILL }},
2436
14
      { &hf_swils_lsrh_options, { "Options", "swils.lsr.options", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2437
14
      { &hf_swils_lsrh_checksum, { "Checksum", "swils.lsr.checksum", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2438
14
      { &hf_swils_lsrh_lsr_length, { "LSR Length", "swils.lsr.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2439
14
      { &hf_swils_lsrec_number_of_links, { "Number of Links", "swils.lsr.number_of_links", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2440
14
      { &hf_swils_lsupdate_flags, { "Flags", "swils.lsupdate.flags", FT_UINT8, BASE_HEX, VALS(fc_swils_fspf_lsrflags_val), 0x0, NULL, HFILL }},
2441
14
      { &hf_swils_lsupdate_num_of_lsrs, { "Num of LSRs", "swils.lsupdate.num_of_lsrs", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2442
14
      { &hf_swils_lsack_flags, { "Flags", "swils.lsack.flags", FT_UINT8, BASE_HEX, VALS(fc_swils_fspf_lsrflags_val), 0x0, NULL, HFILL }},
2443
14
      { &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 }},
2444
14
      { &hf_swils_rscn_num_entries, { "Num Entries", "swils.rscn.num_entries", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2445
14
      { &hf_swils_zone_mbrflags, { "Flags", "swils.zone.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2446
14
      { &hf_swils_zone_mbr_identifier_length, { "Identifier Length", "swils.zone.identifier_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2447
14
      { &hf_swils_zone_num_members, { "4", "swils.zone.num_members", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2448
14
      { &hf_swils_zone_active_zoneset_length, { "Active ZoneSet Length", "swils.zone.active_zoneset_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2449
14
      { &hf_swils_zone_num_zoning_objects, { "Number of zoning objects", "swils.zone.num_zoning_objects", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2450
14
      { &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 }},
2451
14
      { &hf_swils_zone_vendor_unique, { "Vendor Unique", "swils.zone.vendor_unique", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2452
14
      { &hf_swils_domain_id_list_length, { "Domain ID List Length", "swils.aca.domain_id_list_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2453
14
      { &hf_swils_sfc_zoneset_length, { "ZoneSet Length", "swils.sfc.zoneset_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2454
14
      { &hf_swils_esc_payload_length, { "Payload Length", "swils.esc.payload_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2455
14
    };
2456
2457
14
    static int *ett[] = {
2458
14
        &ett_fcswils,
2459
14
        &ett_fcswils_swacc,
2460
14
        &ett_fcswils_swrjt,
2461
14
        &ett_fcswils_elp,
2462
14
        &ett_fcswils_efp,
2463
14
        &ett_fcswils_efplist,
2464
14
        &ett_fcswils_dia,
2465
14
        &ett_fcswils_rdi,
2466
14
        &ett_fcswils_fspfhdr,
2467
14
        &ett_fcswils_hlo,
2468
14
        &ett_fcswils_lsrec,
2469
14
        &ett_fcswils_lsrechdr,
2470
14
        &ett_fcswils_ldrec,
2471
14
        &ett_fcswils_lsu,
2472
14
        &ett_fcswils_lsa,
2473
14
        &ett_fcswils_bf,
2474
14
        &ett_fcswils_rcf,
2475
14
        &ett_fcswils_rscn,
2476
14
        &ett_fcswils_rscn_dev,
2477
14
        &ett_fcswils_drlir,
2478
14
        &ett_fcswils_mr,
2479
14
        &ett_fcswils_zoneobjlist,
2480
14
        &ett_fcswils_zoneobj,
2481
14
        &ett_fcswils_zonembr,
2482
14
        &ett_fcswils_aca,
2483
14
        &ett_fcswils_rca,
2484
14
        &ett_fcswils_sfc,
2485
14
        &ett_fcswils_ufc,
2486
14
        &ett_fcswils_esc,
2487
14
        &ett_fcswils_esc_pdesc,
2488
14
        &ett_fcswils_ieinfo,
2489
14
        &ett_fcswils_capinfo
2490
14
    };
2491
2492
14
    static ei_register_info ei[] = {
2493
14
        { &ei_swils_efp_record_len, { "swils.efp.recordlen.zero", PI_UNDECODED, PI_NOTE, "Record length is zero", EXPFILL }},
2494
14
        { &ei_swils_no_exchange, { "swils.no_exchange", PI_UNDECODED, PI_WARN, "No record of Exchg. Unable to decode", EXPFILL }},
2495
14
        { &ei_swils_zone_mbrid, { "swils.zone.mbrid.unknown_type", PI_PROTOCOL, PI_WARN, "Unknown member type format", EXPFILL }},
2496
14
    };
2497
2498
14
    expert_module_t* expert_fcswils;
2499
2500
14
    proto_fcswils = proto_register_protocol("Fibre Channel SW_ILS", "FC-SWILS", "swils");
2501
2502
14
    proto_register_field_array(proto_fcswils, hf, array_length(hf));
2503
14
    proto_register_subtree_array(ett, array_length(ett));
2504
14
    expert_fcswils = expert_register_protocol(proto_fcswils);
2505
14
    expert_register_field_array(expert_fcswils, ei, array_length(ei));
2506
2507
14
    fcswils_req_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), fcswils_hash, fcswils_equal);
2508
2509
14
    swils_handle = register_dissector("swils", dissect_fcswils, proto_fcswils);
2510
14
}
2511
2512
void
2513
proto_reg_handoff_fcswils(void)
2514
14
{
2515
14
    dissector_add_uint("fc.ftype", FC_FTYPE_SWILS, swils_handle);
2516
2517
14
    fcsp_handle = find_dissector_add_dependency("fcsp", proto_fcswils);
2518
14
}
2519
2520
/*
2521
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
2522
 *
2523
 * Local variables:
2524
 * c-basic-offset: 4
2525
 * tab-width: 8
2526
 * indent-tabs-mode: nil
2527
 * End:
2528
 *
2529
 * vi: set shiftwidth=4 tabstop=8 expandtab:
2530
 * :indentSize=4:tabSize=8:noTabs=true:
2531
 */