2 * Routines for FC Extended Link Services
3 * Copyright 2001, Dinesh G Dutt <ddutt@cisco.com>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 * TODO Still (Complete compliance with FC-MI):
35 #include <epan/packet.h>
36 #include <epan/to_str.h>
37 #include <epan/wmem/wmem.h>
38 #include <epan/conversation.h>
39 #include <epan/etypes.h>
40 #include <epan/expert.h>
41 #include "packet-scsi.h"
42 #include "packet-fc.h"
43 #include "packet-fcels.h"
48 /* Initialize the protocol and registered fields */
49 static int proto_fcels
= -1;
50 static int hf_fcels_opcode
= -1;
51 static int hf_fcels_rjtcode
= -1;
52 static int hf_fcels_rjtdetcode
= -1;
53 static int hf_fcels_vnduniq
= -1;
54 static int hf_fcels_b2b
= -1;
55 static int hf_fcels_cmnfeatures
= -1;
56 static int hf_fcels_bbscnum
= -1;
57 static int hf_fcels_rcvsize
= -1;
58 static int hf_fcels_maxconseq
= -1;
59 static int hf_fcels_reloffset
= -1;
60 static int hf_fcels_edtov
= -1;
61 static int hf_fcels_npname
= -1;
62 static int hf_fcels_fnname
= -1;
64 static int hf_fcels_cls1param
= -1;
65 static int hf_fcels_cls2param
= -1;
66 static int hf_fcels_cls3param
= -1;
67 static int hf_fcels_cls4param
= -1;
69 static int hf_fcels_vendorvers
= -1;
70 static int hf_fcels_svcavail
= -1;
71 static int hf_fcels_clsflags
= -1;
72 static int hf_fcels_clsrcvsize
= -1;
73 static int hf_fcels_conseq
= -1;
74 static int hf_fcels_e2e
= -1;
75 static int hf_fcels_openseq
= -1;
76 static int hf_fcels_nportid
= -1;
77 static int hf_fcels_oxid
= -1;
78 static int hf_fcels_rxid
= -1;
79 static int hf_fcels_recovqual
= -1;
80 static int hf_fcels_fabricaddr
= -1;
81 static int hf_fcels_fabricpname
= -1;
82 static int hf_fcels_failedrcvr
= -1;
83 static int hf_fcels_flacompliance
= -1;
84 static int hf_fcels_loopstate
= -1;
85 static int hf_fcels_publicloop_bmap
= -1;
86 static int hf_fcels_pvtloop_bmap
= -1;
87 static int hf_fcels_alpa_map
= -1;
88 static int hf_fcels_scrregn
= -1;
89 static int hf_fcels_farp_matchcodept
= -1;
90 static int hf_fcels_farp_respaction
= -1;
91 static int hf_fcels_resportid
= -1;
92 static int hf_fcels_respname
= -1;
93 static int hf_fcels_respnname
= -1;
94 static int hf_fcels_reqipaddr
= -1;
95 static int hf_fcels_respipaddr
= -1;
96 static int hf_fcels_hardaddr
= -1;
97 static int hf_fcels_rps_flag
= -1;
98 static int hf_fcels_rps_portnum
= -1;
99 static int hf_fcels_rps_portstatus
= -1;
100 static int hf_fcels_rnft_fc4type
= -1;
101 static int hf_fcels_rscn_evqual
= -1;
102 static int hf_fcels_rscn_addrfmt
= -1;
103 static int hf_fcels_rscn_domain
= -1;
104 static int hf_fcels_rscn_area
= -1;
105 static int hf_fcels_rscn_port
= -1;
106 static int hf_fcels_rec_fc4
= -1;
107 static int hf_fcels_estat
= -1;
108 static int hf_fcels_estat_resp
= -1;
109 static int hf_fcels_estat_seq_init
= -1;
110 static int hf_fcels_estat_compl
= -1;
111 static int hf_fcels_nodeidfmt
= -1;
112 static int hf_fcels_spidlen
= -1;
113 static int hf_fcels_vendoruniq
= -1;
114 static int hf_fcels_vendorsp
= -1;
115 static int hf_fcels_asstype
= -1;
116 static int hf_fcels_physport
= -1;
117 static int hf_fcels_attnodes
= -1;
118 static int hf_fcels_nodemgmt
= -1;
119 static int hf_fcels_ipvers
= -1;
120 static int hf_fcels_tcpport
= -1;
121 static int hf_fcels_ip
= -1;
122 static int hf_fcels_cbind_liveness
= -1;
123 static int hf_fcels_cbind_addr_mode
= -1;
124 static int hf_fcels_cbind_ifcp_version
= -1;
125 static int hf_fcels_cbind_userinfo
= -1;
126 static int hf_fcels_cbind_snpname
= -1;
127 static int hf_fcels_cbind_dnpname
= -1;
128 static int hf_fcels_cbind_status
= -1;
129 static int hf_fcels_chandle
= -1;
130 static int hf_fcels_unbind_status
= -1;
131 static int hf_fcels_cmn_cios
= -1;
132 static int hf_fcels_cmn_rro
= -1;
133 static int hf_fcels_cmn_vvv
= -1;
134 static int hf_fcels_cmn_b2b
= -1;
135 static int hf_fcels_cmn_e_d_tov
= -1;
136 static int hf_fcels_cmn_simplex
= -1;
137 static int hf_fcels_cmn_multicast
= -1;
138 static int hf_fcels_cmn_broadcast
= -1;
139 static int hf_fcels_cmn_security
= -1;
140 static int hf_fcels_cmn_clk
= -1;
141 static int hf_fcels_cmn_dhd
= -1;
142 static int hf_fcels_cmn_seqcnt
= -1;
143 static int hf_fcels_cmn_payload
= -1;
144 static int hf_fcels_cls_cns
= -1;
145 static int hf_fcels_cls_sdr
= -1;
146 static int hf_fcels_cls_prio
= -1;
147 static int hf_fcels_cls_nzctl
= -1;
148 static int hf_fcels_initctl
= -1;
149 static int hf_fcels_initctl_initial_pa
= -1;
150 static int hf_fcels_initctl_ack0
= -1;
151 static int hf_fcels_initctl_ackgaa
= -1;
152 static int hf_fcels_initctl_sync
= -1;
153 static int hf_fcels_rcptctl
= -1;
154 static int hf_fcels_rcptctl_ack0
= -1;
155 static int hf_fcels_rcptctl_interlock
= -1;
156 static int hf_fcels_rcptctl_policy
= -1;
157 static int hf_fcels_rcptctl_category
= -1;
158 static int hf_fcels_rcptctl_sync
= -1;
159 static int hf_fcels_fcpflags
= -1;
160 static int hf_fcels_fcpflags_trireq
= -1;
161 static int hf_fcels_fcpflags_trirep
= -1;
162 static int hf_fcels_fcpflags_retry
= -1;
163 static int hf_fcels_fcpflags_ccomp
= -1;
164 static int hf_fcels_fcpflags_datao
= -1;
165 static int hf_fcels_fcpflags_initiator
= -1;
166 static int hf_fcels_fcpflags_target
= -1;
167 static int hf_fcels_fcpflags_rdxr
= -1;
168 static int hf_fcels_fcpflags_wrxr
= -1;
169 static int hf_fcels_prliloflags
= -1;
170 static int hf_fcels_tprloflags_opav
= -1;
171 static int hf_fcels_tprloflags_rpav
= -1;
172 static int hf_fcels_tprloflags_npv
= -1;
173 static int hf_fcels_tprloflags_gprlo
= -1;
174 static int hf_fcels_speedflags
= -1;
175 static int hf_fcels_speedflags_1gb
= -1;
176 static int hf_fcels_speedflags_2gb
= -1;
177 static int hf_fcels_speedflags_4gb
= -1;
178 static int hf_fcels_speedflags_10gb
= -1;
179 static int hf_fcels_prliloflags_opav
= -1;
180 static int hf_fcels_prliloflags_ipe
= -1;
181 static int hf_fcels_prliloflags_eip
= -1;
183 static gint ett_fcels
= -1;
184 static gint ett_fcels_lsrjt
= -1;
185 static gint ett_fcels_acc
= -1;
186 static gint ett_fcels_logi
= -1;
187 static gint ett_fcels_logi_cmnsvc
= -1;
188 static gint ett_fcels_logi_clssvc
= -1;
189 static gint ett_fcels_logo
= -1;
190 static gint ett_fcels_abtx
= -1;
191 static gint ett_fcels_rsi
= -1;
192 static gint ett_fcels_rrq
= -1;
193 static gint ett_fcels_rec
= -1;
194 static gint ett_fcels_prli
= -1;
195 static gint ett_fcels_prli_svcpg
= -1;
196 static gint ett_fcels_adisc
= -1;
197 static gint ett_fcels_farp
= -1;
198 static gint ett_fcels_rps
= -1;
199 static gint ett_fcels_rpl
= -1;
200 static gint ett_fcels_rplpb
= -1;
201 static gint ett_fcels_fan
= -1;
202 static gint ett_fcels_rscn
= -1;
203 static gint ett_fcels_rscn_rec
= -1;
204 static gint ett_fcels_estat
= -1;
205 static gint ett_fcels_scr
= -1;
206 static gint ett_fcels_rnft
= -1;
207 static gint ett_fcels_rnft_fc4
= -1;
208 static gint ett_fcels_lsts
= -1;
209 static gint ett_fcels_rnid
= -1;
210 static gint ett_fcels_rlir
= -1;
211 static gint ett_fcels_lirr
= -1;
212 static gint ett_fcels_srl
= -1;
213 static gint ett_fcels_rpsc
= -1;
214 static gint ett_fcels_cbind
= -1;
215 static gint ett_fcels_cmnfeatures
= -1;
216 static gint ett_fcels_clsflags
= -1;
217 static gint ett_fcels_initctl
= -1;
218 static gint ett_fcels_rcptctl
= -1;
219 static gint ett_fcels_fcpflags
= -1;
220 static gint ett_fcels_prliloflags
= -1;
221 static gint ett_fcels_speedflags
= -1;
223 static expert_field ei_fcels_src_unknown
= EI_INIT
;
224 static expert_field ei_fcels_dst_unknown
= EI_INIT
;
226 static const int *hf_fcels_estat_fields
[] = {
227 &hf_fcels_estat_resp
,
228 &hf_fcels_estat_seq_init
,
229 &hf_fcels_estat_compl
,
233 static const true_false_string tfs_fcels_estat_resp
= {
234 "Responding to Exchange",
235 "Originator of Exchange"
238 static const true_false_string tfs_fcels_estat_seq_init
= {
239 "Seq Initiative held by REC responder",
240 "Seq Initiative not held by REC responder"
244 #define FC_ESB_ST_RESP (1 << 31) /* responder to exchange */
245 #define FC_ESB_ST_SEQ_INIT (1 << 30) /* holds sequence initiative */
246 #define FC_ESB_ST_COMPLETE (1 << 29) /* exchange is complete */
248 static const value_string fc_prli_fc4_val
[] = {
249 {FC_TYPE_SCSI
, "FCP"},
250 {FC_TYPE_IP
, "IP/FC"},
251 {FC_TYPE_LLCSNAP
, "LLC_SNAP"},
252 {FC_TYPE_ELS
, "Ext Link Svc"},
253 {FC_TYPE_FCCT
, "FC_CT"},
254 {FC_TYPE_SWILS
, "SW_ILS"},
256 {FC_TYPE_SNMP
, "SNMP"},
257 {FC_TYPE_CMNSVC
, "Common to all FC-4 Types"},
261 static const value_string cbind_addr_mode_vals
[] = {
262 {0, "Address Translation mode"},
263 {1, "Address Transparent Mode"},
267 static const value_string cbind_status_vals
[] = {
269 {16, "Failed - Unspecified Reason"},
270 {18, "Failed - Connection ID invalid"},
274 static const value_string unbind_status_vals
[] = {
276 {16, "Failed - Unspecified Reason"},
277 {17, "Failed - No such device"},
278 {18, "Failed - iFCP session already exists"},
279 {19, "Failed - Lack of resources"},
280 {20, "Failed - Incompatible address translation mode"},
281 {21, "Failed - Incorrect protocol version"},
282 {22, "Failed - Gateway not synchronized"},
286 typedef struct _fcels_conv_key
{
290 typedef struct _fcels_conv_data
{
294 static GHashTable
*fcels_req_hash
= NULL
;
296 static dissector_handle_t data_handle
, fcsp_handle
;
302 fcels_equal(gconstpointer v
, gconstpointer w
)
304 const fcels_conv_key_t
*v1
= (const fcels_conv_key_t
*)v
;
305 const fcels_conv_key_t
*v2
= (const fcels_conv_key_t
*)w
;
307 return (v1
->conv_idx
== v2
->conv_idx
);
311 fcels_hash (gconstpointer v
)
313 const fcels_conv_key_t
*key
= (const fcels_conv_key_t
*)v
;
322 * Protocol initialization
325 fcels_init_protocol(void)
328 g_hash_table_destroy(fcels_req_hash
);
330 fcels_req_hash
= g_hash_table_new(fcels_hash
, fcels_equal
);
333 static const true_false_string tfs_fc_fcels_cmn_b2b
= {
334 "Alt B2B Credit Mgmt",
335 "Normal B2B Credit Mgmt"
337 static const true_false_string tfs_fc_fcels_cmn_e_d_tov
= {
338 "E_D_TOV Resolution in ns",
339 "E_D_TOV Resolution in ms"
341 static const true_false_string tfs_fc_fcels_cmn_seqcnt
= {
342 "Cont. Incr SEQCNT rules",
343 "Normal SEQCNT rules"
345 static const true_false_string tfs_fc_fcels_cmn_payload
= {
346 "Payload Len=256 bytes",
347 "Payload Len=116 bytes"
351 dissect_cmnsvc (proto_tree
*parent_tree
, tvbuff_t
*tvb
, int offset
, guint16 flags
, guint8 opcode
)
353 proto_item
*item
=NULL
;
354 proto_tree
*tree
=NULL
;
357 item
=proto_tree_add_uint(parent_tree
, hf_fcels_cmnfeatures
,
358 tvb
, offset
, 2, flags
);
359 tree
=proto_item_add_subtree(item
, ett_fcels_cmnfeatures
);
362 proto_tree_add_boolean(tree
, hf_fcels_cmn_cios
, tvb
, offset
, 2, flags
);
364 proto_item_append_text(item
, " Cont. Incr. Offset Supported");
366 flags
&=(~( 0x8000 ));
368 proto_tree_add_boolean(tree
, hf_fcels_cmn_rro
, tvb
, offset
, 2, flags
);
370 proto_item_append_text(item
, " RRO Supported");
372 flags
&=(~( 0x4000 ));
374 proto_tree_add_boolean(tree
, hf_fcels_cmn_vvv
, tvb
, offset
, 2, flags
);
376 proto_item_append_text(item
, " Valid Vendor Version");
378 flags
&=(~( 0x2000 ));
380 proto_tree_add_boolean(tree
, hf_fcels_cmn_b2b
, tvb
, offset
, 2, flags
);
382 proto_item_append_text(item
, " Alt B2B Credit Mgmt");
384 proto_item_append_text(item
, " Normal B2B Credit Mgmt");
386 flags
&=(~( 0x0800 ));
388 if ((opcode
== FC_ELS_PLOGI
) || (opcode
== FC_ELS_PDISC
)) {
389 proto_tree_add_boolean(tree
, hf_fcels_cmn_e_d_tov
, tvb
, offset
, 2, flags
);
391 proto_item_append_text(item
, " E_D_TOV Resolution in ns");
393 proto_item_append_text(item
, " E_D_TOV Resolution in ms");
395 flags
&=(~( 0x0400 ));
397 proto_tree_add_boolean(tree
, hf_fcels_cmn_simplex
, tvb
, offset
, 2, flags
);
399 proto_item_append_text(item
, " Simplex Dedicated Conn Supported");
401 flags
&=(~( 0x0040 ));
404 proto_tree_add_boolean(tree
, hf_fcels_cmn_multicast
, tvb
, offset
, 2, flags
);
406 proto_item_append_text(item
, " Multicast Supported");
408 flags
&=(~( 0x0200 ));
410 proto_tree_add_boolean(tree
, hf_fcels_cmn_broadcast
, tvb
, offset
, 2, flags
);
412 proto_item_append_text(item
, " Broadcast Supported");
414 flags
&=(~( 0x0100 ));
416 proto_tree_add_boolean(tree
, hf_fcels_cmn_security
, tvb
, offset
, 2, flags
);
418 proto_item_append_text(item
, " Security Bit");
420 flags
&=(~( 0x0020 ));
422 proto_tree_add_boolean(tree
, hf_fcels_cmn_clk
, tvb
, offset
, 2, flags
);
424 proto_item_append_text(item
, " Clk Sync Prim Capable");
426 flags
&=(~( 0x0010 ));
428 proto_tree_add_boolean(tree
, hf_fcels_cmn_dhd
, tvb
, offset
, 2, flags
);
430 proto_item_append_text(item
, " DHD Capable");
432 flags
&=(~( 0x0004 ));
434 if ((opcode
== FC_ELS_PLOGI
) || (opcode
== FC_ELS_PDISC
)) {
435 proto_tree_add_boolean(tree
, hf_fcels_cmn_seqcnt
, tvb
, offset
, 2, flags
);
437 proto_item_append_text(item
, " Cont. Incr SEQCNT rules");
439 proto_item_append_text(item
, " Normal SEQCNT rules");
441 flags
&=(~( 0x0002 ));
444 proto_tree_add_boolean(tree
, hf_fcels_cmn_payload
, tvb
, offset
, 2, flags
);
446 proto_item_append_text(item
, " Payload Len=256 bytes");
448 proto_item_append_text(item
, " Payload Len=116 bytes");
450 /*flags&=(~( 0x0001 ));*/
454 static const true_false_string tfs_fc_fcels_cls_sdr
= {
455 "Seq Delivery Requested",
456 "Out of Order Delivery Requested"
458 static const true_false_string tfs_fc_fcels_cls_nzctl
= {
459 "Non-zero CS_CTL Tolerated",
460 "Non-zero CS_CTL Maybe Tolerated"
463 /* The next 3 routines decode only Class 2 & Class 3 relevant bits */
465 dissect_clssvc_flags (proto_tree
*parent_tree
, tvbuff_t
*tvb
, int offset
, guint16 flags
, guint8 opcode
)
467 proto_item
*item
=NULL
;
468 proto_tree
*tree
=NULL
;
471 item
=proto_tree_add_uint(parent_tree
, hf_fcels_clsflags
,
472 tvb
, offset
, 2, flags
);
473 tree
=proto_item_add_subtree(item
, ett_fcels_clsflags
);
476 proto_tree_add_boolean(tree
, hf_fcels_cls_cns
, tvb
, offset
, 2, flags
);
477 if (!(flags
&0x8000)){
478 proto_item_append_text(item
, " Class Not Supported");
481 flags
&=(~( 0x8000 ));
483 if ((opcode
== FC_ELS_FLOGI
) || (opcode
== FC_ELS_FDISC
)) {
484 proto_tree_add_boolean(tree
, hf_fcels_cls_sdr
, tvb
, offset
, 2, flags
);
486 proto_item_append_text(item
, " Seq Delivery Requested");
488 proto_item_append_text(item
, " Out of Order Delivery Requested");
490 flags
&=(~( 0x0800 ));
493 proto_tree_add_boolean(tree
, hf_fcels_cls_prio
, tvb
, offset
, 2, flags
);
495 proto_item_append_text(item
, " Priority/preemption Supported");
497 flags
&=(~( 0x0080 ));
499 if ((opcode
== FC_ELS_PLOGI
) || (opcode
== FC_ELS_PDISC
)) {
500 proto_tree_add_boolean(tree
, hf_fcels_cls_nzctl
, tvb
, offset
, 2, flags
);
501 if (flags
& 0x0040) {
502 proto_item_append_text(item
, " Non-zero CS_CTL Tolerated");
504 proto_item_append_text(item
, " Non-zero CS_CTL Maybe Tolerated");
506 /*flags&=(~( 0x0040 ));*/
510 static const true_false_string tfs_fc_fcels_fcpflags_retry
= {
514 static const true_false_string tfs_fc_fcels_fcpflags_ccomp
= {
518 static const true_false_string tfs_fc_fcels_fcpflags_datao
= {
522 static const true_false_string tfs_fc_fcels_fcpflags_initiator
= {
526 static const true_false_string tfs_fc_fcels_fcpflags_target
= {
530 static const true_false_string tfs_fc_fcels_fcpflags_rdxr
= {
534 static const true_false_string tfs_fc_fcels_fcpflags_wrxr
= {
540 dissect_fcp_flags (proto_tree
*parent_tree
, tvbuff_t
*tvb
, int offset
, guint32 flags
, guint8 isreq
)
542 proto_item
*item
=NULL
;
543 proto_tree
*tree
=NULL
;
546 item
=proto_tree_add_uint(parent_tree
, hf_fcels_fcpflags
,
547 tvb
, offset
, 4, flags
);
548 tree
=proto_item_add_subtree(item
, ett_fcels_fcpflags
);
552 proto_tree_add_boolean(tree
, hf_fcels_fcpflags_trireq
, tvb
, offset
, 4, flags
);
554 proto_item_append_text(item
, " Task Retry Ident Req");
557 proto_tree_add_boolean(tree
, hf_fcels_fcpflags_trirep
, tvb
, offset
, 4, flags
);
559 proto_item_append_text(item
, " Task Retry Ident Acc");
562 flags
&=(~( 0x2000 ));
564 proto_tree_add_boolean(tree
, hf_fcels_fcpflags_retry
, tvb
, offset
, 4, flags
);
566 proto_item_append_text(item
, " Retry Possible");
568 flags
&=(~( 0x1000 ));
570 proto_tree_add_boolean(tree
, hf_fcels_fcpflags_ccomp
, tvb
, offset
, 4, flags
);
572 proto_item_append_text(item
, " Confirmed Comp");
574 flags
&=(~( 0x0080 ));
576 proto_tree_add_boolean(tree
, hf_fcels_fcpflags_datao
, tvb
, offset
, 4, flags
);
578 proto_item_append_text(item
, " Data Overlay");
580 flags
&=(~( 0x0040 ));
582 proto_tree_add_boolean(tree
, hf_fcels_fcpflags_initiator
, tvb
, offset
, 4, flags
);
584 proto_item_append_text(item
, " Initiator");
586 flags
&=(~( 0x0020 ));
588 proto_tree_add_boolean(tree
, hf_fcels_fcpflags_target
, tvb
, offset
, 4, flags
);
590 proto_item_append_text(item
, " Target");
592 flags
&=(~( 0x0010 ));
594 proto_tree_add_boolean(tree
, hf_fcels_fcpflags_rdxr
, tvb
, offset
, 4, flags
);
596 proto_item_append_text(item
, " Rd Xfer_Rdy Dis");
598 flags
&=(~( 0x0002 ));
600 proto_tree_add_boolean(tree
, hf_fcels_fcpflags_wrxr
, tvb
, offset
, 4, flags
);
602 proto_item_append_text(item
, " Wr Xfer_Rdy Dis");
604 /*flags&=(~( 0x0001 ));*/
609 dissect_speed_flags (proto_tree
*parent_tree
, tvbuff_t
*tvb
, int offset
, guint32 flags
, int port
)
611 proto_item
*item
=NULL
;
612 proto_tree
*tree
=NULL
;
615 item
=proto_tree_add_uint_format(parent_tree
, hf_fcels_speedflags
,
616 tvb
, offset
, 2, flags
,
617 "Port Speed Capabilities (Port %u): 0x%04x",
619 tree
=proto_item_add_subtree(item
, ett_fcels_speedflags
);
622 proto_tree_add_boolean(tree
, hf_fcels_speedflags_1gb
, tvb
, offset
, 2, flags
);
624 proto_item_append_text(item
, " 1Gb");
626 flags
&=(~( 0x8000 ));
628 proto_tree_add_boolean(tree
, hf_fcels_speedflags_2gb
, tvb
, offset
, 2, flags
);
630 proto_item_append_text(item
, " 2Gb");
632 flags
&=(~( 0x4000 ));
634 proto_tree_add_boolean(tree
, hf_fcels_speedflags_4gb
, tvb
, offset
, 2, flags
);
636 proto_item_append_text(item
, " 4Gb");
638 flags
&=(~( 0x2000 ));
640 proto_tree_add_boolean(tree
, hf_fcels_speedflags_10gb
, tvb
, offset
, 2, flags
);
642 proto_item_append_text(item
, " 10Gb");
644 /*flags&=(~( 0x1000 ));*/
647 static const true_false_string tfs_fc_fcels_tprloflags_gprlo
= {
651 static const true_false_string tfs_fc_fcels_prliloflags_ipe
= {
653 "Image pair NOT estd"
655 static const true_false_string tfs_fc_fcels_prliloflags_eip
= {
656 "Est Image Pair & Exchg Svc Param",
657 "Exchange Svc Param Only"
661 dissect_prlilo_flags (proto_tree
*parent_tree
, tvbuff_t
*tvb
, int offset
, int flags
, guint8 opcode
)
663 proto_item
*item
=NULL
;
664 proto_tree
*tree
=NULL
;
667 item
=proto_tree_add_uint(parent_tree
, hf_fcels_prliloflags
,
668 tvb
, offset
, 1, flags
);
669 tree
=proto_item_add_subtree(item
, ett_fcels_prliloflags
);
672 if (opcode
== FC_ELS_TPRLO
) {
673 proto_tree_add_boolean(tree
, hf_fcels_tprloflags_opav
, tvb
, offset
, 1, flags
);
675 proto_item_append_text(item
, " 3rd Party Orig PA Valid");
679 proto_tree_add_boolean(tree
, hf_fcels_tprloflags_rpav
, tvb
, offset
, 1, flags
);
681 proto_item_append_text(item
, " Resp PA Valid");
685 proto_tree_add_boolean(tree
, hf_fcels_tprloflags_npv
, tvb
, offset
, 1, flags
);
687 proto_item_append_text(item
, " 3rd Party N_Port Valid");
691 proto_tree_add_boolean(tree
, hf_fcels_tprloflags_gprlo
, tvb
, offset
, 1, flags
);
693 proto_item_append_text(item
, " Global PRLO");
695 /*flags&=(~( 0x10 ));*/
696 } else { /* opcode != TPRLO */
697 proto_tree_add_boolean(tree
, hf_fcels_prliloflags_opav
, tvb
, offset
, 1, flags
);
699 proto_item_append_text(item
, " Orig PA Valid");
703 proto_tree_add_boolean(tree
, hf_fcels_tprloflags_rpav
, tvb
, offset
, 1, flags
);
705 proto_item_append_text(item
, " Resp PA Valid");
709 if (opcode
== FC_ELS_PRLI
) {
710 proto_tree_add_boolean(tree
, hf_fcels_prliloflags_ipe
, tvb
, offset
, 1, flags
);
712 proto_item_append_text(item
, " Image Pair Estd");
714 proto_item_append_text(item
, " Image Pair NOT Estd");
716 /*flags&=(~( 0x20 ));*/
718 proto_tree_add_boolean(tree
, hf_fcels_prliloflags_eip
, tvb
, offset
, 1, flags
);
720 proto_item_append_text(item
, " Est Image Pair & Exchg Svc Param");
722 proto_item_append_text(item
, " Exchange Svc Param Only");
724 /*flags&=(~( 0x20 ));*/
729 static const value_string initial_pa_vals
[] = {
730 { 0, "Initial P_A Not Supported" },
731 { 1, "Initial P_A Supported" },
732 { 3, "Initial P_A Required & Supported" },
735 static const true_false_string tfs_fc_fcels_initctl_ackgaa
= {
736 "ACK Generation Assistance Avail",
737 "NO ack generation assistance"
741 dissect_initctl_flags (proto_tree
*parent_tree
, tvbuff_t
*tvb
, int offset
, guint16 flags
, guint8 opcode
)
743 proto_item
*item
=NULL
;
744 proto_tree
*tree
=NULL
;
747 item
=proto_tree_add_uint(parent_tree
, hf_fcels_initctl
,
748 tvb
, offset
, 2, flags
);
749 tree
=proto_item_add_subtree(item
, ett_fcels_initctl
);
752 if ((opcode
== FC_ELS_PLOGI
) || (opcode
== FC_ELS_PDISC
)) {
753 proto_tree_add_uint(tree
, hf_fcels_initctl_initial_pa
,
754 tvb
, offset
, 2, flags
);
755 proto_item_append_text(item
, " %s",
756 val_to_str((flags
&0x3000)>>12, initial_pa_vals
,
759 flags
&=(~( 0x3000 ));
761 proto_tree_add_boolean(tree
, hf_fcels_initctl_ack0
, tvb
, offset
, 2, flags
);
763 proto_item_append_text(item
, " ACK0 Capable");
765 flags
&=(~( 0x0800 ));
767 proto_tree_add_boolean(tree
, hf_fcels_initctl_ackgaa
, tvb
, offset
, 2, flags
);
769 proto_item_append_text(item
, " ACK Generation Assistance Avail");
771 flags
&=(~( 0x0200 ));
776 proto_tree_add_boolean(tree
, hf_fcels_initctl_sync
, tvb
, offset
, 2, flags
);
778 proto_item_append_text(item
, " Clock Sync ELS Supported");
780 /*flags&=(~( 0x0010 ));*/
784 static const value_string rcptctl_policy_vals
[] = {
785 { 0, "Error Policy: Discard Policy only" },
786 { 1, "Error Policy: Reserved" },
787 { 2, "Error Policy: Both discard and process policies supported" },
788 { 3, "Error Policy: Reserved" },
791 static const value_string rcptctl_category_vals
[] = {
792 { 0, "1 Category/Seq" },
793 { 1, "2 Categories/Seq" },
794 { 3, "More than 2 Categories/Seq" },
799 dissect_rcptctl_flags (proto_tree
*parent_tree
, tvbuff_t
*tvb
, int offset
, guint16 flags
, guint8 opcode
)
801 proto_item
*item
=NULL
;
802 proto_tree
*tree
=NULL
;
805 item
=proto_tree_add_uint(parent_tree
, hf_fcels_rcptctl
,
806 tvb
, offset
, 2, flags
);
807 tree
=proto_item_add_subtree(item
, ett_fcels_rcptctl
);
810 if ((opcode
== FC_ELS_PLOGI
) || (opcode
== FC_ELS_PDISC
)) {
811 proto_tree_add_boolean(tree
, hf_fcels_rcptctl_ack0
, tvb
, offset
, 2, flags
);
813 proto_item_append_text(item
, " ACK0 Supported");
815 proto_item_append_text(item
, " ACK0 NOT Supported");
817 flags
&=(~( 0x8000 ));
819 proto_tree_add_boolean(tree
, hf_fcels_rcptctl_interlock
, tvb
, offset
, 2, flags
);
821 proto_item_append_text(item
, " X_ID Interlock Reqd");
823 flags
&=(~( 0x2000 ));
825 proto_tree_add_uint(tree
, hf_fcels_rcptctl_policy
,
826 tvb
, offset
, 2, flags
);
827 proto_item_append_text(item
, " %s",
828 val_to_str((flags
&0x1800)>>11, rcptctl_policy_vals
,
831 flags
&=(~( 0x1800 ));
833 proto_tree_add_uint(tree
, hf_fcels_rcptctl_category
,
834 tvb
, offset
, 2, flags
);
835 proto_item_append_text(item
, " %s",
836 val_to_str((flags
&0x0030)>>4, rcptctl_category_vals
,
839 flags
&=(~( 0x0030 ));
842 proto_tree_add_boolean(tree
, hf_fcels_rcptctl_sync
, tvb
, offset
, 2, flags
);
844 proto_item_append_text(item
, " Clock Sync ELS Supported");
846 /*flags&=(~( 0x0008 ));*/
849 /* Maximum length of possible string from, construct_*_string
850 * 296 bytes, FIX possible buffer overflow */
851 #define FCELS_LOGI_MAXSTRINGLEN 512
854 dissect_fcels_logi (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
855 proto_item
*ti
, guint8 opcode
)
857 /* Set up structures needed to add the protocol subtree and manage it */
861 proto_tree
*logi_tree
, *cmnsvc_tree
;
866 logi_tree
= proto_item_add_subtree (ti
, ett_fcels_logi
);
867 proto_tree_add_item (logi_tree
, hf_fcels_opcode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
869 subti
= proto_tree_add_text (logi_tree
, tvb
, offset
+4, 16,
870 "Common Svc Parameters");
871 cmnsvc_tree
= proto_item_add_subtree (subti
, ett_fcels_logi_cmnsvc
);
872 proto_tree_add_item (cmnsvc_tree
, hf_fcels_b2b
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
873 flag
= tvb_get_ntohs (tvb
, offset
+8);
879 dissect_cmnsvc (cmnsvc_tree
, tvb
, offset
+8, flag
, opcode
);
881 proto_tree_add_item (cmnsvc_tree
, hf_fcels_bbscnum
, tvb
, offset
+10, 1, ENC_BIG_ENDIAN
);
882 proto_tree_add_item (cmnsvc_tree
, hf_fcels_rcvsize
, tvb
, offset
+10, 2, ENC_BIG_ENDIAN
);
883 proto_tree_add_item (cmnsvc_tree
, hf_fcels_maxconseq
, tvb
, offset
+12, 2, ENC_BIG_ENDIAN
);
884 proto_tree_add_item (cmnsvc_tree
, hf_fcels_reloffset
, tvb
, offset
+14, 2, ENC_BIG_ENDIAN
);
885 proto_tree_add_item (cmnsvc_tree
, hf_fcels_edtov
, tvb
, offset
+16, 4, ENC_BIG_ENDIAN
);
886 proto_tree_add_string (cmnsvc_tree
, hf_fcels_npname
, tvb
, offset
+20, 8,
887 tvb_fcwwn_to_str (tvb
, offset
+20));
888 proto_tree_add_string (cmnsvc_tree
, hf_fcels_fnname
, tvb
, offset
+28, 8,
889 tvb_fcwwn_to_str (tvb
, offset
+28));
891 /* Add subtree for class paramters */
893 for (svcclass
= 1; svcclass
< 5; svcclass
++) {
894 subti
= proto_tree_add_text (logi_tree
, tvb
, offset
, 16,
895 "Class %d Svc Parameters", svcclass
);
896 cmnsvc_tree
= proto_item_add_subtree (subti
, ett_fcels_logi_cmnsvc
);
898 flag
= tvb_get_ntohs (tvb
, offset
);
899 dissect_clssvc_flags (cmnsvc_tree
, tvb
, offset
, flag
, opcode
);
901 flag
= tvb_get_ntohs (tvb
, offset
+2);
902 dissect_initctl_flags (cmnsvc_tree
, tvb
, offset
+2, flag
, opcode
);
904 flag
= tvb_get_ntohs (tvb
, offset
+4);
905 dissect_rcptctl_flags (cmnsvc_tree
, tvb
, offset
+4, flag
, opcode
);
907 proto_tree_add_item (cmnsvc_tree
, hf_fcels_clsrcvsize
, tvb
,
908 offset
+6, 2, ENC_BIG_ENDIAN
);
909 proto_tree_add_item (cmnsvc_tree
, hf_fcels_conseq
, tvb
,
910 offset
+8, 2, ENC_BIG_ENDIAN
);
911 proto_tree_add_item (cmnsvc_tree
, hf_fcels_e2e
, tvb
,
912 offset
+10, 2, ENC_BIG_ENDIAN
);
913 proto_tree_add_item (cmnsvc_tree
, hf_fcels_openseq
, tvb
,
914 offset
+12, 2, ENC_BIG_ENDIAN
);
918 proto_tree_add_item (logi_tree
, hf_fcels_vendorvers
, tvb
, offset
, 16, ENC_NA
);
920 proto_tree_add_item (logi_tree
, hf_fcels_svcavail
, tvb
, offset
+32, 8, ENC_NA
);
926 dissect_fcels_plogi (tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
927 guint8 isreq _U_
, proto_item
*ti
)
929 dissect_fcels_logi (tvb
, pinfo
, tree
, ti
, FC_ELS_PLOGI
);
933 dissect_fcels_flogi (tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
934 guint8 isreq _U_
, proto_item
*ti
)
936 dissect_fcels_logi (tvb
, pinfo
, tree
, ti
, FC_ELS_FLOGI
);
940 dissect_fcels_logout (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
941 guint8 isreq
, proto_item
*ti
)
943 /* Set up structures needed to add the protocol subtree and manage it */
944 int offset
= 5; /* bypass opcode+rsvd field */
945 proto_tree
*logo_tree
;
948 logo_tree
= proto_item_add_subtree (ti
, ett_fcels_logo
);
950 proto_tree_add_item (logo_tree
, hf_fcels_opcode
, tvb
, offset
-5, 1, ENC_BIG_ENDIAN
);
953 /* Accept has no payload */
957 proto_tree_add_string (logo_tree
, hf_fcels_nportid
, tvb
, offset
, 3,
958 tvb_fc_to_str (tvb
, offset
));
959 proto_tree_add_string (logo_tree
, hf_fcels_npname
, tvb
, offset
+3, 6,
960 tvb_fcwwn_to_str (tvb
, offset
+3));
965 dissect_fcels_abtx (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
966 guint8 isreq
, proto_item
*ti
)
968 /* Set up structures needed to add the protocol subtree and manage it */
970 proto_tree
*abtx_tree
;
973 abtx_tree
= proto_item_add_subtree (ti
, ett_fcels_abtx
);
975 proto_tree_add_item (abtx_tree
, hf_fcels_opcode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
981 proto_tree_add_text (abtx_tree
, tvb
, offset
+4, 1,
982 "Recovery Qualifier Status: 0x%x",
983 tvb_get_guint8 (tvb
, offset
+4));
984 proto_tree_add_string (abtx_tree
, hf_fcels_nportid
, tvb
, offset
+5, 3,
985 tvb_fc_to_str (tvb
, offset
+5));
986 proto_tree_add_item (abtx_tree
, hf_fcels_oxid
, tvb
, offset
+8, 2, ENC_BIG_ENDIAN
);
987 proto_tree_add_item (abtx_tree
, hf_fcels_rxid
, tvb
, offset
+10, 2, ENC_BIG_ENDIAN
);
992 dissect_fcels_rsi (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
993 guint8 isreq
, proto_item
*ti
)
995 /* Set up structures needed to add the protocol subtree and manage it */
997 proto_tree
*rsi_tree
;
1000 rsi_tree
= proto_item_add_subtree (ti
, ett_fcels_rsi
);
1002 proto_tree_add_item (rsi_tree
, hf_fcels_opcode
, tvb
, offset
-4, 1, ENC_BIG_ENDIAN
);
1006 proto_tree_add_item (rsi_tree
, hf_fcels_recovqual
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1007 proto_tree_add_string (rsi_tree
, hf_fcels_nportid
, tvb
, offset
+1, 3,
1008 tvb_fc_to_str (tvb
, offset
+1));
1009 proto_tree_add_item (rsi_tree
, hf_fcels_rxid
, tvb
, offset
+4, 2, ENC_BIG_ENDIAN
);
1010 proto_tree_add_item (rsi_tree
, hf_fcels_oxid
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
1015 dissect_fcels_rrq (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1016 guint8 isreq
, proto_item
*ti
)
1018 /* Set up structures needed to add the protocol subtree and manage it */
1020 proto_tree
*rrq_tree
;
1023 rrq_tree
= proto_item_add_subtree (ti
, ett_fcels_rrq
);
1025 proto_tree_add_item (rrq_tree
, hf_fcels_opcode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1029 proto_tree_add_string (rrq_tree
, hf_fcels_nportid
, tvb
, offset
+5, 3,
1030 tvb_fc_to_str (tvb
, offset
+5));
1031 proto_tree_add_item (rrq_tree
, hf_fcels_oxid
, tvb
, offset
+8, 2, ENC_BIG_ENDIAN
);
1032 proto_tree_add_item (rrq_tree
, hf_fcels_rxid
, tvb
, offset
+10, 2, ENC_BIG_ENDIAN
);
1037 dissect_fcels_rec (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1038 guint8 isreq
, proto_item
*ti
)
1040 /* Set up structures needed to add the protocol subtree and manage it */
1042 proto_tree
*rec_tree
;
1045 rec_tree
= proto_item_add_subtree (ti
, ett_fcels_rec
);
1047 proto_tree_add_item (rec_tree
, hf_fcels_opcode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1050 proto_tree_add_string (rec_tree
, hf_fcels_nportid
, tvb
,
1052 tvb_fc_to_str (tvb
, offset
+5));
1053 proto_tree_add_item (rec_tree
, hf_fcels_oxid
, tvb
,
1054 offset
+8, 2, ENC_BIG_ENDIAN
);
1055 proto_tree_add_item (rec_tree
, hf_fcels_rxid
, tvb
,
1056 offset
+10, 2, ENC_BIG_ENDIAN
);
1058 proto_tree_add_item (rec_tree
, hf_fcels_oxid
, tvb
,
1059 offset
+4, 2, ENC_BIG_ENDIAN
);
1060 proto_tree_add_item (rec_tree
, hf_fcels_rxid
, tvb
,
1061 offset
+6, 2, ENC_BIG_ENDIAN
);
1062 proto_tree_add_string (rec_tree
, hf_fcels_nportid
, tvb
,
1064 tvb_fc_to_str (tvb
, offset
+9));
1065 proto_tree_add_string (rec_tree
, hf_fcels_resportid
, tvb
,
1067 tvb_fc_to_str (tvb
, offset
+13));
1068 proto_tree_add_item (rec_tree
, hf_fcels_rec_fc4
, tvb
,
1069 offset
+16, 4, ENC_BIG_ENDIAN
);
1070 proto_tree_add_bitmask (rec_tree
, tvb
, offset
+20, hf_fcels_estat
,
1071 ett_fcels_estat
, hf_fcels_estat_fields
,
1078 dissect_fcels_pdisc (tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
1079 guint8 isreq _U_
, proto_item
*ti
)
1081 dissect_fcels_logi (tvb
, pinfo
, tree
, ti
, FC_ELS_PDISC
);
1085 dissect_fcels_fdisc (tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
1086 guint8 isreq _U_
, proto_item
*ti
)
1088 dissect_fcels_logi (tvb
, pinfo
, tree
, ti
, FC_ELS_FDISC
);
1092 dissect_fcels_adisc (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1093 guint8 isreq _U_
, proto_item
*ti
)
1095 /* Set up structures needed to add the protocol subtree and manage it */
1097 proto_tree
*adisc_tree
;
1100 adisc_tree
= proto_item_add_subtree (ti
, ett_fcels_adisc
);
1102 proto_tree_add_item (adisc_tree
, hf_fcels_opcode
, tvb
, offset
-5, 1, ENC_BIG_ENDIAN
);
1104 proto_tree_add_string (adisc_tree
, hf_fcels_hardaddr
, tvb
, offset
, 3,
1105 tvb_fc_to_str (tvb
, offset
));
1106 proto_tree_add_string (adisc_tree
, hf_fcels_npname
, tvb
, offset
+3, 8,
1107 tvb_fcwwn_to_str (tvb
, offset
+3));
1108 proto_tree_add_string (adisc_tree
, hf_fcels_fnname
, tvb
, offset
+11, 8,
1109 tvb_fcwwn_to_str (tvb
, offset
+11));
1110 proto_tree_add_string (adisc_tree
, hf_fcels_nportid
, tvb
, offset
+20, 3,
1111 tvb_fc_to_str (tvb
, offset
+20));
1117 dissect_fcels_farp (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1121 proto_tree
*farp_tree
;
1124 farp_tree
= proto_item_add_subtree (ti
, ett_fcels_farp
);
1126 proto_tree_add_item (farp_tree
, hf_fcels_opcode
, tvb
, offset
-4, 1, ENC_BIG_ENDIAN
);
1128 proto_tree_add_item (farp_tree
, hf_fcels_farp_matchcodept
,
1129 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1130 proto_tree_add_string (farp_tree
, hf_fcels_nportid
, tvb
, offset
+1,
1131 3, tvb_fc_to_str (tvb
, offset
+1));
1132 proto_tree_add_item (farp_tree
, hf_fcels_farp_respaction
, tvb
,
1133 offset
+4, 1, ENC_BIG_ENDIAN
);
1134 proto_tree_add_string (farp_tree
, hf_fcels_resportid
, tvb
, offset
+5,
1135 3, tvb_fc_to_str (tvb
, offset
+5));
1136 proto_tree_add_string (farp_tree
, hf_fcels_npname
, tvb
, offset
+8,
1137 8, tvb_fcwwn_to_str (tvb
, offset
+8));
1138 proto_tree_add_string (farp_tree
, hf_fcels_fnname
, tvb
, offset
+16,
1139 8, tvb_fcwwn_to_str (tvb
, offset
+16));
1140 proto_tree_add_string (farp_tree
, hf_fcels_respname
, tvb
, offset
+24,
1141 8, tvb_fcwwn_to_str (tvb
, offset
+24));
1142 proto_tree_add_string (farp_tree
, hf_fcels_respnname
, tvb
, offset
+32,
1143 8, tvb_fcwwn_to_str (tvb
, offset
+32));
1144 proto_tree_add_item (farp_tree
, hf_fcels_reqipaddr
, tvb
, offset
+40,
1146 proto_tree_add_item (farp_tree
, hf_fcels_respipaddr
, tvb
, offset
+56,
1152 dissect_fcels_farp_req (tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
1153 guint8 isreq _U_
, proto_item
*ti
)
1155 dissect_fcels_farp (tvb
, pinfo
, tree
, ti
);
1159 dissect_fcels_farp_rply (tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
1160 guint8 isreq _U_
, proto_item
*ti
)
1162 dissect_fcels_farp (tvb
, pinfo
, tree
, ti
);
1166 dissect_fcels_rps (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1167 guint8 isreq
, proto_item
*ti
)
1169 /* Set up structures needed to add the protocol subtree and manage it */
1172 proto_tree
*rps_tree
;
1174 flag
= tvb_get_guint8 (tvb
, offset
);
1177 rps_tree
= proto_item_add_subtree (ti
, ett_fcels_rps
);
1180 proto_tree_add_item (rps_tree
, hf_fcels_rps_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1182 proto_tree_add_item (rps_tree
, hf_fcels_opcode
, tvb
, offset
-3, 1, ENC_BIG_ENDIAN
);
1185 proto_tree_add_string (rps_tree
, hf_fcels_npname
, tvb
, offset
+1,
1186 8, tvb_fcwwn_to_str (tvb
, offset
+1));
1188 else if (flag
& 0x1) {
1189 proto_tree_add_item (rps_tree
, hf_fcels_rps_portnum
, tvb
,
1190 offset
+5, 3, ENC_BIG_ENDIAN
);
1194 proto_tree_add_item (rps_tree
, hf_fcels_rps_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1195 proto_tree_add_item (rps_tree
, hf_fcels_rps_portstatus
, tvb
,
1196 offset
+3, 2, ENC_BIG_ENDIAN
);
1197 /* Next 6 fields are from Link Error Status Block (LESB) */
1198 proto_tree_add_text (rps_tree
, tvb
, offset
+5, 4,
1199 "Link Failure Count: %u",
1200 tvb_get_ntohl (tvb
, offset
+5));
1201 proto_tree_add_text (rps_tree
, tvb
, offset
+9, 4,
1202 "Loss of Sync Count: %u",
1203 tvb_get_ntohl (tvb
, offset
+9));
1204 proto_tree_add_text (rps_tree
, tvb
, offset
+13, 4,
1205 "Loss of Signal Count: %u",
1206 tvb_get_ntohl (tvb
, offset
+13));
1207 proto_tree_add_text (rps_tree
, tvb
, offset
+17, 4,
1208 "Primitive Seq Protocol Err: %u",
1209 tvb_get_ntohl (tvb
, offset
+17));
1210 proto_tree_add_text (rps_tree
, tvb
, offset
+21, 4,
1211 "Invalid Xmission Word: %u",
1212 tvb_get_ntohl (tvb
, offset
+21));
1213 proto_tree_add_text (rps_tree
, tvb
, offset
+25, 4,
1214 "Invalid CRC Count: %u",
1215 tvb_get_ntohl (tvb
, offset
+25));
1217 /* Next 6 fields are from L_Port Extension field */
1218 proto_tree_add_text (rps_tree
, tvb
, offset
+31, 2,
1219 "L_Port Status: 0x%x",
1220 tvb_get_ntohs (tvb
, offset
+31));
1221 proto_tree_add_text (rps_tree
, tvb
, offset
+36, 1,
1223 tvb_get_guint8 (tvb
, offset
+36));
1224 proto_tree_add_text (rps_tree
, tvb
, offset
+37, 4,
1225 "LIP F7 Initiated Count: %u",
1226 tvb_get_ntohl (tvb
, offset
+37));
1227 proto_tree_add_text (rps_tree
, tvb
, offset
+41, 4,
1228 "LIP F7 Received Count: %u",
1229 tvb_get_ntohl (tvb
, offset
+41));
1230 proto_tree_add_text (rps_tree
, tvb
, offset
+45, 4,
1231 "LIP F8 Initiated Count: %u",
1232 tvb_get_ntohl (tvb
, offset
+45));
1233 proto_tree_add_text (rps_tree
, tvb
, offset
+49, 4,
1234 "LIP F8 Received Count: %u",
1235 tvb_get_ntohl (tvb
, offset
+49));
1236 proto_tree_add_text (rps_tree
, tvb
, offset
+53, 4,
1237 "LIP Reset Initiated Count: %u",
1238 tvb_get_ntohl (tvb
, offset
+53));
1239 proto_tree_add_text (rps_tree
, tvb
, offset
+57, 4,
1240 "LIP Reset Received Count: %u",
1241 tvb_get_ntohl (tvb
, offset
+57));
1248 dissect_fcels_rpl (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1249 guint8 isreq
, proto_item
*ti
)
1251 /* Set up structures needed to add the protocol subtree and manage it */
1253 proto_tree
*rpl_tree
, *pb_tree
;
1258 rpl_tree
= proto_item_add_subtree (ti
, ett_fcels_rpl
);
1260 proto_tree_add_item (rpl_tree
, hf_fcels_opcode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1263 proto_tree_add_text (rpl_tree
, tvb
, offset
+6, 2,
1265 tvb_get_ntohs (tvb
, offset
+6));
1266 proto_tree_add_text (rpl_tree
, tvb
, offset
+9, 3,
1268 tvb_get_ntoh24 (tvb
, offset
+9));
1271 /* Reply consists of a header and a number of port blocks */
1272 proto_tree_add_text (rpl_tree
, tvb
, offset
+2, 2,
1273 "Payload Length: %u",
1274 tvb_get_ntohs (tvb
, offset
+2));
1275 proto_tree_add_text (rpl_tree
, tvb
, offset
+5, 3,
1277 tvb_get_ntoh24 (tvb
, offset
+5));
1278 proto_tree_add_text (rpl_tree
, tvb
, offset
+9, 3,
1279 "Index of I Port Block: %u",
1280 tvb_get_ntoh24 (tvb
, offset
+9));
1282 /* The following loop is for dissecting the port blocks */
1283 for (loop
= tvb_get_ntoh24 (tvb
, 5); loop
> 0; loop
--) {
1284 subti
= proto_tree_add_text (rpl_tree
, tvb
, offset
+12, 16,
1285 "Port Block %u", loop
);
1286 pb_tree
= proto_item_add_subtree (subti
, ett_fcels_rplpb
);
1288 proto_tree_add_text (pb_tree
, tvb
, offset
, 4,
1289 "Physical Port #: %u",
1290 tvb_get_ntohl (tvb
, offset
));
1291 proto_tree_add_text (pb_tree
, tvb
, offset
+5, 3,
1292 "Port Identifier: %s",
1293 tvb_fc_to_str (tvb
, offset
+5));
1294 proto_tree_add_text (pb_tree
, tvb
, offset
+8, 8,
1296 tvb_fcwwn_to_str (tvb
, offset
+8));
1304 dissect_fcels_fan (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1305 guint8 isreq _U_
, proto_item
*ti
)
1307 /* Set up structures needed to add the protocol subtree and manage it */
1309 proto_tree
*fan_tree
;
1312 fan_tree
= proto_item_add_subtree (ti
, ett_fcels_fan
);
1314 proto_tree_add_item (fan_tree
, hf_fcels_opcode
, tvb
, offset
-5, 1, ENC_BIG_ENDIAN
);
1316 proto_tree_add_string (fan_tree
, hf_fcels_fabricaddr
, tvb
, offset
, 3,
1317 tvb_fc_to_str (tvb
, offset
));
1318 proto_tree_add_string (fan_tree
, hf_fcels_fabricpname
, tvb
, offset
+3,
1319 8, tvb_fcwwn_to_str (tvb
, offset
));
1320 proto_tree_add_string (fan_tree
, hf_fcels_fnname
, tvb
, offset
+11, 8,
1321 tvb_fcwwn_to_str (tvb
, offset
+11));
1326 dissect_fcels_rscn (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1327 guint8 isreq
, proto_item
*ti
)
1329 /* Set up structures needed to add the protocol subtree and manage it */
1331 proto_tree
*rscn_tree
, *rectree
;
1333 int numrec
, plen
, i
;
1336 rscn_tree
= proto_item_add_subtree (ti
, ett_fcels_rscn
);
1338 proto_tree_add_item (rscn_tree
, hf_fcels_opcode
, tvb
, offset
-1, 1, ENC_BIG_ENDIAN
);
1342 proto_tree_add_text (rscn_tree
, tvb
, offset
, 1,
1343 "Page Len: %u", tvb_get_guint8 (tvb
, offset
));
1344 plen
= tvb_get_ntohs (tvb
, offset
+1);
1345 proto_tree_add_text (rscn_tree
, tvb
, offset
+1, 2,
1346 "Payload Len: %u", plen
);
1347 numrec
= (plen
- 4)/4;
1350 for (i
= 0; i
< numrec
; i
++) {
1351 subti
= proto_tree_add_text (rscn_tree
, tvb
, offset
, 4,
1352 "Affected N_Port Page %u", i
);
1353 rectree
= proto_item_add_subtree (subti
, ett_fcels_rscn_rec
);
1355 proto_tree_add_item (rectree
, hf_fcels_rscn_evqual
, tvb
, offset
,
1357 proto_tree_add_item (rectree
, hf_fcels_rscn_addrfmt
, tvb
, offset
,
1359 proto_tree_add_item (rectree
, hf_fcels_rscn_domain
, tvb
, offset
+1,
1361 proto_tree_add_item (rectree
, hf_fcels_rscn_area
, tvb
, offset
+2,
1363 proto_tree_add_item (rectree
, hf_fcels_rscn_port
, tvb
, offset
+3,
1371 dissect_fcels_scr (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1372 guint8 isreq
, proto_item
*ti
)
1374 /* Set up structures needed to add the protocol subtree and manage it */
1376 proto_tree
*scr_tree
;
1379 scr_tree
= proto_item_add_subtree (ti
, ett_fcels_scr
);
1380 proto_tree_add_item (scr_tree
, hf_fcels_opcode
, tvb
, offset
-7, 1, ENC_BIG_ENDIAN
);
1382 proto_tree_add_item (scr_tree
, hf_fcels_scrregn
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1387 dissect_fcels_rnft (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1388 guint8 isreq
, proto_item
*ti
)
1392 proto_tree
*rnft_tree
, *fc4_tree
;
1396 rnft_tree
= proto_item_add_subtree (ti
, ett_fcels_rnft
);
1398 proto_tree_add_item (rnft_tree
, hf_fcels_opcode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1401 proto_tree_add_text (rnft_tree
, tvb
, offset
+2, 2,
1402 "Max Size: %u", tvb_get_ntohs (tvb
, offset
+2));
1403 proto_tree_add_text (rnft_tree
, tvb
, offset
+7, 1,
1404 "Index: %u", tvb_get_guint8 (tvb
, offset
+7));
1407 proto_tree_add_text (rnft_tree
, tvb
, offset
+2, 2,
1409 tvb_get_ntohs (tvb
, offset
+2));
1410 numrec
= tvb_get_guint8 (tvb
, offset
+5);
1411 proto_tree_add_text (rnft_tree
, tvb
, offset
+5, 1,
1412 "List Length: %u", numrec
);
1413 proto_tree_add_text (rnft_tree
, tvb
, offset
+7, 1,
1414 "Index of First Rec in List: %u",
1415 tvb_get_guint8 (tvb
, offset
+7));
1417 for (i
= 0; i
< numrec
; i
++) {
1418 subti
= proto_tree_add_text (rnft_tree
, tvb
, offset
, 4,
1419 "FC-4 Entry #%u", i
);
1420 fc4_tree
= proto_item_add_subtree (subti
, ett_fcels_rnft_fc4
);
1422 proto_tree_add_item (fc4_tree
, hf_fcels_rnft_fc4type
, tvb
,
1423 offset
, 1, ENC_BIG_ENDIAN
);
1424 proto_tree_add_text (fc4_tree
, tvb
, offset
+1, 3,
1425 "FC-4 Qualifier 0x%x",
1426 tvb_get_ntoh24 (tvb
, offset
+1));
1434 dissect_fcels_lsts (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1435 guint8 isreq
, proto_item
*ti
)
1437 /* Set up structures needed to add the protocol subtree and manage it */
1439 proto_tree
*lsts_tree
;
1442 lsts_tree
= proto_item_add_subtree (ti
, ett_fcels_lsts
);
1444 proto_tree_add_item (lsts_tree
, hf_fcels_opcode
, tvb
, offset
-5, 1, ENC_BIG_ENDIAN
);
1446 /* In case of LSTS, the reply has the meat */
1449 proto_tree_add_item (lsts_tree
, hf_fcels_failedrcvr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1450 proto_tree_add_item (lsts_tree
, hf_fcels_flacompliance
, tvb
, offset
+1,
1452 proto_tree_add_item (lsts_tree
, hf_fcels_loopstate
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
1453 proto_tree_add_item (lsts_tree
, hf_fcels_publicloop_bmap
, tvb
, offset
+3,
1455 proto_tree_add_item (lsts_tree
, hf_fcels_pvtloop_bmap
, tvb
, offset
+19,
1457 proto_tree_add_item (lsts_tree
, hf_fcels_alpa_map
, tvb
, offset
+35,
1462 /* Maximum length of possible string from, dissect_fcels_prlilo_payload
1463 * 119 bytes, FIX possible buffer overflow */
1464 #define FCELS_PRLILO_MAXSTRINGLEN 256
1467 dissect_fcels_prlilo_payload (tvbuff_t
*tvb
, packet_info
*pinfo _U_
,
1468 guint8 isreq
, proto_item
*ti
, guint8 opcode
)
1472 proto_tree
*prli_tree
, *svcpg_tree
;
1473 int num_svcpg
, payload_len
, i
, flag
;
1476 /* We're assuming that we're invoked only if tree is not NULL i.e.
1477 * we don't do the usual "if (tree)" check here, the caller must.
1479 prli_tree
= proto_item_add_subtree (ti
, ett_fcels_prli
);
1481 proto_tree_add_item (prli_tree
, hf_fcels_opcode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1483 proto_tree_add_text (prli_tree
, tvb
, offset
+1, 1,
1485 tvb_get_guint8 (tvb
, offset
+1));
1486 payload_len
= tvb_get_ntohs (tvb
, offset
+2);
1487 proto_tree_add_text (prli_tree
, tvb
, offset
+2, 2,
1488 "Payload Length: %u", payload_len
);
1489 num_svcpg
= payload_len
/16;
1492 for (i
= 0; i
< num_svcpg
; i
++) {
1493 subti
= proto_tree_add_text (prli_tree
, tvb
, offset
, 16,
1494 "Service Parameter Page %u", i
);
1495 svcpg_tree
= proto_item_add_subtree (subti
, ett_fcels_prli_svcpg
);
1497 type
= tvb_get_guint8 (tvb
, offset
);
1498 proto_tree_add_text (svcpg_tree
, tvb
, offset
, 1,
1501 fc_prli_fc4_val
, "0x%x"));
1502 proto_tree_add_text (svcpg_tree
, tvb
, offset
+1, 1,
1503 "TYPE Code Extension: %u",
1504 tvb_get_guint8 (tvb
, offset
+1));
1506 flag
= tvb_get_guint8 (tvb
, offset
+2);
1507 dissect_prlilo_flags (svcpg_tree
, tvb
, offset
+2, flag
, opcode
);
1509 if (!isreq
&& (opcode
!= FC_ELS_TPRLO
)) {
1510 /* This is valid only for ACC */
1511 proto_tree_add_text (svcpg_tree
, tvb
, offset
+2, 1,
1512 "Response Code: 0x%x",
1513 (tvb_get_guint8 (tvb
, offset
+2) & 0x0F));
1515 if (opcode
!= FC_ELS_TPRLO
) {
1516 proto_tree_add_text (svcpg_tree
, tvb
, offset
+4, 4,
1517 "Originator PA: 0x%x",
1518 tvb_get_ntohl (tvb
, offset
+4));
1521 proto_tree_add_text (svcpg_tree
, tvb
, offset
+4, 4,
1522 "3rd Party Originator PA: 0x%x",
1523 tvb_get_ntohl (tvb
, offset
+4));
1525 proto_tree_add_text (svcpg_tree
, tvb
, offset
+8, 4,
1526 "Responder PA: 0x%x",
1527 tvb_get_ntohl (tvb
, offset
+8));
1529 if (type
== FC_TYPE_SCSI
) {
1530 flag
= tvb_get_ntohs (tvb
, offset
+14);
1531 dissect_fcp_flags (svcpg_tree
, tvb
, offset
+12, flag
, isreq
);
1533 else if ((opcode
== FC_ELS_PRLI
) && !isreq
) {
1534 proto_tree_add_text (svcpg_tree
, tvb
, offset
+12, 4,
1535 "Service Parameter Response: 0x%x",
1536 tvb_get_ntohl (tvb
, offset
+12));
1538 else if (opcode
== FC_ELS_TPRLO
) {
1539 proto_tree_add_text (svcpg_tree
, tvb
, offset
+13, 3,
1540 "3rd Party N_Port Id: %s",
1541 tvb_fc_to_str (tvb
, offset
+13));
1547 dissect_fcels_prli (tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
1548 guint8 isreq
, proto_item
*ti
)
1551 dissect_fcels_prlilo_payload (tvb
, pinfo
, isreq
, ti
, FC_ELS_PRLI
);
1556 dissect_fcels_prlo (tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
1557 guint8 isreq
, proto_item
*ti
)
1559 /* Set up structures needed to add the protocol subtree and manage it */
1561 dissect_fcels_prlilo_payload (tvb
, pinfo
, isreq
, ti
, FC_ELS_PRLO
);
1566 dissect_fcels_tprlo (tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
1567 guint8 isreq
, proto_item
*ti
)
1569 /* Set up structures needed to add the protocol subtree and manage it */
1572 dissect_fcels_prlilo_payload (tvb
, pinfo
, isreq
, ti
, FC_ELS_TPRLO
);
1577 dissect_fcels_lirr (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1578 guint8 isreq _U_
, proto_item
*ti
)
1580 /* Set up structures needed to add the protocol subtree and manage it */
1582 proto_tree
*lirr_tree
;
1586 lirr_tree
= proto_item_add_subtree (ti
, ett_fcels_lirr
);
1588 proto_tree_add_item (lirr_tree
, hf_fcels_opcode
, tvb
, offset
-4, 1, ENC_BIG_ENDIAN
);
1590 proto_tree_add_text (lirr_tree
, tvb
, offset
, 1,
1591 "Regn. Function: %s",
1592 val_to_str (tvb_get_guint8 (tvb
, offset
),
1593 fc_els_lirr_regfunc_val
,
1594 "Reserved (0x%x)"));
1595 lirr_fmt
= tvb_get_guint8 (tvb
, offset
+1);
1597 /* This scheme is resorted to because the value 0 has a string in
1598 * the value_string that is not what we want displayed here.
1600 proto_tree_add_text (lirr_tree
, tvb
, offset
, 1,
1601 "Regn. Format: Common Format");
1604 proto_tree_add_text (lirr_tree
, tvb
, offset
, 1,
1606 val_to_str (lirr_fmt
, fc_fc4_val
, "0x%x"));
1612 dissect_fcels_srl (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1613 guint8 isreq
, proto_item
*ti
)
1615 /* Set up structures needed to add the protocol subtree and manage it */
1618 proto_tree
*srl_tree
;
1621 srl_tree
= proto_item_add_subtree (ti
, ett_fcels_srl
);
1623 proto_tree_add_item (srl_tree
, hf_fcels_opcode
, tvb
, offset
-4, 1, ENC_BIG_ENDIAN
);
1627 flag
= tvb_get_guint8 (tvb
, offset
);
1629 proto_tree_add_text (srl_tree
, tvb
, offset
, 1,
1630 "Flag: Scan only specified FL Port");
1633 proto_tree_add_text (srl_tree
, tvb
, offset
, 1,
1634 "Flag: Scan all loops in domain");
1636 proto_tree_add_text (srl_tree
, tvb
, offset
+1, 3,
1638 tvb_fc_to_str (tvb
, offset
+1));
1643 dissect_fcels_rpsc (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1644 guint8 isreq
, proto_item
*ti
)
1646 /* Set up structures needed to add the protocol subtree and manage it */
1648 int num_entries
, i
, cap
;
1649 proto_tree
*rpsc_tree
;
1652 rpsc_tree
= proto_item_add_subtree (ti
, ett_fcels_rpsc
);
1654 proto_tree_add_item (rpsc_tree
, hf_fcels_opcode
, tvb
, offset
-2, 1, ENC_BIG_ENDIAN
);
1658 num_entries
= tvb_get_ntohs (tvb
, offset
);
1659 proto_tree_add_text (rpsc_tree
, tvb
, offset
, 2,
1660 "Number of Entries: %u", num_entries
);
1662 for (i
= 0; i
< num_entries
; i
++) {
1663 cap
= tvb_get_ntohs (tvb
, offset
);
1664 dissect_speed_flags (rpsc_tree
, tvb
, offset
, cap
, i
);
1666 cap
= tvb_get_ntohs (tvb
, offset
+2);
1667 proto_tree_add_text (rpsc_tree
, tvb
, offset
+2, 2,
1668 "Port Oper Speed: %s",
1669 val_to_str (cap
, fc_els_portspeed_val
,
1677 dissect_fcels_cbind (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1681 proto_tree
*cbind_tree
=NULL
;
1684 cbind_tree
= proto_item_add_subtree (ti
, ett_fcels_cbind
);
1686 proto_tree_add_item (cbind_tree
, hf_fcels_opcode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1688 col_set_str(pinfo
->cinfo
, COL_INFO
, "CBIND ");
1690 proto_tree_add_item (cbind_tree
, hf_fcels_cbind_liveness
, tvb
, offset
+4, 2, ENC_BIG_ENDIAN
);
1691 proto_tree_add_item (cbind_tree
, hf_fcels_cbind_addr_mode
, tvb
, offset
+6, 1, ENC_BIG_ENDIAN
);
1692 proto_tree_add_item (cbind_tree
, hf_fcels_cbind_ifcp_version
, tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
1693 proto_tree_add_item (cbind_tree
, hf_fcels_cbind_userinfo
, tvb
, offset
+8, 4, ENC_BIG_ENDIAN
);
1695 proto_tree_add_string (cbind_tree
, hf_fcels_cbind_snpname
, tvb
, offset
+12, 8,
1696 tvb_fcwwn_to_str (tvb
, offset
+12));
1697 proto_tree_add_string (cbind_tree
, hf_fcels_cbind_dnpname
, tvb
, offset
+20, 8,
1698 tvb_fcwwn_to_str (tvb
, offset
+20));
1700 switch(tvb_reported_length(tvb
)){
1701 case 32: /* 28 byte Request + 4 bytes FC CRC */
1702 col_append_str (pinfo
->cinfo
, COL_INFO
, "Request");
1704 case 40: /* 36 byte Response + 4 bytes FC CRC */
1705 col_append_str (pinfo
->cinfo
, COL_INFO
, "Response");
1706 proto_tree_add_item (cbind_tree
, hf_fcels_cbind_status
, tvb
, offset
+30, 2, ENC_BIG_ENDIAN
);
1707 proto_tree_add_item (cbind_tree
, hf_fcels_chandle
, tvb
, offset
+34, 2, ENC_BIG_ENDIAN
);
1714 dissect_fcels_unbind (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1718 proto_tree
*cbind_tree
=NULL
;
1721 cbind_tree
= proto_item_add_subtree (ti
, ett_fcels_cbind
);
1723 proto_tree_add_item (cbind_tree
, hf_fcels_opcode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1725 col_set_str(pinfo
->cinfo
, COL_INFO
, "UNBIND ");
1727 proto_tree_add_item (cbind_tree
, hf_fcels_cbind_userinfo
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
1728 proto_tree_add_item (cbind_tree
, hf_fcels_chandle
, tvb
, offset
+10, 2, ENC_BIG_ENDIAN
);
1731 switch(tvb_reported_length(tvb
)){
1732 case 24: /* 20 byte Request + 4 bytes FC CRC */
1733 col_append_str (pinfo
->cinfo
, COL_INFO
, "Request");
1735 case 28: /* 24 byte Response + 4 bytes FC CRC */
1736 col_append_str (pinfo
->cinfo
, COL_INFO
, "Response");
1737 proto_tree_add_item (cbind_tree
, hf_fcels_unbind_status
, tvb
, offset
+22, 2, ENC_BIG_ENDIAN
);
1744 dissect_fcels_rnid (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1745 guint8 isreq
, proto_item
*ti
)
1747 /* Set up structures needed to add the protocol subtree and manage it */
1750 proto_tree
*rnid_tree
;
1753 rnid_tree
= proto_item_add_subtree (ti
, ett_fcels_rnid
);
1755 proto_tree_add_item (rnid_tree
, hf_fcels_opcode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1757 proto_tree_add_item (rnid_tree
, hf_fcels_nodeidfmt
, tvb
, offset
+4,
1761 /* We only decode responses to nodeid fmt DF */
1762 proto_tree_add_item (rnid_tree
, hf_fcels_nodeidfmt
, tvb
, offset
+4,
1764 clen
= tvb_get_guint8 (tvb
, offset
+5);
1765 proto_tree_add_text (rnid_tree
, tvb
, offset
+5, 1,
1766 "Common Identification Data Length: %u", clen
);
1767 proto_tree_add_item (rnid_tree
, hf_fcels_spidlen
, tvb
, offset
+7,
1770 proto_tree_add_string (rnid_tree
, hf_fcels_npname
, tvb
,
1772 tvb_fcwwn_to_str (tvb
, offset
+8));
1773 proto_tree_add_string (rnid_tree
, hf_fcels_fnname
, tvb
,
1775 tvb_fcwwn_to_str (tvb
, offset
+16));
1777 if (tvb_get_guint8 (tvb
, offset
+4) == 0xDF) {
1778 /* Decode the Specific Node ID Format as this is known */
1779 proto_tree_add_item (rnid_tree
, hf_fcels_vendoruniq
, tvb
,
1780 offset
+24, 16, ENC_NA
);
1781 proto_tree_add_item (rnid_tree
, hf_fcels_asstype
, tvb
,
1782 offset
+40, 4, ENC_BIG_ENDIAN
);
1783 proto_tree_add_item (rnid_tree
, hf_fcels_physport
, tvb
,
1784 offset
+44, 4, ENC_BIG_ENDIAN
);
1785 proto_tree_add_item (rnid_tree
, hf_fcels_attnodes
, tvb
,
1786 offset
+48, 4, ENC_BIG_ENDIAN
);
1787 proto_tree_add_item (rnid_tree
, hf_fcels_nodemgmt
, tvb
,
1788 offset
+52, 1, ENC_BIG_ENDIAN
);
1789 proto_tree_add_item (rnid_tree
, hf_fcels_ipvers
, tvb
,
1790 offset
+53, 1, ENC_BIG_ENDIAN
);
1791 proto_tree_add_item (rnid_tree
, hf_fcels_tcpport
, tvb
,
1792 offset
+54, 2, ENC_BIG_ENDIAN
);
1793 proto_tree_add_item (rnid_tree
, hf_fcels_ip
, tvb
, offset
+56,
1795 proto_tree_add_item (rnid_tree
, hf_fcels_vendorsp
, tvb
,
1796 offset
+74, 2, ENC_BIG_ENDIAN
);
1803 dissect_fcels_rlir (tvbuff_t
*tvb _U_
, packet_info
*pinfo _U_
,
1804 proto_tree
*tree
, guint8 isreq _U_
,
1807 /* Set up structures needed to add the protocol subtree and manage it */
1814 dissect_fcels_lsrjt (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1815 guint8 isreq _U_
, proto_item
*ti
)
1817 /* Set up structures needed to add the protocol subtree and manage it */
1819 proto_tree
*lsrjt_tree
;
1822 lsrjt_tree
= proto_item_add_subtree (ti
, ett_fcels_lsrjt
);
1824 proto_tree_add_item (lsrjt_tree
, hf_fcels_opcode
, tvb
, offset
-5, 1, ENC_BIG_ENDIAN
);
1826 proto_tree_add_item (lsrjt_tree
, hf_fcels_rjtcode
, tvb
, offset
++, 1, ENC_BIG_ENDIAN
);
1827 proto_tree_add_item (lsrjt_tree
, hf_fcels_rjtdetcode
, tvb
, offset
++, 1, ENC_BIG_ENDIAN
);
1828 proto_tree_add_item (lsrjt_tree
, hf_fcels_vnduniq
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1833 dissect_fcels (tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
1836 /* Set up structures needed to add the protocol subtree and manage it */
1837 proto_item
*ti
= NULL
;
1838 proto_tree
*acc_tree
;
1839 guint8 isreq
= FC_ELS_REQ
;
1843 conversation_t
*conversation
;
1844 fcels_conv_data_t
*cdata
;
1845 fcels_conv_key_t ckey
, *req_key
;
1850 /* Make entries in Protocol column and Info column on summary display */
1851 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "FC ELS");
1853 /* decoding of this is done by each individual opcode handler */
1854 opcode
= tvb_get_guint8 (tvb
, 0);
1857 ti
= proto_tree_add_protocol_format (tree
, proto_fcels
, tvb
, 0,
1858 tvb_length (tvb
), "FC ELS");
1861 /* Register conversation in case this is not a response */
1862 if ((opcode
!= FC_ELS_LSRJT
) && (opcode
!= FC_ELS_ACC
)) {
1863 if (opcode
== FC_ELS_FLOGI
) {
1864 const guint8
*srcfc
;
1866 /* Check that the source address is, in fact, an FC address */
1867 if (pinfo
->src
.type
!= AT_FC
) {
1868 expert_add_info_format(pinfo
, ti
, &ei_fcels_src_unknown
,
1869 "Unknown source address type: %u",
1874 srcfc
= (guint8
*)pinfo
->src
.data
;
1876 /* If it is a loop port, we'll need to remember the ALPA */
1880 options
= NO_PORT2
| NO_ADDR2
;
1886 conversation
= find_conversation (pinfo
->fd
->num
, &pinfo
->dst
, &pinfo
->src
,
1887 pinfo
->ptype
, pinfo
->oxid
,
1888 pinfo
->rxid
, options
);
1890 if (!conversation
) {
1891 conversation
= conversation_new (pinfo
->fd
->num
, &pinfo
->dst
, &pinfo
->src
,
1892 pinfo
->ptype
, pinfo
->oxid
,
1893 pinfo
->rxid
, options
);
1896 ckey
.conv_idx
= conversation
->index
;
1898 cdata
= (fcels_conv_data_t
*)g_hash_table_lookup (fcels_req_hash
,
1901 /* Since we never free the memory used by an exchange, this maybe a
1902 * case of another request using the same exchange as a previous
1905 cdata
->opcode
= opcode
;
1908 req_key
= wmem_new(wmem_file_scope(), fcels_conv_key_t
);
1909 req_key
->conv_idx
= conversation
->index
;
1911 cdata
= wmem_new(wmem_file_scope(), fcels_conv_data_t
);
1912 cdata
->opcode
= opcode
;
1914 g_hash_table_insert (fcels_req_hash
, req_key
, cdata
);
1918 isreq
= FC_ELS_RPLY
;
1921 conversation
= find_conversation (pinfo
->fd
->num
, &pinfo
->dst
, &pinfo
->src
,
1922 pinfo
->ptype
, pinfo
->oxid
,
1923 pinfo
->rxid
, options
);
1924 if (!conversation
) {
1925 /* FLOGI has two ways to save state: without the src and using just
1926 * the port (ALPA) part of the address. Try both.
1928 const guint8
*dstfc
;
1930 /* Check that the source address is, in fact, an FC address */
1931 if (pinfo
->dst
.type
!= AT_FC
) {
1932 expert_add_info_format(pinfo
, ti
, &ei_fcels_dst_unknown
,
1933 "Unknown destination address type: %u",
1938 dstfc
= (guint8
*)pinfo
->dst
.data
;
1940 addrdata
[0] = addrdata
[1] = 0;
1941 addrdata
[2] = dstfc
[2];
1942 SET_ADDRESS (&dstaddr
, AT_FC
, 3, addrdata
);
1943 conversation
= find_conversation (pinfo
->fd
->num
, &dstaddr
, &pinfo
->src
,
1944 pinfo
->ptype
, pinfo
->oxid
,
1945 pinfo
->rxid
, options
);
1948 if (!conversation
) {
1949 /* Finally check for FLOGI with both NO_PORT2 and NO_ADDR2 set */
1950 options
= NO_ADDR2
| NO_PORT2
;
1951 conversation
= find_conversation (pinfo
->fd
->num
, &pinfo
->src
, &pinfo
->dst
,
1952 pinfo
->ptype
, pinfo
->oxid
,
1953 pinfo
->rxid
, options
);
1954 if (!conversation
) {
1955 if (tree
&& (opcode
== FC_ELS_ACC
)) {
1956 /* No record of what this accept is for. Can't decode */
1957 acc_tree
= proto_item_add_subtree (ti
, ett_fcels_acc
);
1958 proto_tree_add_text (acc_tree
, tvb
, offset
, tvb_length (tvb
),
1959 "No record of Exchange. Unable to decode ACC");
1967 ckey
.conv_idx
= conversation
->index
;
1969 cdata
= (fcels_conv_data_t
*)g_hash_table_lookup (fcels_req_hash
, &ckey
);
1971 if (cdata
!= NULL
) {
1972 if ((options
& NO_ADDR2
) && (cdata
->opcode
!= FC_ELS_FLOGI
)) {
1973 /* only FLOGI can have this special check */
1974 if (tree
&& (opcode
== FC_ELS_ACC
)) {
1975 /* No record of what this accept is for. Can't decode */
1976 acc_tree
= proto_item_add_subtree (ti
,
1978 proto_tree_add_text (acc_tree
, tvb
, offset
,
1980 "No record of Exchg. Unable to decode ACC");
1984 if (opcode
== FC_ELS_ACC
)
1985 opcode
= cdata
->opcode
;
1987 failed_opcode
= cdata
->opcode
;
1991 if ((cdata
== NULL
) && (opcode
!= FC_ELS_LSRJT
)) {
1992 /* No record of what this accept is for. Can't decode */
1993 acc_tree
= proto_item_add_subtree (ti
, ett_fcels_acc
);
1994 proto_tree_add_text (acc_tree
, tvb
, offset
, tvb_length (tvb
),
1995 "No record of ELS Req. Unable to decode ACC");
2002 if (isreq
== FC_ELS_REQ
) {
2003 col_add_str (pinfo
->cinfo
, COL_INFO
,
2004 val_to_str (opcode
, fc_els_proto_val
, "0x%x"));
2006 else if (opcode
== FC_ELS_LSRJT
) {
2007 col_add_fstr (pinfo
->cinfo
, COL_INFO
, "LS_RJT (%s)",
2008 val_to_str (failed_opcode
, fc_els_proto_val
, "0x%x"));
2011 col_add_fstr (pinfo
->cinfo
, COL_INFO
, "ACC (%s)",
2012 val_to_str (opcode
, fc_els_proto_val
, "0x%x"));
2017 dissect_fcels_lsrjt (tvb
, pinfo
, tree
, isreq
, ti
);
2020 dissect_fcels_plogi (tvb
, pinfo
, tree
, isreq
, ti
);
2023 dissect_fcels_flogi (tvb
, pinfo
, tree
, isreq
, ti
);
2026 dissect_fcels_logout (tvb
, pinfo
, tree
, isreq
, ti
);
2029 dissect_fcels_abtx (tvb
, pinfo
, tree
, isreq
, ti
);
2032 dissect_fcels_rsi (tvb
, pinfo
, tree
, isreq
, ti
);
2035 dissect_fcels_rrq (tvb
, pinfo
, tree
, isreq
, ti
);
2038 dissect_fcels_rec (tvb
, pinfo
, tree
, isreq
, ti
);
2041 dissect_fcels_prli (tvb
, pinfo
, tree
, isreq
, ti
);
2044 dissect_fcels_prlo (tvb
, pinfo
, tree
, isreq
, ti
);
2047 dissect_fcels_tprlo (tvb
, pinfo
, tree
, isreq
, ti
);
2050 dissect_fcels_pdisc (tvb
, pinfo
, tree
, isreq
, ti
);
2053 dissect_fcels_fdisc (tvb
, pinfo
, tree
, isreq
, ti
);
2056 dissect_fcels_adisc (tvb
, pinfo
, tree
, isreq
, ti
);
2058 case FC_ELS_FARP_REQ
:
2059 dissect_fcels_farp_req (tvb
, pinfo
, tree
, isreq
, ti
);
2061 case FC_ELS_FARP_RPLY
:
2062 dissect_fcels_farp_rply (tvb
, pinfo
, tree
, isreq
, ti
);
2065 dissect_fcels_rps (tvb
, pinfo
, tree
, isreq
, ti
);
2068 dissect_fcels_rpl (tvb
, pinfo
, tree
, isreq
, ti
);
2071 dissect_fcels_fan (tvb
, pinfo
, tree
, isreq
, ti
);
2074 dissect_fcels_rscn (tvb
, pinfo
, tree
, isreq
, ti
);
2077 dissect_fcels_scr (tvb
, pinfo
, tree
, isreq
, ti
);
2080 dissect_fcels_rnft (tvb
, pinfo
, tree
, isreq
, ti
);
2083 dissect_fcels_lsts (tvb
, pinfo
, tree
, isreq
, ti
);
2086 dissect_fcels_rnid (tvb
, pinfo
, tree
, isreq
, ti
);
2089 dissect_fcels_rlir (tvb
, pinfo
, tree
, isreq
, ti
);
2092 dissect_fcels_lirr (tvb
, pinfo
, tree
, isreq
, ti
);
2095 dissect_fcels_srl (tvb
, pinfo
, tree
, isreq
, ti
);
2098 dissect_fcels_rpsc (tvb
, pinfo
, tree
, isreq
, ti
);
2101 if (isreq
&& fcsp_handle
)
2102 call_dissector (fcsp_handle
, tvb
, pinfo
, tree
);
2105 dissect_fcels_cbind (tvb
, pinfo
, tree
, ti
);
2108 dissect_fcels_unbind (tvb
, pinfo
, tree
, ti
);
2111 /* proto_tree_add_text ( */
2112 call_dissector (data_handle
, tvb
, pinfo
, tree
);
2118 proto_register_fcels (void)
2120 static hf_register_info hf
[] = {
2122 {"Cmd Code", "fcels.opcode", FT_UINT8
, BASE_HEX
,
2123 VALS (fc_els_proto_val
), 0x0, NULL
, HFILL
}},
2124 { &hf_fcels_rjtcode
,
2125 {"Reason Code", "fcels.rjt.reason", FT_UINT8
, BASE_HEX
,
2126 VALS (fc_els_rjt_val
), 0x0, NULL
, HFILL
}},
2127 { &hf_fcels_rjtdetcode
,
2128 {"Reason Explanation", "fcels.rjt.detail", FT_UINT8
, BASE_HEX
,
2129 VALS (fc_els_rjt_det_val
), 0x0, NULL
, HFILL
}},
2130 { &hf_fcels_vnduniq
,
2131 {"Vendor Unique", "fcels.rjt.vnduniq", FT_UINT8
, BASE_HEX
, NULL
,
2134 {"B2B Credit", "fcels.logi.b2b", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
,
2136 { &hf_fcels_cmnfeatures
,
2137 {"Common Svc Parameters", "fcels.logi.cmnfeatures", FT_UINT16
, BASE_HEX
, NULL
,
2139 { &hf_fcels_bbscnum
,
2140 {"BB_SC Number", "fcels.logi.bbscnum", FT_UINT8
, BASE_DEC
, NULL
, 0xF0, NULL
,
2142 { &hf_fcels_rcvsize
,
2143 {"Receive Size", "fcels.logi.rcvsize", FT_UINT16
, BASE_DEC
, NULL
, 0x0FFF, NULL
,
2145 { &hf_fcels_maxconseq
,
2146 {"Max Concurrent Seq", "fcels.logi.maxconseq", FT_UINT16
, BASE_DEC
, NULL
,
2148 { &hf_fcels_reloffset
,
2149 {"Relative Offset By Info Cat", "fcels.logi.reloff", FT_UINT16
, BASE_DEC
,
2150 NULL
, 0x0, NULL
, HFILL
}},
2152 {"E_D_TOV", "fcels.edtov", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
2154 {"N_Port Port_Name", "fcels.npname", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2157 {"Fabric/Node Name", "fcels.fnname", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2160 { &hf_fcels_cls1param
,
2161 {"Class 1 Svc Param", "fcels.logi.cls1param", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2163 { &hf_fcels_cls2param
,
2164 {"Class 2 Svc Param", "fcels.logi.cls2param", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2166 { &hf_fcels_cls3param
,
2167 {"Class 3 Svc Param", "fcels.logi.cls3param", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2169 { &hf_fcels_cls4param
,
2170 {"Class 4 Svc Param", "fcels.logi.cls4param", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2173 { &hf_fcels_vendorvers
,
2174 {"Vendor Version", "fcels.logi.vendvers", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
,
2176 { &hf_fcels_svcavail
,
2177 {"Services Availability", "fcels.logi.svcavail", FT_BYTES
, BASE_NONE
, NULL
,
2179 { &hf_fcels_clsflags
,
2180 {"Service Options", "fcels.logi.clsflags", FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
,
2182 { &hf_fcels_clsrcvsize
,
2183 {"Class Recv Size", "fcels.logi.clsrcvsize", FT_UINT16
, BASE_DEC
, NULL
,
2186 {"Total Concurrent Seq", "fcels.logi.totconseq", FT_UINT8
, BASE_DEC
, NULL
,
2189 {"End2End Credit", "fcels.logi.e2e", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
,
2191 { &hf_fcels_openseq
,
2192 {"Open Seq Per Exchg", "fcels.logi.openseq", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2194 { &hf_fcels_nportid
,
2195 {"Originator S_ID", "fcels.portid", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2198 {"OXID", "fcels.oxid", FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
2200 {"RXID", "fcels.rxid", FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
2201 { &hf_fcels_recovqual
,
2202 {"Recovery Qualifier", "fcels.rcovqual", FT_UINT8
, BASE_HEX
, NULL
,
2204 { &hf_fcels_fabricaddr
,
2205 {"Fabric Address", "fcels.faddr", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
,
2207 { &hf_fcels_fabricpname
,
2208 {"Fabric Port Name", "fcels.fpname", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2210 { &hf_fcels_failedrcvr
,
2211 {"Failed Receiver AL_PA", "fcels.faildrcvr", FT_UINT8
, BASE_HEX
, NULL
,
2213 { &hf_fcels_flacompliance
,
2214 {"FC-FLA Compliance", "fcels.flacompliance", FT_UINT8
, BASE_HEX
,
2215 VALS (fc_els_flacompliance_val
), 0x0, NULL
, HFILL
}},
2216 { &hf_fcels_loopstate
,
2217 {"Loop State", "fcels.loopstate", FT_UINT8
, BASE_HEX
,
2218 VALS (fc_els_loopstate_val
), 0x0, NULL
, HFILL
}},
2219 { &hf_fcels_publicloop_bmap
,
2220 {"Public Loop Device Bitmap", "fcels.pubdev_bmap", FT_BYTES
, BASE_NONE
,
2221 NULL
, 0x0, NULL
, HFILL
}},
2222 { &hf_fcels_pvtloop_bmap
,
2223 {"Private Loop Device Bitmap", "fcels.pvtdev_bmap", FT_BYTES
,
2224 BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
2225 { &hf_fcels_alpa_map
,
2226 {"AL_PA Map", "fcels.alpa", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
,
2228 { &hf_fcels_scrregn
,
2229 {"Registration Function", "fcels.scr.regn", FT_UINT8
, BASE_HEX
,
2230 VALS (fc_els_scr_reg_val
), 0x0, NULL
, HFILL
}},
2231 { &hf_fcels_farp_matchcodept
,
2232 {"Match Address Code Points", "fcels.matchcp", FT_UINT8
, BASE_DEC
,
2233 NULL
, 0x0, NULL
, HFILL
}},
2234 { &hf_fcels_farp_respaction
,
2235 {"Responder Action", "fcels.respaction", FT_UINT8
, BASE_HEX
,
2236 VALS (fc_els_farp_respaction_val
), 0x0, NULL
, HFILL
}},
2237 { &hf_fcels_resportid
,
2238 {"Responding Port ID", "fcels.resportid", FT_STRING
, BASE_NONE
,
2239 NULL
, 0x0, NULL
, HFILL
}},
2240 { &hf_fcels_respname
,
2241 {"Responding Port Name", "fcels.respname", FT_STRING
, BASE_NONE
,
2242 NULL
, 0x0, NULL
, HFILL
}},
2243 { &hf_fcels_respnname
,
2244 {"Responding Node Name", "fcels.respnname", FT_STRING
, BASE_NONE
,
2245 NULL
, 0x0, NULL
, HFILL
}},
2246 { &hf_fcels_reqipaddr
,
2247 {"Requesting IP Address", "fcels.reqipaddr", FT_IPv6
, BASE_NONE
,
2248 NULL
, 0x0, NULL
, HFILL
}},
2249 { &hf_fcels_respipaddr
,
2250 {"Responding IP Address", "fcels.respipaddr", FT_IPv6
, BASE_NONE
,
2251 NULL
, 0x0, NULL
, HFILL
}},
2252 { &hf_fcels_hardaddr
,
2253 {"Hard Address of Originator", "fcels.hrdaddr", FT_STRING
, BASE_NONE
,
2254 NULL
, 0x0, NULL
, HFILL
}},
2255 { &hf_fcels_rps_flag
,
2256 {"Flag", "fcels.flag", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
2257 { &hf_fcels_rps_portnum
,
2258 {"Physical Port Number", "fcels.portnum", FT_UINT32
, BASE_HEX
, NULL
,
2260 { &hf_fcels_rps_portstatus
,
2261 {"Port Status", "fcels.portstatus", FT_UINT16
, BASE_HEX
,
2262 VALS(fc_els_portstatus_val
), 0x0, NULL
, HFILL
}},
2263 { &hf_fcels_rnft_fc4type
,
2264 {"FC-4 Type", "fcels.rnft.fc4type", FT_UINT8
, BASE_HEX
,
2265 VALS (fc_fc4_val
), 0x0, NULL
, HFILL
}},
2266 { &hf_fcels_rscn_evqual
,
2267 {"Event Qualifier", "fcels.rscn.evqual", FT_UINT8
, BASE_HEX
,
2268 VALS (fc_els_rscn_evqual_val
), 0x3C, NULL
, HFILL
}},
2269 { &hf_fcels_rscn_addrfmt
,
2270 {"Address Format", "fcels.rscn.addrfmt", FT_UINT8
, BASE_HEX
,
2271 VALS (fc_els_rscn_addrfmt_val
), 0x03, NULL
, HFILL
}},
2272 { &hf_fcels_rscn_domain
,
2273 {"Affected Domain", "fcels.rscn.domain", FT_UINT8
, BASE_HEX
,
2274 NULL
, 0x0, NULL
, HFILL
}},
2275 { &hf_fcels_rscn_area
,
2276 {"Affected Area", "fcels.rscn.area", FT_UINT8
, BASE_HEX
,
2277 NULL
, 0x0, NULL
, HFILL
}},
2278 { &hf_fcels_rscn_port
,
2279 {"Affected Port", "fcels.rscn.port", FT_UINT8
, BASE_HEX
,
2280 NULL
, 0x0, NULL
, HFILL
}},
2281 { &hf_fcels_rec_fc4
,
2282 {"FC4 value", "fcels.rec.fc4value", FT_UINT32
, BASE_HEX
,
2283 NULL
, 0x0, NULL
, HFILL
}},
2285 {"Exchange Status", "fcels.estat", FT_UINT32
, BASE_HEX
,
2286 NULL
, 0x0, NULL
, HFILL
}},
2287 { &hf_fcels_estat_resp
,
2288 {"Sequence Responder", "fcels.estat.resp", FT_BOOLEAN
, 32,
2289 TFS(&tfs_fcels_estat_resp
),
2290 FC_ESB_ST_RESP
, "Seq responder?", HFILL
}},
2291 { &hf_fcels_estat_seq_init
,
2292 {"Sequence Initiative", "fcels.estat.seq_init", FT_BOOLEAN
, 32,
2293 TFS(&tfs_fcels_estat_seq_init
),
2294 FC_ESB_ST_SEQ_INIT
, "Responder has Sequence Initiative?", HFILL
}},
2295 { &hf_fcels_estat_compl
,
2296 {"Exchange Complete", "fcels.estat.complete", FT_BOOLEAN
, 32,
2297 TFS(&tfs_complete_incomplete
),
2298 FC_ESB_ST_COMPLETE
, "Exchange complete?", HFILL
}},
2299 { &hf_fcels_nodeidfmt
,
2300 {"Node Identification Format", "fcels.rnid.nodeidfmt", FT_UINT8
,
2301 BASE_HEX
, VALS (fc_els_nodeid_val
), 0x0, NULL
, HFILL
}},
2302 { &hf_fcels_spidlen
,
2303 {"Specific Id Length", "fcels.rnid.spidlen", FT_UINT8
, BASE_DEC
, NULL
,
2305 { &hf_fcels_vendoruniq
,
2306 {"Vendor Unique", "fcels.rnid.vendoruniq", FT_BYTES
, BASE_NONE
, NULL
,
2308 { &hf_fcels_vendorsp
,
2309 {"Vendor Specific", "fcels.rnid.vendorsp", FT_UINT16
, BASE_HEX
, NULL
,
2311 { &hf_fcels_asstype
,
2312 {"Associated Type", "fcels.rnid.asstype", FT_UINT32
, BASE_HEX
,
2313 VALS (fc_els_rnid_asstype_val
), 0x0, NULL
, HFILL
}},
2314 { &hf_fcels_physport
,
2315 {"Physical Port Number", "fcels.rnid.physport", FT_UINT32
, BASE_HEX
,
2316 NULL
, 0x0, NULL
, HFILL
}},
2317 { &hf_fcels_attnodes
,
2318 {"Number of Attached Nodes", "fcels.rnid.attnodes", FT_UINT32
,
2319 BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
2320 { &hf_fcels_nodemgmt
,
2321 {"Node Management", "fcels.rnid.nodemgmt", FT_UINT8
, BASE_HEX
,
2322 VALS (fc_els_rnid_mgmt_val
), 0x0, NULL
, HFILL
}},
2324 {"IP Version", "fcels.rnid.ipvers", FT_UINT8
, BASE_HEX
,
2325 VALS (fc_els_rnid_ipvers_val
), 0x0, NULL
, HFILL
}},
2326 { &hf_fcels_tcpport
,
2327 {"TCP/UDP Port Number", "fcels.rnid.tcpport", FT_UINT16
, BASE_DEC
,
2328 NULL
, 0x0, NULL
, HFILL
}},
2330 {"IP Address", "fcels.rnid.ip", FT_IPv6
, BASE_NONE
, NULL
, 0x0, NULL
,
2332 { &hf_fcels_cbind_liveness
,
2333 {"Liveness Test Interval", "fcels.cbind.liveness", FT_UINT16
, BASE_DEC
,
2334 NULL
, 0x0, "Liveness Test Interval in seconds", HFILL
}},
2335 { &hf_fcels_cbind_addr_mode
,
2336 {"Addressing Mode", "fcels.cbind.addr_mode", FT_UINT8
, BASE_HEX
,
2337 VALS(cbind_addr_mode_vals
), 0x0, NULL
, HFILL
}},
2338 { &hf_fcels_cbind_ifcp_version
,
2339 {"iFCP version", "fcels.cbind.ifcp_version", FT_UINT8
, BASE_DEC
,
2340 NULL
, 0x0, "Version of iFCP protocol", HFILL
}},
2341 { &hf_fcels_cbind_userinfo
,
2342 {"UserInfo", "fcels.cbind.userinfo", FT_UINT32
, BASE_HEX
,
2343 NULL
, 0x0, "Userinfo token", HFILL
}},
2344 { &hf_fcels_cbind_snpname
,
2345 {"Source N_Port Port_Name", "fcels.cbind.snpname", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2347 { &hf_fcels_cbind_dnpname
,
2348 {"Destination N_Port Port_Name", "fcels.cbind.dnpname", FT_STRING
, BASE_NONE
, NULL
, 0x0,
2350 { &hf_fcels_cbind_status
,
2351 {"Status", "fcels.cbind.status", FT_UINT16
, BASE_DEC
,
2352 VALS(cbind_status_vals
), 0x0, "Cbind status", HFILL
}},
2353 { &hf_fcels_chandle
,
2354 {"Connection Handle", "fcels.cbind.handle", FT_UINT16
, BASE_HEX
,
2355 NULL
, 0x0, "Cbind/Unbind connection handle", HFILL
}},
2356 { &hf_fcels_unbind_status
,
2357 {"Status", "fcels.unbind.status", FT_UINT16
, BASE_DEC
,
2358 VALS(unbind_status_vals
), 0x0, "Unbind status", HFILL
}},
2359 { &hf_fcels_cmn_cios
,
2360 {"Cont. Incr. Offset Supported", "fcels.cmn.cios", FT_BOOLEAN
, 16,
2361 TFS(&tfs_supported_not_supported
), 0x8000, NULL
, HFILL
}},
2362 { &hf_fcels_cmn_rro
,
2363 {"RRO Supported", "fcels.cmn.rro", FT_BOOLEAN
, 16,
2364 TFS(&tfs_supported_not_supported
), 0x4000, NULL
, HFILL
}},
2365 { &hf_fcels_cmn_vvv
,
2366 {"Valid Vendor Version", "fcels.cmn.vvv", FT_BOOLEAN
, 16,
2367 TFS(&tfs_valid_invalid
), 0x2000, NULL
, HFILL
}},
2368 { &hf_fcels_cmn_b2b
,
2369 {"B2B Credit Mgmt", "fcels.cmn.bbb", FT_BOOLEAN
, 16,
2370 TFS(&tfs_fc_fcels_cmn_b2b
), 0x0800, NULL
, HFILL
}},
2371 { &hf_fcels_cmn_e_d_tov
,
2372 {"E_D_TOV", "fcels.cmn.e_d_tov", FT_BOOLEAN
, 16,
2373 TFS(&tfs_fc_fcels_cmn_e_d_tov
), 0x0400, NULL
, HFILL
}},
2374 { &hf_fcels_cmn_simplex
,
2375 {"Simplex", "fcels.cmn.simplex", FT_BOOLEAN
, 16,
2376 TFS(&tfs_supported_not_supported
), 0x0040, NULL
, HFILL
}},
2377 { &hf_fcels_cmn_multicast
,
2378 {"Multicast", "fcels.cmn.multicast", FT_BOOLEAN
, 16,
2379 TFS(&tfs_supported_not_supported
), 0x0200, NULL
, HFILL
}},
2380 { &hf_fcels_cmn_broadcast
,
2381 {"Broadcast", "fcels.cmn.broadcast", FT_BOOLEAN
, 16,
2382 TFS(&tfs_supported_not_supported
), 0x0100, NULL
, HFILL
}},
2383 { &hf_fcels_cmn_security
,
2384 {"Security", "fcels.cmn.security", FT_BOOLEAN
, 16,
2385 TFS(&tfs_set_notset
), 0x0020, NULL
, HFILL
}},
2386 { &hf_fcels_cmn_clk
,
2387 {"Clk Sync", "fcels.cmn.clk", FT_BOOLEAN
, 16,
2388 TFS(&tfs_capable_not_capable
), 0x0010, NULL
, HFILL
}},
2389 { &hf_fcels_cmn_dhd
,
2390 {"DHD Capable", "fcels.cmn.dhd", FT_BOOLEAN
, 16,
2391 TFS(&tfs_capable_not_capable
), 0x0004, NULL
, HFILL
}},
2392 { &hf_fcels_cmn_seqcnt
,
2393 {"SEQCNT", "fcels.cmn.seqcnt", FT_BOOLEAN
, 16,
2394 TFS(&tfs_fc_fcels_cmn_seqcnt
), 0x0002, NULL
, HFILL
}},
2395 { &hf_fcels_cmn_payload
,
2396 {"Payload Len", "fcels.cmn.payload", FT_BOOLEAN
, 16,
2397 TFS(&tfs_fc_fcels_cmn_payload
), 0x0001, NULL
, HFILL
}},
2398 { &hf_fcels_cls_cns
,
2399 {"Class Supported", "fcels.cls.cns", FT_BOOLEAN
, 16,
2400 TFS(&tfs_supported_not_supported
), 0x8000, NULL
, HFILL
}},
2401 { &hf_fcels_cls_sdr
,
2402 {"Delivery Mode", "fcels.cls.sdr", FT_BOOLEAN
, 16,
2403 TFS(&tfs_fc_fcels_cls_sdr
), 0x0800, NULL
, HFILL
}},
2404 { &hf_fcels_cls_prio
,
2405 {"Priority", "fcels.cls.prio", FT_BOOLEAN
, 16,
2406 TFS(&tfs_supported_not_supported
), 0x0080, NULL
, HFILL
}},
2407 { &hf_fcels_cls_nzctl
,
2408 {"Non-zero CS_CTL", "fcels.cls.nzctl", FT_BOOLEAN
, 16,
2409 TFS(&tfs_fc_fcels_cls_nzctl
), 0x0040, NULL
, HFILL
}},
2410 { &hf_fcels_initctl
,
2411 {"Initiator Ctl", "fcels.logi.initctl", FT_UINT16
, BASE_HEX
,
2412 NULL
, 0x0, NULL
, HFILL
}},
2413 { &hf_fcels_initctl_initial_pa
,
2414 {"Initial P_A", "fcels.logi.initctl.initial_pa", FT_UINT16
, BASE_HEX
,
2415 VALS(initial_pa_vals
), 0x3000, NULL
, HFILL
}},
2416 { &hf_fcels_initctl_ack0
,
2417 {"ACK0 Capable", "fcels.logi.initctl.ack0", FT_BOOLEAN
, 16,
2418 TFS(&tfs_capable_not_capable
), 0x0800, NULL
, HFILL
}},
2419 { &hf_fcels_initctl_ackgaa
,
2420 {"ACK GAA", "fcels.logi.initctl.ackgaa", FT_BOOLEAN
, 16,
2421 TFS(&tfs_fc_fcels_initctl_ackgaa
), 0x0200, NULL
, HFILL
}},
2422 { &hf_fcels_initctl_sync
,
2423 {"Clock Sync", "fcels.logi.initctl.sync", FT_BOOLEAN
, 16,
2424 TFS(&tfs_supported_not_supported
), 0x0010, NULL
, HFILL
}},
2425 { &hf_fcels_rcptctl
,
2426 {"Recipient Ctl", "fcels.logi.rcptctl", FT_UINT16
, BASE_HEX
,
2427 NULL
, 0x0, NULL
, HFILL
}},
2428 { &hf_fcels_rcptctl_ack0
,
2429 {"ACK0", "fcels.logi.rcptctl.ack", FT_BOOLEAN
, 16,
2430 TFS(&tfs_supported_not_supported
), 0x8000, NULL
, HFILL
}},
2431 { &hf_fcels_rcptctl_interlock
,
2432 {"X_ID Interlock", "fcels.logi.rcptctl.interlock", FT_BOOLEAN
, 16,
2433 TFS(&tfs_requested_not_requested
), 0x2000, NULL
, HFILL
}},
2434 { &hf_fcels_rcptctl_policy
,
2435 {"Policy", "fcels.logi.rcptctl.policy", FT_UINT16
, BASE_HEX
,
2436 VALS(rcptctl_policy_vals
), 0x1800, NULL
, HFILL
}},
2437 { &hf_fcels_rcptctl_category
,
2438 {"Category", "fcels.logi.rcptctl.category", FT_UINT16
, BASE_HEX
,
2439 VALS(rcptctl_category_vals
), 0x0030, NULL
, HFILL
}},
2440 { &hf_fcels_rcptctl_sync
,
2441 {"Clock Sync", "fcels.logi.rcptctl.sync", FT_BOOLEAN
, 16,
2442 TFS(&tfs_supported_not_supported
), 0x0008, NULL
, HFILL
}},
2443 { &hf_fcels_fcpflags
,
2444 {"FCP Flags", "fcels.fcpflags", FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
,
2446 { &hf_fcels_fcpflags_trireq
,
2447 {"Task Retry Ident", "fcels.fcpflags.trireq", FT_BOOLEAN
, 32,
2448 TFS(&tfs_requested_not_requested
), 1 << 9, NULL
, HFILL
}},
2449 { &hf_fcels_fcpflags_trirep
,
2450 {"Task Retry Ident", "fcels.fcpflags.trirep", FT_BOOLEAN
, 32,
2451 TFS(&tfs_accepted_not_accepted
), 1 << 9, NULL
, HFILL
}},
2452 { &hf_fcels_fcpflags_retry
,
2453 {"Retry", "fcels.fcpflags.retry", FT_BOOLEAN
, 32,
2454 TFS(&tfs_fc_fcels_fcpflags_retry
), 1 << 8, NULL
, HFILL
}},
2455 { &hf_fcels_fcpflags_ccomp
,
2456 {"Comp", "fcels.fcpflags.ccomp", FT_BOOLEAN
, 32,
2457 TFS(&tfs_fc_fcels_fcpflags_ccomp
), 0x0080, NULL
, HFILL
}},
2458 { &hf_fcels_fcpflags_datao
,
2459 {"Data Overlay", "fcels.fcpflags.datao", FT_BOOLEAN
, 32,
2460 TFS(&tfs_fc_fcels_fcpflags_datao
), 0x0040, NULL
, HFILL
}},
2461 { &hf_fcels_fcpflags_initiator
,
2462 {"Initiator", "fcels.fcpflags.initiator", FT_BOOLEAN
, 32,
2463 TFS(&tfs_fc_fcels_fcpflags_initiator
), 0x0020, NULL
, HFILL
}},
2464 { &hf_fcels_fcpflags_target
,
2465 {"Target", "fcels.fcpflags.target", FT_BOOLEAN
, 32,
2466 TFS(&tfs_fc_fcels_fcpflags_target
), 0x0010, NULL
, HFILL
}},
2467 { &hf_fcels_fcpflags_rdxr
,
2468 {"Rd Xfer_Rdy Dis", "fcels.fcpflags.rdxr", FT_BOOLEAN
, 32,
2469 TFS(&tfs_fc_fcels_fcpflags_rdxr
), 0x0002, NULL
, HFILL
}},
2470 { &hf_fcels_fcpflags_wrxr
,
2471 {"Wr Xfer_Rdy Dis", "fcels.fcpflags.wrxr", FT_BOOLEAN
, 32,
2472 TFS(&tfs_fc_fcels_fcpflags_wrxr
), 0x0001, NULL
, HFILL
}},
2473 { &hf_fcels_prliloflags
,
2474 {"PRLILO Flags", "fcels.prliloflags", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
,
2476 { &hf_fcels_tprloflags_opav
,
2477 {"3rd Party Orig PA Valid", "fcels.tprloflags.opav", FT_BOOLEAN
, 8,
2478 TFS(&tfs_valid_not_valid
), 0x80, NULL
, HFILL
}},
2479 { &hf_fcels_tprloflags_rpav
,
2480 {"Resp PA Valid", "fcels.tprloflags.rpav", FT_BOOLEAN
, 8,
2481 TFS(&tfs_valid_not_valid
), 0x40, NULL
, HFILL
}},
2482 { &hf_fcels_tprloflags_npv
,
2483 {"3rd Party N_Port Valid", "fcels.tprloflags.npv", FT_BOOLEAN
, 8,
2484 TFS(&tfs_valid_not_valid
), 0x20, NULL
, HFILL
}},
2485 { &hf_fcels_tprloflags_gprlo
,
2486 {"Global PRLO", "fcels.tprloflags.gprlo", FT_BOOLEAN
, 8,
2487 TFS(&tfs_fc_fcels_tprloflags_gprlo
), 0x10, NULL
, HFILL
}},
2488 { &hf_fcels_speedflags
,
2489 {"Port Speed Capabilities", "fcels.speedflags", FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
,
2491 { &hf_fcels_speedflags_1gb
,
2492 {"1Gb Support", "fcels.speedflags.1gb", FT_BOOLEAN
, 16,
2493 TFS(&tfs_supported_not_supported
), 0x8000, NULL
, HFILL
}},
2494 { &hf_fcels_speedflags_2gb
,
2495 {"2Gb Support", "fcels.speedflags.2gb", FT_BOOLEAN
, 16,
2496 TFS(&tfs_supported_not_supported
), 0x4000, NULL
, HFILL
}},
2497 { &hf_fcels_speedflags_4gb
,
2498 {"4Gb Support", "fcels.speedflags.4gb", FT_BOOLEAN
, 16,
2499 TFS(&tfs_supported_not_supported
), 0x2000, NULL
, HFILL
}},
2500 { &hf_fcels_speedflags_10gb
,
2501 {"10Gb Support", "fcels.speedflags.10gb", FT_BOOLEAN
, 16,
2502 TFS(&tfs_supported_not_supported
), 0x1000, NULL
, HFILL
}},
2503 { &hf_fcels_prliloflags_opav
,
2504 {"Orig PA Valid", "fcels.prliloflags.opav", FT_BOOLEAN
, 8,
2505 TFS(&tfs_valid_not_valid
), 0x80, NULL
, HFILL
}},
2506 { &hf_fcels_prliloflags_ipe
,
2507 {"Image Pair Estd", "fcels.prliloflags.ipe", FT_BOOLEAN
, 8,
2508 TFS(&tfs_fc_fcels_prliloflags_ipe
), 0x20, NULL
, HFILL
}},
2509 { &hf_fcels_prliloflags_eip
,
2510 {"Est Image Pair", "fcels.prliloflags.eip", FT_BOOLEAN
, 8,
2511 TFS(&tfs_fc_fcels_prliloflags_eip
), 0x20, NULL
, HFILL
}},
2514 static gint
*ett
[] = {
2519 &ett_fcels_logi_cmnsvc
,
2520 &ett_fcels_logi_clssvc
,
2527 &ett_fcels_prli_svcpg
,
2535 &ett_fcels_rscn_rec
,
2539 &ett_fcels_rnft_fc4
,
2547 &ett_fcels_cmnfeatures
,
2548 &ett_fcels_clsflags
,
2551 &ett_fcels_fcpflags
,
2552 &ett_fcels_prliloflags
,
2553 &ett_fcels_speedflags
,
2557 static ei_register_info ei
[] = {
2558 { &ei_fcels_src_unknown
, { "fcels.src.type.unknown", PI_MALFORMED
, PI_WARN
, "Unknown source address type", EXPFILL
}},
2559 { &ei_fcels_dst_unknown
, { "fcels.dst.type.unknown", PI_MALFORMED
, PI_WARN
, "Unknown destination address type", EXPFILL
}},
2562 expert_module_t
* expert_fcels
;
2564 proto_fcels
= proto_register_protocol("FC Extended Link Svc", "FC ELS", "fcels");
2566 proto_register_field_array(proto_fcels
, hf
, array_length(hf
));
2567 proto_register_subtree_array(ett
, array_length(ett
));
2568 expert_fcels
= expert_register_protocol(proto_fcels
);
2569 expert_register_field_array(expert_fcels
, ei
, array_length(ei
));
2570 register_init_routine (&fcels_init_protocol
);
2574 proto_reg_handoff_fcels (void)
2576 dissector_handle_t els_handle
;
2578 els_handle
= create_dissector_handle (dissect_fcels
, proto_fcels
);
2579 dissector_add_uint("fc.ftype", FC_FTYPE_ELS
, els_handle
);
2581 data_handle
= find_dissector ("data");
2582 fcsp_handle
= find_dissector ("fcsp");