3 * Routines for FIP dissection - FCoE Initialization Protocol
4 * Copyright (c) 2008 Cisco Systems, Inc. (jeykholt@cisco.com)
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * Based on packet-fcoe.c, Copyright 2006, Nuova Systems, (jre@nuovasystems.com)
13 * Based on packet-fcp.c, Copyright 2001, Dinesh G Dutt (ddutt@cisco.com)
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
31 * For FIP protocol details, see http://t11.org.
32 * This version uses preliminary details not yet standardized.
33 * Based on http://www.t11.org/ftp/t11/pub/fc/bb-5/08-543v1.pdf
34 * and http://www.t11.org/ftp/t11/pub/fc/bb-5/08-545v1.pdf
41 #include <epan/packet.h>
42 #include <epan/to_str.h>
43 #include <epan/etypes.h>
44 #include <epan/expert.h>
47 * FIP protocol information.
49 #define FIP_HEADER_LEN 10
50 #define FIP_BPW 4 /* bytes per descriptor length unit */
53 * FIP opcodes and subcodes.
56 FIP_OP_DISC
= 1, /* discovery, advertisement, etc. */
57 FIP_OP_LS
= 2, /* Link Service request or reply */
58 FIP_OP_CTRL
= 3, /* control */
59 FIP_OP_VLAN
= 4, /* VLAN request or reply */
60 FIP_OP_VN2VN
= 5 /* VN_port to VN_port operation */
64 * Subcodes for FIP_OP_DISC.
66 enum fip_disc_subcode
{
67 FIP_SC_SOL
= 1, /* solicitation */
68 FIP_SC_ADV
= 2 /* advertisement */
72 * Subcodes for FIP_OP_LS.
75 FIP_SC_REQ
= 1, /* request */
76 FIP_SC_REP
= 2 /* reply */
79 enum fip_ctrl_subcode
{
80 FIP_SC_KA
= 1, /* keep-alive */
81 FIP_SC_CVL
= 2 /* clear virtual link */
84 enum fip_vlan_subcode
{
85 FIP_VL_REQ
= 1, /* request */
86 FIP_VL_REP
= 2 /* reply */
90 * Subcodes for FIP_OP_VN2VN.
93 enum fip_vn2vn_subcode
{
94 FIP_SC_VN_PROBE_REQ
= 1, /* probe request */
95 FIP_SC_VN_PROBE_REP
= 2, /* probe reply */
96 FIP_SC_VN_CLAIM_NOTIFY
= 3, /* claim notification */
97 FIP_SC_VN_CLAIM_REP
= 4, /* claim response */
98 FIP_SC_VN_BEACON
= 5 /* beacon */
101 static const value_string fip_opcodes
[] = {
102 { FIP_OP_DISC
, "Discovery" },
103 { FIP_OP_LS
, "Link Service" },
104 { FIP_OP_CTRL
, "Control" },
105 { FIP_OP_VLAN
, "VLAN" },
106 { FIP_OP_VN2VN
, "VN2VN" },
110 static const value_string fip_disc_subcodes
[] = {
111 { FIP_SC_SOL
, "Solicitation" },
112 { FIP_SC_ADV
, "Advertisement" },
116 static const value_string fip_ls_subcodes
[] = {
117 { FIP_SC_REQ
, "ELS Request" },
118 { FIP_SC_REP
, "ELS Response" },
122 static const value_string fip_ctrl_subcodes
[] = {
123 { FIP_SC_KA
, "Keep-Alive" },
124 { FIP_SC_CVL
, "Clear Virtual Link" },
128 static const value_string fip_vlan_subcodes
[] = {
129 { FIP_VL_REQ
, "VLAN Request" },
130 { FIP_VL_REP
, "VLAN Response" },
134 static const value_string fip_vn2vn_subcodes
[] = {
135 { FIP_SC_VN_PROBE_REQ
, "Probe Request" },
136 { FIP_SC_VN_PROBE_REP
, "Probe Reply" },
137 { FIP_SC_VN_CLAIM_NOTIFY
, "Claim Notification" },
138 { FIP_SC_VN_CLAIM_REP
, "Claim Response" },
139 { FIP_SC_VN_BEACON
, "Beacon" },
147 FIP_DT_PRI
= 1, /* priority for forwarder selection */
148 FIP_DT_MAC
= 2, /* MAC address */
149 FIP_DT_MAP_OUI
= 3, /* FC-MAP OUI */
150 FIP_DT_NAME
= 4, /* switch name or node name */
151 FIP_DT_FAB
= 5, /* fabric descriptor */
152 FIP_DT_FCOE_SIZE
= 6, /* max FCoE frame size */
153 FIP_DT_FLOGI
= 7, /* FLOGI request or response */
154 FIP_DT_FDISC
= 8, /* FDISC request or response */
155 FIP_DT_LOGO
= 9, /* LOGO request or response */
156 FIP_DT_ELP
= 10, /* ELP request or response */
157 FIP_DT_VN
= 11, /* VN_Port Info */
158 FIP_DT_FKA
= 12, /* FIP keep-alive / advert. period */
159 FIP_DT_VEND
= 13, /* Vendor-specific TLV */
160 FIP_DT_VLAN
= 14, /* VLAN number */
161 FIP_DT_FC4F
= 15 /* FC-4 features */
164 static const value_string fip_desc_types
[] = {
165 { FIP_DT_PRI
, "Priority" },
166 { FIP_DT_MAC
, "MAC Address" },
167 { FIP_DT_MAP_OUI
, "FPMA MAP OUI" },
168 { FIP_DT_NAME
, "Switch or Node Name" },
169 { FIP_DT_FAB
, "Fabric Descriptor" },
170 { FIP_DT_FCOE_SIZE
, "Max FCoE frame size" },
171 { FIP_DT_FLOGI
, "FLOGI Encapsulation" },
172 { FIP_DT_FDISC
, "FDISC Encapsulation" },
173 { FIP_DT_LOGO
, "LOGO Encapsulation" },
174 { FIP_DT_ELP
, "ELP Encapsulation" },
175 { FIP_DT_VN
, "VN_Port Info" },
176 { FIP_DT_FKA
, "FKA_ADV_Period" },
177 { FIP_DT_VEND
, "Vendor_ID" },
178 { FIP_DT_VLAN
, "VLAN" },
179 { FIP_DT_FC4F
, "FC-4 features" },
184 * flags in header fip_flags.
187 FIP_FL_FPMA
= 0x8000, /* supports FPMA fabric-provided MACs */
188 FIP_FL_SPMA
= 0x4000, /* supports SPMA server-provided MACs */
189 FIP_FL_REC_P2P
= 0x0008, /* recorded addr or point-to-point */
190 FIP_FL_AVAIL
= 0x0004, /* available for FLOGI */
191 FIP_FL_SOL
= 0x0002, /* this is a solicited message */
192 FIP_FL_FPORT
= 0x0001 /* sent from an F port */
195 static int proto_fip
= -1;
196 static int hf_fip_ver
= -1;
197 static int hf_fip_op
= -1;
198 static int hf_fip_disc_subcode
= -1;
199 static int hf_fip_ls_subcode
= -1;
200 static int hf_fip_ctrl_subcode
= -1;
201 static int hf_fip_vlan_subcode
= -1;
202 static int hf_fip_vn2vn_subcode
= -1;
203 static int hf_fip_hex_subcode
= -1;
204 static int hf_fip_dlen
= -1;
205 static int hf_fip_flags
= -1;
206 static int hf_fip_flag_fpma
= -1;
207 static int hf_fip_flag_spma
= -1;
208 static int hf_fip_flag_rec_p2p
= -1;
209 static int hf_fip_flag_avail
= -1;
210 static int hf_fip_flag_sol
= -1;
211 static int hf_fip_flag_fport
= -1;
213 static const int *hf_fip_flags_fields
[] = {
216 &hf_fip_flag_rec_p2p
,
223 static int hf_fip_desc_type
= -1;
224 static int hf_fip_desc_len
= -1;
225 static int hf_fip_desc_pri
= -1;
226 static int hf_fip_desc_mac
= -1;
227 static int hf_fip_desc_map
= -1;
228 static int hf_fip_desc_name
= -1;
229 static int hf_fip_desc_fab_vfid
= -1;
230 static int hf_fip_desc_fab_map
= -1;
231 static int hf_fip_desc_fab_name
= -1;
232 static int hf_fip_desc_fcoe_size
= -1;
233 static int hf_fip_desc_vn_mac
= -1;
234 static int hf_fip_desc_vn_fid
= -1;
235 static int hf_fip_desc_vn_wwpn
= -1;
236 static int hf_fip_desc_fka
= -1;
237 static int hf_fip_desc_vend
= -1;
238 static int hf_fip_desc_vend_data
= -1;
239 static int hf_fip_desc_vlan
= -1;
240 static int hf_fip_desc_unk
= -1;
241 static int hf_fip_desc_fc4f_types
= -1;
242 static int hf_fip_desc_fcp_feat
= -1;
243 static int hf_fip_type_ip
= -1;
244 static int hf_fip_type_fcp
= -1;
245 static int hf_fip_type_gs3
= -1;
246 static int hf_fip_fcp_feat_i
= -1;
247 static int hf_fip_fcp_feat_t
= -1;
249 static int ett_fip
= -1;
250 static int ett_fip_flags
= -1;
251 static int ett_fip_dt_pri
= -1;
252 static int ett_fip_dt_mac
= -1;
253 static int ett_fip_dt_map
= -1;
254 static int ett_fip_dt_name
= -1;
255 static int ett_fip_dt_fab
= -1;
256 static int ett_fip_dt_mdl
= -1;
257 static int ett_fip_dt_caps
= -1;
258 static int ett_fip_dt_vn
= -1;
259 static int ett_fip_dt_fka
= -1;
260 static int ett_fip_dt_vend
= -1;
261 static int ett_fip_dt_vlan
= -1;
262 static int ett_fip_dt_unk
= -1;
263 static int ett_fip_dt_fc4f
= -1;
264 static int ett_fip_dt_fc4f_types
= -1;
265 static int ett_fip_dt_fcp_feat
= -1;
267 static dissector_handle_t fc_handle
;
270 * Insert common descriptor type and length fields.
273 fip_desc_type_len(proto_tree
*tree
, tvbuff_t
*tvb
)
275 proto_tree_add_item(tree
, hf_fip_desc_type
, tvb
, 0, 1, ENC_BIG_ENDIAN
);
276 proto_tree_add_item(tree
, hf_fip_desc_len
, tvb
, 1, 1, ENC_BIG_ENDIAN
);
280 * Dissect the FC-4 type features descriptor.
283 fip_desc_fc4f(tvbuff_t
*tvb
, proto_tree
*tree
, proto_item
*item
)
288 static const int *types_word0
[] = { /* types 0 - 31 */
293 static const int *types_word1
[] = { /* types 32 - 63 */
297 static const int *fcp_feat
[] = {
304 * First the 256-bit bitmask of types supported.
307 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_fip_desc_fc4f_types
,
308 ett_fip_dt_fc4f_types
, types_word0
, ENC_BIG_ENDIAN
);
310 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_fip_desc_fc4f_types
,
311 ett_fip_dt_fc4f_types
, types_word1
, ENC_BIG_ENDIAN
);
312 offset
+= 256 / 8 - 4; /* skip to end of bitmask (32 bytes) */
315 * Next the 4-bit capabilities per type.
316 * Only decode FCP (type 8) for now.
318 offset
+= 8 / 2; /* skip first 8 types, 2 types per byte */
319 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_fip_desc_fcp_feat
,
320 ett_fip_dt_fcp_feat
, fcp_feat
, ENC_BIG_ENDIAN
);
321 mask
= tvb_get_ntohl(tvb
, offset
);
323 proto_item_append_text(item
, "FCP Target ");
326 proto_item_append_text(item
, "FCP Initiator ");
331 dissect_fip(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
338 proto_tree
*fip_tree
;
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]");
354 proto_tree_add_protocol_format(tree
, proto_fip
, tvb
, 0,
355 -1, "FIP [packet too short]");
359 op
= tvb_get_ntohs(tvb
, 2);
360 sub
= tvb_get_guint8(tvb
, 5);
364 info
= val_to_str(sub
, fip_disc_subcodes
, "Discovery 0x%x");
367 info
= val_to_str(sub
, fip_ls_subcodes
, "Link Service 0x%x");
370 info
= val_to_str(sub
, fip_ctrl_subcodes
, "Control 0x%x");
373 info
= val_to_str(sub
, fip_vlan_subcodes
, "VLAN 0x%x");
376 info
= val_to_str(sub
, fip_vn2vn_subcodes
, "VN2VN 0x%x");
379 info
= val_to_str(op
, fip_opcodes
, "Unknown op 0x%x");
383 col_add_str(pinfo
->cinfo
, COL_INFO
, info
);
385 rlen
= tvb_get_ntohs(tvb
, 6);
387 ti
= proto_tree_add_protocol_format(tree
, proto_fip
, tvb
, 0,
388 FIP_HEADER_LEN
+ rlen
* FIP_BPW
,
390 fip_tree
= proto_item_add_subtree(ti
, ett_fip
);
391 proto_tree_add_item(fip_tree
, hf_fip_ver
, tvb
, 0, 1, ENC_BIG_ENDIAN
);
392 proto_tree_add_item(fip_tree
, hf_fip_op
, tvb
, 2, 2, ENC_BIG_ENDIAN
);
395 proto_tree_add_item(fip_tree
, hf_fip_disc_subcode
, tvb
, 5, 1, ENC_BIG_ENDIAN
);
398 proto_tree_add_item(fip_tree
, hf_fip_ls_subcode
, tvb
, 5, 1, ENC_BIG_ENDIAN
);
401 proto_tree_add_item(fip_tree
, hf_fip_ctrl_subcode
, tvb
, 5, 1, ENC_BIG_ENDIAN
);
404 proto_tree_add_item(fip_tree
, hf_fip_vlan_subcode
, tvb
, 5, 1, ENC_BIG_ENDIAN
);
407 proto_tree_add_item(fip_tree
, hf_fip_vn2vn_subcode
, tvb
, 5, 1, ENC_BIG_ENDIAN
);
410 proto_tree_add_item(fip_tree
, hf_fip_hex_subcode
, tvb
, 5, 1, ENC_BIG_ENDIAN
);
413 proto_tree_add_item(fip_tree
, hf_fip_dlen
, tvb
, 6, 2, ENC_BIG_ENDIAN
);
415 proto_tree_add_bitmask(fip_tree
, tvb
, 8, hf_fip_flags
,
416 ett_fip_flags
, hf_fip_flags_fields
, ENC_BIG_ENDIAN
);
418 desc_offset
= FIP_HEADER_LEN
;
420 proto_tree_add_text(fip_tree
, tvb
, desc_offset
, rlen
, "Descriptors:");
422 while ((rlen
> 0) && tvb_bytes_exist(tvb
, desc_offset
, 2)) {
423 dlen
= tvb_get_guint8(tvb
, desc_offset
+ 1) * FIP_BPW
;
425 proto_tree_add_text(fip_tree
, tvb
, desc_offset
, -1,
426 "Descriptor [length error]");
429 if (!tvb_bytes_exist(tvb
, desc_offset
, dlen
) || dlen
> rlen
) {
432 desc_tvb
= tvb_new_subset(tvb
, desc_offset
, dlen
, -1);
433 dtype
= tvb_get_guint8(desc_tvb
, 0);
437 item
= proto_tree_add_text(fip_tree
, desc_tvb
, 0, -1, "Descriptor: %s ",
438 val_to_str(dtype
, fip_desc_types
, "Unknown 0x%x"));
442 subtree
= proto_item_add_subtree(item
, ett_fip_dt_pri
);
443 fip_desc_type_len(subtree
, desc_tvb
);
444 proto_tree_add_item(subtree
, hf_fip_desc_pri
, desc_tvb
,
445 3, 1, ENC_BIG_ENDIAN
);
446 proto_item_append_text(item
, "%u", tvb_get_guint8(desc_tvb
, 3));
449 subtree
= proto_item_add_subtree(item
, ett_fip_dt_mac
);
450 fip_desc_type_len(subtree
, desc_tvb
);
451 proto_tree_add_item(subtree
, hf_fip_desc_mac
, desc_tvb
,
453 proto_item_append_text(item
, "%s",
454 tvb_bytes_to_str_punct(desc_tvb
, 2, 6, ':'));
457 subtree
= proto_item_add_subtree(item
, ett_fip_dt_map
);
458 fip_desc_type_len(subtree
, desc_tvb
);
459 text
= tvb_fc_to_str(desc_tvb
, 5);
460 proto_tree_add_string(subtree
, hf_fip_desc_map
, desc_tvb
,
462 proto_item_append_text(item
, "%s", text
);
465 subtree
= proto_item_add_subtree(item
, ett_fip_dt_name
);
466 fip_desc_type_len(subtree
, desc_tvb
);
467 text
= tvb_fcwwn_to_str(desc_tvb
, 4);
468 proto_tree_add_string(subtree
, hf_fip_desc_name
,
469 desc_tvb
, 4, 8, text
);
470 proto_item_append_text(item
, "%s", text
);
473 subtree
= proto_item_add_subtree(item
, ett_fip_dt_fab
);
474 fip_desc_type_len(subtree
, desc_tvb
);
475 proto_tree_add_item(subtree
, hf_fip_desc_fab_vfid
, desc_tvb
,
476 2, 2, ENC_BIG_ENDIAN
);
477 text
= tvb_fc_to_str(desc_tvb
, 5);
478 proto_tree_add_string(subtree
, hf_fip_desc_fab_map
, desc_tvb
,
480 text
= tvb_fcwwn_to_str(desc_tvb
, 8);
481 proto_tree_add_string(subtree
, hf_fip_desc_fab_name
,
482 desc_tvb
, 8, 8, text
);
483 proto_item_append_text(item
, "%s", text
);
485 case FIP_DT_FCOE_SIZE
:
486 subtree
= proto_item_add_subtree(item
, ett_fip_dt_mdl
);
487 fip_desc_type_len(subtree
, desc_tvb
);
488 proto_tree_add_item(subtree
, hf_fip_desc_fcoe_size
, desc_tvb
,
489 2, 2, ENC_BIG_ENDIAN
);
490 proto_item_append_text(item
, "%u", tvb_get_ntohs(desc_tvb
, 2));
497 subtree
= proto_item_add_subtree(item
, ett_fip_dt_caps
);
498 fip_desc_type_len(subtree
, desc_tvb
);
499 ls_tvb
= tvb_new_subset(desc_tvb
, 4, dlen
- 4, -1);
500 call_dissector(fc_handle
, ls_tvb
, pinfo
, subtree
);
501 proto_item_append_text(item
, "%u bytes", dlen
- 4);
505 subtree
= proto_item_add_subtree(item
, ett_fip_dt_vn
);
506 fip_desc_type_len(subtree
, desc_tvb
);
507 proto_tree_add_item(subtree
, hf_fip_desc_vn_mac
, desc_tvb
,
509 proto_tree_add_item(subtree
, hf_fip_desc_vn_fid
, desc_tvb
,
510 9, 3, ENC_BIG_ENDIAN
);
511 text
= tvb_fcwwn_to_str(desc_tvb
, 12);
512 proto_tree_add_string(subtree
, hf_fip_desc_vn_wwpn
,
513 desc_tvb
, 12, 8, text
);
514 proto_item_append_text(item
, "MAC %s FC_ID %6.6x",
515 tvb_bytes_to_str_punct(desc_tvb
, 2, 6, ':'),
516 tvb_get_ntoh24(desc_tvb
, 9));
519 subtree
= proto_item_add_subtree(item
, ett_fip_dt_fka
);
520 fip_desc_type_len(subtree
, desc_tvb
);
521 val
= tvb_get_ntohl(desc_tvb
, 4);
522 proto_tree_add_uint_format_value(subtree
, hf_fip_desc_fka
,
523 desc_tvb
, 4, 4, val
, "%u ms", val
);
524 proto_item_append_text(item
, "%u ms", val
);
527 subtree
= proto_item_add_subtree(item
, ett_fip_dt_vend
);
528 fip_desc_type_len(subtree
, desc_tvb
);
529 proto_tree_add_item(subtree
, hf_fip_desc_vend
, desc_tvb
,
531 if (tvb_bytes_exist(desc_tvb
, 9, -1)) {
532 proto_tree_add_item(subtree
, hf_fip_desc_vend_data
,
533 desc_tvb
, 9, -1, ENC_NA
);
537 subtree
= proto_item_add_subtree(item
, ett_fip_dt_vlan
);
538 fip_desc_type_len(subtree
, desc_tvb
);
539 proto_tree_add_item(subtree
, hf_fip_desc_vlan
, desc_tvb
,
540 2, 2, ENC_BIG_ENDIAN
);
541 proto_item_append_text(item
, "%u", tvb_get_ntohs(desc_tvb
, 2));
544 subtree
= proto_item_add_subtree(item
, ett_fip_dt_fc4f
);
545 fip_desc_type_len(subtree
, desc_tvb
);
546 fip_desc_fc4f(desc_tvb
, subtree
, item
);
549 subtree
= proto_item_add_subtree(item
, ett_fip_dt_unk
);
550 fip_desc_type_len(subtree
, desc_tvb
);
551 proto_tree_add_item(subtree
, hf_fip_desc_unk
, desc_tvb
,
559 proto_register_fip(void)
561 /* Setup list of header fields See Section 1.6.1 for details*/
562 static hf_register_info hf
[] = {
567 { "Version", "fip.ver",
568 FT_UINT8
, BASE_DEC
, NULL
, 0xf0,
573 { "Opcode", "fip.opcode",
574 FT_UINT16
, BASE_HEX
, VALS(fip_opcodes
), 0,
577 { &hf_fip_disc_subcode
,
578 { "Discovery Subcode", "fip.disc_subcode",
579 FT_UINT8
, BASE_HEX
, VALS(fip_disc_subcodes
), 0,
582 { &hf_fip_ls_subcode
,
583 { "Link Service Subcode", "fip.ls.subcode",
584 FT_UINT8
, BASE_HEX
, VALS(fip_ls_subcodes
), 0,
587 { &hf_fip_ctrl_subcode
,
588 { "Control Subcode", "fip.ctrl_subcode",
589 FT_UINT8
, BASE_HEX
, VALS(fip_ctrl_subcodes
), 0,
592 { &hf_fip_vlan_subcode
,
593 { "VLAN Subcode", "fip.vlan_subcode",
594 FT_UINT8
, BASE_HEX
, VALS(fip_vlan_subcodes
), 0,
597 { &hf_fip_vn2vn_subcode
,
598 { "VN2VN Subcode", "fip.vn2vn_subcode",
599 FT_UINT8
, BASE_HEX
, VALS(fip_vn2vn_subcodes
), 0,
602 { &hf_fip_hex_subcode
,
603 { "Unknown Subcode", "fip.subcode",
604 FT_UINT8
, BASE_HEX
, NULL
, 0,
608 { "Length of Descriptors (words)", "fip.dl_len",
609 FT_UINT16
, BASE_DEC
, NULL
, 0,
613 { "Flags", "fip.flags",
614 FT_UINT16
, BASE_HEX
, NULL
, 0,
618 { "Fabric Provided MAC addr", "fip.flags.fpma",
619 FT_BOOLEAN
, 16, NULL
, FIP_FL_FPMA
,
623 { "Server Provided MAC addr", "fip.flags.spma",
624 FT_BOOLEAN
, 16, NULL
, FIP_FL_SPMA
,
627 { &hf_fip_flag_rec_p2p
,
628 { "REC/P2P", "fip.flags.rec_p2p",
629 FT_BOOLEAN
, 16, NULL
, FIP_FL_REC_P2P
,
632 { &hf_fip_flag_avail
,
633 { "Available", "fip.flags.available",
634 FT_BOOLEAN
, 16, NULL
, FIP_FL_AVAIL
,
638 { "Solicited", "fip.flags.sol",
639 FT_BOOLEAN
, 16, NULL
, FIP_FL_SOL
,
642 { &hf_fip_flag_fport
,
643 { "F_Port", "fip.flags.fport",
644 FT_BOOLEAN
, 16, NULL
, FIP_FL_FPORT
,
648 { "Descriptor Type", "fip.desc_type",
649 FT_UINT8
, BASE_HEX
, VALS(fip_desc_types
), 0,
653 { "Descriptor Length (words)", "fip.desc_len",
654 FT_UINT8
, BASE_DEC
, NULL
, 0,
658 * Various descriptor fields.
661 { "Priority", "fip.pri",
662 FT_UINT8
, BASE_DEC
, NULL
, 0,
666 { "MAC Address", "fip.mac",
667 FT_ETHER
, BASE_NONE
, NULL
, 0,
671 { "FC-MAP-OUI", "fip.map",
672 FT_STRING
, BASE_NONE
, NULL
, 0,
676 { "Switch or Node Name", "fip.name",
677 FT_STRING
, BASE_NONE
, NULL
, 0,
680 { &hf_fip_desc_fab_vfid
,
681 { "VFID", "fip.fab.vfid",
682 FT_UINT16
, BASE_DEC
, NULL
, 0,
685 { &hf_fip_desc_fab_map
,
686 { "FC-MAP", "fip.fab.map",
687 FT_STRING
, BASE_NONE
, NULL
, 0,
690 { &hf_fip_desc_fab_name
,
691 { "Fabric Name", "fip.fab.name",
692 FT_STRING
, BASE_NONE
, NULL
, 0,
695 { &hf_fip_desc_fcoe_size
,
696 { "Max FCoE frame size", "fip.fcoe_size",
697 FT_UINT16
, BASE_DEC
, NULL
, 0,
700 { &hf_fip_desc_vn_mac
,
701 { "VN_Port MAC Address", "fip.vn.mac",
702 FT_ETHER
, BASE_NONE
, NULL
, 0,
705 { &hf_fip_desc_vn_fid
,
706 { "VN_Port FC_ID", "fip.vn.fc_id",
707 FT_UINT32
, BASE_HEX
, NULL
, 0,
710 { &hf_fip_desc_vn_wwpn
,
711 { "Port Name", "fip.vn.pwwn",
712 FT_STRING
, BASE_NONE
, NULL
, 0,
716 { "FKA_ADV_Period", "fip.fka",
717 FT_UINT32
, BASE_DEC
, NULL
, 0,
721 { "Vendor-ID", "fip.vendor",
722 FT_BYTES
, BASE_NONE
, NULL
, 0,
725 { &hf_fip_desc_vend_data
,
726 { "Vendor-specific data", "fip.vendor.data",
727 FT_BYTES
, BASE_NONE
, NULL
, 0,
731 { "VLAN", "fip.vlan",
732 FT_UINT16
, BASE_DEC
, NULL
, 0,
735 { &hf_fip_desc_fc4f_types
,
736 { "FC4 Types", "fip.fc4f.types",
737 FT_UINT32
, BASE_HEX
, NULL
, 0,
740 { &hf_fip_desc_fcp_feat
,
741 { "FCP Features", "fip.fc4f.feat.fcp",
742 FT_UINT32
, BASE_HEX
, NULL
, 0xf,
746 { "IP", "fip.fc4f.ip",
747 FT_BOOLEAN
, 32, NULL
, 1 << 5,
751 { "FCP", "fip.fc4f.fcp",
752 FT_BOOLEAN
, 32, NULL
, 1 << 8,
756 { "GS3", "fip.fc4f.gs3",
757 FT_BOOLEAN
, 32, NULL
, 1 << 0,
760 { &hf_fip_fcp_feat_t
,
761 { "FCP Target", "fip.fc4f.feat.fcp.target",
762 FT_BOOLEAN
, 32, NULL
, 1,
765 { &hf_fip_fcp_feat_i
,
766 { "FCP Initiator", "fip.fc4f.feat.fcp.initiator",
767 FT_BOOLEAN
, 32, NULL
, 2,
771 { "Unknown Descriptor", "fip.desc",
772 FT_BYTES
, BASE_NONE
, NULL
, 0,
776 static gint
*ett
[] = {
791 &ett_fip_dt_fc4f_types
,
792 &ett_fip_dt_fcp_feat
,
796 /* Register the protocol name and description */
797 proto_fip
= proto_register_protocol("FCoE Initialization Protocol",
800 /* Required function calls to register the header fields and
802 proto_register_field_array(proto_fip
, hf
, array_length(hf
));
803 proto_register_subtree_array(ett
, array_length(ett
));
807 * This function name is required because a script is used to find these
808 * routines and create the code that calls these routines.
811 proto_reg_handoff_fip(void)
813 dissector_handle_t fip_handle
;
815 fip_handle
= create_dissector_handle(dissect_fip
, proto_fip
);
816 dissector_add_uint("ethertype", ETHERTYPE_FIP
, fip_handle
);
817 fc_handle
= find_dissector("fc");