3 * Routines for FIP dissection - FCoE Initialization Protocol
4 * Copyright (c) 2008 Cisco Systems, Inc. (jeykholt@cisco.com)
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * Based on packet-fcoe.c, Copyright 2006, Nuova Systems, (jre@nuovasystems.com)
11 * Based on packet-fcp.c, Copyright 2001, Dinesh G Dutt (ddutt@cisco.com)
13 * SPDX-License-Identifier: GPL-2.0-or-later
17 * For FIP protocol details, see http://t11.org.
18 * This version uses preliminary details not yet standardized.
19 * Based on http://www.t11.org/ftp/t11/pub/fc/bb-5/08-543v1.pdf
20 * and http://www.t11.org/ftp/t11/pub/fc/bb-5/08-545v1.pdf
25 #include <epan/packet.h>
26 #include <epan/to_str.h>
27 #include <epan/expert.h>
28 #include "packet-fc.h"
30 void proto_register_fip(void);
31 void proto_reg_handoff_fip(void);
33 static dissector_handle_t fip_handle
;
36 * FIP protocol information.
38 #define FIP_HEADER_LEN 10
39 #define FIP_BPW 4 /* bytes per descriptor length unit */
42 * FIP opcodes and subcodes.
45 FIP_OP_DISC
= 1, /* discovery, advertisement, etc. */
46 FIP_OP_LS
= 2, /* Link Service request or reply */
47 FIP_OP_CTRL
= 3, /* control */
48 FIP_OP_VLAN
= 4, /* VLAN request or reply */
49 FIP_OP_VN2VN
= 5 /* VN_port to VN_port operation */
53 * Subcodes for FIP_OP_DISC.
55 enum fip_disc_subcode
{
56 FIP_SC_SOL
= 1, /* solicitation */
57 FIP_SC_ADV
= 2 /* advertisement */
61 * Subcodes for FIP_OP_LS.
64 FIP_SC_REQ
= 1, /* request */
65 FIP_SC_REP
= 2 /* reply */
68 enum fip_ctrl_subcode
{
69 FIP_SC_KA
= 1, /* keep-alive */
70 FIP_SC_CVL
= 2 /* clear virtual link */
73 enum fip_vlan_subcode
{
74 FIP_VL_REQ
= 1, /* request */
75 FIP_VL_REP
= 2 /* reply */
79 * Subcodes for FIP_OP_VN2VN.
82 enum fip_vn2vn_subcode
{
83 FIP_SC_VN_PROBE_REQ
= 1, /* probe request */
84 FIP_SC_VN_PROBE_REP
= 2, /* probe reply */
85 FIP_SC_VN_CLAIM_NOTIFY
= 3, /* claim notification */
86 FIP_SC_VN_CLAIM_REP
= 4, /* claim response */
87 FIP_SC_VN_BEACON
= 5 /* beacon */
90 static const value_string fip_opcodes
[] = {
91 { FIP_OP_DISC
, "Discovery" },
92 { FIP_OP_LS
, "Link Service" },
93 { FIP_OP_CTRL
, "Control" },
94 { FIP_OP_VLAN
, "VLAN" },
95 { FIP_OP_VN2VN
, "VN2VN" },
99 static const value_string fip_disc_subcodes
[] = {
100 { FIP_SC_SOL
, "Solicitation" },
101 { FIP_SC_ADV
, "Advertisement" },
105 static const value_string fip_ls_subcodes
[] = {
106 { FIP_SC_REQ
, "ELS Request" },
107 { FIP_SC_REP
, "ELS Response" },
111 static const value_string fip_ctrl_subcodes
[] = {
112 { FIP_SC_KA
, "Keep-Alive" },
113 { FIP_SC_CVL
, "Clear Virtual Link" },
117 static const value_string fip_vlan_subcodes
[] = {
118 { FIP_VL_REQ
, "VLAN Request" },
119 { FIP_VL_REP
, "VLAN Response" },
123 static const value_string fip_vn2vn_subcodes
[] = {
124 { FIP_SC_VN_PROBE_REQ
, "Probe Request" },
125 { FIP_SC_VN_PROBE_REP
, "Probe Reply" },
126 { FIP_SC_VN_CLAIM_NOTIFY
, "Claim Notification" },
127 { FIP_SC_VN_CLAIM_REP
, "Claim Response" },
128 { FIP_SC_VN_BEACON
, "Beacon" },
136 FIP_DT_PRI
= 1, /* priority for forwarder selection */
137 FIP_DT_MAC
= 2, /* MAC address */
138 FIP_DT_MAP_OUI
= 3, /* FC-MAP OUI */
139 FIP_DT_NAME
= 4, /* switch name or node name */
140 FIP_DT_FAB
= 5, /* fabric descriptor */
141 FIP_DT_FCOE_SIZE
= 6, /* max FCoE frame size */
142 FIP_DT_FLOGI
= 7, /* FLOGI request or response */
143 FIP_DT_FDISC
= 8, /* FDISC request or response */
144 FIP_DT_LOGO
= 9, /* LOGO request or response */
145 FIP_DT_ELP
= 10, /* ELP request or response */
146 FIP_DT_VN
= 11, /* VN_Port Info */
147 FIP_DT_FKA
= 12, /* FIP keep-alive / advert. period */
148 FIP_DT_VEND
= 13, /* Vendor-specific TLV */
149 FIP_DT_VLAN
= 14, /* VLAN number */
150 FIP_DT_FC4F
= 15 /* FC-4 features */
153 static const value_string fip_desc_types
[] = {
154 { FIP_DT_PRI
, "Priority" },
155 { FIP_DT_MAC
, "MAC Address" },
156 { FIP_DT_MAP_OUI
, "FPMA MAP OUI" },
157 { FIP_DT_NAME
, "Switch or Node Name" },
158 { FIP_DT_FAB
, "Fabric Descriptor" },
159 { FIP_DT_FCOE_SIZE
, "Max FCoE frame size" },
160 { FIP_DT_FLOGI
, "FLOGI Encapsulation" },
161 { FIP_DT_FDISC
, "FDISC Encapsulation" },
162 { FIP_DT_LOGO
, "LOGO Encapsulation" },
163 { FIP_DT_ELP
, "ELP Encapsulation" },
164 { FIP_DT_VN
, "VN_Port Info" },
165 { FIP_DT_FKA
, "FKA_ADV_Period" },
166 { FIP_DT_VEND
, "Vendor_ID" },
167 { FIP_DT_VLAN
, "VLAN" },
168 { FIP_DT_FC4F
, "FC-4 features" },
171 static value_string_ext fip_desc_types_ext
= VALUE_STRING_EXT_INIT(fip_desc_types
);
174 * flags in header fip_flags.
177 FIP_FL_FPMA
= 0x8000, /* supports FPMA fabric-provided MACs */
178 FIP_FL_SPMA
= 0x4000, /* supports SPMA server-provided MACs */
179 FIP_FL_REC_P2P
= 0x0008, /* recorded addr or point-to-point */
180 FIP_FL_AVAIL
= 0x0004, /* available for FLOGI */
181 FIP_FL_SOL
= 0x0002, /* this is a solicited message */
182 FIP_FL_FPORT
= 0x0001 /* sent from an F port */
185 static int proto_fip
;
186 static int hf_fip_ver
;
187 static int hf_fip_reserved12
;
188 static int hf_fip_op
;
189 static int hf_fip_reserved8
;
190 static int hf_fip_disc_subcode
;
191 static int hf_fip_ls_subcode
;
192 static int hf_fip_ctrl_subcode
;
193 static int hf_fip_vlan_subcode
;
194 static int hf_fip_vn2vn_subcode
;
195 static int hf_fip_hex_subcode
;
196 static int hf_fip_dlen
;
197 static int hf_fip_flags
;
198 static int hf_fip_flag_fpma
;
199 static int hf_fip_flag_spma
;
200 static int hf_fip_flag_rec_p2p
;
201 static int hf_fip_flag_avail
;
202 static int hf_fip_flag_sol
;
203 static int hf_fip_flag_fport
;
204 static int hf_fip_descriptors
;
206 static int * const hf_fip_flags_fields
[] = {
209 &hf_fip_flag_rec_p2p
,
216 static int hf_fip_desc_type
;
217 static int hf_fip_desc_len
;
218 static int hf_fip_desc_pri
;
219 static int hf_fip_desc_mac
;
220 static int hf_fip_desc_map
;
221 static int hf_fip_desc_name
;
222 static int hf_fip_desc_fab_vfid
;
223 static int hf_fip_desc_fab_map
;
224 static int hf_fip_desc_fab_name
;
225 static int hf_fip_desc_fcoe_size
;
226 static int hf_fip_desc_vn_mac
;
227 static int hf_fip_desc_vn_fid
;
228 static int hf_fip_desc_vn_wwpn
;
229 static int hf_fip_desc_fka
;
230 static int hf_fip_desc_vend
;
231 static int hf_fip_desc_vend_data
;
232 static int hf_fip_desc_vlan
;
233 static int hf_fip_desc_unk
;
234 static int hf_fip_desc_fc4f_types
;
235 static int hf_fip_desc_fcp_feat
;
236 static int hf_fip_type_ip
;
237 static int hf_fip_type_fcp
;
238 static int hf_fip_type_gs3
;
239 static int hf_fip_fcp_feat_i
;
240 static int hf_fip_fcp_feat_t
;
243 static int ett_fip_flags
;
244 static int ett_fip_dt_pri
;
245 static int ett_fip_dt_mac
;
246 static int ett_fip_dt_map
;
247 static int ett_fip_dt_name
;
248 static int ett_fip_dt_fab
;
249 static int ett_fip_dt_mdl
;
250 static int ett_fip_dt_caps
;
251 static int ett_fip_dt_vn
;
252 static int ett_fip_dt_fka
;
253 static int ett_fip_dt_vend
;
254 static int ett_fip_dt_vlan
;
255 static int ett_fip_dt_unk
;
256 static int ett_fip_dt_fc4f
;
257 static int ett_fip_dt_fc4f_types
;
258 static int ett_fip_dt_fcp_feat
;
260 static expert_field ei_fip_descriptors
;
262 static dissector_handle_t fc_handle
;
265 * Insert common descriptor type and length fields.
268 fip_desc_type_len(proto_tree
*tree
, tvbuff_t
*tvb
, uint8_t dtype
, int ett
, proto_item
** item
)
270 proto_tree
* ret_tree
;
272 ret_tree
= proto_tree_add_subtree_format(tree
, tvb
, 0, -1, ett
, item
,
273 "Descriptor: %s ", val_to_str_ext(dtype
, &fip_desc_types_ext
, "Unknown 0x%x"));
274 proto_tree_add_item(ret_tree
, hf_fip_desc_type
, tvb
, 0, 1, ENC_BIG_ENDIAN
);
275 proto_tree_add_item(ret_tree
, hf_fip_desc_len
, tvb
, 1, 1, ENC_BIG_ENDIAN
);
281 * Dissect the FC-4 type features descriptor.
284 fip_desc_fc4f(tvbuff_t
*tvb
, proto_tree
*tree
, proto_item
*item
)
289 static int * const types_word0
[] = { /* types 0 - 31 */
294 static int * const types_word1
[] = { /* types 32 - 63 */
298 static int * const fcp_feat
[] = {
305 * First the 256-bit bitmask of types supported.
308 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_fip_desc_fc4f_types
,
309 ett_fip_dt_fc4f_types
, types_word0
, ENC_BIG_ENDIAN
);
311 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_fip_desc_fc4f_types
,
312 ett_fip_dt_fc4f_types
, types_word1
, ENC_BIG_ENDIAN
);
313 offset
+= 256 / 8 - 4; /* skip to end of bitmask (32 bytes) */
316 * Next the 4-bit capabilities per type.
317 * Only decode FCP (type 8) for now.
319 offset
+= 8 / 2; /* skip first 8 types, 2 types per byte */
320 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_fip_desc_fcp_feat
,
321 ett_fip_dt_fcp_feat
, fcp_feat
, ENC_BIG_ENDIAN
);
322 mask
= tvb_get_ntohl(tvb
, offset
);
324 proto_item_append_text(item
, "FCP Target ");
327 proto_item_append_text(item
, "FCP Initiator ");
332 dissect_fip(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
339 proto_tree
*fip_tree
;
343 unsigned desc_offset
;
348 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "FIP");
349 col_clear(pinfo
->cinfo
, COL_INFO
);
351 if (!tvb_bytes_exist(tvb
, 0, FIP_HEADER_LEN
)) {
352 col_set_str(pinfo
->cinfo
, COL_INFO
, "[packet too short]");
353 proto_tree_add_protocol_format(tree
, proto_fip
, tvb
, 0,
354 -1, "FIP [packet too short]");
355 return tvb_captured_length(tvb
);
358 op
= tvb_get_ntohs(tvb
, 2);
359 sub
= tvb_get_uint8(tvb
, 5);
363 info
= val_to_str(sub
, fip_disc_subcodes
, "Discovery 0x%x");
366 info
= val_to_str(sub
, fip_ls_subcodes
, "Link Service 0x%x");
369 info
= val_to_str(sub
, fip_ctrl_subcodes
, "Control 0x%x");
372 info
= val_to_str(sub
, fip_vlan_subcodes
, "VLAN 0x%x");
375 info
= val_to_str(sub
, fip_vn2vn_subcodes
, "VN2VN 0x%x");
378 info
= val_to_str(op
, fip_opcodes
, "Unknown op 0x%x");
382 col_add_str(pinfo
->cinfo
, COL_INFO
, info
);
384 rlen
= tvb_get_ntohs(tvb
, 6);
386 ti
= proto_tree_add_protocol_format(tree
, proto_fip
, tvb
, 0,
387 FIP_HEADER_LEN
+ rlen
* FIP_BPW
,
389 fip_tree
= proto_item_add_subtree(ti
, ett_fip
);
390 proto_tree_add_item(fip_tree
, hf_fip_ver
, tvb
, 0, 1, ENC_BIG_ENDIAN
);
391 proto_tree_add_item(fip_tree
, hf_fip_reserved12
, tvb
, 0, 2, ENC_BIG_ENDIAN
);
392 proto_tree_add_item(fip_tree
, hf_fip_op
, tvb
, 2, 2, ENC_BIG_ENDIAN
);
393 proto_tree_add_item(fip_tree
, hf_fip_reserved8
, tvb
, 4, 1, ENC_NA
);
396 proto_tree_add_item(fip_tree
, hf_fip_disc_subcode
, tvb
, 5, 1, ENC_BIG_ENDIAN
);
399 proto_tree_add_item(fip_tree
, hf_fip_ls_subcode
, tvb
, 5, 1, ENC_BIG_ENDIAN
);
402 proto_tree_add_item(fip_tree
, hf_fip_ctrl_subcode
, tvb
, 5, 1, ENC_BIG_ENDIAN
);
405 proto_tree_add_item(fip_tree
, hf_fip_vlan_subcode
, tvb
, 5, 1, ENC_BIG_ENDIAN
);
408 proto_tree_add_item(fip_tree
, hf_fip_vn2vn_subcode
, tvb
, 5, 1, ENC_BIG_ENDIAN
);
411 proto_tree_add_item(fip_tree
, hf_fip_hex_subcode
, tvb
, 5, 1, ENC_BIG_ENDIAN
);
414 proto_tree_add_item(fip_tree
, hf_fip_dlen
, tvb
, 6, 2, ENC_BIG_ENDIAN
);
416 proto_tree_add_bitmask(fip_tree
, tvb
, 8, hf_fip_flags
,
417 ett_fip_flags
, hf_fip_flags_fields
, ENC_BIG_ENDIAN
);
419 desc_offset
= FIP_HEADER_LEN
;
421 proto_tree_add_bytes_format(fip_tree
, hf_fip_descriptors
, tvb
, desc_offset
, rlen
, NULL
, "Descriptors");
423 while ((rlen
> 0) && tvb_bytes_exist(tvb
, desc_offset
, 2)) {
424 dlen
= tvb_get_uint8(tvb
, desc_offset
+ 1) * FIP_BPW
;
426 proto_tree_add_expert(fip_tree
, pinfo
, &ei_fip_descriptors
, tvb
, desc_offset
, -1);
429 if (!tvb_bytes_exist(tvb
, desc_offset
, dlen
) || dlen
> rlen
) {
432 desc_tvb
= tvb_new_subset_length_caplen(tvb
, desc_offset
, dlen
, -1);
433 dtype
= tvb_get_uint8(desc_tvb
, 0);
439 subtree
= fip_desc_type_len(fip_tree
, desc_tvb
, dtype
, ett_fip_dt_pri
, &item
);
440 proto_tree_add_item(subtree
, hf_fip_desc_pri
, desc_tvb
,
441 3, 1, ENC_BIG_ENDIAN
);
442 proto_item_append_text(item
, "%u", tvb_get_uint8(desc_tvb
, 3));
445 subtree
= fip_desc_type_len(fip_tree
, desc_tvb
, dtype
, ett_fip_dt_mac
, &item
);
446 proto_tree_add_item(subtree
, hf_fip_desc_mac
, desc_tvb
,
448 proto_item_append_text(item
, "%s",
449 tvb_bytes_to_str_punct(pinfo
->pool
, desc_tvb
, 2, 6, ':'));
452 subtree
= fip_desc_type_len(fip_tree
, desc_tvb
, dtype
, ett_fip_dt_map
, &item
);
453 proto_tree_add_item(subtree
, hf_fip_desc_map
, desc_tvb
,
455 proto_item_append_text(item
, "%s", tvb_fc_to_str(pinfo
->pool
, desc_tvb
, 5));
458 subtree
= fip_desc_type_len(fip_tree
, desc_tvb
, dtype
, ett_fip_dt_name
, &item
);
459 proto_tree_add_item(subtree
, hf_fip_desc_name
, desc_tvb
, 4, 8, ENC_NA
);
460 proto_item_append_text(item
, "%s", tvb_fcwwn_to_str(pinfo
->pool
, desc_tvb
, 4));
463 subtree
= fip_desc_type_len(fip_tree
, desc_tvb
, dtype
, ett_fip_dt_fab
, &item
);
464 proto_tree_add_item(subtree
, hf_fip_desc_fab_vfid
, desc_tvb
,
465 2, 2, ENC_BIG_ENDIAN
);
466 proto_tree_add_item(subtree
, hf_fip_desc_fab_map
, desc_tvb
,
468 proto_tree_add_item(subtree
, hf_fip_desc_fab_name
, desc_tvb
, 8, 8, ENC_NA
);
469 proto_item_append_text(item
, "%s", tvb_fcwwn_to_str(pinfo
->pool
, desc_tvb
, 8));
471 case FIP_DT_FCOE_SIZE
:
472 subtree
= fip_desc_type_len(fip_tree
, desc_tvb
, dtype
, ett_fip_dt_mdl
, &item
);
473 proto_tree_add_item(subtree
, hf_fip_desc_fcoe_size
, desc_tvb
,
474 2, 2, ENC_BIG_ENDIAN
);
475 proto_item_append_text(item
, "%u", tvb_get_ntohs(desc_tvb
, 2));
482 fc_data_t fc_data
= {ETHERTYPE_FIP
, 0};
484 subtree
= fip_desc_type_len(fip_tree
, desc_tvb
, dtype
, ett_fip_dt_caps
, &item
);
485 ls_tvb
= tvb_new_subset_length_caplen(desc_tvb
, 4, dlen
- 4, -1);
486 call_dissector_with_data(fc_handle
, ls_tvb
, pinfo
, subtree
, &fc_data
);
487 proto_item_append_text(item
, "%u bytes", dlen
- 4);
491 subtree
= fip_desc_type_len(fip_tree
, desc_tvb
, dtype
, ett_fip_dt_vn
, &item
);
492 proto_tree_add_item(subtree
, hf_fip_desc_vn_mac
, desc_tvb
,
494 proto_tree_add_item(subtree
, hf_fip_desc_vn_fid
, desc_tvb
,
495 9, 3, ENC_BIG_ENDIAN
);
496 proto_tree_add_item(subtree
, hf_fip_desc_vn_wwpn
,
497 desc_tvb
, 12, 8, ENC_NA
);
498 proto_item_append_text(item
, "MAC %s FC_ID %6.6x",
499 tvb_bytes_to_str_punct(pinfo
->pool
, desc_tvb
, 2, 6, ':'),
500 tvb_get_ntoh24(desc_tvb
, 9));
503 subtree
= fip_desc_type_len(fip_tree
, desc_tvb
, dtype
, ett_fip_dt_fka
, &item
);
504 val
= tvb_get_ntohl(desc_tvb
, 4);
505 proto_tree_add_uint_format_value(subtree
, hf_fip_desc_fka
,
506 desc_tvb
, 4, 4, val
, "%u ms", val
);
507 proto_item_append_text(item
, "%u ms", val
);
510 subtree
= fip_desc_type_len(fip_tree
, desc_tvb
, dtype
, ett_fip_dt_vend
, &item
);
511 proto_tree_add_item(subtree
, hf_fip_desc_vend
, desc_tvb
,
513 if (tvb_reported_length_remaining(desc_tvb
, 9)) {
514 proto_tree_add_item(subtree
, hf_fip_desc_vend_data
,
515 desc_tvb
, 9, -1, ENC_NA
);
519 subtree
= fip_desc_type_len(fip_tree
, desc_tvb
, dtype
, ett_fip_dt_vlan
, &item
);
520 proto_tree_add_item(subtree
, hf_fip_desc_vlan
, desc_tvb
,
521 2, 2, ENC_BIG_ENDIAN
);
522 proto_item_append_text(item
, "%u", tvb_get_ntohs(desc_tvb
, 2));
525 subtree
= fip_desc_type_len(fip_tree
, desc_tvb
, dtype
, ett_fip_dt_fc4f
, &item
);
526 fip_desc_fc4f(desc_tvb
, subtree
, item
);
529 subtree
= fip_desc_type_len(fip_tree
, desc_tvb
, dtype
, ett_fip_dt_unk
, &item
);
530 proto_tree_add_item(subtree
, hf_fip_desc_unk
, desc_tvb
,
535 return tvb_captured_length(tvb
);
539 proto_register_fip(void)
541 /* Setup list of header fields See Section 1.6.1 for details*/
542 static hf_register_info hf
[] = {
547 { "Version", "fip.ver",
548 FT_UINT8
, BASE_DEC
, NULL
, 0xf0,
551 { &hf_fip_reserved12
,
552 { "Reserved", "fip.reserved",
553 FT_UINT16
, BASE_HEX
, NULL
, 0x0fff,
557 { "Opcode", "fip.opcode",
558 FT_UINT16
, BASE_HEX
, VALS(fip_opcodes
), 0,
562 { "Reserved", "fip.reserved",
563 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
566 { &hf_fip_disc_subcode
,
567 { "Discovery Subcode", "fip.disc_subcode",
568 FT_UINT8
, BASE_HEX
, VALS(fip_disc_subcodes
), 0,
571 { &hf_fip_ls_subcode
,
572 { "Link Service Subcode", "fip.ls.subcode",
573 FT_UINT8
, BASE_HEX
, VALS(fip_ls_subcodes
), 0,
576 { &hf_fip_ctrl_subcode
,
577 { "Control Subcode", "fip.ctrl_subcode",
578 FT_UINT8
, BASE_HEX
, VALS(fip_ctrl_subcodes
), 0,
581 { &hf_fip_vlan_subcode
,
582 { "VLAN Subcode", "fip.vlan_subcode",
583 FT_UINT8
, BASE_HEX
, VALS(fip_vlan_subcodes
), 0,
586 { &hf_fip_vn2vn_subcode
,
587 { "VN2VN Subcode", "fip.vn2vn_subcode",
588 FT_UINT8
, BASE_HEX
, VALS(fip_vn2vn_subcodes
), 0,
591 { &hf_fip_hex_subcode
,
592 { "Unknown Subcode", "fip.subcode",
593 FT_UINT8
, BASE_HEX
, NULL
, 0,
597 { "Length of Descriptors (words)", "fip.dl_len",
598 FT_UINT16
, BASE_DEC
, NULL
, 0,
602 { "Flags", "fip.flags",
603 FT_UINT16
, BASE_HEX
, NULL
, 0,
607 { "Fabric Provided MAC addr", "fip.flags.fpma",
608 FT_BOOLEAN
, 16, NULL
, FIP_FL_FPMA
,
612 { "Server Provided MAC addr", "fip.flags.spma",
613 FT_BOOLEAN
, 16, NULL
, FIP_FL_SPMA
,
616 { &hf_fip_flag_rec_p2p
,
617 { "REC/P2P", "fip.flags.rec_p2p",
618 FT_BOOLEAN
, 16, NULL
, FIP_FL_REC_P2P
,
621 { &hf_fip_flag_avail
,
622 { "Available", "fip.flags.available",
623 FT_BOOLEAN
, 16, NULL
, FIP_FL_AVAIL
,
627 { "Solicited", "fip.flags.sol",
628 FT_BOOLEAN
, 16, NULL
, FIP_FL_SOL
,
631 { &hf_fip_flag_fport
,
632 { "F_Port", "fip.flags.fport",
633 FT_BOOLEAN
, 16, NULL
, FIP_FL_FPORT
,
637 { "Descriptor Type", "fip.desc_type",
638 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &fip_desc_types_ext
, 0,
642 { "Descriptor Length (words)", "fip.desc_len",
643 FT_UINT8
, BASE_DEC
, NULL
, 0,
647 * Various descriptor fields.
650 { "Priority", "fip.pri",
651 FT_UINT8
, BASE_DEC
, NULL
, 0,
655 { "MAC Address", "fip.mac",
656 FT_ETHER
, BASE_NONE
, NULL
, 0,
660 { "FC-MAP-OUI", "fip.map",
661 FT_BYTES
, SEP_DOT
, NULL
, 0,
665 { "Switch or Node Name", "fip.name",
666 FT_FCWWN
, BASE_NONE
, NULL
, 0,
669 { &hf_fip_desc_fab_vfid
,
670 { "VFID", "fip.fab.vfid",
671 FT_UINT16
, BASE_DEC
, NULL
, 0,
674 { &hf_fip_desc_fab_map
,
675 { "FC-MAP", "fip.fab.map",
676 FT_BYTES
, SEP_DOT
, NULL
, 0,
679 { &hf_fip_desc_fab_name
,
680 { "Fabric Name", "fip.fab.name",
681 FT_FCWWN
, BASE_NONE
, NULL
, 0,
684 { &hf_fip_desc_fcoe_size
,
685 { "Max FCoE frame size", "fip.fcoe_size",
686 FT_UINT16
, BASE_DEC
, NULL
, 0,
689 { &hf_fip_desc_vn_mac
,
690 { "VN_Port MAC Address", "fip.vn.mac",
691 FT_ETHER
, BASE_NONE
, NULL
, 0,
694 { &hf_fip_desc_vn_fid
,
695 { "VN_Port FC_ID", "fip.vn.fc_id",
696 FT_UINT32
, BASE_HEX
, NULL
, 0,
699 { &hf_fip_desc_vn_wwpn
,
700 { "Port Name", "fip.vn.pwwn",
701 FT_FCWWN
, BASE_NONE
, NULL
, 0,
705 { "FKA_ADV_Period", "fip.fka",
706 FT_UINT32
, BASE_DEC
, NULL
, 0,
710 { "Vendor-ID", "fip.vendor",
711 FT_BYTES
, BASE_NONE
, NULL
, 0,
714 { &hf_fip_desc_vend_data
,
715 { "Vendor-specific data", "fip.vendor.data",
716 FT_BYTES
, BASE_NONE
, NULL
, 0,
720 { "VLAN", "fip.vlan",
721 FT_UINT16
, BASE_DEC
, NULL
, 0,
724 { &hf_fip_desc_fc4f_types
,
725 { "FC4 Types", "fip.fc4f.types",
726 FT_UINT32
, BASE_HEX
, NULL
, 0,
729 { &hf_fip_desc_fcp_feat
,
730 { "FCP Features", "fip.fc4f.feat.fcp",
731 FT_UINT32
, BASE_HEX
, NULL
, 0xf,
735 { "IP", "fip.fc4f.ip",
736 FT_BOOLEAN
, 32, NULL
, 1 << 5,
740 { "FCP", "fip.fc4f.fcp",
741 FT_BOOLEAN
, 32, NULL
, 1 << 8,
745 { "GS3", "fip.fc4f.gs3",
746 FT_BOOLEAN
, 32, NULL
, 1 << 0,
749 { &hf_fip_fcp_feat_t
,
750 { "FCP Target", "fip.fc4f.feat.fcp.target",
751 FT_BOOLEAN
, 32, NULL
, 1,
754 { &hf_fip_fcp_feat_i
,
755 { "FCP Initiator", "fip.fc4f.feat.fcp.initiator",
756 FT_BOOLEAN
, 32, NULL
, 2,
760 { "Unknown Descriptor", "fip.desc_unk",
761 FT_BYTES
, BASE_NONE
, NULL
, 0,
764 { &hf_fip_descriptors
,
765 { "Descriptors", "fip.descriptors",
766 FT_BYTES
, BASE_NONE
, NULL
, 0,
770 static int *ett
[] = {
785 &ett_fip_dt_fc4f_types
,
786 &ett_fip_dt_fcp_feat
,
790 static ei_register_info ei
[] = {
791 { &ei_fip_descriptors
, { "fip.descriptors.length_error", PI_MALFORMED
, PI_ERROR
, "Descriptor [length error]", EXPFILL
}},
794 expert_module_t
* expert_fip
;
796 /* Register the protocol name and description */
797 proto_fip
= proto_register_protocol("FCoE Initialization Protocol",
799 fip_handle
= register_dissector("fip", dissect_fip
, proto_fip
);
801 /* Required function calls to register the header fields and
803 proto_register_field_array(proto_fip
, hf
, array_length(hf
));
804 proto_register_subtree_array(ett
, array_length(ett
));
805 expert_fip
= expert_register_protocol(proto_fip
);
806 expert_register_field_array(expert_fip
, ei
, array_length(ei
));
810 * This function name is required because a script is used to find these
811 * routines and create the code that calls these routines.
814 proto_reg_handoff_fip(void)
816 dissector_add_uint("ethertype", ETHERTYPE_FIP
, fip_handle
);
817 fc_handle
= find_dissector_add_dependency("fc", proto_fip
);
821 * Editor modelines - https://www.wireshark.org/tools/modelines.html
826 * indent-tabs-mode: nil
829 * vi: set shiftwidth=4 tabstop=8 expandtab:
830 * :indentSize=4:tabSize=8:noTabs=true: