Coverage Report

Created: 2025-12-27 06:52

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