Coverage Report

Created: 2026-11-12 07:01

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-fcels.c
Line
Count
Source
1
/* packet-fcels.c
2
 * Routines for FC Extended 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
/*
13
 * TODO Still (Complete compliance with FC-MI):
14
 * - Decode RNID, RLIR
15
 */
16
/* AI generated:
17
 * Fibre Channel (FC) Extended Link Services (ELS) is a protocol used for managing communication between ports (Nx_Ports)
18
 * within a Fibre Channel fabric. While Basic Link Services are single-frame commands, ELS requests and replies are
19
 * transmitted within their own independent Exchanges.
20
 */
21
#include "config.h"
22
23
#include <epan/packet.h>
24
#include <epan/tfs.h>
25
#include <epan/expert.h>
26
#include "packet-fc.h"
27
#include "packet-fcels.h"
28
29
void proto_register_fcels(void);
30
void proto_reg_handoff_fcels(void);
31
32
static dissector_handle_t els_handle;
33
34
16
#define FC_ELS_RPLY 0
35
331
#define FC_ELS_REQ  1
36
37
/* Initialize the protocol and registered fields */
38
static int proto_fcels;
39
static int hf_fcels_opcode;
40
static int hf_fcels_rjtcode;
41
static int hf_fcels_rjtdetcode;
42
static int hf_fcels_vnduniq;
43
static int hf_fcels_b2b;
44
static int hf_fcels_cmnfeatures;
45
static int hf_fcels_bbscnum;
46
static int hf_fcels_rcvsize;
47
static int hf_fcels_maxconseq;
48
static int hf_fcels_reloffset;
49
static int hf_fcels_edtov;
50
static int hf_fcels_npname;
51
static int hf_fcels_fnname;
52
#if 0
53
static int hf_fcels_cls1param;
54
static int hf_fcels_cls2param;
55
static int hf_fcels_cls3param;
56
static int hf_fcels_cls4param;
57
#endif
58
static int hf_fcels_vendorvers;
59
static int hf_fcels_svcavail;
60
static int hf_fcels_clsflags;
61
static int hf_fcels_clsrcvsize;
62
static int hf_fcels_conseq;
63
static int hf_fcels_e2e;
64
static int hf_fcels_openseq;
65
static int hf_fcels_nportid;
66
static int hf_fcels_oxid;
67
static int hf_fcels_rxid;
68
static int hf_fcels_recovqual;
69
static int hf_fcels_fabricaddr;
70
static int hf_fcels_fabricpname;
71
static int hf_fcels_failedrcvr;
72
static int hf_fcels_flacompliance;
73
static int hf_fcels_loopstate;
74
static int hf_fcels_publicloop_bmap;
75
static int hf_fcels_pvtloop_bmap;
76
static int hf_fcels_alpa_map;
77
static int hf_fcels_scrregn;
78
static int hf_fcels_farp_matchcodept;
79
static int hf_fcels_farp_respaction;
80
static int hf_fcels_resportid;
81
static int hf_fcels_respname;
82
static int hf_fcels_respnname;
83
static int hf_fcels_reqipaddr;
84
static int hf_fcels_respipaddr;
85
static int hf_fcels_hardaddr;
86
static int hf_fcels_rps_flag;
87
static int hf_fcels_rps_portnum;
88
static int hf_fcels_rps_portstatus;
89
static int hf_fcels_rnft_fc4type;
90
static int hf_fcels_rscn_evqual;
91
static int hf_fcels_rscn_addrfmt;
92
static int hf_fcels_rscn_domain;
93
static int hf_fcels_rscn_area;
94
static int hf_fcels_rscn_port;
95
static int hf_fcels_rec_fc4;
96
static int hf_fcels_estat;
97
static int hf_fcels_estat_resp;
98
static int hf_fcels_estat_seq_init;
99
static int hf_fcels_estat_compl;
100
static int hf_fcels_nodeidfmt;
101
static int hf_fcels_spidlen;
102
static int hf_fcels_vendoruniq;
103
static int hf_fcels_vendorsp;
104
static int hf_fcels_asstype;
105
static int hf_fcels_physport;
106
static int hf_fcels_attnodes;
107
static int hf_fcels_nodemgmt;
108
static int hf_fcels_ipvers;
109
static int hf_fcels_tcpport;
110
static int hf_fcels_ip;
111
static int hf_fcels_cbind_liveness;
112
static int hf_fcels_cbind_addr_mode;
113
static int hf_fcels_cbind_ifcp_version;
114
static int hf_fcels_cbind_userinfo;
115
static int hf_fcels_cbind_snpname;
116
static int hf_fcels_cbind_dnpname;
117
static int hf_fcels_cbind_status;
118
static int hf_fcels_chandle;
119
static int hf_fcels_unbind_status;
120
static int hf_fcels_cmn_cios;
121
static int hf_fcels_cmn_rro;
122
static int hf_fcels_cmn_vvv;
123
static int hf_fcels_cmn_b2b;
124
static int hf_fcels_cmn_e_d_tov;
125
static int hf_fcels_cmn_simplex;
126
static int hf_fcels_cmn_multicast;
127
static int hf_fcels_cmn_broadcast;
128
static int hf_fcels_cmn_security;
129
static int hf_fcels_cmn_clk;
130
static int hf_fcels_cmn_dhd;
131
static int hf_fcels_cmn_seqcnt;
132
static int hf_fcels_cmn_payload;
133
static int hf_fcels_cls_cns;
134
static int hf_fcels_cls_sdr;
135
static int hf_fcels_cls_prio;
136
static int hf_fcels_cls_nzctl;
137
static int hf_fcels_initctl;
138
static int hf_fcels_initctl_initial_pa;
139
static int hf_fcels_initctl_ack0;
140
static int hf_fcels_initctl_ackgaa;
141
static int hf_fcels_initctl_sync;
142
static int hf_fcels_rcptctl;
143
static int hf_fcels_rcptctl_ack0;
144
static int hf_fcels_rcptctl_interlock;
145
static int hf_fcels_rcptctl_policy;
146
static int hf_fcels_rcptctl_category;
147
static int hf_fcels_rcptctl_sync;
148
static int hf_fcels_fcpflags;
149
static int hf_fcels_fcpflags_trireq;
150
static int hf_fcels_fcpflags_trirep;
151
static int hf_fcels_fcpflags_retry;
152
static int hf_fcels_fcpflags_ccomp;
153
static int hf_fcels_fcpflags_datao;
154
static int hf_fcels_fcpflags_initiator;
155
static int hf_fcels_fcpflags_target;
156
static int hf_fcels_fcpflags_rdxr;
157
static int hf_fcels_fcpflags_wrxr;
158
static int hf_fcels_prliloflags;
159
static int hf_fcels_tprloflags_opav;
160
static int hf_fcels_tprloflags_rpav;
161
static int hf_fcels_tprloflags_npv;
162
static int hf_fcels_tprloflags_gprlo;
163
static int hf_fcels_speedflags;
164
static int hf_fcels_speedflags_1gb;
165
static int hf_fcels_speedflags_2gb;
166
static int hf_fcels_speedflags_4gb;
167
static int hf_fcels_speedflags_10gb;
168
static int hf_fcels_prliloflags_opav;
169
static int hf_fcels_prliloflags_ipe;
170
static int hf_fcels_prliloflags_eip;
171
/* Generated from convert_proto_tree_add_text.pl */
172
static int hf_fcels_rnft_index_of_first_rec_in_list;
173
static int hf_fcels_lip_f7_received_count;
174
static int hf_fcels_recovery_qualifier_status;
175
static int hf_fcels_rpl_port_identifier;
176
static int hf_fcels_rpl_index_of_i_port_block;
177
static int hf_fcels_lip_f7_initiated_count;
178
static int hf_fcels_srl_fl_port_addr;
179
static int hf_fcels_loss_of_signal_count;
180
static int hf_fcels_lirr_regn_function;
181
static int hf_fcels_rscn_page_len;
182
static int hf_fcels_prlilo_service_parameter_response;
183
static int hf_fcels_prlilo_type_code_extension;
184
static int hf_fcels_rnft_list_length;
185
static int hf_fcels_rpl_index;
186
static int hf_fcels_rpl_physical_port;
187
static int hf_fcels_prlilo_originator_pa;
188
static int hf_fcels_rpl_list_length;
189
static int hf_fcels_common_identification_data_length;
190
static int hf_fcels_loss_of_sync_count;
191
static int hf_fcels_lip_reset_received_count;
192
static int hf_fcels_rpl_max_size;
193
static int hf_fcels_prlilo_response_code;
194
static int hf_fcels_invalid_crc_count;
195
static int hf_fcels_rscn_payload_len;
196
static int hf_fcels_link_failure_count;
197
static int hf_fcels_prlilo_3rd_party_n_port_id;
198
static int hf_fcels_lip_al_ps;
199
static int hf_fcels_prlilo_type;
200
static int hf_fcels_lirr_regn_format;
201
static int hf_fcels_srl_flag;
202
static int hf_fcels_prlilo_page_length;
203
static int hf_fcels_rpl_payload_length;
204
static int hf_fcels_rpsc_port_oper_speed;
205
static int hf_fcels_lip_reset_initiated_count;
206
static int hf_fcels_l_port_status;
207
static int hf_fcels_primitive_seq_protocol_err;
208
static int hf_fcels_rnft_max_size;
209
static int hf_fcels_lip_f8_received_count;
210
static int hf_fcels_rnft_index;
211
static int hf_fcels_rnft_payload_len;
212
static int hf_fcels_prlilo_payload_length;
213
static int hf_fcels_prlilo_responder_pa;
214
static int hf_fcels_rpsc_number_of_entries;
215
static int hf_fcels_prlilo_3rd_party_originator_pa;
216
static int hf_fcels_invalid_xmission_word;
217
static int hf_fcels_rnft_fc4_qualifier;
218
static int hf_fcels_lip_f8_initiated_count;
219
static int hf_fcels_rpl_port_name;
220
221
static int ett_fcels;
222
static int ett_fcels_lsrjt;
223
static int ett_fcels_acc;
224
static int ett_fcels_logi;
225
static int ett_fcels_logi_cmnsvc;
226
static int ett_fcels_logi_clssvc;
227
static int ett_fcels_logo;
228
static int ett_fcels_abtx;
229
static int ett_fcels_rsi;
230
static int ett_fcels_rrq;
231
static int ett_fcels_rec;
232
static int ett_fcels_prli;
233
static int ett_fcels_prli_svcpg;
234
static int ett_fcels_adisc;
235
static int ett_fcels_farp;
236
static int ett_fcels_rps;
237
static int ett_fcels_rpl;
238
static int ett_fcels_rplpb;
239
static int ett_fcels_fan;
240
static int ett_fcels_rscn;
241
static int ett_fcels_rscn_rec;
242
static int ett_fcels_estat;
243
static int ett_fcels_scr;
244
static int ett_fcels_rnft;
245
static int ett_fcels_rnft_fc4;
246
static int ett_fcels_lsts;
247
static int ett_fcels_rnid;
248
static int ett_fcels_rlir;
249
static int ett_fcels_lirr;
250
static int ett_fcels_srl;
251
static int ett_fcels_rpsc;
252
static int ett_fcels_cbind;
253
static int ett_fcels_cmnfeatures;
254
static int ett_fcels_clsflags;
255
static int ett_fcels_initctl;
256
static int ett_fcels_rcptctl;
257
static int ett_fcels_fcpflags;
258
static int ett_fcels_prliloflags;
259
static int ett_fcels_speedflags;
260
261
static expert_field ei_fcels_src_unknown;
262
static expert_field ei_fcels_dst_unknown;
263
static expert_field ei_fcels_no_record_of_els_req;
264
static expert_field ei_fcels_no_record_of_exchange;
265
static expert_field ei_fcels_short_payload;
266
267
static int * const hf_fcels_estat_fields[] = {
268
    &hf_fcels_estat_resp,
269
    &hf_fcels_estat_seq_init,
270
    &hf_fcels_estat_compl,
271
    NULL
272
};
273
274
static const true_false_string tfs_fcels_estat_resp = {
275
        "Responding to Exchange",
276
        "Originator of Exchange"
277
};
278
279
static const true_false_string tfs_fcels_estat_seq_init = {
280
        "Seq Initiative held by REC responder",
281
        "Seq Initiative not held by REC responder"
282
};
283
284
285
16
#define FC_ESB_ST_RESP      (1U << 31)   /* responder to exchange */
286
16
#define FC_ESB_ST_SEQ_INIT  (1U << 30)   /* holds sequence initiative */
287
16
#define FC_ESB_ST_COMPLETE  (1U << 29)   /* exchange is complete */
288
289
static const value_string fc_els_proto_val[] = {
290
    {FC_ELS_LSRJT        , "LS_RJT"},
291
    {FC_ELS_ACC          , "ACC"},
292
    {FC_ELS_PLOGI        , "PLOGI"},
293
    {FC_ELS_FLOGI        , "FLOGI"},
294
    {FC_ELS_LOGOUT       , "LOGO"},
295
    {FC_ELS_ABTX         , "ABTX"},
296
    {FC_ELS_RSI          , "RSI"},
297
    {FC_ELS_RTV          , "RTV"},
298
    {FC_ELS_RLS          , "RLS"},
299
    {FC_ELS_ECHO         , "ECHO"},
300
    {FC_ELS_TEST         , "TEST"},
301
    {FC_ELS_RRQ          , "RRQ"},
302
    {FC_ELS_REC          , "REC"},
303
    {FC_ELS_SRR          , "SRR"},
304
    {FC_ELS_PRLI         , "PRLI"},
305
    {FC_ELS_PRLO         , "PRLO"},
306
    {FC_ELS_TPRLO        , "TPRLO"},
307
    {FC_ELS_PDISC        , "PDISC"},
308
    {FC_ELS_FDISC        , "FDISC"},
309
    {FC_ELS_ADISC        , "ADISC"},
310
    {FC_ELS_FARP_REQ     , "FARP-REQ"},
311
    {FC_ELS_FARP_RPLY    , "FARP-REPLY"},
312
    {FC_ELS_RPS          , "RPS"},
313
    {FC_ELS_RPL          , "RPL"},
314
    {FC_ELS_FAN          , "FAN"},
315
    {FC_ELS_RSCN         , "RSCN"},
316
    {FC_ELS_SCR          , "SCR"},
317
    {FC_ELS_RNFT         , "RNFT"},
318
    {FC_ELS_LINIT        , "LINIT"},
319
    {FC_ELS_LSTS         , "LSTS"},
320
    {FC_ELS_RNID         , "RNID"},
321
    {FC_ELS_RLIR         , "RLIR"},
322
    {FC_ELS_LIRR         , "LIRR"},
323
    {FC_ELS_SRL          , "SRL"},
324
    {FC_ELS_RPSC         , "RPSC"},
325
    {FC_ELS_LKA          , "LKA"},
326
    {FC_ELS_AUTH         , "AUTH"},
327
    {FC_ELS_CBIND        , "CBIND"},
328
    {FC_ELS_UNBIND       , "UNBIND"},
329
    {0, NULL}
330
};
331
value_string_ext fc_els_proto_val_ext = VALUE_STRING_EXT_INIT(fc_els_proto_val);
332
333
/* Reject Reason Codes */
334
#define FC_ELS_RJT_INVCMDCODE   0x01
335
#define FC_ELS_RJT_LOGERR       0x03
336
#define FC_ELS_RJT_LOGBSY       0x05
337
#define FC_ELS_RJT_PROTERR      0x07
338
#define FC_ELS_RJT_GENFAIL      0x09
339
#define FC_ELS_RJT_CMDNOTSUPP   0x0B
340
#define FC_ELS_RJT_GENFAIL2     0x0D
341
#define FC_ELS_RJT_CMDINPROG    0x0E
342
#define FC_ELS_RJT_FIP          0x20
343
#define FC_ELS_RJT_VENDOR       0xFF
344
345
static const value_string fc_els_rjt_val[] = {
346
    {FC_ELS_RJT_INVCMDCODE, "Invalid Cmd Code"},
347
    {FC_ELS_RJT_LOGERR    , "Logical Error"},
348
    {FC_ELS_RJT_LOGBSY    , "Logical Busy"},
349
    {FC_ELS_RJT_PROTERR   , "Protocol Error"},
350
    {FC_ELS_RJT_GENFAIL   , "Unable to Perform Cmd"},
351
    {FC_ELS_RJT_CMDNOTSUPP, "Command Not Supported"},
352
    {FC_ELS_RJT_GENFAIL2  , "Unable to Perform Cmd"},
353
    {FC_ELS_RJT_CMDINPROG , "Command in Progress Already"},
354
    {FC_ELS_RJT_FIP       , "FIP Error"},
355
    {FC_ELS_RJT_VENDOR    , "Vendor Unique Error"},
356
    {0, NULL}
357
};
358
static value_string_ext fc_els_rjt_val_ext = VALUE_STRING_EXT_INIT(fc_els_rjt_val);
359
360
#define FC_ELS_RJT_DET_NODET             0x00
361
#define FC_ELS_RJT_DET_SVCPARM_OPT       0x01
362
#define FC_ELS_RJT_DET_SVCPARM_INITCTL   0x03
363
#define FC_ELS_RJT_DET_SVCPARM_RCPTCTL   0x05
364
#define FC_ELS_RJT_DET_SVCPARM_RCVSZE    0x07
365
#define FC_ELS_RJT_DET_SVCPARM_CSEQ      0x09
366
#define FC_ELS_RJT_DET_SVCPARM_CREDIT    0x0B
367
#define FC_ELS_RJT_DET_INV_PFNAME        0x0D
368
#define FC_ELS_RJT_DET_INV_NFNAME        0x0E
369
#define FC_ELS_RJT_DET_INV_CMNSVCPARM    0x0F
370
#define FC_ELS_RJT_DET_INV_ASSOCHDR      0x11
371
#define FC_ELS_RJT_DET_ASSOCHDR_REQD     0x13
372
#define FC_ELS_RJT_DET_INV_OSID          0x15
373
#define FC_ELS_RJT_DET_EXCHG_COMBO       0x17
374
#define FC_ELS_RJT_DET_CMDINPROG         0x19
375
#define FC_ELS_RJT_DET_PLOGI_REQ         0x1E
376
#define FC_ELS_RJT_DET_INV_NPID          0x1F
377
#define FC_ELS_RJT_DET_INV_SEQID         0x21
378
#define FC_ELS_RJT_DET_INV_EXCHG         0x23
379
#define FC_ELS_RJT_DET_INACTIVE_EXCHG    0x25
380
#define FC_ELS_RJT_DET_RQUAL_REQD        0x27
381
#define FC_ELS_RJT_DET_OORSRC            0x29
382
#define FC_ELS_RJT_DET_SUPPLYFAIL        0x2A
383
#define FC_ELS_RJT_DET_REQNOTSUPP        0x2C
384
#define FC_ELS_RJT_DET_INV_PLEN          0x2D
385
#define FC_ELS_RJT_DET_INV_ALIASID       0x30
386
#define FC_ELS_RJT_DET_OORSRC_ALIASID    0x31
387
#define FC_ELS_RJT_DET_INACTIVE_ALIASID  0x32
388
#define FC_ELS_RJT_DET_DEACT_ALIAS_FAIL1 0x33
389
#define FC_ELS_RJT_DET_DEACT_ALIAS_FAIL2 0x34
390
#define FC_ELS_RJT_DET_SVCPARM_CONFLICT  0x35
391
#define FC_ELS_RJT_DET_INV_ALIASTOK      0x36
392
#define FC_ELS_RJT_DET_UNSUPP_ALIASTOK   0x37
393
#define FC_ELS_RJT_DET_GRPFORM_FAIL      0x38
394
#define FC_ELS_RJT_DET_QOSPARM_ERR       0x40
395
#define FC_ELS_RJT_DET_INV_VCID          0x41
396
#define FC_ELS_RJT_DET_OORSRC_C4         0x42
397
#define FC_ELS_RJT_DET_INV_PNNAME        0x44
398
#define FC_ELS_RJT_DET_AUTH_REQD         0x48
399
#define FC_ELS_RJT_DET_NOT_NEIGHBOR      0x62
400
401
static const value_string fc_els_rjt_det_val[] = {
402
    {FC_ELS_RJT_DET_NODET            , "No further details"},
403
    {FC_ELS_RJT_DET_SVCPARM_OPT      , "Svc Param - Options Error"},
404
    {FC_ELS_RJT_DET_SVCPARM_INITCTL  , "Svc Param - Initiator Ctl Error"},
405
    {FC_ELS_RJT_DET_SVCPARM_RCPTCTL  , "Svc Param - Recipient Ctl Error"},
406
    {FC_ELS_RJT_DET_SVCPARM_RCVSZE   , "Svc Param - Recv Size Error"},
407
    {FC_ELS_RJT_DET_SVCPARM_CSEQ     , "Svc Param - Concurrent Seq Error"},
408
    {FC_ELS_RJT_DET_SVCPARM_CREDIT   , "Svc Param - Credit Error"},
409
    {FC_ELS_RJT_DET_INV_PFNAME       , "Invalid N_/F_Port Name"},
410
    {FC_ELS_RJT_DET_INV_NFNAME       , "Invalid Node/Fabric Name"},
411
    {FC_ELS_RJT_DET_INV_CMNSVCPARM   , "Invalid Common Svc Param"},
412
    {FC_ELS_RJT_DET_INV_ASSOCHDR     , "Invalid Association Header"},
413
    {FC_ELS_RJT_DET_ASSOCHDR_REQD    , "Association Header Reqd"},
414
    {FC_ELS_RJT_DET_INV_OSID         , "Invalid Orig S_ID"},
415
    {FC_ELS_RJT_DET_EXCHG_COMBO      , "Invalid OXID-RXID Combo"},
416
    {FC_ELS_RJT_DET_CMDINPROG        , "Cmd Already in Progress"},
417
    {FC_ELS_RJT_DET_PLOGI_REQ        , "N_Port Login Required"},
418
    {FC_ELS_RJT_DET_INV_NPID         , "Invalid N_Port Id"},
419
    {FC_ELS_RJT_DET_INV_SEQID        , "Invalid SeqID"},
420
    {FC_ELS_RJT_DET_INV_EXCHG        , "Attempt to Abort Invalid Exchg"},
421
    {FC_ELS_RJT_DET_INACTIVE_EXCHG   , "Attempt to Abort Inactive Exchg"},
422
    {FC_ELS_RJT_DET_RQUAL_REQD       , "Resource Qualifier Required"},
423
    {FC_ELS_RJT_DET_OORSRC           , "Insufficient Resources for Login"},
424
    {FC_ELS_RJT_DET_SUPPLYFAIL       , "Unable to Supply Req Data"},
425
    {FC_ELS_RJT_DET_REQNOTSUPP       , "Command Not Supported"},
426
    {FC_ELS_RJT_DET_INV_PLEN         , "Invalid Payload Length"},
427
    {FC_ELS_RJT_DET_INV_ALIASID      , "No Alias IDs available"},
428
    {FC_ELS_RJT_DET_OORSRC_ALIASID   , "Alias_ID Cannot be Activated (Out of Rsrc)"},
429
    {FC_ELS_RJT_DET_INACTIVE_ALIASID , "Alias_ID Cannot be Activated (Inv AID)"},
430
    {FC_ELS_RJT_DET_DEACT_ALIAS_FAIL1, "Alias_ID Cannot be Deactivated"},
431
    {FC_ELS_RJT_DET_DEACT_ALIAS_FAIL2, "Alias_ID Cannot be Deactivated"},
432
    {FC_ELS_RJT_DET_SVCPARM_CONFLICT , "Svc Parameter Conflict"},
433
    {FC_ELS_RJT_DET_INV_ALIASTOK     , "Invalid Alias Token"},
434
    {FC_ELS_RJT_DET_UNSUPP_ALIASTOK  , "Unsupported Alias Token"},
435
    {FC_ELS_RJT_DET_GRPFORM_FAIL     , "Alias Grp Cannot be Formed"},
436
    {FC_ELS_RJT_DET_QOSPARM_ERR      , "QoS Param Error"},
437
    {FC_ELS_RJT_DET_INV_VCID         , "VC_ID Not Found"},
438
    {FC_ELS_RJT_DET_OORSRC_C4        , "No Resources to Support Class 4 Conn"},
439
    {FC_ELS_RJT_DET_INV_PNNAME       , "Invalid Port/Node Name"},
440
    {FC_ELS_RJT_DET_AUTH_REQD        , "Authentication Required"},
441
    {FC_ELS_RJT_DET_NOT_NEIGHBOR     , "VN2VN_Port not in Neighbor Set"},
442
    {0, NULL}
443
};
444
static value_string_ext fc_els_rjt_det_val_ext = VALUE_STRING_EXT_INIT(fc_els_rjt_det_val);
445
446
static const value_string fc_els_flacompliance_val[] = {
447
    {1, "FC-FLA Level 1"},
448
    {2, "FC-FLA Level 2"},
449
    {0, NULL}
450
};
451
452
static const value_string fc_els_loopstate_val[] = {
453
    {1, "Online"},
454
    {2, "Loop Failure"},
455
    {3, "Initialization Failure"},
456
    {4, "Initializing"},
457
    {0, NULL}
458
};
459
460
static const value_string fc_els_scr_reg_val[] = {
461
    {1, "Fabric Detected Regn"},
462
    {2, "N_Port Detected Regn"},
463
    {3, "Full Regn"},
464
    {255, "Clear All Regn"},
465
    {0, NULL}
466
};
467
468
static const value_string fc_els_farp_respaction_val[] = {
469
    {0, "No Action"},
470
    {1, "Login Using Requesting Port ID"},
471
    {2, "Respond with FARP-REPLY"},
472
    {3, "Login & send FARP-REPLY"},
473
    {0, NULL}
474
};
475
476
static const value_string fc_els_portstatus_val[] = {
477
    {0x01, "Link Reset Protocol in Progress"},
478
    {0x02, "Loss of Synchronization"},
479
    {0x04, "Loss of Signal"},
480
    {0x10, "AL Connection | No Fabric"},
481
    {0x14, "AL Connection | Loss of Signal"},
482
    {0x18, "AL Connection | Fabric Detected"},
483
    {0x1C, "AL Connection | Fabric Detected | Loss of Signal"},
484
    {0x20, "Point-to-Point Connection | No Fabric"},
485
    {0x24, "Point-to-Point Connection | Loss of Signal"},
486
    {0x28, "Point-to-Point Connection | Fabric Detected"},
487
    {0x2C, "Point-to-Point Connection | Fabric Detected | Loss of Signal"},
488
    {0, NULL}
489
};
490
static value_string_ext fc_els_portstatus_val_ext = VALUE_STRING_EXT_INIT(fc_els_portstatus_val);
491
492
static const value_string fc_els_portspeed_val[] = {
493
    {0x8000, "1 Gb"},
494
    {0x4000, "2 Gb"},
495
    {0x2000, "4 Gb"},
496
    {0x1000, "10 Gb"},
497
    {0x0002, "Unknown"},
498
    {0x0001, "Speed Not Estd."},
499
    {0, NULL}
500
};
501
502
static const value_string fc_els_lirr_regfunc_val[] = {
503
    {0x1, "Set Reg: Conditionally Receive"},
504
    {0x2, "Set Reg: Always Receive"},
505
    {0xFF, "Clear Reg"},
506
    {0, NULL}
507
};
508
509
static const value_string fc_els_rscn_evqual_val[] = {
510
    {0x00, "Event is not specified"},
511
    {0x01, "Changed Name Server Object"},
512
    {0x02, "Changed Port Attribute"},
513
    {0x03, "Changed Service Object"},
514
    {0x04, "Changed Switch Config"},
515
    {0, NULL}
516
};
517
518
static const value_string fc_els_rscn_addrfmt_val[] = {
519
    {0, "Port Addr (single N/L Port or service)"},
520
    {1, "Area Addr Group (area of E/L/N Port addresses)"},
521
    {2, "Domain Addr Group"},
522
    {3, "Fabric Addr Group"},
523
    {0, NULL}
524
};
525
526
static const value_string fc_els_nodeid_val[] = {
527
    {0x00, "Common Identification Data Only"},
528
    {0x05, "IP Specific Data"},
529
    {0x08, "FCP-Specific Data"},
530
    {0x20, "FC_CT Specific Data"},
531
    {0x22, "SW_ILS Specific Data"},
532
    {0x23, "AL Specific Data"},
533
    {0x24, "SNMP Specific Data"},
534
    {0xDF, "Common ID Data + General Topology Discovery Format"},
535
    {0, NULL}
536
};
537
538
static const value_string fc_els_rnid_asstype_val[] = {
539
    {0x0, "Reserved"},
540
    {0x1, "Unknown"},
541
    {0x2, "Other"},
542
    {0x3, "Hub"},
543
    {0x4, "Switch"},
544
    {0x5, "Gateway"},
545
    {0x6, "Converter"},
546
    {0x7, "HBA"},
547
    {0x9, "Storage Device"},
548
    {0xA, "Host"},
549
    {0xB, "Storage Subsystem"},
550
    {0xE, "Storage Access Device"},
551
    {0x11, "NAS Device"},
552
    {0, NULL}
553
};
554
static value_string_ext fc_els_rnid_asstype_val_ext = VALUE_STRING_EXT_INIT(fc_els_rnid_asstype_val);
555
556
static const value_string fc_els_rnid_mgmt_val[] = {
557
    {0, "IP/UDP/SNMP"},
558
    {1, "IP/TCP/Telnet"},
559
    {2, "IP/TCP/HTTP"},
560
    {3, "IP/TCP/HTTPS"},
561
    {0, NULL}
562
};
563
564
static const value_string fc_els_rnid_ipvers_val[] = {
565
    {0, "None"},
566
    {1, "IPv4"},
567
    {2, "IPv6"},
568
    {0, NULL}
569
};
570
571
static const value_string fc_prli_fc4_val[] = {
572
    {FC_TYPE_SCSI    , "FCP"},
573
    {FC_TYPE_IP      , "IP/FC"},
574
    {FC_TYPE_LLCSNAP , "LLC_SNAP"},
575
    {FC_TYPE_ELS     , "Ext Link Svc"},
576
    {FC_TYPE_FCCT    , "FC_CT"},
577
    {FC_TYPE_SWILS   , "SW_ILS"},
578
    {FC_TYPE_AL      , "AL"},
579
    {FC_TYPE_SNMP    , "SNMP"},
580
    {FC_TYPE_CMNSVC  , "Common to all FC-4 Types"},
581
    {0, NULL},
582
};
583
584
static const value_string cbind_addr_mode_vals[] = {
585
    {0, "Address Translation mode"},
586
    {1, "Address Transparent Mode"},
587
    {0, NULL},
588
};
589
590
static const value_string cbind_status_vals[] = {
591
    {0, "Success"},
592
    {16, "Failed - Unspecified Reason"},
593
    {18, "Failed - Connection ID invalid"},
594
    {0, NULL},
595
};
596
597
static const value_string unbind_status_vals[] = {
598
    {0, "Success"},
599
    {16, "Failed - Unspecified Reason"},
600
    {17, "Failed - No such device"},
601
    {18, "Failed - iFCP session already exists"},
602
    {19, "Failed - Lack of resources"},
603
    {20, "Failed - Incompatible address translation mode"},
604
    {21, "Failed - Incorrect protocol version"},
605
    {22, "Failed - Gateway not synchronized"},
606
    {0, NULL},
607
};
608
609
typedef struct _fcels_conv_key {
610
    uint32_t conv_idx;
611
} fcels_conv_key_t;
612
613
typedef struct _fcels_conv_data {
614
    uint32_t opcode;
615
} fcels_conv_data_t;
616
617
static wmem_map_t *fcels_req_hash;
618
619
static dissector_handle_t fcsp_handle;
620
621
/*
622
 * Hash Functions
623
 */
624
static int
625
fcels_equal(const void *v, const void *w)
626
114
{
627
114
  const fcels_conv_key_t *v1 = (const fcels_conv_key_t *)v;
628
114
  const fcels_conv_key_t *v2 = (const fcels_conv_key_t *)w;
629
630
114
  return (v1->conv_idx == v2->conv_idx);
631
114
}
632
633
static unsigned
634
fcels_hash (const void *v)
635
211
{
636
211
    const fcels_conv_key_t *key = (const fcels_conv_key_t *)v;
637
211
    unsigned val;
638
639
211
    val = key->conv_idx;
640
641
211
    return val;
642
211
}
643
644
static const true_false_string tfs_fc_fcels_cmn_b2b = {
645
    "Alt B2B Credit Mgmt",
646
    "Normal B2B Credit Mgmt"
647
};
648
static const true_false_string tfs_fc_fcels_cmn_e_d_tov = {
649
    "E_D_TOV Resolution in ns",
650
    "E_D_TOV Resolution in ms"
651
};
652
static const true_false_string tfs_fc_fcels_cmn_seqcnt = {
653
    "Cont. Incr SEQCNT rules",
654
    "Normal SEQCNT rules"
655
};
656
static const true_false_string tfs_fc_fcels_cmn_payload = {
657
    "Payload Len=256 bytes",
658
    "Payload Len=116 bytes"
659
};
660
661
static void
662
dissect_cmnsvc (proto_tree *parent_tree, tvbuff_t *tvb, unsigned offset, uint16_t flags, uint8_t opcode)
663
33
{
664
33
    static int * const common_flags[] = {
665
33
        &hf_fcels_cmn_cios,
666
33
        &hf_fcels_cmn_rro,
667
33
        &hf_fcels_cmn_vvv,
668
33
        &hf_fcels_cmn_b2b,
669
33
        &hf_fcels_cmn_multicast,
670
33
        &hf_fcels_cmn_broadcast,
671
33
        &hf_fcels_cmn_security,
672
33
        &hf_fcels_cmn_clk,
673
33
        &hf_fcels_cmn_dhd,
674
33
        &hf_fcels_cmn_payload,
675
33
        NULL
676
33
    };
677
678
33
    static int * const pflags[] = {
679
33
        &hf_fcels_cmn_cios,
680
33
        &hf_fcels_cmn_rro,
681
33
        &hf_fcels_cmn_vvv,
682
33
        &hf_fcels_cmn_b2b,
683
33
        &hf_fcels_cmn_e_d_tov,
684
33
        &hf_fcels_cmn_simplex,
685
33
        &hf_fcels_cmn_multicast,
686
33
        &hf_fcels_cmn_broadcast,
687
33
        &hf_fcels_cmn_security,
688
33
        &hf_fcels_cmn_clk,
689
33
        &hf_fcels_cmn_dhd,
690
33
        &hf_fcels_cmn_seqcnt,
691
33
        &hf_fcels_cmn_payload,
692
33
        NULL
693
33
    };
694
695
696
33
    if ((opcode == FC_ELS_PLOGI) || (opcode == FC_ELS_PDISC)) {
697
23
        proto_tree_add_bitmask_value_with_flags(parent_tree, tvb, offset, hf_fcels_cmnfeatures,
698
23
                           ett_fcels_cmnfeatures, pflags, flags, BMT_NO_FLAGS);
699
23
    } else {
700
10
        proto_tree_add_bitmask_value_with_flags(parent_tree, tvb, offset, hf_fcels_cmnfeatures,
701
10
                           ett_fcels_cmnfeatures, common_flags, flags, BMT_NO_FLAGS);
702
10
    }
703
33
}
704
705
706
static const true_false_string tfs_fc_fcels_cls_sdr = {
707
    "Seq Delivery Requested",
708
    "Out of Order Delivery Requested"
709
};
710
static const true_false_string tfs_fc_fcels_cls_nzctl = {
711
    "Non-zero CS_CTL Tolerated",
712
    "Non-zero CS_CTL Maybe Tolerated"
713
};
714
715
/* The next 3 routines decode only Class 2 & Class 3 relevant bits */
716
static void
717
dissect_clssvc_flags (proto_tree *parent_tree, tvbuff_t *tvb, unsigned offset, uint16_t flags, uint8_t opcode)
718
112
{
719
112
    static int * const common_flags[] = {
720
112
        &hf_fcels_cls_cns,
721
112
        &hf_fcels_cls_prio,
722
112
        NULL
723
112
    };
724
725
112
    static int * const pflags[] = {
726
112
        &hf_fcels_cls_cns,
727
112
        &hf_fcels_cls_sdr,
728
112
        &hf_fcels_cls_prio,
729
112
        &hf_fcels_cls_nzctl,
730
112
        NULL
731
112
    };
732
733
112
    if ((opcode == FC_ELS_FLOGI) || (opcode == FC_ELS_FDISC)) {
734
32
        proto_tree_add_bitmask_value_with_flags(parent_tree, tvb, offset, hf_fcels_clsflags,
735
32
                           ett_fcels_clsflags, pflags, flags, BMT_NO_FLAGS);
736
80
    } else {
737
80
        proto_tree_add_bitmask_value_with_flags(parent_tree, tvb, offset, hf_fcels_clsflags,
738
80
                           ett_fcels_clsflags, common_flags, flags, BMT_NO_FLAGS);
739
80
    }
740
112
}
741
742
static const true_false_string tfs_fc_fcels_fcpflags_retry = {
743
    "Retry Possible",
744
    "Retry NOT possible"
745
};
746
static const true_false_string tfs_fc_fcels_fcpflags_ccomp = {
747
    "Confirmed Comp",
748
    "Comp NOT confirmed"
749
};
750
static const true_false_string tfs_fc_fcels_fcpflags_datao = {
751
    "Data Overlay",
752
    "NO data overlay"
753
};
754
static const true_false_string tfs_fc_fcels_fcpflags_initiator = {
755
    "Initiator",
756
    "NOT an initiator"
757
};
758
static const true_false_string tfs_fc_fcels_fcpflags_target = {
759
    "Target",
760
    "NOT a target"
761
};
762
static const true_false_string tfs_fc_fcels_fcpflags_rdxr = {
763
    "Rd Xfer_Rdy Dis",
764
    "NO rd xfer_rdy dis"
765
};
766
static const true_false_string tfs_fc_fcels_fcpflags_wrxr = {
767
    "Wr Xfer_Rdy Dis",
768
    "NO wr xfer_rdy dis"
769
};
770
771
static void
772
dissect_fcp_flags (proto_tree *parent_tree, tvbuff_t *tvb, unsigned offset, uint32_t flags, uint8_t isreq)
773
5
{
774
5
    static int * const req_flags[] = {
775
5
        &hf_fcels_fcpflags_trireq,
776
5
        &hf_fcels_fcpflags_retry,
777
5
        &hf_fcels_fcpflags_ccomp,
778
5
        &hf_fcels_fcpflags_datao,
779
5
        &hf_fcels_fcpflags_initiator,
780
5
        &hf_fcels_fcpflags_target,
781
5
        &hf_fcels_fcpflags_rdxr,
782
5
        &hf_fcels_fcpflags_wrxr,
783
5
        NULL
784
5
    };
785
786
5
    static int * const rep_flags[] = {
787
5
        &hf_fcels_fcpflags_trirep,
788
5
        &hf_fcels_fcpflags_retry,
789
5
        &hf_fcels_fcpflags_ccomp,
790
5
        &hf_fcels_fcpflags_datao,
791
5
        &hf_fcels_fcpflags_initiator,
792
5
        &hf_fcels_fcpflags_target,
793
5
        &hf_fcels_fcpflags_rdxr,
794
5
        &hf_fcels_fcpflags_wrxr,
795
5
        NULL
796
5
    };
797
798
5
    if (isreq) {
799
5
        proto_tree_add_bitmask_value_with_flags(parent_tree, tvb, offset, hf_fcels_fcpflags,
800
5
                           ett_fcels_fcpflags, req_flags, flags, BMT_NO_FALSE);
801
5
    } else {
802
0
        proto_tree_add_bitmask_value_with_flags(parent_tree, tvb, offset, hf_fcels_fcpflags,
803
0
                           ett_fcels_fcpflags, rep_flags, flags, BMT_NO_FALSE);
804
0
    }
805
5
}
806
807
808
static void
809
dissect_speed_flags (proto_tree *parent_tree, tvbuff_t *tvb, unsigned offset, uint32_t flags, int port)
810
0
{
811
0
    proto_item *item;
812
0
    static int * const speed_flags[] = {
813
0
        &hf_fcels_speedflags_1gb,
814
0
        &hf_fcels_speedflags_2gb,
815
0
        &hf_fcels_speedflags_4gb,
816
0
        &hf_fcels_speedflags_10gb,
817
0
        NULL
818
0
    };
819
820
0
    item = proto_tree_add_bitmask_value_with_flags(parent_tree, tvb, offset, hf_fcels_speedflags,
821
0
                           ett_fcels_speedflags, speed_flags, flags, BMT_NO_FALSE|BMT_NO_TFS);
822
0
    proto_item_set_text(item, "Port Speed Capabilities (Port %u): 0x%04x", port, flags);
823
0
}
824
825
static const true_false_string tfs_fc_fcels_tprloflags_gprlo = {
826
    "Global PRLO",
827
    "NO global prlo"
828
};
829
static const true_false_string tfs_fc_fcels_prliloflags_ipe = {
830
    "Image Pair Estd",
831
    "Image pair NOT estd"
832
};
833
static const true_false_string tfs_fc_fcels_prliloflags_eip = {
834
    "Est Image Pair & Exchg Svc Param",
835
    "Exchange Svc Param Only"
836
};
837
838
static void
839
dissect_prlilo_flags (proto_tree *parent_tree, tvbuff_t *tvb, unsigned offset, int flags, uint8_t opcode)
840
152
{
841
152
    static int * const tprlo_flags[] = {
842
152
        &hf_fcels_tprloflags_opav,
843
152
        &hf_fcels_tprloflags_rpav,
844
152
        &hf_fcels_tprloflags_npv,
845
152
        &hf_fcels_tprloflags_gprlo,
846
152
        NULL
847
152
    };
848
849
152
    static int * const prli_flags[] = {
850
152
        &hf_fcels_prliloflags_opav,
851
152
        &hf_fcels_tprloflags_rpav,
852
152
        &hf_fcels_prliloflags_ipe,
853
152
        NULL
854
152
    };
855
856
152
    static int * const not_prli_flags[] = {
857
152
        &hf_fcels_prliloflags_opav,
858
152
        &hf_fcels_tprloflags_rpav,
859
152
        &hf_fcels_prliloflags_eip,
860
152
        NULL
861
152
    };
862
863
152
    if (opcode == FC_ELS_TPRLO) {
864
70
        proto_tree_add_bitmask_value_with_flags(parent_tree, tvb, offset, hf_fcels_prliloflags,
865
70
                                   ett_fcels_prliloflags, tprlo_flags, flags, BMT_NO_FALSE|BMT_NO_TFS);
866
867
82
    } else { /* opcode != TPRLO */
868
82
        if (opcode == FC_ELS_PRLI) {
869
59
            proto_tree_add_bitmask_value_with_flags(parent_tree, tvb, offset, hf_fcels_prliloflags,
870
59
                                   ett_fcels_prliloflags, prli_flags, flags, BMT_NO_FALSE);
871
59
        } else {
872
23
            proto_tree_add_bitmask_value_with_flags(parent_tree, tvb, offset, hf_fcels_prliloflags,
873
23
                                   ett_fcels_prliloflags, not_prli_flags, flags, BMT_NO_FALSE);
874
23
        }
875
82
    }
876
152
}
877
878
static const value_string initial_pa_vals[] = {
879
    { 0, "Initial P_A Not Supported" },
880
    { 1, "Initial P_A Supported" },
881
    { 3, "Initial P_A Required & Supported" },
882
    { 0, NULL }
883
};
884
static const true_false_string tfs_fc_fcels_initctl_ackgaa = {
885
    "ACK Generation Assistance Avail",
886
    "NO ack generation assistance"
887
};
888
889
static void
890
dissect_initctl_flags (proto_tree *parent_tree, tvbuff_t *tvb, unsigned offset, uint16_t flags, uint8_t opcode)
891
54
{
892
54
    static int * const plogi_flags[] = {
893
54
        &hf_fcels_initctl_initial_pa,
894
54
        &hf_fcels_initctl_ack0,
895
54
        &hf_fcels_initctl_ackgaa,
896
54
        &hf_fcels_initctl_sync,
897
54
        NULL
898
54
    };
899
900
54
    static int * const not_plogi_flags[] = {
901
54
        &hf_fcels_initctl_sync,
902
54
        NULL
903
54
    };
904
905
54
    if ((opcode == FC_ELS_PLOGI) || (opcode == FC_ELS_PDISC)) {
906
36
        proto_tree_add_bitmask_value_with_flags(parent_tree, tvb, offset, hf_fcels_initctl,
907
36
                                   ett_fcels_initctl, plogi_flags, flags, BMT_NO_FALSE);
908
36
    } else {
909
18
        proto_tree_add_bitmask_value_with_flags(parent_tree, tvb, offset, hf_fcels_initctl,
910
18
                                   ett_fcels_initctl, not_plogi_flags, flags, BMT_NO_FALSE);
911
18
    }
912
54
}
913
914
915
static const value_string rcptctl_policy_vals[] = {
916
    { 0, "Error Policy: Discard Policy only" },
917
    { 1, "Error Policy: Reserved" },
918
    { 2, "Error Policy: Both discard and process policies supported" },
919
    { 3, "Error Policy: Reserved" },
920
    { 0, NULL }
921
};
922
static const value_string rcptctl_category_vals[] = {
923
    { 0, "1 Category/Seq" },
924
    { 1, "2 Categories/Seq" },
925
    { 3, "More than 2 Categories/Seq" },
926
    { 0, NULL }
927
};
928
929
static void
930
dissect_rcptctl_flags (proto_tree *parent_tree, tvbuff_t *tvb, unsigned offset, uint16_t flags, uint8_t opcode)
931
53
{
932
53
    static int * const plogi_flags[] = {
933
53
        &hf_fcels_rcptctl_ack0,
934
53
        &hf_fcels_rcptctl_interlock,
935
53
        &hf_fcels_rcptctl_policy,
936
53
        &hf_fcels_rcptctl_category,
937
53
        &hf_fcels_rcptctl_sync,
938
53
        NULL
939
53
    };
940
941
53
    static int * const not_plogi_flags[] = {
942
53
        &hf_fcels_rcptctl_sync,
943
53
        NULL
944
53
    };
945
946
53
    if ((opcode == FC_ELS_PLOGI) || (opcode == FC_ELS_PDISC)) {
947
35
        proto_tree_add_bitmask_value_with_flags(parent_tree, tvb, offset, hf_fcels_rcptctl,
948
35
                                   ett_fcels_rcptctl, plogi_flags, flags, BMT_NO_FALSE);
949
35
    } else {
950
18
        proto_tree_add_bitmask_value_with_flags(parent_tree, tvb, offset, hf_fcels_rcptctl,
951
18
                                   ett_fcels_rcptctl, not_plogi_flags, flags, BMT_NO_FALSE);
952
18
    }
953
53
}
954
955
/* Maximum length of possible string from, construct_*_string
956
 * 296 bytes, FIX possible buffer overflow */
957
#define FCELS_LOGI_MAXSTRINGLEN 512
958
959
static void
960
dissect_fcels_logi (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
961
                    proto_item *ti, uint8_t opcode)
962
35
{
963
    /* Set up structures needed to add the protocol subtree and manage it */
964
35
    unsigned offset = 0,
965
35
        svcvld = 0,
966
35
        svcclass;
967
35
    proto_tree *logi_tree, *cmnsvc_tree;
968
35
    uint16_t flag;
969
970
35
    if (tree) {
971
35
        logi_tree = proto_item_add_subtree (ti, ett_fcels_logi);
972
35
        proto_tree_add_item (logi_tree, hf_fcels_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
973
974
35
        cmnsvc_tree = proto_tree_add_subtree(logi_tree, tvb, offset+4, 16, ett_fcels_logi_cmnsvc, NULL, "Common Svc Parameters");
975
35
        proto_tree_add_item (cmnsvc_tree, hf_fcels_b2b, tvb, offset+6, 2, ENC_BIG_ENDIAN);
976
35
        flag = tvb_get_ntohs (tvb, offset+8);
977
978
35
        if (flag & 0x0001) {
979
19
            svcvld = 1;
980
19
        }
981
982
35
        dissect_cmnsvc (cmnsvc_tree, tvb, offset+8, flag, opcode);
983
984
35
        proto_tree_add_item (cmnsvc_tree, hf_fcels_bbscnum, tvb, offset+10, 1, ENC_BIG_ENDIAN);
985
35
        proto_tree_add_item (cmnsvc_tree, hf_fcels_rcvsize, tvb, offset+10, 2, ENC_BIG_ENDIAN);
986
35
        proto_tree_add_item (cmnsvc_tree, hf_fcels_maxconseq, tvb, offset+12, 2, ENC_BIG_ENDIAN);
987
35
        proto_tree_add_item (cmnsvc_tree, hf_fcels_reloffset, tvb, offset+14, 2, ENC_BIG_ENDIAN);
988
35
        proto_tree_add_item (cmnsvc_tree, hf_fcels_edtov, tvb, offset+16, 4, ENC_BIG_ENDIAN);
989
35
        proto_tree_add_item (cmnsvc_tree, hf_fcels_npname, tvb, offset+20, 8, ENC_NA);
990
35
        proto_tree_add_item (cmnsvc_tree, hf_fcels_fnname, tvb, offset+28, 8, ENC_NA);
991
992
        /* Add subtree for class parameters */
993
35
        offset = 36;
994
150
        for (svcclass = 1; svcclass < 5; svcclass++) {
995
115
            cmnsvc_tree = proto_tree_add_subtree_format(logi_tree, tvb, offset, 16,
996
115
                                         ett_fcels_logi_cmnsvc, NULL, "Class %d Svc Parameters", svcclass);
997
998
115
            flag = tvb_get_ntohs (tvb, offset);
999
115
            dissect_clssvc_flags (cmnsvc_tree, tvb, offset, flag, opcode);
1000
115
            if (flag & 0x8000) {
1001
54
                flag = tvb_get_ntohs (tvb, offset+2);
1002
54
                dissect_initctl_flags (cmnsvc_tree, tvb, offset+2, flag, opcode);
1003
1004
54
                flag = tvb_get_ntohs (tvb, offset+4);
1005
54
                dissect_rcptctl_flags (cmnsvc_tree, tvb, offset+4, flag, opcode);
1006
1007
54
                proto_tree_add_item (cmnsvc_tree, hf_fcels_clsrcvsize, tvb,
1008
54
                                     offset+6, 2, ENC_BIG_ENDIAN);
1009
54
                proto_tree_add_item (cmnsvc_tree, hf_fcels_conseq, tvb,
1010
54
                                     offset+8, 2, ENC_BIG_ENDIAN);
1011
54
                proto_tree_add_item (cmnsvc_tree, hf_fcels_e2e, tvb,
1012
54
                                     offset+10, 2, ENC_BIG_ENDIAN);
1013
54
                proto_tree_add_item (cmnsvc_tree, hf_fcels_openseq, tvb,
1014
54
                                     offset+12, 2, ENC_BIG_ENDIAN);
1015
54
            }
1016
115
            offset += 16;
1017
115
        }
1018
35
        proto_tree_add_item (logi_tree, hf_fcels_vendorvers, tvb, offset, 16, ENC_NA);
1019
        /* The standard 116 octet payload ends before the service availability */
1020
35
        if (svcvld && tvb_bytes_exist (tvb, offset+32, 8)) {
1021
11
            proto_tree_add_item (logi_tree, hf_fcels_svcavail, tvb, offset+32, 8, ENC_NA);
1022
11
        }
1023
35
    }
1024
35
}
1025
1026
static void
1027
dissect_fcels_plogi (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1028
                     uint8_t isreq _U_, proto_item *ti)
1029
12
{
1030
12
    dissect_fcels_logi (tvb, pinfo, tree, ti, FC_ELS_PLOGI);
1031
12
}
1032
1033
static void
1034
dissect_fcels_flogi (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1035
                     uint8_t isreq _U_, proto_item *ti)
1036
6
{
1037
6
    dissect_fcels_logi (tvb, pinfo, tree, ti, FC_ELS_FLOGI);
1038
6
}
1039
1040
static void
1041
dissect_fcels_logout (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
1042
                      uint8_t isreq, proto_item *ti)
1043
0
{
1044
    /* Set up structures needed to add the protocol subtree and manage it */
1045
0
    unsigned offset = 5;             /* bypass opcode+rsvd field */
1046
0
    proto_tree *logo_tree;
1047
1048
0
    if (tree) {
1049
0
        logo_tree = proto_item_add_subtree (ti, ett_fcels_logo);
1050
1051
0
        proto_tree_add_item (logo_tree, hf_fcels_opcode, tvb, offset-5, 1, ENC_BIG_ENDIAN);
1052
1053
0
        if (!isreq) {
1054
            /* Accept has no payload */
1055
0
            return;
1056
0
        }
1057
1058
0
        proto_tree_add_item (logo_tree, hf_fcels_nportid, tvb, offset, 3, ENC_NA);
1059
0
        proto_tree_add_item (logo_tree, hf_fcels_npname, tvb, offset+3, 8, ENC_NA);
1060
0
    }
1061
0
}
1062
1063
static void
1064
dissect_fcels_abtx (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
1065
                    uint8_t isreq, proto_item *ti)
1066
1
{
1067
    /* Set up structures needed to add the protocol subtree and manage it */
1068
1
    unsigned offset = 0;
1069
1
    proto_tree *abtx_tree;
1070
1071
1
    if (tree) {
1072
1
        abtx_tree = proto_item_add_subtree (ti, ett_fcels_abtx);
1073
1074
1
        proto_tree_add_item (abtx_tree, hf_fcels_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1075
1076
1
        if (!isreq) {
1077
0
            return;
1078
0
        }
1079
1080
1
        proto_tree_add_item(abtx_tree, hf_fcels_recovery_qualifier_status, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1081
1
        proto_tree_add_item (abtx_tree, hf_fcels_nportid, tvb, offset+5, 3, ENC_NA);
1082
1
        proto_tree_add_item (abtx_tree, hf_fcels_oxid, tvb, offset+8, 2, ENC_BIG_ENDIAN);
1083
1
        proto_tree_add_item (abtx_tree, hf_fcels_rxid, tvb, offset+10, 2, ENC_BIG_ENDIAN);
1084
1
    }
1085
1
}
1086
1087
static void
1088
dissect_fcels_rsi (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
1089
                   uint8_t isreq, proto_item *ti)
1090
4
{
1091
    /* Set up structures needed to add the protocol subtree and manage it */
1092
4
    unsigned offset = 4;
1093
4
    proto_tree *rsi_tree;
1094
1095
4
    if (tree) {
1096
4
        rsi_tree = proto_item_add_subtree (ti, ett_fcels_rsi);
1097
1098
4
        proto_tree_add_item (rsi_tree, hf_fcels_opcode, tvb, offset-4, 1, ENC_BIG_ENDIAN);
1099
4
        if (!isreq)
1100
0
            return;
1101
1102
4
        proto_tree_add_item (rsi_tree, hf_fcels_recovqual, tvb, offset, 1, ENC_BIG_ENDIAN);
1103
4
        proto_tree_add_item (rsi_tree, hf_fcels_nportid, tvb, offset+1, 3, ENC_NA);
1104
4
        proto_tree_add_item (rsi_tree, hf_fcels_rxid, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1105
4
        proto_tree_add_item (rsi_tree, hf_fcels_oxid, tvb, offset+6, 2, ENC_BIG_ENDIAN);
1106
4
    }
1107
4
}
1108
1109
static void
1110
dissect_fcels_rrq (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
1111
                   uint8_t isreq, proto_item *ti)
1112
1
{
1113
    /* Set up structures needed to add the protocol subtree and manage it */
1114
1
    unsigned offset = 0;
1115
1
    proto_tree *rrq_tree;
1116
1117
1
    if (tree) {
1118
1
        rrq_tree = proto_item_add_subtree (ti, ett_fcels_rrq);
1119
1120
1
        proto_tree_add_item (rrq_tree, hf_fcels_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1121
1
        if (!isreq)
1122
0
            return;
1123
1124
1
        proto_tree_add_item (rrq_tree, hf_fcels_nportid, tvb, offset+5, 3, ENC_NA);
1125
1
        proto_tree_add_item (rrq_tree, hf_fcels_oxid, tvb, offset+8, 2, ENC_BIG_ENDIAN);
1126
1
        proto_tree_add_item (rrq_tree, hf_fcels_rxid, tvb, offset+10, 2, ENC_BIG_ENDIAN);
1127
1
    }
1128
1
}
1129
1130
static void
1131
dissect_fcels_rec (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
1132
                   uint8_t isreq, proto_item *ti)
1133
1
{
1134
    /* Set up structures needed to add the protocol subtree and manage it */
1135
1
    unsigned offset = 0;
1136
1
    proto_tree *rec_tree;
1137
1138
1
    if (tree) {
1139
1
        rec_tree = proto_item_add_subtree (ti, ett_fcels_rec);
1140
1141
1
        proto_tree_add_item (rec_tree, hf_fcels_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1142
1143
1
        if (isreq) {
1144
1
            proto_tree_add_item (rec_tree, hf_fcels_nportid, tvb,
1145
1
                                   offset+5, 3, ENC_NA);
1146
1
            proto_tree_add_item (rec_tree, hf_fcels_oxid, tvb,
1147
1
                                 offset+8, 2, ENC_BIG_ENDIAN);
1148
1
            proto_tree_add_item (rec_tree, hf_fcels_rxid, tvb,
1149
1
                                 offset+10, 2, ENC_BIG_ENDIAN);
1150
1
        } else {
1151
0
            proto_tree_add_item (rec_tree, hf_fcels_oxid, tvb,
1152
0
                                 offset+4, 2, ENC_BIG_ENDIAN);
1153
0
            proto_tree_add_item (rec_tree, hf_fcels_rxid, tvb,
1154
0
                                 offset+6, 2, ENC_BIG_ENDIAN);
1155
0
            proto_tree_add_item (rec_tree, hf_fcels_nportid, tvb,
1156
0
                                   offset+9, 3, ENC_NA);
1157
0
            proto_tree_add_item (rec_tree, hf_fcels_resportid, tvb,
1158
0
                                   offset+13, 3, ENC_NA);
1159
0
            proto_tree_add_item (rec_tree, hf_fcels_rec_fc4, tvb,
1160
0
                                 offset+16, 4, ENC_BIG_ENDIAN);
1161
0
            proto_tree_add_bitmask (rec_tree, tvb, offset+20, hf_fcels_estat,
1162
0
                                    ett_fcels_estat, hf_fcels_estat_fields,
1163
0
                                    ENC_BIG_ENDIAN);
1164
0
        }
1165
1
    }
1166
1
}
1167
1168
static void
1169
dissect_fcels_pdisc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1170
                     uint8_t isreq _U_, proto_item *ti)
1171
12
{
1172
12
    dissect_fcels_logi (tvb, pinfo, tree, ti, FC_ELS_PDISC);
1173
12
}
1174
1175
static void
1176
dissect_fcels_fdisc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1177
                     uint8_t isreq _U_, proto_item *ti)
1178
5
{
1179
5
    dissect_fcels_logi (tvb, pinfo, tree, ti, FC_ELS_FDISC);
1180
5
}
1181
1182
static void
1183
dissect_fcels_adisc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1184
                     uint8_t isreq _U_, proto_item *ti)
1185
3
{
1186
    /* Set up structures needed to add the protocol subtree and manage it */
1187
3
    unsigned offset = 5;
1188
3
    proto_tree *adisc_tree;
1189
1190
3
    if (tree) {
1191
3
        adisc_tree = proto_item_add_subtree (ti, ett_fcels_adisc);
1192
1193
3
        proto_tree_add_item (adisc_tree, hf_fcels_opcode, tvb, offset-5, 1, ENC_BIG_ENDIAN);
1194
1195
3
        if (tvb_captured_length (tvb) < 28) {
1196
0
            proto_tree_add_expert_remaining (adisc_tree, pinfo, &ei_fcels_short_payload, tvb, 1);
1197
0
            return;
1198
0
        }
1199
1200
3
        proto_tree_add_item (adisc_tree, hf_fcels_hardaddr, tvb, offset, 3, ENC_NA);
1201
3
        proto_tree_add_item (adisc_tree, hf_fcels_npname, tvb, offset+3, 8, ENC_NA);
1202
3
        proto_tree_add_item (adisc_tree, hf_fcels_fnname, tvb, offset+11, 8, ENC_NA);
1203
3
        proto_tree_add_item (adisc_tree, hf_fcels_nportid, tvb, offset+20, 3, ENC_NA);
1204
3
    }
1205
1206
3
}
1207
1208
static void
1209
dissect_fcels_farp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1210
                    proto_item *ti)
1211
2
{
1212
2
    unsigned offset = 4;
1213
2
    proto_tree *farp_tree;
1214
1215
2
    if (tree) {
1216
2
        farp_tree = proto_item_add_subtree (ti, ett_fcels_farp);
1217
1218
2
        proto_tree_add_item (farp_tree, hf_fcels_opcode, tvb, offset-4, 1, ENC_BIG_ENDIAN);
1219
1220
2
        if (tvb_captured_length (tvb) < 76) {
1221
1
            proto_tree_add_expert_remaining (farp_tree, pinfo, &ei_fcels_short_payload, tvb, 1);
1222
1
            return;
1223
1
        }
1224
1225
1
        proto_tree_add_item (farp_tree, hf_fcels_farp_matchcodept,
1226
1
                             tvb, offset, 1, ENC_BIG_ENDIAN);
1227
1
        proto_tree_add_item (farp_tree, hf_fcels_nportid, tvb, offset+1,
1228
1
                               3, ENC_NA);
1229
1
        proto_tree_add_item (farp_tree, hf_fcels_farp_respaction, tvb,
1230
1
                             offset+4, 1, ENC_BIG_ENDIAN);
1231
1
        proto_tree_add_item (farp_tree, hf_fcels_resportid, tvb, offset+5,
1232
1
                               3, ENC_NA);
1233
1
        proto_tree_add_item (farp_tree, hf_fcels_npname, tvb, offset+8, 8, ENC_NA);
1234
1
        proto_tree_add_item (farp_tree, hf_fcels_fnname, tvb, offset+16, 8, ENC_NA);
1235
1
        proto_tree_add_item (farp_tree, hf_fcels_respname, tvb, offset+24,
1236
1
                               8, ENC_NA);
1237
1
        proto_tree_add_item (farp_tree, hf_fcels_respnname, tvb, offset+32,
1238
1
                               8, ENC_NA);
1239
1
        proto_tree_add_item (farp_tree, hf_fcels_reqipaddr, tvb, offset+40,
1240
1
                             16, ENC_NA);
1241
1
        proto_tree_add_item (farp_tree, hf_fcels_respipaddr, tvb, offset+56,
1242
1
                             16, ENC_NA);
1243
1
    }
1244
2
}
1245
1246
static void
1247
dissect_fcels_farp_req (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1248
                        uint8_t isreq _U_, proto_item *ti)
1249
0
{
1250
0
    dissect_fcels_farp (tvb, pinfo, tree, ti);
1251
0
}
1252
1253
static void
1254
dissect_fcels_farp_rply (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1255
                         uint8_t isreq _U_, proto_item *ti)
1256
2
{
1257
2
    dissect_fcels_farp (tvb, pinfo, tree, ti);
1258
2
}
1259
1260
static void
1261
dissect_fcels_rps (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
1262
                   uint8_t isreq, proto_item *ti)
1263
0
{
1264
    /* Set up structures needed to add the protocol subtree and manage it */
1265
0
    unsigned offset = 3;
1266
0
    uint8_t flag;
1267
0
    proto_tree *rps_tree;
1268
1269
0
    flag = tvb_get_uint8 (tvb, offset);
1270
1271
0
    if (tree) {
1272
0
        rps_tree = proto_item_add_subtree (ti, ett_fcels_rps);
1273
1274
0
        if (isreq) {
1275
0
            proto_tree_add_item (rps_tree, hf_fcels_rps_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
1276
1277
0
            proto_tree_add_item (rps_tree, hf_fcels_opcode, tvb, offset-3, 1, ENC_BIG_ENDIAN);
1278
1279
0
            if (flag & 0x2) {
1280
0
                proto_tree_add_item (rps_tree, hf_fcels_npname, tvb, offset+1, 8, ENC_NA);
1281
0
            }
1282
0
            else if (flag & 0x1) {
1283
0
                proto_tree_add_item (rps_tree, hf_fcels_rps_portnum, tvb,
1284
0
                                     offset+5, 3, ENC_BIG_ENDIAN);
1285
0
            }
1286
0
        }
1287
0
        else {
1288
0
            proto_tree_add_item (rps_tree, hf_fcels_rps_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
1289
0
            proto_tree_add_item (rps_tree, hf_fcels_rps_portstatus, tvb,
1290
0
                                 offset+3, 2, ENC_BIG_ENDIAN);
1291
            /* Next 6 fields are from Link Error Status Block (LESB) */
1292
0
            proto_tree_add_item(rps_tree, hf_fcels_link_failure_count, tvb, offset+5, 4, ENC_BIG_ENDIAN);
1293
0
            proto_tree_add_item(rps_tree, hf_fcels_loss_of_sync_count, tvb, offset+9, 4, ENC_BIG_ENDIAN);
1294
0
            proto_tree_add_item(rps_tree, hf_fcels_loss_of_signal_count, tvb, offset+13, 4, ENC_BIG_ENDIAN);
1295
0
            proto_tree_add_item(rps_tree, hf_fcels_primitive_seq_protocol_err, tvb, offset+17, 4, ENC_BIG_ENDIAN);
1296
0
            proto_tree_add_item(rps_tree, hf_fcels_invalid_xmission_word, tvb, offset+21, 4, ENC_BIG_ENDIAN);
1297
0
            proto_tree_add_item(rps_tree, hf_fcels_invalid_crc_count, tvb, offset+25, 4, ENC_BIG_ENDIAN);
1298
0
            if (flag & 0x01) {
1299
                /* Next 6 fields are from L_Port Extension field */
1300
0
                proto_tree_add_item(rps_tree, hf_fcels_l_port_status, tvb, offset+31, 2, ENC_BIG_ENDIAN);
1301
0
                proto_tree_add_item(rps_tree, hf_fcels_lip_al_ps, tvb, offset+36, 1, ENC_BIG_ENDIAN);
1302
0
                proto_tree_add_item(rps_tree, hf_fcels_lip_f7_initiated_count, tvb, offset+37, 4, ENC_BIG_ENDIAN);
1303
0
                proto_tree_add_item(rps_tree, hf_fcels_lip_f7_received_count, tvb, offset+41, 4, ENC_BIG_ENDIAN);
1304
0
                proto_tree_add_item(rps_tree, hf_fcels_lip_f8_initiated_count, tvb, offset+45, 4, ENC_BIG_ENDIAN);
1305
0
                proto_tree_add_item(rps_tree, hf_fcels_lip_f8_received_count, tvb, offset+49, 4, ENC_BIG_ENDIAN);
1306
0
                proto_tree_add_item(rps_tree, hf_fcels_lip_reset_initiated_count, tvb, offset+53, 4, ENC_BIG_ENDIAN);
1307
0
                proto_tree_add_item(rps_tree, hf_fcels_lip_reset_received_count, tvb, offset+57, 4, ENC_BIG_ENDIAN);
1308
0
            }
1309
0
        }
1310
0
    }
1311
0
}
1312
1313
static void
1314
dissect_fcels_rpl (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
1315
                   uint8_t isreq, proto_item *ti)
1316
2
{
1317
    /* Set up structures needed to add the protocol subtree and manage it */
1318
2
    unsigned offset = 0;
1319
2
    proto_tree *rpl_tree, *pb_tree;
1320
2
    int loop;
1321
1322
2
    if (tree) {
1323
2
        rpl_tree = proto_item_add_subtree (ti, ett_fcels_rpl);
1324
1325
2
        proto_tree_add_item (rpl_tree, hf_fcels_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1326
1327
2
        if (isreq) {
1328
1
            proto_tree_add_item(rpl_tree, hf_fcels_rpl_max_size, tvb, offset+6, 2, ENC_BIG_ENDIAN);
1329
1
            proto_tree_add_item(rpl_tree, hf_fcels_rpl_index, tvb, offset+9, 3, ENC_BIG_ENDIAN);
1330
1
        }
1331
1
        else {
1332
            /* Reply consists of a header and a number of port blocks */
1333
1
            proto_tree_add_item(rpl_tree, hf_fcels_rpl_payload_length, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1334
1
            proto_tree_add_item(rpl_tree, hf_fcels_rpl_list_length, tvb, offset+5, 3, ENC_BIG_ENDIAN);
1335
1
            proto_tree_add_item(rpl_tree, hf_fcels_rpl_index_of_i_port_block, tvb, offset+9, 3, ENC_BIG_ENDIAN);
1336
1
            offset = 12;
1337
            /* The following loop is for dissecting the port blocks */
1338
7
            for (loop = tvb_get_ntoh24 (tvb, 5); loop > 0; loop--) {
1339
6
                pb_tree = proto_tree_add_subtree_format(rpl_tree, tvb, offset, 16,
1340
6
                                             ett_fcels_rplpb, NULL, "Port Block %u", loop);
1341
1342
6
                proto_tree_add_item(pb_tree, hf_fcels_rpl_physical_port, tvb, offset, 4, ENC_BIG_ENDIAN);
1343
6
                proto_tree_add_item(pb_tree, hf_fcels_rpl_port_identifier, tvb, offset+5, 3, ENC_NA);
1344
6
                proto_tree_add_item(pb_tree, hf_fcels_rpl_port_name, tvb, offset+8, 8, ENC_NA);
1345
6
                offset += 16;
1346
6
            }
1347
1
        }
1348
2
    }
1349
2
}
1350
1351
static void
1352
dissect_fcels_fan (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1353
                   uint8_t isreq _U_, proto_item *ti)
1354
3
{
1355
    /* Set up structures needed to add the protocol subtree and manage it */
1356
3
    unsigned offset = 5;
1357
3
    proto_tree *fan_tree;
1358
1359
3
    if (tree) {
1360
3
        fan_tree = proto_item_add_subtree (ti, ett_fcels_fan);
1361
1362
3
        proto_tree_add_item (fan_tree, hf_fcels_opcode, tvb, offset-5, 1, ENC_BIG_ENDIAN);
1363
1364
3
        if (tvb_captured_length (tvb) < 24) {
1365
1
            proto_tree_add_expert_remaining (fan_tree, pinfo, &ei_fcels_short_payload, tvb, 1);
1366
1
            return;
1367
1
        }
1368
1369
2
        proto_tree_add_item (fan_tree, hf_fcels_fabricaddr, tvb, offset, 3, ENC_NA);
1370
2
        proto_tree_add_item (fan_tree, hf_fcels_fabricpname, tvb, offset+3,
1371
2
                               8, ENC_NA);
1372
2
        proto_tree_add_item (fan_tree, hf_fcels_fnname, tvb, offset+11, 8, ENC_NA);
1373
2
    }
1374
3
}
1375
1376
static void
1377
dissect_fcels_rscn (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
1378
                    uint8_t isreq, proto_item *ti)
1379
5
{
1380
    /* Set up structures needed to add the protocol subtree and manage it */
1381
5
    unsigned offset = 1;
1382
5
    proto_tree *rscn_tree, *rectree;
1383
5
    int numrec, plen, i;
1384
1385
5
    if (tree) {
1386
5
        rscn_tree = proto_item_add_subtree (ti, ett_fcels_rscn);
1387
1388
5
        proto_tree_add_item (rscn_tree, hf_fcels_opcode, tvb, offset-1, 1, ENC_BIG_ENDIAN);
1389
5
        if (!isreq)
1390
0
            return;
1391
1392
5
        proto_tree_add_item(rscn_tree, hf_fcels_rscn_page_len, tvb, offset, 1, ENC_BIG_ENDIAN);
1393
5
        plen = tvb_get_ntohs (tvb, offset+1);
1394
5
        proto_tree_add_item(rscn_tree, hf_fcels_rscn_payload_len, tvb, offset+1, 2, ENC_BIG_ENDIAN);
1395
5
        numrec = (plen - 4)/4;
1396
1397
5
        offset = 4;
1398
138
        for (i = 0; i < numrec; i++) {
1399
133
            rectree = proto_tree_add_subtree_format(rscn_tree, tvb, offset, 4,
1400
133
                                         ett_fcels_rscn_rec, NULL, "Affected N_Port Page %u", i);
1401
1402
133
            proto_tree_add_item (rectree, hf_fcels_rscn_evqual, tvb, offset,
1403
133
                                 1, ENC_BIG_ENDIAN);
1404
133
            proto_tree_add_item (rectree, hf_fcels_rscn_addrfmt, tvb, offset,
1405
133
                                 1, ENC_BIG_ENDIAN);
1406
133
            proto_tree_add_item (rectree, hf_fcels_rscn_domain, tvb, offset+1,
1407
133
                                 1, ENC_BIG_ENDIAN);
1408
133
            proto_tree_add_item (rectree, hf_fcels_rscn_area, tvb, offset+2,
1409
133
                                 1, ENC_BIG_ENDIAN);
1410
133
            proto_tree_add_item (rectree, hf_fcels_rscn_port, tvb, offset+3,
1411
133
                                 1, ENC_BIG_ENDIAN);
1412
133
            offset += 4;
1413
133
        }
1414
5
    }
1415
5
}
1416
1417
static void
1418
dissect_fcels_scr (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
1419
                   uint8_t isreq, proto_item *ti)
1420
1
{
1421
    /* Set up structures needed to add the protocol subtree and manage it */
1422
1
    unsigned offset = 7;
1423
1
    proto_tree *scr_tree;
1424
1425
1
    if (tree) {
1426
1
        scr_tree = proto_item_add_subtree (ti, ett_fcels_scr);
1427
1
        proto_tree_add_item (scr_tree, hf_fcels_opcode, tvb, offset-7, 1, ENC_BIG_ENDIAN);
1428
1
        if (isreq)
1429
1
            proto_tree_add_item (scr_tree, hf_fcels_scrregn, tvb, offset, 1, ENC_BIG_ENDIAN);
1430
1
    }
1431
1
}
1432
1433
static void
1434
dissect_fcels_rnft (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
1435
                    uint8_t isreq, proto_item *ti)
1436
1
{
1437
1
    unsigned offset = 0;
1438
1
    uint16_t numrec, i;
1439
1
    proto_tree *rnft_tree, *fc4_tree;
1440
1441
1
    if (tree) {
1442
1
        rnft_tree = proto_item_add_subtree (ti, ett_fcels_rnft);
1443
1444
1
        proto_tree_add_item (rnft_tree, hf_fcels_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1445
1446
1
        if (isreq) {
1447
1
            proto_tree_add_item(rnft_tree, hf_fcels_rnft_max_size, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1448
1
            proto_tree_add_item(rnft_tree, hf_fcels_rnft_index, tvb, offset+7, 1, ENC_BIG_ENDIAN);
1449
1
        }
1450
0
        else {
1451
0
            proto_tree_add_item(rnft_tree, hf_fcels_rnft_payload_len, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1452
0
            numrec = tvb_get_uint8 (tvb, offset+5);
1453
0
            proto_tree_add_item(rnft_tree, hf_fcels_rnft_list_length, tvb, offset+5, 1, ENC_BIG_ENDIAN);
1454
0
            proto_tree_add_item(rnft_tree, hf_fcels_rnft_index_of_first_rec_in_list, tvb, offset+7, 1, ENC_BIG_ENDIAN);
1455
0
            offset = 8;
1456
0
            for (i = 0; i < numrec; i++) {
1457
0
                fc4_tree = proto_tree_add_subtree_format(rnft_tree, tvb, offset, 4,
1458
0
                                             ett_fcels_rnft_fc4, NULL, "FC-4 Entry #%u", i);
1459
1460
0
                proto_tree_add_item (fc4_tree, hf_fcels_rnft_fc4type, tvb,
1461
0
                                     offset, 1, ENC_BIG_ENDIAN);
1462
0
                proto_tree_add_item(fc4_tree, hf_fcels_rnft_fc4_qualifier, tvb, offset+1, 3, ENC_BIG_ENDIAN);
1463
0
                offset += 4;
1464
0
            }
1465
0
        }
1466
1
    }
1467
1
}
1468
1469
static void
1470
dissect_fcels_lsts (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
1471
                    uint8_t isreq, proto_item *ti)
1472
0
{
1473
    /* Set up structures needed to add the protocol subtree and manage it */
1474
0
    unsigned offset = 5;
1475
0
    proto_tree *lsts_tree;
1476
1477
0
    if (tree) {
1478
0
        lsts_tree = proto_item_add_subtree (ti, ett_fcels_lsts);
1479
1480
0
        proto_tree_add_item (lsts_tree, hf_fcels_opcode, tvb, offset-5, 1, ENC_BIG_ENDIAN);
1481
0
        if (isreq) {
1482
            /* In case of LSTS, the reply has the meat */
1483
0
            return;
1484
0
        }
1485
0
        proto_tree_add_item (lsts_tree, hf_fcels_failedrcvr, tvb, offset, 1, ENC_BIG_ENDIAN);
1486
0
        proto_tree_add_item (lsts_tree, hf_fcels_flacompliance, tvb, offset+1,
1487
0
                             1, ENC_BIG_ENDIAN);
1488
0
        proto_tree_add_item (lsts_tree, hf_fcels_loopstate, tvb, offset+2, 1, ENC_BIG_ENDIAN);
1489
0
        proto_tree_add_item (lsts_tree, hf_fcels_publicloop_bmap, tvb, offset+3,
1490
0
                             16, ENC_NA);
1491
0
        proto_tree_add_item (lsts_tree, hf_fcels_pvtloop_bmap, tvb, offset+19,
1492
0
                             16, ENC_NA);
1493
0
        proto_tree_add_item (lsts_tree, hf_fcels_alpa_map, tvb, offset+35,
1494
0
                             128, ENC_NA);
1495
0
    }
1496
0
}
1497
1498
/* Maximum length of possible string from, dissect_fcels_prlilo_payload
1499
 * 119 bytes, FIX possible buffer overflow */
1500
#define FCELS_PRLILO_MAXSTRINGLEN 256
1501
1502
static void
1503
dissect_fcels_prlilo_payload (tvbuff_t *tvb, packet_info *pinfo _U_,
1504
                              uint8_t isreq, proto_item *ti, uint8_t opcode)
1505
24
{
1506
24
    unsigned offset = 0;
1507
24
    uint8_t type;
1508
24
    proto_tree *prli_tree, *svcpg_tree;
1509
24
    int num_svcpg, payload_len, i, flag;
1510
1511
    /* We're assuming that we're invoked only if tree is not NULL i.e.
1512
     * we don't do the usual "if (tree)" check here, the caller must.
1513
     */
1514
24
    prli_tree = proto_item_add_subtree (ti, ett_fcels_prli);
1515
1516
24
    proto_tree_add_item (prli_tree, hf_fcels_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1517
1518
24
    proto_tree_add_item(prli_tree, hf_fcels_prlilo_page_length, tvb, offset+1, 1, ENC_BIG_ENDIAN);
1519
24
    payload_len = tvb_get_ntohs (tvb, offset+2);
1520
24
    proto_tree_add_item(prli_tree, hf_fcels_prlilo_payload_length, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1521
24
    num_svcpg = payload_len/16;
1522
1523
24
    offset = 4;
1524
184
    for (i = 0; i < num_svcpg; i++) {
1525
160
        svcpg_tree = proto_tree_add_subtree_format(prli_tree, tvb, offset, 16,
1526
160
                                     ett_fcels_prli_svcpg, NULL, "Service Parameter Page %u", i);
1527
1528
160
        proto_tree_add_item_ret_uint8(svcpg_tree, hf_fcels_prlilo_type, tvb, offset, 1, ENC_BIG_ENDIAN, &type);
1529
160
        proto_tree_add_item(svcpg_tree, hf_fcels_prlilo_type_code_extension, tvb, offset+1, 1, ENC_BIG_ENDIAN);
1530
1531
160
        flag = tvb_get_uint8 (tvb, offset+2);
1532
160
        dissect_prlilo_flags (svcpg_tree, tvb, offset+2, flag, opcode);
1533
1534
160
        if (!isreq && (opcode != FC_ELS_TPRLO)) {
1535
            /* This is valid only for ACC */
1536
12
            proto_tree_add_item(svcpg_tree, hf_fcels_prlilo_response_code, tvb, offset+2, 1, ENC_BIG_ENDIAN);
1537
12
        }
1538
160
        if (opcode != FC_ELS_TPRLO) {
1539
82
            proto_tree_add_item(svcpg_tree, hf_fcels_prlilo_originator_pa, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1540
82
        }
1541
78
        else {
1542
78
            proto_tree_add_item(svcpg_tree, hf_fcels_prlilo_3rd_party_originator_pa, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1543
78
        }
1544
160
        proto_tree_add_item(svcpg_tree, hf_fcels_prlilo_responder_pa, tvb, offset+8, 4, ENC_BIG_ENDIAN);
1545
1546
160
        if (type == FC_TYPE_SCSI) {
1547
5
            flag = tvb_get_ntohs (tvb, offset+14);
1548
5
            dissect_fcp_flags (svcpg_tree, tvb, offset+12, flag, isreq);
1549
5
        }
1550
155
        else if ((opcode == FC_ELS_PRLI) && !isreq) {
1551
12
            proto_tree_add_item(svcpg_tree, hf_fcels_prlilo_service_parameter_response, tvb, offset+12, 4, ENC_BIG_ENDIAN);
1552
12
        }
1553
143
        else if (opcode == FC_ELS_TPRLO) {
1554
64
            proto_tree_add_item(svcpg_tree, hf_fcels_prlilo_3rd_party_n_port_id, tvb, offset+13, 3, ENC_NA);
1555
64
        }
1556
160
        offset += 16;
1557
160
    }
1558
24
}
1559
1560
static void
1561
dissect_fcels_prli (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1562
                    uint8_t isreq, proto_item *ti)
1563
14
{
1564
14
    if (tree) {
1565
14
        dissect_fcels_prlilo_payload (tvb, pinfo, isreq, ti, FC_ELS_PRLI);
1566
14
    }
1567
14
}
1568
1569
static void
1570
dissect_fcels_prlo (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1571
                    uint8_t isreq, proto_item *ti)
1572
3
{
1573
    /* Set up structures needed to add the protocol subtree and manage it */
1574
3
    if (tree) {
1575
3
        dissect_fcels_prlilo_payload (tvb, pinfo, isreq, ti, FC_ELS_PRLO);
1576
3
    }
1577
3
}
1578
1579
static void
1580
dissect_fcels_tprlo (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1581
                     uint8_t isreq, proto_item *ti)
1582
7
{
1583
    /* Set up structures needed to add the protocol subtree and manage it */
1584
1585
7
    if (tree) {
1586
7
        dissect_fcels_prlilo_payload (tvb, pinfo, isreq, ti, FC_ELS_TPRLO);
1587
7
    }
1588
7
}
1589
1590
static void
1591
dissect_fcels_lirr (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1592
                    uint8_t isreq _U_, proto_item *ti)
1593
0
{
1594
    /* Set up structures needed to add the protocol subtree and manage it */
1595
0
    unsigned offset = 4;
1596
0
    proto_tree *lirr_tree;
1597
0
    uint8_t lirr_fmt;
1598
1599
0
    if (tree) {
1600
0
        lirr_tree = proto_item_add_subtree (ti, ett_fcels_lirr);
1601
1602
0
        proto_tree_add_item (lirr_tree, hf_fcels_opcode, tvb, offset-4, 1, ENC_BIG_ENDIAN);
1603
1604
0
        if (tvb_captured_length (tvb) < 6) {
1605
0
            proto_tree_add_expert_remaining (lirr_tree, pinfo, &ei_fcels_short_payload, tvb, 1);
1606
0
            return;
1607
0
        }
1608
1609
0
        proto_tree_add_item(lirr_tree, hf_fcels_lirr_regn_function, tvb, offset, 1, ENC_BIG_ENDIAN);
1610
0
        lirr_fmt = tvb_get_uint8 (tvb, offset+1);
1611
0
        if (!lirr_fmt) {
1612
            /* This scheme is resorted to because the value 0 has a string in
1613
             * the value_string that is not what we want displayed here.
1614
             */
1615
0
            proto_tree_add_uint_format_value(lirr_tree, hf_fcels_lirr_regn_format, tvb, offset+1, 1, 0, "Common Format");
1616
0
        }
1617
0
        else {
1618
0
            proto_tree_add_item(lirr_tree, hf_fcels_lirr_regn_format, tvb, offset+1, 1, ENC_BIG_ENDIAN);
1619
0
        }
1620
0
    }
1621
0
}
1622
1623
static const true_false_string tfs_srl_flag = { "Scan only specified FL Port", "Scan all loops in domain" };
1624
1625
static void
1626
dissect_fcels_srl (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
1627
                   uint8_t isreq, proto_item *ti)
1628
0
{
1629
    /* Set up structures needed to add the protocol subtree and manage it */
1630
0
    unsigned offset = 4;
1631
0
    proto_tree *srl_tree;
1632
1633
0
    if (tree) {
1634
0
        srl_tree = proto_item_add_subtree (ti, ett_fcels_srl);
1635
1636
0
        proto_tree_add_item (srl_tree, hf_fcels_opcode, tvb, offset-4, 1, ENC_BIG_ENDIAN);
1637
0
        if (!isreq)
1638
0
            return;
1639
1640
0
        proto_tree_add_item(srl_tree, hf_fcels_srl_flag, tvb, offset, 1, ENC_NA);
1641
0
        proto_tree_add_item(srl_tree, hf_fcels_srl_fl_port_addr, tvb, offset+1, 3, ENC_NA);
1642
0
    }
1643
0
}
1644
1645
static void
1646
dissect_fcels_rpsc (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
1647
                    uint8_t isreq, proto_item *ti)
1648
0
{
1649
    /* Set up structures needed to add the protocol subtree and manage it */
1650
0
    unsigned offset = 2;
1651
0
    int num_entries, i, cap;
1652
0
    proto_tree *rpsc_tree;
1653
1654
0
    if (tree) {
1655
0
        rpsc_tree = proto_item_add_subtree (ti, ett_fcels_rpsc);
1656
1657
0
        proto_tree_add_item (rpsc_tree, hf_fcels_opcode, tvb, offset-2, 1, ENC_BIG_ENDIAN);
1658
0
        if (isreq)
1659
0
            return;
1660
1661
0
        num_entries = tvb_get_ntohs (tvb, offset);
1662
0
        proto_tree_add_item(rpsc_tree, hf_fcels_rpsc_number_of_entries, tvb, offset, 2, ENC_BIG_ENDIAN);
1663
0
        offset = 4;
1664
0
        for (i = 0; i < num_entries; i++, offset+=4) {
1665
0
            cap = tvb_get_ntohs (tvb, offset);
1666
0
            dissect_speed_flags (rpsc_tree, tvb, offset, cap, i);
1667
1668
0
            proto_tree_add_item(rpsc_tree, hf_fcels_rpsc_port_oper_speed, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1669
0
        }
1670
0
    }
1671
0
}
1672
1673
1674
static void
1675
dissect_fcels_cbind (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1676
                    proto_item *ti)
1677
0
{
1678
0
    unsigned offset = 0;
1679
0
    proto_tree *cbind_tree=NULL;
1680
1681
0
    if (tree) {
1682
0
        cbind_tree = proto_item_add_subtree (ti, ett_fcels_cbind);
1683
1684
0
        proto_tree_add_item (cbind_tree, hf_fcels_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1685
0
    }
1686
0
    col_set_str(pinfo->cinfo, COL_INFO, "CBIND ");
1687
1688
0
    proto_tree_add_item (cbind_tree, hf_fcels_cbind_liveness, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1689
0
    proto_tree_add_item (cbind_tree, hf_fcels_cbind_addr_mode, tvb, offset+6, 1, ENC_BIG_ENDIAN);
1690
0
    proto_tree_add_item (cbind_tree, hf_fcels_cbind_ifcp_version, tvb, offset+7, 1, ENC_BIG_ENDIAN);
1691
0
    proto_tree_add_item (cbind_tree, hf_fcels_cbind_userinfo, tvb, offset+8, 4, ENC_BIG_ENDIAN);
1692
1693
0
    proto_tree_add_item (cbind_tree, hf_fcels_cbind_snpname, tvb, offset+12, 8, ENC_NA);
1694
0
    proto_tree_add_item (cbind_tree, hf_fcels_cbind_dnpname, tvb, offset+20, 8, ENC_NA);
1695
1696
0
    switch(tvb_reported_length(tvb)){
1697
0
    case 28: /* 28 byte Request without the FC CRC */
1698
0
    case 32: /* 28 byte Request + 4 bytes FC CRC */
1699
0
        col_append_str (pinfo->cinfo, COL_INFO, "Request");
1700
0
        break;
1701
0
    case 36: /* 36 byte Response without the FC CRC */
1702
0
    case 40: /* 36 byte Response + 4 bytes FC CRC */
1703
0
        col_append_str (pinfo->cinfo, COL_INFO, "Response");
1704
0
        proto_tree_add_item (cbind_tree, hf_fcels_cbind_status, tvb, offset+30, 2, ENC_BIG_ENDIAN);
1705
0
        proto_tree_add_item (cbind_tree, hf_fcels_chandle, tvb, offset+34, 2, ENC_BIG_ENDIAN);
1706
0
        break;
1707
0
    }
1708
1709
0
}
1710
1711
static void
1712
dissect_fcels_unbind (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1713
                    proto_item *ti)
1714
0
{
1715
0
    unsigned offset = 0;
1716
0
    proto_tree *cbind_tree=NULL;
1717
1718
0
    if (tree) {
1719
0
        cbind_tree = proto_item_add_subtree (ti, ett_fcels_cbind);
1720
1721
0
        proto_tree_add_item (cbind_tree, hf_fcels_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1722
0
    }
1723
0
    col_set_str(pinfo->cinfo, COL_INFO, "UNBIND ");
1724
1725
0
    proto_tree_add_item (cbind_tree, hf_fcels_cbind_userinfo, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1726
0
    proto_tree_add_item (cbind_tree, hf_fcels_chandle, tvb, offset+10, 2, ENC_BIG_ENDIAN);
1727
1728
1729
0
    switch(tvb_reported_length(tvb)){
1730
0
    case 20: /* 20 byte Request without the FC CRC (24 is ambiguous and
1731
             * is taken as a Request with the CRC) */
1732
0
    case 24: /* 20 byte Request + 4 bytes FC CRC */
1733
0
        col_append_str (pinfo->cinfo, COL_INFO, "Request");
1734
0
        break;
1735
0
    case 28: /* 24 byte Response + 4 bytes FC CRC */
1736
0
        col_append_str (pinfo->cinfo, COL_INFO, "Response");
1737
0
        proto_tree_add_item (cbind_tree, hf_fcels_unbind_status, tvb, offset+22, 2, ENC_BIG_ENDIAN);
1738
0
        break;
1739
0
    }
1740
1741
0
}
1742
1743
static void
1744
dissect_fcels_rnid (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
1745
                    uint8_t isreq, proto_item *ti)
1746
4
{
1747
    /* Set up structures needed to add the protocol subtree and manage it */
1748
4
    unsigned offset = 0;
1749
4
    int clen;
1750
4
    proto_tree *rnid_tree;
1751
1752
4
    if (tree) {
1753
4
        rnid_tree = proto_item_add_subtree (ti, ett_fcels_rnid);
1754
1755
4
        proto_tree_add_item (rnid_tree, hf_fcels_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1756
4
        if (isreq) {
1757
4
            proto_tree_add_item (rnid_tree, hf_fcels_nodeidfmt, tvb, offset+4,
1758
4
                                 1, ENC_BIG_ENDIAN);
1759
4
        }
1760
0
        else {
1761
            /* We only decode responses to nodeid fmt DF */
1762
0
            proto_tree_add_item (rnid_tree, hf_fcels_nodeidfmt, tvb, offset+4,
1763
0
                                 1, ENC_BIG_ENDIAN);
1764
0
            clen = tvb_get_uint8 (tvb, offset+5);
1765
0
            proto_tree_add_item(rnid_tree, hf_fcels_common_identification_data_length, tvb, offset+5, 1, ENC_BIG_ENDIAN);
1766
0
            proto_tree_add_item (rnid_tree, hf_fcels_spidlen, tvb, offset+7,
1767
0
                                 1, ENC_BIG_ENDIAN);
1768
0
            if (clen) {
1769
0
                proto_tree_add_item (rnid_tree, hf_fcels_npname, tvb,
1770
0
                                       offset+8, 8, ENC_NA);
1771
0
                proto_tree_add_item (rnid_tree, hf_fcels_fnname, tvb,
1772
0
                                       offset+16, 8, ENC_NA);
1773
0
            }
1774
0
            if (tvb_get_uint8 (tvb, offset+4) == 0xDF) {
1775
                /* Decode the Specific Node ID Format as this is known */
1776
0
                proto_tree_add_item (rnid_tree, hf_fcels_vendoruniq, tvb,
1777
0
                                     offset+24, 16, ENC_NA);
1778
0
                proto_tree_add_item (rnid_tree, hf_fcels_asstype, tvb,
1779
0
                                     offset+40, 4, ENC_BIG_ENDIAN);
1780
0
                proto_tree_add_item (rnid_tree, hf_fcels_physport, tvb,
1781
0
                                     offset+44, 4, ENC_BIG_ENDIAN);
1782
0
                proto_tree_add_item (rnid_tree, hf_fcels_attnodes, tvb,
1783
0
                                     offset+48, 4, ENC_BIG_ENDIAN);
1784
0
                proto_tree_add_item (rnid_tree, hf_fcels_nodemgmt, tvb,
1785
0
                                     offset+52, 1, ENC_BIG_ENDIAN);
1786
0
                proto_tree_add_item (rnid_tree, hf_fcels_ipvers, tvb,
1787
0
                                     offset+53, 1, ENC_BIG_ENDIAN);
1788
0
                proto_tree_add_item (rnid_tree, hf_fcels_tcpport, tvb,
1789
0
                                     offset+54, 2, ENC_BIG_ENDIAN);
1790
0
                proto_tree_add_item (rnid_tree, hf_fcels_ip, tvb, offset+56,
1791
0
                                     16, ENC_NA);
1792
0
                proto_tree_add_item (rnid_tree, hf_fcels_vendorsp, tvb,
1793
0
                                     offset+74, 2, ENC_BIG_ENDIAN);
1794
0
            }
1795
0
        }
1796
4
    }
1797
4
}
1798
1799
static void
1800
dissect_fcels_rlir (tvbuff_t *tvb _U_, packet_info *pinfo _U_,
1801
                    proto_tree *tree, uint8_t isreq _U_,
1802
                    proto_item *ti _U_)
1803
0
{
1804
    /* Set up structures needed to add the protocol subtree and manage it */
1805
1806
0
    if (tree) {
1807
0
    }
1808
0
}
1809
1810
static void
1811
dissect_fcels_lsrjt (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
1812
                     uint8_t isreq _U_, proto_item *ti)
1813
7
{
1814
    /* Set up structures needed to add the protocol subtree and manage it */
1815
7
    unsigned offset = 5;
1816
7
    proto_tree *lsrjt_tree;
1817
1818
7
    if (tree) {
1819
7
        lsrjt_tree = proto_item_add_subtree (ti, ett_fcels_lsrjt);
1820
1821
7
        proto_tree_add_item (lsrjt_tree, hf_fcels_opcode, tvb, offset-5, 1, ENC_BIG_ENDIAN);
1822
1823
7
        proto_tree_add_item (lsrjt_tree, hf_fcels_rjtcode, tvb, offset++, 1, ENC_BIG_ENDIAN);
1824
7
        proto_tree_add_item (lsrjt_tree, hf_fcels_rjtdetcode, tvb, offset++, 1, ENC_BIG_ENDIAN);
1825
7
        proto_tree_add_item (lsrjt_tree, hf_fcels_vnduniq, tvb, offset, 1, ENC_BIG_ENDIAN);
1826
7
    }
1827
7
}
1828
1829
static int
1830
dissect_fcels (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
1831
167
{
1832
1833
/* Set up structures needed to add the protocol subtree and manage it */
1834
167
    proto_item *ti = NULL;
1835
167
    proto_tree *acc_tree;
1836
167
    uint8_t isreq = FC_ELS_REQ;
1837
167
    unsigned offset = 0;
1838
167
    uint8_t opcode,
1839
167
           failed_opcode = 0;
1840
167
    conversation_t *conversation;
1841
167
    fcels_conv_data_t *cdata;
1842
167
    fcels_conv_key_t ckey, *req_key;
1843
167
    unsigned find_options, new_options;
1844
167
    address dstaddr;
1845
167
    uint8_t addrdata[3];
1846
167
    fc_hdr *fchdr;
1847
1848
    /* Reject the packet if data is NULL */
1849
167
    if (data == NULL)
1850
0
        return 0;
1851
167
    fchdr = (fc_hdr *)data;
1852
1853
    /* Make entries in Protocol column and Info column on summary display */
1854
167
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "FC ELS");
1855
    /* col_clear(pinfo->cinfo, COL_INFO);  XXX: It seems to me that COL_INFO should be cleared here ?? */
1856
1857
    /* decoding of this is done by each individual opcode handler */
1858
167
    opcode = tvb_get_uint8 (tvb, 0);
1859
1860
167
    if (tree) {
1861
167
        ti = proto_tree_add_protocol_format (tree, proto_fcels, tvb, 0,
1862
167
                                             -1, "FC ELS");
1863
167
    }
1864
1865
    /* Register conversation in case this is not a response */
1866
167
    if ((opcode != FC_ELS_LSRJT) && (opcode != FC_ELS_ACC)) {
1867
151
        if (opcode == FC_ELS_FLOGI) {
1868
6
            const uint8_t *srcfc;
1869
1870
            /* Check that the source address is, in fact, an FC address */
1871
6
            if (pinfo->src.type != AT_FC) {
1872
0
                expert_add_info_format(pinfo, ti, &ei_fcels_src_unknown,
1873
0
                                       "Unknown source address type: %u",
1874
0
                                       pinfo->src.type);
1875
0
                return 0;
1876
0
            }
1877
1878
6
            srcfc = (const uint8_t *)pinfo->src.data;
1879
6
            if (srcfc[2]) {
1880
                /* If it is a loop port, we'll need to remember the ALPA */
1881
6
                find_options = NO_PORT_B;
1882
6
                new_options = NO_PORT2;
1883
6
            }
1884
0
            else {
1885
0
                find_options = NO_PORT_B | NO_ADDR_B;
1886
0
                new_options = NO_PORT2 | NO_ADDR2;
1887
0
            }
1888
6
        }
1889
145
        else {
1890
145
            find_options = NO_PORT_B;
1891
145
            new_options = NO_PORT2;
1892
145
        }
1893
151
        conversation = find_conversation (pinfo->num, &pinfo->dst, &pinfo->src,
1894
151
                                          conversation_pt_to_conversation_type(pinfo->ptype), fchdr->oxid,
1895
151
                                          fchdr->rxid, find_options);
1896
1897
151
        if (!conversation) {
1898
47
            conversation = conversation_new (pinfo->num, &pinfo->dst, &pinfo->src,
1899
47
                                             conversation_pt_to_conversation_type(pinfo->ptype), fchdr->oxid,
1900
47
                                             fchdr->rxid, new_options);
1901
47
        }
1902
1903
151
        ckey.conv_idx = conversation->conv_index;
1904
1905
151
        cdata = (fcels_conv_data_t *)wmem_map_lookup (fcels_req_hash,
1906
151
                                                          &ckey);
1907
151
        if (cdata) {
1908
            /* Since we never free the memory used by an exchange, this maybe a
1909
             * case of another request using the same exchange as a previous
1910
             * req.
1911
             */
1912
103
            cdata->opcode = opcode;
1913
103
        }
1914
48
        else {
1915
48
            req_key = wmem_new(wmem_file_scope(), fcels_conv_key_t);
1916
48
            req_key->conv_idx = conversation->conv_index;
1917
1918
48
            cdata = wmem_new(wmem_file_scope(), fcels_conv_data_t);
1919
48
            cdata->opcode = opcode;
1920
1921
48
            wmem_map_insert (fcels_req_hash, req_key, cdata);
1922
48
        }
1923
151
    }
1924
16
    else {
1925
16
        isreq = FC_ELS_RPLY;
1926
1927
16
        find_options = NO_PORT_B;
1928
16
        conversation = find_conversation (pinfo->num, &pinfo->dst, &pinfo->src,
1929
16
                                          conversation_pt_to_conversation_type(pinfo->ptype), fchdr->oxid,
1930
16
                                          fchdr->rxid, find_options);
1931
16
        if (!conversation) {
1932
            /* FLOGI has two ways to save state: without the src and using just
1933
             * the port (ALPA) part of the address. Try both.
1934
             */
1935
3
            const uint8_t *dstfc;
1936
1937
            /* Check that the source address is, in fact, an FC address */
1938
3
            if (pinfo->dst.type != AT_FC) {
1939
0
                expert_add_info_format(pinfo, ti, &ei_fcels_dst_unknown,
1940
0
                                       "Unknown destination address type: %u",
1941
0
                                       pinfo->dst.type);
1942
0
                return 0;
1943
0
            }
1944
1945
3
            dstfc = (const uint8_t *)pinfo->dst.data;
1946
1947
3
            addrdata[0] = addrdata[1] = 0;
1948
3
            addrdata[2] = dstfc[2];
1949
3
            set_address (&dstaddr, AT_FC, 3, addrdata);
1950
3
            conversation = find_conversation (pinfo->num, &dstaddr, &pinfo->src,
1951
3
                                              conversation_pt_to_conversation_type(pinfo->ptype), fchdr->oxid,
1952
3
                                              fchdr->rxid, find_options);
1953
3
        }
1954
1955
16
        if (!conversation) {
1956
            /* Finally check for FLOGI with both NO_PORT2 and NO_ADDR2 set */
1957
3
            find_options = NO_ADDR_B | NO_PORT_B;
1958
3
            conversation = find_conversation (pinfo->num, &pinfo->src, &pinfo->dst,
1959
3
                                              conversation_pt_to_conversation_type(pinfo->ptype), fchdr->oxid,
1960
3
                                              fchdr->rxid, find_options);
1961
3
            if (!conversation) {
1962
3
                if (tree && (opcode == FC_ELS_ACC)) {
1963
                    /* No record of what this accept is for. Can't decode */
1964
1
                    acc_tree = proto_item_add_subtree (ti, ett_fcels_acc);
1965
1
                    proto_tree_add_expert_remaining(acc_tree, pinfo, &ei_fcels_no_record_of_exchange, tvb, offset);
1966
1
                    return 0;
1967
1
                }
1968
2
                failed_opcode = 0;
1969
2
            }
1970
3
        }
1971
1972
15
        if (conversation) {
1973
13
            ckey.conv_idx = conversation->conv_index;
1974
1975
13
            cdata = (fcels_conv_data_t *)wmem_map_lookup (fcels_req_hash, &ckey);
1976
1977
13
            if (cdata != NULL) {
1978
11
                if ((find_options & NO_ADDR_B) && (cdata->opcode != FC_ELS_FLOGI)) {
1979
                    /* only FLOGI can have this special check */
1980
0
                    if (tree && (opcode == FC_ELS_ACC)) {
1981
                        /* No record of what this accept is for. Can't decode */
1982
0
                        acc_tree = proto_item_add_subtree (ti,
1983
0
                                                           ett_fcels_acc);
1984
0
                        proto_tree_add_expert_remaining(acc_tree, pinfo, &ei_fcels_no_record_of_exchange, tvb, offset);
1985
0
                        return 0;
1986
0
                    }
1987
0
                }
1988
11
                if (opcode == FC_ELS_ACC)
1989
6
                    opcode = cdata->opcode;
1990
5
                else
1991
5
                    failed_opcode = cdata->opcode;
1992
11
            }
1993
1994
13
            if (tree) {
1995
13
                if ((cdata == NULL) && (opcode != FC_ELS_LSRJT)) {
1996
                    /* No record of what this accept is for. Can't decode */
1997
2
                    acc_tree = proto_item_add_subtree (ti, ett_fcels_acc);
1998
2
                    proto_tree_add_expert_remaining(acc_tree, pinfo, &ei_fcels_no_record_of_els_req, tvb, offset);
1999
2
                    return 0;
2000
2
                }
2001
13
            }
2002
13
        }
2003
15
    }
2004
2005
164
    if (isreq == FC_ELS_REQ) {
2006
151
        col_add_str (pinfo->cinfo, COL_INFO,
2007
151
                        val_to_str_ext(pinfo->pool, opcode, &fc_els_proto_val_ext, "0x%x"));
2008
151
    }
2009
13
    else if (opcode == FC_ELS_LSRJT) {
2010
7
        col_add_fstr (pinfo->cinfo, COL_INFO, "LS_RJT (%s)",
2011
7
                        val_to_str_ext(pinfo->pool, failed_opcode, &fc_els_proto_val_ext, "0x%x"));
2012
7
    }
2013
6
    else {
2014
6
        col_add_fstr (pinfo->cinfo, COL_INFO, "ACC (%s)",
2015
6
                        val_to_str_ext(pinfo->pool, opcode, &fc_els_proto_val_ext, "0x%x"));
2016
6
    }
2017
2018
164
    switch (opcode) {
2019
7
    case FC_ELS_LSRJT:
2020
7
        dissect_fcels_lsrjt (tvb, pinfo, tree, isreq, ti);
2021
7
        break;
2022
12
    case FC_ELS_PLOGI:
2023
12
        dissect_fcels_plogi (tvb, pinfo, tree, isreq, ti);
2024
12
        break;
2025
6
    case FC_ELS_FLOGI:
2026
6
        dissect_fcels_flogi (tvb, pinfo, tree, isreq, ti);
2027
6
        break;
2028
0
    case FC_ELS_LOGOUT:
2029
0
        dissect_fcels_logout (tvb, pinfo, tree, isreq, ti);
2030
0
        break;
2031
1
    case FC_ELS_ABTX:
2032
1
        dissect_fcels_abtx (tvb, pinfo, tree, isreq, ti);
2033
1
        break;
2034
4
    case FC_ELS_RSI:
2035
4
        dissect_fcels_rsi (tvb, pinfo, tree, isreq, ti);
2036
4
        break;
2037
1
    case FC_ELS_RRQ:
2038
1
        dissect_fcels_rrq (tvb, pinfo, tree, isreq, ti);
2039
1
        break;
2040
1
    case FC_ELS_REC:
2041
1
        dissect_fcels_rec (tvb, pinfo, tree, isreq, ti);
2042
1
        break;
2043
14
    case FC_ELS_PRLI:
2044
14
        dissect_fcels_prli (tvb, pinfo, tree, isreq, ti);
2045
14
        break;
2046
3
    case FC_ELS_PRLO:
2047
3
        dissect_fcels_prlo (tvb, pinfo, tree, isreq, ti);
2048
3
        break;
2049
7
    case FC_ELS_TPRLO:
2050
7
        dissect_fcels_tprlo (tvb, pinfo, tree, isreq, ti);
2051
7
        break;
2052
12
    case FC_ELS_PDISC:
2053
12
        dissect_fcels_pdisc (tvb, pinfo, tree, isreq, ti);
2054
12
        break;
2055
5
    case FC_ELS_FDISC:
2056
5
        dissect_fcels_fdisc (tvb, pinfo, tree, isreq, ti);
2057
5
        break;
2058
3
    case FC_ELS_ADISC:
2059
3
        dissect_fcels_adisc (tvb, pinfo, tree, isreq, ti);
2060
3
        break;
2061
0
    case FC_ELS_FARP_REQ:
2062
0
        dissect_fcels_farp_req (tvb, pinfo, tree, isreq, ti);
2063
0
        break;
2064
2
    case FC_ELS_FARP_RPLY:
2065
2
        dissect_fcels_farp_rply (tvb, pinfo, tree, isreq, ti);
2066
2
        break;
2067
0
    case FC_ELS_RPS:
2068
0
        dissect_fcels_rps (tvb, pinfo, tree, isreq, ti);
2069
0
        break;
2070
2
    case FC_ELS_RPL:
2071
2
        dissect_fcels_rpl (tvb, pinfo, tree, isreq, ti);
2072
2
        break;
2073
3
    case FC_ELS_FAN:
2074
3
        dissect_fcels_fan (tvb, pinfo, tree, isreq, ti);
2075
3
        break;
2076
5
    case FC_ELS_RSCN:
2077
5
        dissect_fcels_rscn (tvb, pinfo, tree, isreq, ti);
2078
5
        break;
2079
1
    case FC_ELS_SCR:
2080
1
        dissect_fcels_scr (tvb, pinfo, tree, isreq, ti);
2081
1
        break;
2082
1
    case FC_ELS_RNFT:
2083
1
        dissect_fcels_rnft (tvb, pinfo, tree, isreq, ti);
2084
1
        break;
2085
0
    case FC_ELS_LSTS:
2086
0
        dissect_fcels_lsts (tvb, pinfo, tree, isreq, ti);
2087
0
        break;
2088
4
    case FC_ELS_RNID:
2089
4
        dissect_fcels_rnid (tvb, pinfo, tree, isreq, ti);
2090
4
        break;
2091
0
    case FC_ELS_RLIR:
2092
0
        dissect_fcels_rlir (tvb, pinfo, tree, isreq, ti);
2093
0
        break;
2094
0
    case FC_ELS_LIRR:
2095
0
        dissect_fcels_lirr (tvb, pinfo, tree, isreq, ti);
2096
0
        break;
2097
0
    case FC_ELS_SRL:
2098
0
        dissect_fcels_srl (tvb, pinfo, tree, isreq, ti);
2099
0
        break;
2100
0
    case FC_ELS_RPSC:
2101
0
        dissect_fcels_rpsc (tvb, pinfo, tree, isreq, ti);
2102
0
        break;
2103
0
    case FC_ELS_AUTH:
2104
0
        if (isreq && fcsp_handle)
2105
0
            call_dissector (fcsp_handle, tvb, pinfo, tree);
2106
0
        break;
2107
0
    case FC_ELS_CBIND:
2108
0
        dissect_fcels_cbind (tvb, pinfo, tree, ti);
2109
0
        break;
2110
0
    case FC_ELS_UNBIND:
2111
0
        dissect_fcels_unbind (tvb, pinfo, tree, ti);
2112
0
        break;
2113
70
    default:
2114
70
        call_data_dissector(tvb, pinfo, tree);
2115
70
        break;
2116
164
    }
2117
2118
116
    return tvb_reported_length(tvb);
2119
164
}
2120
2121
void
2122
proto_register_fcels (void)
2123
16
{
2124
16
    static hf_register_info hf[] = {
2125
16
        { &hf_fcels_opcode,
2126
16
          {"Cmd Code", "fcels.opcode", FT_UINT8, BASE_HEX | BASE_EXT_STRING,
2127
16
           &fc_els_proto_val_ext, 0x0, NULL, HFILL}},
2128
16
        { &hf_fcels_rjtcode,
2129
16
          {"Reason Code", "fcels.rjt.reason", FT_UINT8, BASE_HEX | BASE_EXT_STRING,
2130
16
           &fc_els_rjt_val_ext, 0x0, NULL, HFILL}},
2131
16
        { &hf_fcels_rjtdetcode,
2132
16
          {"Reason Explanation", "fcels.rjt.detail", FT_UINT8, BASE_HEX | BASE_EXT_STRING,
2133
16
           &fc_els_rjt_det_val_ext, 0x0, NULL, HFILL}},
2134
16
        { &hf_fcels_vnduniq,
2135
16
          {"Vendor Unique", "fcels.rjt.vnduniq", FT_UINT8, BASE_HEX, NULL,
2136
16
           0x0, NULL, HFILL}},
2137
16
        { &hf_fcels_b2b,
2138
16
          {"B2B Credit", "fcels.logi.b2b", FT_UINT16, BASE_DEC, NULL, 0x0, NULL,
2139
16
           HFILL}},
2140
16
        { &hf_fcels_cmnfeatures,
2141
16
          {"Common Svc Parameters", "fcels.logi.cmnfeatures", FT_UINT16, BASE_HEX, NULL,
2142
16
           0x0, NULL, HFILL}},
2143
16
        { &hf_fcels_bbscnum,
2144
16
          {"BB_SC Number", "fcels.logi.bbscnum", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL,
2145
16
           HFILL}},
2146
16
        { &hf_fcels_rcvsize,
2147
16
          {"Receive Size", "fcels.logi.rcvsize", FT_UINT16, BASE_DEC, NULL, 0x0FFF, NULL,
2148
16
           HFILL}},
2149
16
        { &hf_fcels_maxconseq,
2150
16
          {"Max Concurrent Seq", "fcels.logi.maxconseq", FT_UINT16, BASE_DEC, NULL,
2151
16
           0x0, NULL, HFILL}},
2152
16
        { &hf_fcels_reloffset,
2153
16
          {"Relative Offset By Info Cat", "fcels.logi.reloff", FT_UINT16, BASE_DEC,
2154
16
           NULL, 0x0, NULL, HFILL}},
2155
16
        { &hf_fcels_edtov,
2156
16
          {"E_D_TOV", "fcels.edtov", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},
2157
16
        { &hf_fcels_npname,
2158
16
          {"N_Port Port_Name", "fcels.npname", FT_FCWWN, BASE_NONE, NULL, 0x0,
2159
16
           NULL, HFILL}},
2160
16
        { &hf_fcels_fnname,
2161
16
          {"Fabric/Node Name", "fcels.fnname", FT_FCWWN, BASE_NONE, NULL, 0x0,
2162
16
           NULL, HFILL}},
2163
#if 0
2164
        { &hf_fcels_cls1param,
2165
          {"Class 1 Svc Param", "fcels.logi.cls1param", FT_BYTES, BASE_NONE, NULL, 0x0,
2166
           NULL, HFILL}},
2167
        { &hf_fcels_cls2param,
2168
          {"Class 2 Svc Param", "fcels.logi.cls2param", FT_BYTES, BASE_NONE, NULL, 0x0,
2169
           NULL, HFILL}},
2170
        { &hf_fcels_cls3param,
2171
          {"Class 3 Svc Param", "fcels.logi.cls3param", FT_BYTES, BASE_NONE, NULL, 0x0,
2172
           NULL, HFILL}},
2173
        { &hf_fcels_cls4param,
2174
          {"Class 4 Svc Param", "fcels.logi.cls4param", FT_BYTES, BASE_NONE, NULL, 0x0,
2175
           NULL, HFILL}},
2176
#endif
2177
16
        { &hf_fcels_vendorvers,
2178
16
          {"Vendor Version", "fcels.logi.vendvers", FT_BYTES, BASE_NONE, NULL, 0x0, NULL,
2179
16
           HFILL}},
2180
16
        { &hf_fcels_svcavail,
2181
16
          {"Services Availability", "fcels.logi.svcavail", FT_BYTES, BASE_NONE, NULL,
2182
16
           0x0, NULL, HFILL}},
2183
16
        { &hf_fcels_clsflags,
2184
16
          {"Service Options", "fcels.logi.clsflags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL,
2185
16
           HFILL}},
2186
16
        { &hf_fcels_clsrcvsize,
2187
16
          {"Class Recv Size", "fcels.logi.clsrcvsize", FT_UINT16, BASE_DEC, NULL,
2188
16
           0x0, NULL, HFILL}},
2189
16
        { &hf_fcels_conseq,
2190
16
          {"Total Concurrent Seq", "fcels.logi.totconseq", FT_UINT16, BASE_DEC, NULL,
2191
16
           0x0, NULL, HFILL}},
2192
16
        { &hf_fcels_e2e,
2193
16
          {"End2End Credit", "fcels.logi.e2e", FT_UINT16, BASE_DEC, NULL, 0x0, NULL,
2194
16
           HFILL}},
2195
16
        { &hf_fcels_openseq,
2196
16
          {"Open Seq Per Exchg", "fcels.logi.openseq", FT_UINT16, BASE_DEC, NULL, 0x0,
2197
16
           NULL, HFILL}},
2198
16
        { &hf_fcels_nportid,
2199
16
          {"Originator S_ID", "fcels.portid", FT_BYTES, SEP_DOT, NULL, 0x0,
2200
16
           NULL, HFILL}},
2201
16
        { &hf_fcels_oxid,
2202
16
          {"OXID", "fcels.oxid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},
2203
16
        { &hf_fcels_rxid,
2204
16
          {"RXID", "fcels.rxid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},
2205
16
        { &hf_fcels_recovqual,
2206
16
          {"Recovery Qualifier", "fcels.rcovqual", FT_UINT8, BASE_HEX, NULL,
2207
16
           0x0, NULL, HFILL}},
2208
16
        { &hf_fcels_fabricaddr,
2209
16
          {"Fabric Address", "fcels.faddr", FT_BYTES, SEP_DOT, NULL, 0x0, NULL,
2210
16
           HFILL}},
2211
16
        { &hf_fcels_fabricpname,
2212
16
          {"Fabric Port Name", "fcels.fpname", FT_FCWWN, BASE_NONE, NULL, 0x0,
2213
16
           NULL, HFILL}},
2214
16
        { &hf_fcels_failedrcvr,
2215
16
          {"Failed Receiver AL_PA", "fcels.faildrcvr", FT_UINT8, BASE_HEX, NULL,
2216
16
           0x0, NULL, HFILL}},
2217
16
        { &hf_fcels_flacompliance,
2218
16
          {"FC-FLA Compliance", "fcels.flacompliance", FT_UINT8, BASE_HEX,
2219
16
           VALS (fc_els_flacompliance_val), 0x0, NULL, HFILL}},
2220
16
        { &hf_fcels_loopstate,
2221
16
          {"Loop State", "fcels.loopstate", FT_UINT8, BASE_HEX,
2222
16
           VALS (fc_els_loopstate_val), 0x0, NULL, HFILL}},
2223
16
        { &hf_fcels_publicloop_bmap,
2224
16
          {"Public Loop Device Bitmap", "fcels.pubdev_bmap", FT_BYTES, BASE_NONE,
2225
16
           NULL, 0x0, NULL, HFILL}},
2226
16
        { &hf_fcels_pvtloop_bmap,
2227
16
          {"Private Loop Device Bitmap", "fcels.pvtdev_bmap", FT_BYTES,
2228
16
           BASE_NONE, NULL, 0x0, NULL, HFILL}},
2229
16
        { &hf_fcels_alpa_map,
2230
16
          {"AL_PA Map", "fcels.alpa", FT_BYTES, BASE_NONE, NULL, 0x0, NULL,
2231
16
           HFILL}},
2232
16
        { &hf_fcels_scrregn,
2233
16
          {"Registration Function", "fcels.scr.regn", FT_UINT8, BASE_HEX,
2234
16
           VALS (fc_els_scr_reg_val), 0x0, NULL, HFILL}},
2235
16
        { &hf_fcels_farp_matchcodept,
2236
16
          {"Match Address Code Points", "fcels.matchcp", FT_UINT8, BASE_DEC,
2237
16
           NULL, 0x0, NULL, HFILL}},
2238
16
        { &hf_fcels_farp_respaction,
2239
16
          {"Responder Action", "fcels.respaction", FT_UINT8, BASE_HEX,
2240
16
           VALS (fc_els_farp_respaction_val), 0x0, NULL, HFILL}},
2241
16
        { &hf_fcels_resportid,
2242
16
          {"Responding Port ID", "fcels.resportid", FT_BYTES, SEP_DOT,
2243
16
           NULL, 0x0, NULL, HFILL}},
2244
16
        { &hf_fcels_respname,
2245
16
          {"Responding Port Name", "fcels.respname", FT_FCWWN, BASE_NONE,
2246
16
           NULL, 0x0, NULL, HFILL}},
2247
16
        { &hf_fcels_respnname,
2248
16
          {"Responding Node Name", "fcels.respnname", FT_FCWWN, BASE_NONE,
2249
16
           NULL, 0x0, NULL, HFILL}},
2250
16
        { &hf_fcels_reqipaddr,
2251
16
          {"Requesting IP Address", "fcels.reqipaddr", FT_IPv6, BASE_NONE,
2252
16
           NULL, 0x0, NULL, HFILL}},
2253
16
        { &hf_fcels_respipaddr,
2254
16
          {"Responding IP Address", "fcels.respipaddr", FT_IPv6, BASE_NONE,
2255
16
           NULL, 0x0, NULL, HFILL}},
2256
16
        { &hf_fcels_hardaddr,
2257
16
          {"Hard Address of Originator", "fcels.hrdaddr", FT_BYTES, SEP_DOT,
2258
16
           NULL, 0x0, NULL, HFILL}},
2259
16
        { &hf_fcels_rps_flag,
2260
16
          {"Flag", "fcels.flag", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},
2261
16
        { &hf_fcels_rps_portnum,
2262
16
          {"Physical Port Number", "fcels.portnum", FT_UINT32, BASE_HEX, NULL,
2263
16
           0x0, NULL, HFILL}},
2264
16
        { &hf_fcels_rps_portstatus,
2265
16
          {"Port Status", "fcels.portstatus", FT_UINT16, BASE_HEX | BASE_EXT_STRING,
2266
16
           &fc_els_portstatus_val_ext, 0x0, NULL, HFILL}},
2267
16
        { &hf_fcels_rnft_fc4type,
2268
16
          {"FC-4 Type", "fcels.rnft.fc4type", FT_UINT8, BASE_HEX,
2269
16
           VALS (fc_fc4_val), 0x0, NULL, HFILL}},
2270
16
        { &hf_fcels_rscn_evqual,
2271
16
          {"Event Qualifier", "fcels.rscn.evqual", FT_UINT8, BASE_HEX,
2272
16
           VALS (fc_els_rscn_evqual_val), 0x3C, NULL, HFILL}},
2273
16
        { &hf_fcels_rscn_addrfmt,
2274
16
          {"Address Format", "fcels.rscn.addrfmt", FT_UINT8, BASE_HEX,
2275
16
           VALS (fc_els_rscn_addrfmt_val), 0x03, NULL, HFILL}},
2276
16
        { &hf_fcels_rscn_domain,
2277
16
          {"Affected Domain", "fcels.rscn.domain", FT_UINT8, BASE_HEX,
2278
16
           NULL, 0x0, NULL, HFILL}},
2279
16
        { &hf_fcels_rscn_area,
2280
16
          {"Affected Area", "fcels.rscn.area", FT_UINT8, BASE_HEX,
2281
16
           NULL, 0x0, NULL, HFILL}},
2282
16
        { &hf_fcels_rscn_port,
2283
16
          {"Affected Port", "fcels.rscn.port", FT_UINT8, BASE_HEX,
2284
16
           NULL, 0x0, NULL, HFILL}},
2285
16
        { &hf_fcels_rec_fc4,
2286
16
          {"FC4 value", "fcels.rec.fc4value", FT_UINT32, BASE_HEX,
2287
16
           NULL, 0x0, NULL, HFILL}},
2288
16
        { &hf_fcels_estat,
2289
16
          {"Exchange Status", "fcels.estat", FT_UINT32, BASE_HEX,
2290
16
           NULL, 0x0, NULL, HFILL}},
2291
16
        { &hf_fcels_estat_resp,
2292
16
          {"Sequence Responder", "fcels.estat.resp", FT_BOOLEAN, 32,
2293
16
           TFS(&tfs_fcels_estat_resp),
2294
16
           FC_ESB_ST_RESP, "Seq responder?", HFILL}},
2295
16
        { &hf_fcels_estat_seq_init,
2296
16
          {"Sequence Initiative", "fcels.estat.seq_init", FT_BOOLEAN, 32,
2297
16
           TFS(&tfs_fcels_estat_seq_init),
2298
16
           FC_ESB_ST_SEQ_INIT, "Responder has Sequence Initiative?", HFILL}},
2299
16
        { &hf_fcels_estat_compl,
2300
16
          {"Exchange Complete", "fcels.estat.complete", FT_BOOLEAN, 32,
2301
16
           TFS(&tfs_complete_incomplete),
2302
16
           FC_ESB_ST_COMPLETE, "Exchange complete?", HFILL}},
2303
16
        { &hf_fcels_nodeidfmt,
2304
16
          {"Node Identification Format", "fcels.rnid.nodeidfmt", FT_UINT8,
2305
16
           BASE_HEX, VALS (fc_els_nodeid_val), 0x0, NULL, HFILL}},
2306
16
        { &hf_fcels_spidlen,
2307
16
          {"Specific Id Length", "fcels.rnid.spidlen", FT_UINT8, BASE_DEC, NULL,
2308
16
           0x0, NULL, HFILL}},
2309
16
        { &hf_fcels_vendoruniq,
2310
16
          {"Vendor Unique", "fcels.rnid.vendoruniq", FT_BYTES, BASE_NONE, NULL,
2311
16
           0x0, NULL, HFILL}},
2312
16
        { &hf_fcels_vendorsp,
2313
16
          {"Vendor Specific", "fcels.rnid.vendorsp", FT_UINT16, BASE_HEX, NULL,
2314
16
           0x0, NULL, HFILL}},
2315
16
        { &hf_fcels_asstype,
2316
16
          {"Associated Type", "fcels.rnid.asstype", FT_UINT32, BASE_HEX | BASE_EXT_STRING,
2317
16
           &fc_els_rnid_asstype_val_ext, 0x0, NULL, HFILL}},
2318
16
        { &hf_fcels_physport,
2319
16
          {"Physical Port Number", "fcels.rnid.physport", FT_UINT32, BASE_HEX,
2320
16
           NULL, 0x0, NULL, HFILL}},
2321
16
        { &hf_fcels_attnodes,
2322
16
          {"Number of Attached Nodes", "fcels.rnid.attnodes", FT_UINT32,
2323
16
           BASE_HEX, NULL, 0x0, NULL, HFILL}},
2324
16
        { &hf_fcels_nodemgmt,
2325
16
          {"Node Management", "fcels.rnid.nodemgmt", FT_UINT8, BASE_HEX,
2326
16
           VALS (fc_els_rnid_mgmt_val), 0x0, NULL, HFILL}},
2327
16
        { &hf_fcels_ipvers,
2328
16
          {"IP Version", "fcels.rnid.ipvers", FT_UINT8, BASE_HEX,
2329
16
           VALS (fc_els_rnid_ipvers_val), 0x0, NULL, HFILL}},
2330
16
        { &hf_fcels_tcpport,
2331
16
          {"TCP/UDP Port Number", "fcels.rnid.tcpport", FT_UINT16, BASE_PT_TCP,
2332
16
           NULL, 0x0, NULL, HFILL}},
2333
16
        { &hf_fcels_ip,
2334
16
          {"IP Address", "fcels.rnid.ip", FT_IPv6, BASE_NONE, NULL, 0x0, NULL,
2335
16
           HFILL}},
2336
16
        { &hf_fcels_cbind_liveness,
2337
16
          {"Liveness Test Interval", "fcels.cbind.liveness", FT_UINT16, BASE_DEC,
2338
16
           NULL, 0x0, "Liveness Test Interval in seconds", HFILL}},
2339
16
        { &hf_fcels_cbind_addr_mode,
2340
16
          {"Addressing Mode", "fcels.cbind.addr_mode", FT_UINT8, BASE_HEX,
2341
16
           VALS (cbind_addr_mode_vals), 0x0, NULL, HFILL}},
2342
16
        { &hf_fcels_cbind_ifcp_version,
2343
16
          {"iFCP version", "fcels.cbind.ifcp_version", FT_UINT8, BASE_DEC,
2344
16
           NULL, 0x0, "Version of iFCP protocol", HFILL}},
2345
16
        { &hf_fcels_cbind_userinfo,
2346
16
          {"UserInfo", "fcels.cbind.userinfo", FT_UINT32, BASE_HEX,
2347
16
           NULL, 0x0, "Userinfo token", HFILL}},
2348
16
        { &hf_fcels_cbind_snpname,
2349
16
          {"Source N_Port Port_Name", "fcels.cbind.snpname", FT_FCWWN, BASE_NONE, NULL, 0x0,
2350
16
           NULL, HFILL}},
2351
16
        { &hf_fcels_cbind_dnpname,
2352
16
          {"Destination N_Port Port_Name", "fcels.cbind.dnpname", FT_FCWWN, BASE_NONE, NULL, 0x0,
2353
16
           NULL, HFILL}},
2354
16
        { &hf_fcels_cbind_status,
2355
16
          {"Status", "fcels.cbind.status", FT_UINT16, BASE_DEC,
2356
16
           VALS (cbind_status_vals), 0x0, "Cbind status", HFILL}},
2357
16
        { &hf_fcels_chandle,
2358
16
          {"Connection Handle", "fcels.cbind.handle", FT_UINT16, BASE_HEX,
2359
16
           NULL, 0x0, "Cbind/Unbind connection handle", HFILL}},
2360
16
        { &hf_fcels_unbind_status,
2361
16
          {"Status", "fcels.unbind.status", FT_UINT16, BASE_DEC,
2362
16
           VALS (unbind_status_vals), 0x0, "Unbind status", HFILL}},
2363
16
        { &hf_fcels_cmn_cios,
2364
16
          {"Cont. Incr. Offset Supported", "fcels.cmn.cios", FT_BOOLEAN, 16,
2365
16
           TFS(&tfs_supported_not_supported), 0x8000, NULL, HFILL}},
2366
16
        { &hf_fcels_cmn_rro,
2367
16
          {"RRO Supported", "fcels.cmn.rro", FT_BOOLEAN, 16,
2368
16
           TFS(&tfs_supported_not_supported), 0x4000, NULL, HFILL}},
2369
16
        { &hf_fcels_cmn_vvv,
2370
16
          {"Valid Vendor Version", "fcels.cmn.vvv", FT_BOOLEAN, 16,
2371
16
           TFS(&tfs_valid_invalid), 0x2000, NULL, HFILL}},
2372
16
        { &hf_fcels_cmn_b2b,
2373
16
          {"B2B Credit Mgmt", "fcels.cmn.bbb", FT_BOOLEAN, 16,
2374
16
           TFS(&tfs_fc_fcels_cmn_b2b), 0x0800, NULL, HFILL}},
2375
16
        { &hf_fcels_cmn_e_d_tov,
2376
16
          {"E_D_TOV", "fcels.cmn.e_d_tov", FT_BOOLEAN, 16,
2377
16
           TFS(&tfs_fc_fcels_cmn_e_d_tov), 0x0400, NULL, HFILL}},
2378
16
        { &hf_fcels_cmn_simplex,
2379
16
          {"Simplex", "fcels.cmn.simplex", FT_BOOLEAN, 16,
2380
16
           TFS(&tfs_supported_not_supported), 0x0040, NULL, HFILL}},
2381
16
        { &hf_fcels_cmn_multicast,
2382
16
          {"Multicast", "fcels.cmn.multicast", FT_BOOLEAN, 16,
2383
16
           TFS(&tfs_supported_not_supported), 0x0200, NULL, HFILL}},
2384
16
        { &hf_fcels_cmn_broadcast,
2385
16
          {"Broadcast", "fcels.cmn.broadcast", FT_BOOLEAN, 16,
2386
16
           TFS(&tfs_supported_not_supported), 0x0100, NULL, HFILL}},
2387
16
        { &hf_fcels_cmn_security,
2388
16
          {"Security", "fcels.cmn.security", FT_BOOLEAN, 16,
2389
16
           TFS(&tfs_set_notset), 0x0020, NULL, HFILL}},
2390
16
        { &hf_fcels_cmn_clk,
2391
16
          {"Clk Sync", "fcels.cmn.clk", FT_BOOLEAN, 16,
2392
16
           TFS(&tfs_capable_not_capable), 0x0010, NULL, HFILL}},
2393
16
        { &hf_fcels_cmn_dhd,
2394
16
          {"DHD Capable", "fcels.cmn.dhd", FT_BOOLEAN, 16,
2395
16
           TFS(&tfs_capable_not_capable), 0x0004, NULL, HFILL}},
2396
16
        { &hf_fcels_cmn_seqcnt,
2397
16
          {"SEQCNT", "fcels.cmn.seqcnt", FT_BOOLEAN, 16,
2398
16
           TFS(&tfs_fc_fcels_cmn_seqcnt), 0x0002, NULL, HFILL}},
2399
16
        { &hf_fcels_cmn_payload,
2400
16
          {"Payload Len", "fcels.cmn.payload", FT_BOOLEAN, 16,
2401
16
           TFS(&tfs_fc_fcels_cmn_payload), 0x0001, NULL, HFILL}},
2402
16
        { &hf_fcels_cls_cns,
2403
16
          {"Class Supported", "fcels.cls.cns", FT_BOOLEAN, 16,
2404
16
           TFS(&tfs_supported_not_supported), 0x8000, NULL, HFILL}},
2405
16
        { &hf_fcels_cls_sdr,
2406
16
          {"Delivery Mode", "fcels.cls.sdr", FT_BOOLEAN, 16,
2407
16
           TFS(&tfs_fc_fcels_cls_sdr), 0x0800, NULL, HFILL}},
2408
16
        { &hf_fcels_cls_prio,
2409
16
          {"Priority", "fcels.cls.prio", FT_BOOLEAN, 16,
2410
16
           TFS(&tfs_supported_not_supported), 0x0080, NULL, HFILL}},
2411
16
        { &hf_fcels_cls_nzctl,
2412
16
          {"Non-zero CS_CTL", "fcels.cls.nzctl", FT_BOOLEAN, 16,
2413
16
           TFS(&tfs_fc_fcels_cls_nzctl), 0x0040, NULL, HFILL}},
2414
16
        { &hf_fcels_initctl,
2415
16
          {"Initiator Ctl", "fcels.logi.initctl", FT_UINT16, BASE_HEX,
2416
16
           NULL, 0x0, NULL, HFILL}},
2417
16
        { &hf_fcels_initctl_initial_pa,
2418
16
          {"Initial P_A", "fcels.logi.initctl.initial_pa", FT_UINT16, BASE_HEX,
2419
16
           VALS (initial_pa_vals), 0x3000, NULL, HFILL}},
2420
16
        { &hf_fcels_initctl_ack0,
2421
16
          {"ACK0 Capable", "fcels.logi.initctl.ack0", FT_BOOLEAN, 16,
2422
16
           TFS(&tfs_capable_not_capable), 0x0800, NULL, HFILL}},
2423
16
        { &hf_fcels_initctl_ackgaa,
2424
16
          {"ACK GAA", "fcels.logi.initctl.ackgaa", FT_BOOLEAN, 16,
2425
16
           TFS(&tfs_fc_fcels_initctl_ackgaa), 0x0200, NULL, HFILL}},
2426
16
        { &hf_fcels_initctl_sync,
2427
16
          {"Clock Sync", "fcels.logi.initctl.sync", FT_BOOLEAN, 16,
2428
16
           TFS(&tfs_supported_not_supported), 0x0010, NULL, HFILL}},
2429
16
        { &hf_fcels_rcptctl,
2430
16
          {"Recipient Ctl", "fcels.logi.rcptctl", FT_UINT16, BASE_HEX,
2431
16
           NULL, 0x0, NULL, HFILL}},
2432
16
        { &hf_fcels_rcptctl_ack0,
2433
16
          {"ACK0", "fcels.logi.rcptctl.ack", FT_BOOLEAN, 16,
2434
16
           TFS(&tfs_supported_not_supported), 0x8000, NULL, HFILL}},
2435
16
        { &hf_fcels_rcptctl_interlock,
2436
16
          {"X_ID Interlock", "fcels.logi.rcptctl.interlock", FT_BOOLEAN, 16,
2437
16
           TFS(&tfs_requested_not_requested), 0x2000, NULL, HFILL}},
2438
16
        { &hf_fcels_rcptctl_policy,
2439
16
          {"Policy", "fcels.logi.rcptctl.policy", FT_UINT16, BASE_HEX,
2440
16
           VALS (rcptctl_policy_vals), 0x1800, NULL, HFILL}},
2441
16
        { &hf_fcels_rcptctl_category,
2442
16
          {"Category", "fcels.logi.rcptctl.category", FT_UINT16, BASE_HEX,
2443
16
           VALS (rcptctl_category_vals), 0x0030, NULL, HFILL}},
2444
16
        { &hf_fcels_rcptctl_sync,
2445
16
          {"Clock Sync", "fcels.logi.rcptctl.sync", FT_BOOLEAN, 16,
2446
16
           TFS(&tfs_supported_not_supported), 0x0008, NULL, HFILL}},
2447
16
        { &hf_fcels_fcpflags,
2448
16
          {"FCP Flags", "fcels.fcpflags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL,
2449
16
           HFILL}},
2450
16
        { &hf_fcels_fcpflags_trireq,
2451
16
          {"Task Retry Ident", "fcels.fcpflags.trireq", FT_BOOLEAN, 32,
2452
16
           TFS(&tfs_requested_not_requested), 1 << 9, NULL, HFILL}},
2453
16
        { &hf_fcels_fcpflags_trirep,
2454
16
          {"Task Retry Ident", "fcels.fcpflags.trirep", FT_BOOLEAN, 32,
2455
16
           TFS(&tfs_accepted_not_accepted), 1 << 9, NULL, HFILL}},
2456
16
        { &hf_fcels_fcpflags_retry,
2457
16
          {"Retry", "fcels.fcpflags.retry", FT_BOOLEAN, 32,
2458
16
           TFS(&tfs_fc_fcels_fcpflags_retry), 1 << 8, NULL, HFILL}},
2459
16
        { &hf_fcels_fcpflags_ccomp,
2460
16
          {"Comp", "fcels.fcpflags.ccomp", FT_BOOLEAN, 32,
2461
16
           TFS(&tfs_fc_fcels_fcpflags_ccomp), 0x00000080, NULL, HFILL}},
2462
16
        { &hf_fcels_fcpflags_datao,
2463
16
          {"Data Overlay", "fcels.fcpflags.datao", FT_BOOLEAN, 32,
2464
16
           TFS(&tfs_fc_fcels_fcpflags_datao), 0x00000040, NULL, HFILL}},
2465
16
        { &hf_fcels_fcpflags_initiator,
2466
16
          {"Initiator", "fcels.fcpflags.initiator", FT_BOOLEAN, 32,
2467
16
           TFS(&tfs_fc_fcels_fcpflags_initiator), 0x00000020, NULL, HFILL}},
2468
16
        { &hf_fcels_fcpflags_target,
2469
16
          {"Target", "fcels.fcpflags.target", FT_BOOLEAN, 32,
2470
16
           TFS(&tfs_fc_fcels_fcpflags_target), 0x00000010, NULL, HFILL}},
2471
16
        { &hf_fcels_fcpflags_rdxr,
2472
16
          {"Rd Xfer_Rdy Dis", "fcels.fcpflags.rdxr", FT_BOOLEAN, 32,
2473
16
           TFS(&tfs_fc_fcels_fcpflags_rdxr), 0x00000002, NULL, HFILL}},
2474
16
        { &hf_fcels_fcpflags_wrxr,
2475
16
          {"Wr Xfer_Rdy Dis", "fcels.fcpflags.wrxr", FT_BOOLEAN, 32,
2476
16
           TFS(&tfs_fc_fcels_fcpflags_wrxr), 0x00000001, NULL, HFILL}},
2477
16
        { &hf_fcels_prliloflags,
2478
16
          {"PRLILO Flags", "fcels.prliloflags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
2479
16
           HFILL}},
2480
16
        { &hf_fcels_tprloflags_opav,
2481
16
          {"3rd Party Orig PA Valid", "fcels.tprloflags.opav", FT_BOOLEAN, 8,
2482
16
           TFS(&tfs_valid_not_valid), 0x80, NULL, HFILL}},
2483
16
        { &hf_fcels_tprloflags_rpav,
2484
16
          {"Resp PA Valid", "fcels.tprloflags.rpav", FT_BOOLEAN, 8,
2485
16
           TFS(&tfs_valid_not_valid), 0x40, NULL, HFILL}},
2486
16
        { &hf_fcels_tprloflags_npv,
2487
16
          {"3rd Party N_Port Valid", "fcels.tprloflags.npv", FT_BOOLEAN, 8,
2488
16
           TFS(&tfs_valid_not_valid), 0x20, NULL, HFILL}},
2489
16
        { &hf_fcels_tprloflags_gprlo,
2490
16
          {"Global PRLO", "fcels.tprloflags.gprlo", FT_BOOLEAN, 8,
2491
16
           TFS(&tfs_fc_fcels_tprloflags_gprlo), 0x10, NULL, HFILL}},
2492
16
        { &hf_fcels_speedflags,
2493
16
          {"Port Speed Capabilities", "fcels.speedflags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL,
2494
16
           HFILL}},
2495
16
        { &hf_fcels_speedflags_1gb,
2496
16
          {"1Gb Support", "fcels.speedflags.1gb", FT_BOOLEAN, 16,
2497
16
           TFS(&tfs_supported_not_supported), 0x8000, NULL, HFILL}},
2498
16
        { &hf_fcels_speedflags_2gb,
2499
16
          {"2Gb Support", "fcels.speedflags.2gb", FT_BOOLEAN, 16,
2500
16
           TFS(&tfs_supported_not_supported), 0x4000, NULL, HFILL}},
2501
16
        { &hf_fcels_speedflags_4gb,
2502
16
          {"4Gb Support", "fcels.speedflags.4gb", FT_BOOLEAN, 16,
2503
16
           TFS(&tfs_supported_not_supported), 0x2000, NULL, HFILL}},
2504
16
        { &hf_fcels_speedflags_10gb,
2505
16
          {"10Gb Support", "fcels.speedflags.10gb", FT_BOOLEAN, 16,
2506
16
           TFS(&tfs_supported_not_supported), 0x1000, NULL, HFILL}},
2507
16
        { &hf_fcels_prliloflags_opav,
2508
16
          {"Orig PA Valid", "fcels.prliloflags.opav", FT_BOOLEAN, 8,
2509
16
           TFS(&tfs_valid_not_valid), 0x80, NULL, HFILL}},
2510
16
        { &hf_fcels_prliloflags_ipe,
2511
16
          {"Image Pair Estd", "fcels.prliloflags.ipe", FT_BOOLEAN, 8,
2512
16
           TFS(&tfs_fc_fcels_prliloflags_ipe), 0x20, NULL, HFILL}},
2513
16
        { &hf_fcels_prliloflags_eip,
2514
16
          {"Est Image Pair", "fcels.prliloflags.eip", FT_BOOLEAN, 8,
2515
16
           TFS(&tfs_fc_fcels_prliloflags_eip), 0x20, NULL, HFILL}},
2516
2517
      /* Generated from convert_proto_tree_add_text.pl */
2518
16
      { &hf_fcels_recovery_qualifier_status, { "Recovery Qualifier Status", "fcels.recovery_qualifier_status", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2519
16
      { &hf_fcels_link_failure_count, { "Link Failure Count", "fcels.link_failure_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2520
16
      { &hf_fcels_loss_of_sync_count, { "Loss of Sync Count", "fcels.loss_of_sync_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2521
16
      { &hf_fcels_loss_of_signal_count, { "Loss of Signal Count", "fcels.loss_of_signal_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2522
16
      { &hf_fcels_primitive_seq_protocol_err, { "Primitive Seq Protocol Err", "fcels.primitive_seq_protocol_err", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2523
16
      { &hf_fcels_invalid_xmission_word, { "Invalid Xmission Word", "fcels.invalid_xmission_word", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2524
16
      { &hf_fcels_invalid_crc_count, { "Invalid CRC Count", "fcels.invalid_crc_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2525
16
      { &hf_fcels_l_port_status, { "L_Port Status", "fcels.l_port_status", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2526
16
      { &hf_fcels_lip_al_ps, { "LIP AL_PS", "fcels.lip.al_ps", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2527
16
      { &hf_fcels_lip_f7_initiated_count, { "LIP F7 Initiated Count", "fcels.lip.f7_initiated_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2528
16
      { &hf_fcels_lip_f7_received_count, { "LIP F7 Received Count", "fcels.lip.f7_received_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2529
16
      { &hf_fcels_lip_f8_initiated_count, { "LIP F8 Initiated Count", "fcels.lip.f8_initiated_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2530
16
      { &hf_fcels_lip_f8_received_count, { "LIP F8 Received Count", "fcels.lip.f8_received_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2531
16
      { &hf_fcels_lip_reset_initiated_count, { "LIP Reset Initiated Count", "fcels.lip.reset_initiated_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2532
16
      { &hf_fcels_lip_reset_received_count, { "LIP Reset Received Count", "fcels.lip.reset_received_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2533
16
      { &hf_fcels_rpl_max_size, { "Max Size", "fcels.rpl.max_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2534
16
      { &hf_fcels_rpl_index, { "Index", "fcels.rpl.index", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2535
16
      { &hf_fcels_rpl_payload_length, { "Payload Length", "fcels.rpl.payload_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2536
16
      { &hf_fcels_rpl_list_length, { "List Length", "fcels.rpl.list_length", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2537
16
      { &hf_fcels_rpl_index_of_i_port_block, { "Index of I Port Block", "fcels.rpl.index_of_i_port_block", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2538
16
      { &hf_fcels_rpl_physical_port, { "Physical Port #", "fcels.rpl.physical_port", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2539
16
      { &hf_fcels_rpl_port_identifier, { "Port Identifier", "fcels.rpl.port_identifier", FT_BYTES, SEP_DOT, NULL, 0x0, NULL, HFILL }},
2540
16
      { &hf_fcels_rpl_port_name, { "Port Name", "fcels.rpl.port_name", FT_FCWWN, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2541
16
      { &hf_fcels_rscn_page_len, { "Page Len", "fcels.rscn.page_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2542
16
      { &hf_fcels_rscn_payload_len, { "Payload Len", "fcels.rscn.payload_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2543
16
      { &hf_fcels_rnft_max_size, { "Max Size", "fcels.rnft.max_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2544
16
      { &hf_fcels_rnft_index, { "Index", "fcels.rnft.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2545
16
      { &hf_fcels_rnft_payload_len, { "Payload Len", "fcels.rnft.payload_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2546
16
      { &hf_fcels_rnft_list_length, { "List Length", "fcels.rnft.list_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2547
16
      { &hf_fcels_rnft_index_of_first_rec_in_list, { "Index of First Rec in List", "fcels.rnft.index_of_first_rec_in_list", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2548
16
      { &hf_fcels_rnft_fc4_qualifier, { "FC-4 Qualifier", "fcels.rnft.fc_4_qualifier", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2549
16
      { &hf_fcels_prlilo_page_length, { "Page Length", "fcels.prlilo.page_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2550
16
      { &hf_fcels_prlilo_payload_length, { "Payload Length", "fcels.prlilo.payload_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2551
16
      { &hf_fcels_prlilo_type, { "TYPE", "fcels.prlilo.type", FT_UINT8, BASE_DEC, VALS(fc_prli_fc4_val), 0x0, NULL, HFILL }},
2552
16
      { &hf_fcels_prlilo_type_code_extension, { "TYPE Code Extension", "fcels.prlilo.type_code_extension", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2553
16
      { &hf_fcels_prlilo_response_code, { "Response Code", "fcels.prlilo.response_code", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2554
16
      { &hf_fcels_prlilo_originator_pa, { "Originator PA", "fcels.prlilo.originator_pa", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2555
16
      { &hf_fcels_prlilo_3rd_party_originator_pa, { "3rd Party Originator PA", "fcels.prlilo.3rd_party_originator_pa", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2556
16
      { &hf_fcels_prlilo_responder_pa, { "Responder PA", "fcels.prlilo.responder_pa", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2557
16
      { &hf_fcels_prlilo_service_parameter_response, { "Service Parameter Response", "fcels.prlilo.service_parameter_response", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2558
16
      { &hf_fcels_prlilo_3rd_party_n_port_id, { "3rd Party N_Port Id", "fcels.prlilo.3rd_party_n_port_id", FT_BYTES, SEP_DOT, NULL, 0x0, NULL, HFILL }},
2559
16
      { &hf_fcels_lirr_regn_function, { "Regn. Function", "fcels.lirr.regn_function", FT_UINT8, BASE_HEX, VALS(fc_els_lirr_regfunc_val), 0x0, NULL, HFILL }},
2560
16
      { &hf_fcels_lirr_regn_format, { "Regn. Format", "fcels.lirr.regn_format", FT_UINT8, BASE_HEX, VALS(fc_fc4_val), 0x0, NULL, HFILL }},
2561
16
      { &hf_fcels_srl_flag, { "Flag", "fcels.srl.flag", FT_BOOLEAN, 8, TFS(&tfs_srl_flag), 0x01, NULL, HFILL }},
2562
16
      { &hf_fcels_srl_fl_port_addr, { "FL_Port Addr", "fcels.srl.fl_port_addr", FT_BYTES, SEP_DOT, NULL, 0x0, NULL, HFILL }},
2563
16
      { &hf_fcels_rpsc_number_of_entries, { "Number of Entries", "fcels.rpsc.number_of_entries", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2564
16
      { &hf_fcels_rpsc_port_oper_speed, { "Port Oper Speed", "fcels.rpsc.port_oper_speed", FT_UINT16, BASE_HEX, VALS(fc_els_portspeed_val), 0x0, NULL, HFILL }},
2565
16
      { &hf_fcels_common_identification_data_length, { "Common Identification Data Length", "fcels.common_identification_data_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2566
16
    };
2567
2568
16
    static int *ett[] = {
2569
16
        &ett_fcels,
2570
16
        &ett_fcels_lsrjt,
2571
16
        &ett_fcels_acc,
2572
16
        &ett_fcels_logi,
2573
16
        &ett_fcels_logi_cmnsvc,
2574
16
        &ett_fcels_logi_clssvc,
2575
16
        &ett_fcels_logo,
2576
16
        &ett_fcels_abtx,
2577
16
        &ett_fcels_rsi,
2578
16
        &ett_fcels_rrq,
2579
16
        &ett_fcels_rec,
2580
16
        &ett_fcels_prli,
2581
16
        &ett_fcels_prli_svcpg,
2582
16
        &ett_fcels_adisc,
2583
16
        &ett_fcels_farp,
2584
16
        &ett_fcels_rps,
2585
16
        &ett_fcels_rpl,
2586
16
        &ett_fcels_rplpb,
2587
16
        &ett_fcels_fan,
2588
16
        &ett_fcels_rscn,
2589
16
        &ett_fcels_rscn_rec,
2590
16
        &ett_fcels_estat,
2591
16
        &ett_fcels_scr,
2592
16
        &ett_fcels_rnft,
2593
16
        &ett_fcels_rnft_fc4,
2594
16
        &ett_fcels_lsts,
2595
16
        &ett_fcels_rnid,
2596
16
        &ett_fcels_rlir,
2597
16
        &ett_fcels_lirr,
2598
16
        &ett_fcels_srl,
2599
16
        &ett_fcels_rpsc,
2600
16
        &ett_fcels_cbind,
2601
16
        &ett_fcels_cmnfeatures,
2602
16
        &ett_fcels_clsflags,
2603
16
        &ett_fcels_initctl,
2604
16
        &ett_fcels_rcptctl,
2605
16
        &ett_fcels_fcpflags,
2606
16
        &ett_fcels_prliloflags,
2607
16
        &ett_fcels_speedflags,
2608
16
    };
2609
2610
2611
16
    static ei_register_info ei[] = {
2612
16
        { &ei_fcels_src_unknown, { "fcels.src.type.unknown", PI_PROTOCOL, PI_WARN, "Unknown source address type", EXPFILL }},
2613
16
        { &ei_fcels_dst_unknown, { "fcels.dst.type.unknown", PI_PROTOCOL, PI_WARN, "Unknown destination address type", EXPFILL }},
2614
16
        { &ei_fcels_short_payload, { "fcels.short_payload", PI_MALFORMED, PI_ERROR, "Payload too short for this ELS", EXPFILL }},
2615
16
        { &ei_fcels_no_record_of_exchange, { "fcels.no_record_of_exchange", PI_UNDECODED, PI_WARN, "No record of Exchange. Unable to decode ACC", EXPFILL }},
2616
16
        { &ei_fcels_no_record_of_els_req, { "fcels.no_record_of_els_req", PI_UNDECODED, PI_WARN, "No record of ELS Req. Unable to decode ACC", EXPFILL }},
2617
16
    };
2618
2619
16
    expert_module_t* expert_fcels;
2620
2621
16
    proto_fcels = proto_register_protocol("FC Extended Link Svc", "FC ELS", "fcels");
2622
2623
16
    proto_register_field_array(proto_fcels, hf, array_length(hf));
2624
16
    proto_register_subtree_array(ett, array_length(ett));
2625
16
    expert_fcels = expert_register_protocol(proto_fcels);
2626
16
    expert_register_field_array(expert_fcels, ei, array_length(ei));
2627
16
    fcels_req_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), fcels_hash, fcels_equal);
2628
2629
16
    els_handle = register_dissector("fcels", dissect_fcels, proto_fcels);
2630
16
}
2631
2632
void
2633
proto_reg_handoff_fcels (void)
2634
16
{
2635
16
    dissector_add_uint("fc.ftype", FC_FTYPE_ELS, els_handle);
2636
2637
16
    fcsp_handle = find_dissector_add_dependency ("fcsp", proto_fcels);
2638
16
}
2639
2640
2641
/*
2642
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
2643
 *
2644
 * Local variables:
2645
 * c-basic-offset: 4
2646
 * tab-width: 8
2647
 * indent-tabs-mode: nil
2648
 * End:
2649
 *
2650
 * vi: set shiftwidth=4 tabstop=8 expandtab:
2651
 * :indentSize=4:tabSize=8:noTabs=true:
2652
 */