2 * Routines for FC distributed Name Server (dNS)
3 * Copyright 2001, Dinesh G Dutt <ddutt@andiamo.com>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
13 #include <epan/packet.h>
14 #include <epan/expert.h>
16 #include "packet-fc.h"
17 #include "packet-fcct.h"
18 #include "packet-fcswils.h"
20 void proto_register_fcdns(void);
21 void proto_reg_handoff_fcdns(void);
27 static dissector_handle_t dns_handle
;
29 /* protocol and registered fields */
31 /* Opcode definitions */
32 #define FCDNS_GA_NXT 0x0100
33 #define FCDNS_GID_A 0x0101
34 #define FCDNS_GPN_ID 0x0112
35 #define FCDNS_GNN_ID 0x0113
36 #define FCDNS_GCS_ID 0x0114
37 #define FCDNS_GFT_ID 0x0117
38 #define FCDNS_GSPN_ID 0x0118
39 #define FCDNS_GPT_ID 0x011A
40 #define FCDNS_GIPP_ID 0x011B
41 #define FCDNS_GFPN_ID 0x011C
42 #define FCDNS_GHA_ID 0x011D
43 #define FCDNS_GFD_ID 0x011E
44 #define FCDNS_GFF_ID 0x011F
45 #define FCDNS_GID_PN 0x0121
46 #define FCDNS_GIPP_PN 0x012B
47 #define FCDNS_GID_NN 0x0131
48 #define FCDNS_GPN_NN 0x0132
49 #define FCDNS_GIP_NN 0x0135
50 #define FCDNS_GIPA_NN 0x0136
51 #define FCDNS_GSNN_NN 0x0139
52 #define FCDNS_GNN_IP 0x0153
53 #define FCDNS_GIPA_IP 0x0156
54 #define FCDNS_GID_FT 0x0171
55 #define FCDNS_GPN_FT 0x0172
56 #define FCDNS_GNN_FT 0x0173
57 #define FCDNS_GID_PT 0x01A1
58 #define FCDNS_GID_IPP 0x01B1
59 #define FCDNS_GPN_IPP 0x01B2
60 #define FCDNS_GID_FF 0x01F1
61 #define FCDNS_RPN_ID 0x0212
62 #define FCDNS_RNN_ID 0x0213
63 #define FCDNS_RCS_ID 0x0214
64 #define FCDNS_RFT_ID 0x0217
65 #define FCDNS_RSPN_ID 0x0218
66 #define FCDNS_RPT_ID 0x021A
67 #define FCDNS_RIPP_ID 0x021B
68 #define FCDNS_RHA_ID 0x021D
69 #define FCDNS_RFD_ID 0x021E
70 #define FCDNS_RFF_ID 0x021F
71 #define FCDNS_RIP_NN 0x0235
72 #define FCDNS_RSNN_NN 0x0239
73 #define FCDNS_DA_ID 0x0300
74 /* dNS messages defined by FC-SW2 */
76 #define FCDNS_GE_ID 0x0410
77 #define FCDNS_GE_PN 0x0420
78 #define FCDNS_GE_NN 0x0430
79 #define FCDNS_GE_IP 0x0450
80 #define FCDNS_GE_FT 0x0470
81 #define FCDNS_GE_PT 0x04A0
82 #define FCDNS_GE_ZM 0x04B0
83 #define FCDNS_GE_ZN 0x04C0
84 #define FCDNS_GE_IPP 0x04D0
85 #define FCDNS_GE_FF 0x04E0
87 static const value_string fc_dns_opcode_val
[] = {
88 {FCDNS_GA_NXT
, "GA_NXT" },
89 {FCDNS_GID_A
, "GID_A" },
90 {FCDNS_GPN_ID
, "GPN_ID" },
91 {FCDNS_GNN_ID
, "GNN_ID" },
92 {FCDNS_GCS_ID
, "GCS_ID" },
93 {FCDNS_GFT_ID
, "GFT_ID" },
94 {FCDNS_GSPN_ID
, "GSPN_ID" },
95 {FCDNS_GPT_ID
, "GPT_ID" },
96 {FCDNS_GIPP_ID
, "GIPP_ID" },
97 {FCDNS_GFPN_ID
, "GFPN_ID" },
98 {FCDNS_GHA_ID
, "GHA_ID" },
99 {FCDNS_GFD_ID
, "GFD_ID" },
100 {FCDNS_GFF_ID
, "GFF_ID" },
101 {FCDNS_GID_PN
, "GID_PN" },
102 {FCDNS_GIPP_PN
, "GIPP_PN" },
103 {FCDNS_GID_NN
, "GID_NN" },
104 {FCDNS_GPN_NN
, "GPN_NN" },
105 {FCDNS_GIP_NN
, "GIP_NN" },
106 {FCDNS_GIPA_NN
, "GIPA_NN" },
107 {FCDNS_GSNN_NN
, "GSNN_NN" },
108 {FCDNS_GNN_IP
, "GNN_IP" },
109 {FCDNS_GIPA_IP
, "GIPA_IP" },
110 {FCDNS_GID_FT
, "GID_FT" },
111 {FCDNS_GPN_FT
, "GPN_FT" },
112 {FCDNS_GNN_FT
, "GNN_FT" },
113 {FCDNS_GID_PT
, "GID_PT" },
114 {FCDNS_GID_IPP
, "GID_IPP" },
115 {FCDNS_GPN_IPP
, "GPN_IPP" },
116 {FCDNS_GID_FF
, "GID_FF" },
117 {FCDNS_RPN_ID
, "RPN_ID" },
118 {FCDNS_RNN_ID
, "RNN_ID" },
119 {FCDNS_RCS_ID
, "RCS_ID" },
120 {FCDNS_RFT_ID
, "RFT_ID" },
121 {FCDNS_RSPN_ID
, "RSPN_ID" },
122 {FCDNS_RPT_ID
, "RPT_ID" },
123 {FCDNS_RIPP_ID
, "RIPP_ID" },
124 {FCDNS_RHA_ID
, "RHA_ID" },
125 {FCDNS_RFD_ID
, "RFD_ID" },
126 {FCDNS_RFF_ID
, "RFF_ID" },
127 {FCDNS_RIP_NN
, "RIP_NN" },
128 {FCDNS_RSNN_NN
, "RSNN_NN"},
129 {FCDNS_DA_ID
, "DA_ID"},
130 {FCDNS_GE_ID
, "GE_ID"},
131 {FCDNS_GE_PN
, "GE_PN"},
132 {FCDNS_GE_NN
, "GE_NN"},
133 {FCDNS_GE_IP
, "GE_IP"},
134 {FCDNS_GE_FT
, "GE_FT"},
135 {FCDNS_GE_PT
, "GE_PT"},
136 {FCDNS_GE_ZM
, "GE_ZM"},
137 {FCDNS_GE_ZN
, "GE_ZN"},
138 {FCDNS_GE_IPP
, "GE_IPP"},
139 {FCDNS_GE_FF
, "GE_FF"},
140 {FCCT_MSG_ACC
, "MSG_ACC"},
141 {FCCT_MSG_RJT
, "MSG_RJT"},
145 /* Port type definitions */
146 #define FCDNS_PTYPE_UNDEF 0x00
147 #define FCDNS_PTYPE_NPORT 0x01
148 #define FCDNS_PTYPE_NLPORT 0x02
149 #define FCDNS_PTYPE_FNLPORT 0x03
150 #define FCDNS_PTYPE_NXPORT 0x7F
151 #define FCDNS_PTYPE_FPORT 0x81
152 #define FCDNS_PTYPE_FLPORT 0x82
153 #define FCDNS_PTYPE_EPORT 0x84
154 #define FCDNS_PTYPE_BPORT 0x85
156 static const value_string fc_dns_port_type_val
[] = {
157 {FCDNS_PTYPE_UNDEF
, "Undefined Port Type"},
158 {FCDNS_PTYPE_NPORT
, "N_Port"},
159 {FCDNS_PTYPE_NLPORT
, "NL_Port"},
160 {FCDNS_PTYPE_FNLPORT
, "F/NL_Port"},
161 {FCDNS_PTYPE_NXPORT
, "Nx_Port"},
162 {FCDNS_PTYPE_FPORT
, "F_Port"},
163 {FCDNS_PTYPE_FLPORT
, "FL_Port"},
164 {FCDNS_PTYPE_EPORT
, "E_Port"},
165 {FCDNS_PTYPE_BPORT
, "B_Port"},
169 /* Reject Detailed Reason code definitions for dNS */
170 #define FCDNS_RJT_NOREASON 0x00
171 #define FCDNS_RJT_PIDNOTREG 0x01
172 #define FCDNS_RJT_PNAMENOTREG 0x02
173 #define FCDNS_RJT_NNAMENOTREG 0x03
174 #define FCDNS_RJT_CLASSNOTREG 0x04
175 #define FCDNS_RJT_IPNNOTREG 0x05
176 #define FCDNS_RJT_IPANOTREG 0x06
177 #define FCDNS_RJT_FC4NOTREG 0x07
178 #define FCDNS_RJT_SPNAMENOTREG 0x08
179 #define FCDNS_RJT_SNNAMENOTREG 0x09
180 #define FCDNS_RJT_PTYPENOTREG 0x0A
181 #define FCDNS_RJT_IPPNOTREG 0x0B
182 #define FCDNS_RJT_FPNAMENOTREG 0x0C
183 #define FCDNS_RJT_HRDADDNOTREG 0x0D
184 #define FCDNS_RJT_FC4DESNOTREG 0x0E
185 #define FCDNS_RJT_FC4FEANOTREG 0x0F
186 #define FCDNS_RJT_ACCRJT 0x10
187 #define FCDNS_RJT_PTYPEFMT 0x11
188 #define FCDNS_RJT_DBEMPTY 0x12
189 #define FCDNS_RJT_NOOBJSCOPE 0x13
190 #define FCDNS_RJT_AUTHRZN_EXCEPTION 0xF0
191 #define FCDNS_RJT_AUTH_EXCEPTION 0xF1
192 #define FCDNS_RJT_DB_FULL 0xF2
193 #define FCDNS_RJT_DB_EMPTY 0xF3
195 static const value_string fc_dns_rjt_det_code_val
[] = {
196 {FCDNS_RJT_NOREASON
, "No Additional Info"},
197 {FCDNS_RJT_PIDNOTREG
, "PortID Not Regd."},
198 {FCDNS_RJT_PNAMENOTREG
, "PortName Not Regd."},
199 {FCDNS_RJT_NNAMENOTREG
, "NodeName Not Regd."},
200 {FCDNS_RJT_CLASSNOTREG
, "Class Not Regd."},
201 {FCDNS_RJT_IPNNOTREG
, "IP Addr (Node) Not Regd."},
202 {FCDNS_RJT_IPANOTREG
, "IPA Not Regd."},
203 {FCDNS_RJT_FC4NOTREG
, "FC4 TYPEs Not Regd."},
204 {FCDNS_RJT_SPNAMENOTREG
, "Symbolic PortName Not Regd."},
205 {FCDNS_RJT_SNNAMENOTREG
, "Symbolic NodeName Not Regd."},
206 {FCDNS_RJT_PTYPENOTREG
, "PortType Not Regd."},
207 {FCDNS_RJT_IPPNOTREG
, "IP Addr (Port) Not Regd."},
208 {FCDNS_RJT_FPNAMENOTREG
, "Fabric Port Name Not Regd."},
209 {FCDNS_RJT_HRDADDNOTREG
, "Hard Addr Not Regd."},
210 {FCDNS_RJT_FC4DESNOTREG
, "FC4 Descriptors Not Regd."},
211 {FCDNS_RJT_FC4FEANOTREG
, "FC4 Features Not Regd."},
212 {FCDNS_RJT_ACCRJT
, "Access Denied"},
213 {FCDNS_RJT_PTYPEFMT
, "Unacceptable PortId"},
214 {FCDNS_RJT_DBEMPTY
, "Database Empty"},
215 {FCDNS_RJT_NOOBJSCOPE
, "No Objects Regd. in Scope"},
216 {FCDNS_RJT_AUTHRZN_EXCEPTION
, "Authorization Exception"},
217 {FCDNS_RJT_AUTH_EXCEPTION
, "Authentication Exception"},
218 {FCDNS_RJT_DB_FULL
, "Database Full"},
219 {FCDNS_RJT_DB_EMPTY
, "Database Empty"},
223 /* Actual servers serving the directory service type identified by subtype */
224 #define FCDNS_GSSUBTYPE_DNS 0x02
225 #define FCDNS_GSSUBTYPE_IP 0x03
227 static int proto_fcdns
;
229 static int hf_fcdns_cos_1
;
230 static int hf_fcdns_cos_2
;
231 static int hf_fcdns_cos_3
;
232 static int hf_fcdns_cos_4
;
233 static int hf_fcdns_cos_6
;
234 static int hf_fcdns_cos_f
;
235 static int hf_fcdns_fc4features
;
236 static int hf_fcdns_fc4features_i
;
237 static int hf_fcdns_fc4features_t
;
238 static int hf_fcdns_fc4type
;
239 static int hf_fcdns_fc4type_fcp
;
240 static int hf_fcdns_fc4type_gs3
;
241 static int hf_fcdns_fc4type_ip
;
242 static int hf_fcdns_fc4type_llcsnap
;
243 static int hf_fcdns_fc4type_snmp
;
244 static int hf_fcdns_fc4type_swils
;
245 static int hf_fcdns_fc4type_vi
;
246 static int hf_fcdns_id_length
;
247 static int hf_fcdns_maxres_size
;
248 static int hf_fcdns_num_entries
;
249 static int hf_fcdns_num_fc4desc
;
250 static int hf_fcdns_opcode
;
251 static int hf_fcdns_portip
;
252 static int hf_fcdns_reason
;
253 static int hf_fcdns_reply_cos
;
254 static int hf_fcdns_req_areascope
;
255 static int hf_fcdns_req_cos
;
256 static int hf_fcdns_req_domainscope
;
257 static int hf_fcdns_req_fc4type
;
258 static int hf_fcdns_req_fc4types
;
259 static int hf_fcdns_req_fdesc
;
260 static int hf_fcdns_req_fdesclen
;
261 static int hf_fcdns_req_ip
;
262 static int hf_fcdns_req_nname
;
263 static int hf_fcdns_req_pname
;
264 static int hf_fcdns_req_portid
;
265 static int hf_fcdns_req_ptype
;
266 static int hf_fcdns_req_sname
;
267 static int hf_fcdns_req_snamelen
;
268 static int hf_fcdns_req_spname
;
269 static int hf_fcdns_req_spnamelen
;
270 static int hf_fcdns_rjtdetail
;
271 static int hf_fcdns_rply_fc4desc
;
272 static int hf_fcdns_rply_fc4desclen
;
273 static int hf_fcdns_rply_fc4type
;
274 static int hf_fcdns_rply_fpname
;
275 static int hf_fcdns_rply_gft
;
276 static int hf_fcdns_rply_hrdaddr
;
277 static int hf_fcdns_rply_ipa
;
278 static int hf_fcdns_rply_ipnode
;
279 static int hf_fcdns_rply_ipport
;
280 static int hf_fcdns_rply_nname
;
281 static int hf_fcdns_rply_ownerid
;
282 static int hf_fcdns_rply_pname
;
283 static int hf_fcdns_rply_portid
;
284 static int hf_fcdns_rply_ptype
;
285 static int hf_fcdns_rply_sname
;
286 static int hf_fcdns_rply_snamelen
;
287 static int hf_fcdns_rply_spname
;
288 static int hf_fcdns_rply_spnamelen
;
289 static int hf_fcdns_sw2_objfmt
;
290 static int hf_fcdns_vendor
;
291 static int hf_fcdns_zone_flags
;
292 static int hf_fcdns_zone_mbrid
;
293 static int hf_fcdns_zone_mbrid_fc
;
294 static int hf_fcdns_zone_mbrid_uint
;
295 static int hf_fcdns_zone_mbrid_wwn
;
296 static int hf_fcdns_zone_mbrtype
;
297 static int hf_fcdns_zonelen
;
298 static int hf_fcdns_zonenm
;
300 /* Initialize the subtree pointers */
301 static int ett_fcdns
;
302 static int ett_cos_flags
;
303 static int ett_fc4flags
;
304 static int ett_fc4features
;
306 static expert_field ei_fcdns_no_record_of_exchange
;
307 static expert_field ei_fcdns_zone_mbrid
;
309 typedef struct _fcdns_conv_key
{
313 typedef struct _fcdns_conv_data
{
317 static wmem_map_t
*fcdns_req_hash
;
323 fcdns_equal(const void *v
, const void *w
)
325 const fcdns_conv_key_t
*v1
= (const fcdns_conv_key_t
*)v
;
326 const fcdns_conv_key_t
*v2
= (const fcdns_conv_key_t
*)w
;
328 return (v1
->conv_idx
== v2
->conv_idx
);
332 fcdns_hash (const void *v
)
334 const fcdns_conv_key_t
*key
= (const fcdns_conv_key_t
*)v
;
343 dissect_cos_flags (proto_tree
*parent_tree
, tvbuff_t
*tvb
, int offset
, int hfindex
)
345 static int * const flags
[] = {
355 proto_tree_add_bitmask_with_flags(parent_tree
, tvb
, offset
, hfindex
,
356 ett_cos_flags
, flags
, ENC_BIG_ENDIAN
, BMT_NO_FALSE
|BMT_NO_TFS
);
361 /* The feature routines just decode FCP's FC-4 features field
362 * based on the flahs in offset and the type in offset+1
365 dissect_fc4features_and_type (proto_tree
*parent_tree
, tvbuff_t
*tvb
, int offset
)
368 static int * const flags
[] = {
369 &hf_fcdns_fc4features_i
,
370 &hf_fcdns_fc4features_t
,
374 type
= tvb_get_uint8(tvb
, offset
+1);
376 if(type
==FC_TYPE_SCSI
){
377 proto_tree_add_bitmask_with_flags(parent_tree
, tvb
, offset
, hf_fcdns_fc4features
,
378 ett_fc4features
, flags
, ENC_NA
, BMT_NO_FALSE
|BMT_NO_TFS
);
380 proto_tree_add_item(parent_tree
, hf_fcdns_fc4features
, tvb
, offset
, 1, ENC_NA
);
383 proto_tree_add_item (parent_tree
, hf_fcdns_req_fc4type
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
386 /* The feature routines just decode FCP's FC-4 features field
389 dissect_fc4features (proto_tree
*parent_tree
, tvbuff_t
*tvb
, int offset
)
391 static int * const flags
[] = {
392 &hf_fcdns_fc4features_i
,
393 &hf_fcdns_fc4features_t
,
397 proto_tree_add_bitmask(parent_tree
, tvb
, offset
, hf_fcdns_fc4features
,
398 ett_fc4features
, flags
, ENC_NA
);
403 /* Decodes LLC/SNAP, IP, FCP, VI, GS, SW_ILS types only */
405 dissect_fc4type (proto_tree
*parent_tree
, tvbuff_t
*tvb
, int offset
, int hfindex
)
411 item
=proto_tree_add_item(parent_tree
, hfindex
, tvb
, offset
,
413 tree
=proto_item_add_subtree(item
, ett_fc4flags
);
415 flags
= tvb_get_ntohl (tvb
, offset
);
417 proto_tree_add_boolean(tree
, hf_fcdns_fc4type_fcp
, tvb
, offset
, 4, flags
);
419 proto_item_append_text(item
, " FCP");
421 flags
&=(~( 0x0100 ));
423 proto_tree_add_boolean(tree
, hf_fcdns_fc4type_ip
, tvb
, offset
, 4, flags
);
425 proto_item_append_text(item
, " IP");
427 flags
&=(~( 0x0020 ));
429 proto_tree_add_boolean(tree
, hf_fcdns_fc4type_llcsnap
, tvb
, offset
, 4, flags
);
431 proto_item_append_text(item
, " LLC/SNAP");
433 /*flags&=(~( 0x0010 ));*/
436 flags
= tvb_get_ntohl (tvb
, offset
+4);
438 proto_tree_add_boolean(tree
, hf_fcdns_fc4type_swils
, tvb
, offset
+4, 4, flags
);
440 proto_item_append_text(item
, " SW_ILS");
442 flags
&=(~( 0x0010 ));
444 proto_tree_add_boolean(tree
, hf_fcdns_fc4type_snmp
, tvb
, offset
+4, 4, flags
);
446 proto_item_append_text(item
, " SNMP");
448 flags
&=(~( 0x0004 ));
450 proto_tree_add_boolean(tree
, hf_fcdns_fc4type_gs3
, tvb
, offset
+4, 4, flags
);
452 proto_item_append_text(item
, " GS3");
454 /*flags&=(~( 0x0001 ));*/
457 flags
= tvb_get_ntohl (tvb
, offset
+8);
459 proto_tree_add_boolean(tree
, hf_fcdns_fc4type_vi
, tvb
, offset
+8, 4, flags
);
461 proto_item_append_text(item
, " VI");
463 /*flags&=(~( 0x0001 ));*/
466 /* Code to actually dissect the packets */
468 /* A bunch of get routines have a similar req packet format. The first few
469 * routines deal with this decoding. All assume that tree is valid */
471 dissect_fcdns_req_portid (tvbuff_t
*tvb
, proto_tree
*tree
, int offset
)
473 proto_tree_add_item (tree
, hf_fcdns_req_portid
, tvb
, offset
, 3, ENC_NA
);
477 dissect_fcdns_ganxt (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
479 int offset
= 16; /* past the fc_ct header */
484 dissect_fcdns_req_portid (tvb
, req_tree
, offset
+1);
487 proto_tree_add_item (req_tree
, hf_fcdns_rply_ptype
, tvb
, offset
,
489 proto_tree_add_item (req_tree
, hf_fcdns_rply_portid
, tvb
,
490 offset
+1, 3, ENC_NA
);
491 proto_tree_add_item (req_tree
, hf_fcdns_rply_pname
, tvb
,
492 offset
+4, 8, ENC_NA
);
493 len
= tvb_get_uint8 (tvb
, offset
+12);
494 proto_tree_add_item (req_tree
, hf_fcdns_rply_spnamelen
, tvb
,
495 offset
+12, 1, ENC_BIG_ENDIAN
);
496 if (!tvb_offset_exists (tvb
, 29+len
))
500 proto_tree_add_item (req_tree
, hf_fcdns_rply_spname
, tvb
,
501 offset
+13, len
, ENC_ASCII
);
504 if (tvb_offset_exists (tvb
, 292)) {
505 proto_tree_add_item (req_tree
, hf_fcdns_rply_nname
, tvb
,
506 offset
+268, 8, ENC_NA
);
508 if (tvb_offset_exists (tvb
, 548)) {
509 len
= tvb_get_uint8 (tvb
, offset
+276);
510 proto_tree_add_item (req_tree
, hf_fcdns_rply_snamelen
, tvb
,
511 offset
+276, 1, ENC_BIG_ENDIAN
);
513 proto_tree_add_item (req_tree
, hf_fcdns_rply_sname
, tvb
,
514 offset
+277, len
, ENC_ASCII
);
517 if (tvb_offset_exists (tvb
, 556)) {
518 proto_tree_add_item (req_tree
, hf_fcdns_rply_ipa
, tvb
,
519 offset
+532, 8, ENC_NA
);
521 if (tvb_offset_exists (tvb
, 572)) {
522 proto_tree_add_item (req_tree
, hf_fcdns_rply_ipnode
, tvb
,
523 offset
+540, 16, ENC_NA
);
525 if (tvb_offset_exists (tvb
, 576)) {
526 dissect_cos_flags(req_tree
, tvb
, offset
+556, hf_fcdns_reply_cos
);
528 if (tvb_offset_exists (tvb
, 608)) {
529 dissect_fc4type(req_tree
, tvb
, offset
+560, hf_fcdns_rply_gft
);
531 if (tvb_offset_exists (tvb
, 624)) {
532 proto_tree_add_item (req_tree
, hf_fcdns_rply_ipport
, tvb
,
533 offset
+592, 16, ENC_NA
);
535 if (tvb_offset_exists (tvb
, 632)) {
536 proto_tree_add_item (req_tree
, hf_fcdns_rply_fpname
, tvb
,
537 offset
+608, 8, ENC_NA
);
539 if (tvb_offset_exists (tvb
, 635)) {
540 proto_tree_add_item (req_tree
, hf_fcdns_rply_hrdaddr
, tvb
,
541 offset
+617, 3, ENC_NA
);
548 dissect_fcdns_gpnid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
550 int offset
= 16; /* past the fc_ct header */
554 dissect_fcdns_req_portid (tvb
, req_tree
, offset
+1);
557 proto_tree_add_item (req_tree
, hf_fcdns_rply_pname
, tvb
, offset
,
564 dissect_fcdns_gnnid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
566 int offset
= 16; /* past the fc_ct header */
570 dissect_fcdns_req_portid (tvb
, req_tree
, offset
+1);
573 proto_tree_add_item (req_tree
, hf_fcdns_rply_nname
, tvb
,
580 dissect_fcdns_gcsid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
582 int offset
= 16; /* past the fc_ct header */
586 dissect_fcdns_req_portid (tvb
, req_tree
, offset
);
589 dissect_cos_flags(req_tree
, tvb
, offset
, hf_fcdns_reply_cos
);
595 dissect_fcdns_gftid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
597 int offset
= 16; /* past the fc_ct header */
601 dissect_fcdns_req_portid (tvb
, req_tree
, offset
+1);
604 dissect_fc4type(req_tree
, tvb
, offset
, hf_fcdns_rply_gft
);
610 dissect_fcdns_gspnid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
612 int offset
= 16; /* past the fc_ct header */
617 dissect_fcdns_req_portid (tvb
, req_tree
, offset
+1);
620 len
= tvb_get_uint8 (tvb
, offset
);
621 proto_tree_add_item (req_tree
, hf_fcdns_rply_spnamelen
,
622 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
623 proto_tree_add_item (req_tree
, hf_fcdns_rply_spname
, tvb
,
624 offset
+1, len
, ENC_ASCII
);
630 dissect_fcdns_gptid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
632 int offset
= 16; /* past the fc_ct header */
636 dissect_fcdns_req_portid (tvb
, req_tree
, offset
+1);
639 proto_tree_add_item (req_tree
, hf_fcdns_rply_ptype
, tvb
,
640 offset
, 1, ENC_BIG_ENDIAN
);
646 dissect_fcdns_gfpnid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
648 int offset
= 16; /* past the fc_ct header */
652 dissect_fcdns_req_portid (tvb
, req_tree
, offset
+1);
655 proto_tree_add_item (req_tree
, hf_fcdns_rply_fpname
, tvb
,
663 dissect_fcdns_gfdid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
665 int offset
= 16; /* past the fc_ct header */
666 int tot_len
, desclen
;
670 dissect_fcdns_req_portid (tvb
, req_tree
, offset
+1);
671 dissect_fc4type(req_tree
, tvb
, offset
+4, hf_fcdns_fc4type
);
674 tot_len
= tvb_reported_length_remaining (tvb
, offset
); /* excluding CT header */
675 while (tot_len
> 0) {
676 /* The count of the descriptors is not returned and so we have
677 * to track the display by the length field */
678 desclen
= tvb_get_uint8 (tvb
, offset
);
679 proto_tree_add_item (req_tree
, hf_fcdns_rply_fc4desc
, tvb
,
680 offset
, desclen
, ENC_NA
);
681 tot_len
-= 255; /* descriptors are aligned to 255 bytes */
689 dissect_fcdns_gffid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
691 int offset
= 16; /* past the fc_ct header */
695 dissect_fcdns_req_portid (tvb
, req_tree
, offset
+1);
698 dissect_fc4features(req_tree
, tvb
, offset
);
704 dissect_fcdns_gidpn (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
706 int offset
= 16; /* past the fc_ct header */
710 proto_tree_add_item (req_tree
, hf_fcdns_req_pname
, tvb
,
714 proto_tree_add_item (req_tree
, hf_fcdns_rply_portid
, tvb
,
715 offset
+1, 3, ENC_NA
);
721 dissect_fcdns_gipppn (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
723 int offset
= 16; /* past the fc_ct header */
727 proto_tree_add_item (req_tree
, hf_fcdns_req_pname
, tvb
,
731 proto_tree_add_item (req_tree
, hf_fcdns_rply_ipport
, tvb
, offset
,
738 dissect_fcdns_gidnn (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
740 int offset
= 16; /* past the fc_ct header */
745 proto_tree_add_item (req_tree
, hf_fcdns_req_nname
, tvb
,
750 islast
= tvb_get_uint8 (tvb
, offset
);
751 proto_tree_add_item (req_tree
, hf_fcdns_rply_portid
,
752 tvb
, offset
+1, 3, ENC_NA
);
754 } while (!(islast
& 0x80));
760 dissect_fcdns_gipnn (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
762 int offset
= 16; /* past the fc_ct header */
766 proto_tree_add_item (req_tree
, hf_fcdns_req_nname
, tvb
,
770 proto_tree_add_item (req_tree
, hf_fcdns_rply_ipnode
, tvb
, offset
,
777 dissect_fcdns_gpnnn (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
779 int offset
= 16; /* past the fc_ct header */
784 proto_tree_add_item (req_tree
, hf_fcdns_req_nname
, tvb
,
789 islast
= tvb_get_uint8 (tvb
, offset
);
790 proto_tree_add_item (req_tree
, hf_fcdns_rply_portid
,
791 tvb
, offset
+1, 3, ENC_NA
);
792 proto_tree_add_item (req_tree
, hf_fcdns_rply_pname
,
793 tvb
, offset
+8, 8, ENC_NA
);
795 } while (!(islast
& 0x80));
801 dissect_fcdns_gsnnnn (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
803 int offset
= 16; /* past the fc_ct header */
808 proto_tree_add_item (req_tree
, hf_fcdns_req_nname
, tvb
,
812 len
= tvb_get_uint8 (tvb
, offset
);
813 proto_tree_add_item (req_tree
, hf_fcdns_rply_snamelen
, tvb
,
814 offset
, 1, ENC_BIG_ENDIAN
);
815 proto_tree_add_item (req_tree
, hf_fcdns_rply_sname
, tvb
,
816 offset
+1, len
, ENC_ASCII
);
822 dissect_fcdns_gidft (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
824 int offset
= 16; /* past the fc_ct header */
829 proto_tree_add_item (req_tree
, hf_fcdns_req_domainscope
,
830 tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
831 proto_tree_add_item (req_tree
, hf_fcdns_req_areascope
,
832 tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
833 proto_tree_add_item (req_tree
, hf_fcdns_req_fc4type
,
834 tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
838 islast
= tvb_get_uint8 (tvb
, offset
);
839 proto_tree_add_item (req_tree
, hf_fcdns_rply_portid
,
840 tvb
, offset
+1, 3, ENC_NA
);
842 } while (!(islast
& 0x80));
848 dissect_fcdns_gpnft (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
850 int offset
= 16; /* past the fc_ct header */
855 proto_tree_add_item (req_tree
, hf_fcdns_req_domainscope
,
856 tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
857 proto_tree_add_item (req_tree
, hf_fcdns_req_areascope
,
858 tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
859 proto_tree_add_item (req_tree
, hf_fcdns_req_fc4type
,
860 tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
864 islast
= tvb_get_uint8 (tvb
, offset
);
865 proto_tree_add_item (req_tree
, hf_fcdns_rply_portid
,
866 tvb
, offset
+1, 3, ENC_NA
);
867 proto_tree_add_item (req_tree
, hf_fcdns_rply_pname
,
868 tvb
, offset
+4, 8, ENC_NA
);
870 } while (!(islast
& 0x80));
876 dissect_fcdns_gnnft (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
878 int offset
= 16; /* past the fc_ct header */
883 proto_tree_add_item (req_tree
, hf_fcdns_req_domainscope
,
884 tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
885 proto_tree_add_item (req_tree
, hf_fcdns_req_areascope
,
886 tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
887 proto_tree_add_item (req_tree
, hf_fcdns_req_fc4type
,
888 tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
892 islast
= tvb_get_uint8 (tvb
, offset
);
893 proto_tree_add_item (req_tree
, hf_fcdns_rply_portid
,
894 tvb
, offset
+1, 3, ENC_NA
);
895 proto_tree_add_item (req_tree
, hf_fcdns_rply_nname
,
896 tvb
, offset
+4, 8, ENC_NA
);
898 } while (!(islast
& 0x80));
904 dissect_fcdns_gidpt (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
906 int offset
= 16; /* past the fc_ct header */
911 proto_tree_add_item (req_tree
, hf_fcdns_req_ptype
,
912 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
913 proto_tree_add_item (req_tree
, hf_fcdns_req_domainscope
,
914 tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
915 proto_tree_add_item (req_tree
, hf_fcdns_req_areascope
,
916 tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
920 islast
= tvb_get_uint8 (tvb
, offset
);
921 proto_tree_add_item (req_tree
, hf_fcdns_rply_portid
,
922 tvb
, offset
+1, 3, ENC_NA
);
924 } while (!(islast
& 0x80));
930 dissect_fcdns_gidipp (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
932 int offset
= 16; /* past the fc_ct header */
937 proto_tree_add_item (req_tree
, hf_fcdns_req_ip
, tvb
, offset
,
942 islast
= tvb_get_uint8 (tvb
, offset
);
943 proto_tree_add_item (req_tree
, hf_fcdns_rply_portid
,
944 tvb
, offset
+1, 3, ENC_NA
);
946 } while (!(islast
& 0x80));
952 dissect_fcdns_gidff (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
954 int offset
= 16; /* past the fc_ct header */
959 proto_tree_add_item (req_tree
, hf_fcdns_req_domainscope
, tvb
,
960 offset
+1, 1, ENC_BIG_ENDIAN
);
961 proto_tree_add_item (req_tree
, hf_fcdns_req_areascope
, tvb
,
962 offset
+2, 1, ENC_BIG_ENDIAN
);
963 dissect_fc4features_and_type(req_tree
, tvb
, offset
+6);
967 islast
= tvb_get_uint8 (tvb
, offset
);
968 proto_tree_add_item (req_tree
, hf_fcdns_rply_portid
,
969 tvb
, offset
+1, 3, ENC_NA
);
971 } while (!(islast
& 0x80));
977 dissect_fcdns_rpnid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
979 int offset
= 16; /* past the fc_ct header */
983 proto_tree_add_item (req_tree
, hf_fcdns_req_portid
,
984 tvb
, offset
+1, 3, ENC_NA
);
985 proto_tree_add_item (req_tree
, hf_fcdns_req_pname
, tvb
,
986 offset
+4, 8, ENC_NA
);
992 dissect_fcdns_rnnid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
994 int offset
= 16; /* past the fc_ct header */
998 proto_tree_add_item (req_tree
, hf_fcdns_req_portid
,
999 tvb
, offset
+1, 3, ENC_NA
);
1000 proto_tree_add_item (req_tree
, hf_fcdns_req_nname
, tvb
,
1001 offset
+4, 8, ENC_NA
);
1007 dissect_fcdns_rcsid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1009 int offset
= 16; /* past the fc_ct header */
1011 if (req_tree
&& isreq
) {
1012 proto_tree_add_item (req_tree
, hf_fcdns_req_portid
, tvb
,
1013 offset
+1, 3, ENC_NA
);
1014 dissect_cos_flags(req_tree
, tvb
, offset
+4, hf_fcdns_req_cos
);
1019 dissect_fcdns_rptid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1021 int offset
= 16; /* past the fc_ct header */
1024 proto_tree_add_item (req_tree
, hf_fcdns_req_portid
, tvb
,
1025 offset
+1, 3, ENC_NA
);
1026 proto_tree_add_item (req_tree
, hf_fcdns_req_ptype
, tvb
,
1027 offset
+4, 1, ENC_BIG_ENDIAN
);
1032 dissect_fcdns_rftid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1034 int offset
= 16; /* past the fc_ct header */
1037 proto_tree_add_item (req_tree
, hf_fcdns_req_portid
, tvb
,
1038 offset
+1, 3, ENC_NA
);
1039 dissect_fc4type(req_tree
, tvb
, offset
+4, hf_fcdns_req_fc4types
);
1044 dissect_fcdns_rspnid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1046 int offset
= 16; /* past the fc_ct header */
1049 if (req_tree
&& isreq
) {
1050 proto_tree_add_item (req_tree
, hf_fcdns_req_portid
, tvb
,
1051 offset
+1, 3, ENC_NA
);
1052 proto_tree_add_item (req_tree
, hf_fcdns_req_spnamelen
, tvb
,
1053 offset
+4, 1, ENC_BIG_ENDIAN
);
1054 len
= tvb_get_uint8 (tvb
, offset
+4);
1056 proto_tree_add_item (req_tree
, hf_fcdns_req_spname
, tvb
, offset
+5,
1062 dissect_fcdns_rippid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1064 int offset
= 16; /* past the fc_ct header */
1067 proto_tree_add_item (req_tree
, hf_fcdns_req_portid
, tvb
,
1068 offset
+1, 3, ENC_NA
);
1069 proto_tree_add_item (req_tree
, hf_fcdns_req_ip
, tvb
,
1070 offset
+4, 16, ENC_NA
);
1075 dissect_fcdns_rfdid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1077 int offset
= 16; /* past the fc_ct header */
1081 proto_tree_add_item (req_tree
, hf_fcdns_req_portid
, tvb
,
1082 offset
+1, 3, ENC_NA
);
1083 dissect_fc4type(req_tree
, tvb
, offset
+4, hf_fcdns_req_fc4types
);
1086 len
= tvb_reported_length_remaining (tvb
, offset
);
1089 proto_tree_add_item (req_tree
, hf_fcdns_req_fdesclen
, tvb
, offset
,
1091 proto_tree_add_item (req_tree
, hf_fcdns_req_fdesc
, tvb
, offset
+1,
1100 dissect_fcdns_rffid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1102 int offset
= 16; /* past the fc_ct header */
1105 proto_tree_add_item (req_tree
, hf_fcdns_req_portid
, tvb
, offset
+1, 3, ENC_NA
);
1106 dissect_fc4features_and_type(req_tree
, tvb
, offset
+6);
1111 dissect_fcdns_ripnn (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1113 int offset
= 16; /* past the fc_ct header */
1116 proto_tree_add_item (req_tree
, hf_fcdns_req_nname
, tvb
, offset
, 8, ENC_NA
);
1117 proto_tree_add_item (req_tree
, hf_fcdns_req_ip
, tvb
, offset
+8, 16, ENC_NA
);
1122 dissect_fcdns_rsnnnn (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1124 int offset
= 16; /* past the fc_ct header */
1128 proto_tree_add_item (req_tree
, hf_fcdns_req_nname
, tvb
, offset
, 8, ENC_NA
);
1129 len
= tvb_get_uint8 (tvb
, offset
+8);
1131 proto_tree_add_item (req_tree
, hf_fcdns_req_snamelen
, tvb
, offset
+8,
1133 proto_tree_add_item (req_tree
, hf_fcdns_req_sname
, tvb
, offset
+9,
1139 dissect_fcdns_daid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1141 int offset
= 16; /* past the fc_ct header */
1144 proto_tree_add_item (req_tree
, hf_fcdns_req_portid
, tvb
, offset
+1, 3, ENC_NA
);
1149 zonenm_to_str (wmem_allocator_t
*scope
, tvbuff_t
*tvb
, int offset
)
1151 int len
= tvb_get_uint8 (tvb
, offset
);
1152 return tvb_get_string_enc(scope
, tvb
, offset
+4, len
, ENC_ASCII
);
1156 dissect_fcdns_zone_mbr (tvbuff_t
*tvb
, packet_info
* pinfo
, proto_tree
*zmbr_tree
, int offset
)
1162 mbrtype
= tvb_get_uint8 (tvb
, offset
);
1163 ti
= proto_tree_add_uint (zmbr_tree
, hf_fcdns_zone_mbrtype
, tvb
,
1164 offset
, 1, mbrtype
);
1165 proto_tree_add_item(zmbr_tree
, hf_fcdns_zone_flags
, tvb
, offset
+2, 1, ENC_NA
);
1166 idlen
= tvb_get_uint8 (tvb
, offset
+3);
1167 proto_tree_add_item(zmbr_tree
, hf_fcdns_id_length
, tvb
, offset
+3, 1, ENC_NA
);
1169 case FC_SWILS_ZONEMBR_WWN
:
1170 proto_tree_add_item (zmbr_tree
, hf_fcdns_zone_mbrid_wwn
, tvb
,
1171 offset
+4, 8, ENC_NA
);
1173 case FC_SWILS_ZONEMBR_DP
:
1174 proto_tree_add_item (zmbr_tree
, hf_fcdns_zone_mbrid_uint
, tvb
,
1175 offset
+4, 4, ENC_BIG_ENDIAN
);
1177 case FC_SWILS_ZONEMBR_FCID
:
1178 proto_tree_add_item (zmbr_tree
, hf_fcdns_zone_mbrid_fc
, tvb
,
1179 offset
+4, 3, ENC_NA
);
1181 case FC_SWILS_ZONEMBR_ALIAS
:
1182 proto_tree_add_string (zmbr_tree
, hf_fcdns_zone_mbrid
, tvb
,
1183 offset
+4, idlen
, zonenm_to_str (pinfo
->pool
, tvb
, offset
+4));
1186 expert_add_info(pinfo
, ti
, &ei_fcdns_zone_mbrid
);
1192 dissect_fcdns_swils_entries (tvbuff_t
*tvb
, proto_tree
*tree
, int offset
)
1198 numrec
= tvb_get_ntohl (tvb
, offset
);
1199 proto_tree_add_uint(tree
, hf_fcdns_num_entries
, tvb
, offset
, 4, numrec
);
1202 for (i
= 0; i
< numrec
; i
++) {
1203 objfmt
= tvb_get_uint8 (tvb
, offset
);
1205 proto_tree_add_item (tree
, hf_fcdns_sw2_objfmt
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1206 proto_tree_add_item (tree
, hf_fcdns_rply_ownerid
, tvb
, offset
+1, 3, ENC_NA
);
1207 proto_tree_add_item (tree
, hf_fcdns_rply_ptype
, tvb
, offset
+4,
1209 proto_tree_add_item (tree
, hf_fcdns_rply_portid
, tvb
, offset
+5, 3, ENC_NA
);
1210 proto_tree_add_item (tree
, hf_fcdns_rply_pname
, tvb
, offset
+8, 8, ENC_NA
);
1212 if (!(objfmt
& 0x1)) {
1213 len
= tvb_get_uint8 (tvb
, offset
);
1214 proto_tree_add_item (tree
, hf_fcdns_rply_spnamelen
, tvb
,
1215 offset
, 1, ENC_BIG_ENDIAN
);
1216 proto_tree_add_item (tree
, hf_fcdns_rply_spname
, tvb
,
1217 offset
+1, len
, ENC_ASCII
);
1220 proto_tree_add_item (tree
, hf_fcdns_rply_nname
, tvb
, offset
, 8, ENC_NA
);
1222 if (!(objfmt
& 0x1)) {
1223 len
= tvb_get_uint8 (tvb
, offset
);
1224 proto_tree_add_item (tree
, hf_fcdns_rply_snamelen
, tvb
,
1225 offset
, 1, ENC_BIG_ENDIAN
);
1226 proto_tree_add_item (tree
, hf_fcdns_rply_sname
, tvb
,
1227 offset
+1, len
, ENC_ASCII
);
1230 proto_tree_add_item (tree
, hf_fcdns_rply_ipa
, tvb
, offset
, 8, ENC_NA
);
1231 proto_tree_add_item (tree
, hf_fcdns_rply_ipnode
, tvb
, offset
+8, 16,
1233 dissect_cos_flags(tree
, tvb
, offset
+24, hf_fcdns_reply_cos
);
1234 dissect_fc4type(tree
, tvb
, offset
+28, hf_fcdns_rply_gft
);
1235 proto_tree_add_item (tree
, hf_fcdns_rply_ipport
, tvb
, offset
+60,
1237 proto_tree_add_item (tree
, hf_fcdns_rply_fpname
, tvb
, offset
+76,
1239 proto_tree_add_item (tree
, hf_fcdns_rply_hrdaddr
, tvb
, offset
+85,
1243 dissect_fc4features(tree
, tvb
, offset
);
1244 if (tvb_get_uint8 (tvb
, offset
+129)) {
1245 proto_tree_add_item (tree
, hf_fcdns_rply_fc4type
, tvb
,
1246 offset
+128, 1, ENC_BIG_ENDIAN
);
1247 proto_tree_add_item (tree
, hf_fcdns_num_fc4desc
, tvb
,
1248 offset
+129, 1, ENC_BIG_ENDIAN
);
1249 len
= tvb_get_uint8 (tvb
, offset
+132);
1250 proto_tree_add_item (tree
, hf_fcdns_rply_fc4desclen
, tvb
,
1251 offset
+132, 1, ENC_BIG_ENDIAN
);
1252 proto_tree_add_item (tree
, hf_fcdns_rply_fc4desc
, tvb
,
1253 offset
+133, len
, ENC_NA
);
1256 proto_tree_add_item (tree
, hf_fcdns_num_fc4desc
, tvb
,
1257 offset
+129, 1, ENC_BIG_ENDIAN
);
1259 offset
+= 388; /* FC4 desc is 260 bytes, maybe padded */
1266 dissect_fcdns_geid (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1268 int offset
= 16; /* past the fc_ct header */
1271 proto_tree_add_item (req_tree
, hf_fcdns_req_portid
, tvb
, offset
+1, 3, ENC_NA
);
1274 dissect_fcdns_swils_entries (tvb
, req_tree
, offset
);
1279 dissect_fcdns_gepn (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1281 int offset
= 16; /* past the fc_ct header */
1283 proto_tree_add_item(req_tree
, hf_fcdns_req_pname
, tvb
, offset
, 8, ENC_NA
);
1286 dissect_fcdns_swils_entries (tvb
, req_tree
, offset
);
1291 dissect_fcdns_genn (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1293 int offset
= 16; /* past the fc_ct header */
1296 proto_tree_add_item (req_tree
, hf_fcdns_req_nname
, tvb
, offset
, 8, ENC_NA
);
1299 dissect_fcdns_swils_entries (tvb
, req_tree
, offset
);
1304 dissect_fcdns_geip (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1306 int offset
= 16; /* past the fc_ct header */
1310 proto_tree_add_item (req_tree
, hf_fcdns_req_ip
, tvb
, offset
, 16, ENC_NA
);
1314 dissect_fcdns_swils_entries (tvb
, req_tree
, offset
);
1319 dissect_fcdns_geft (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1321 int offset
= 16; /* past the fc_ct header */
1325 dissect_fc4type(req_tree
, tvb
, offset
, hf_fcdns_fc4type
);
1329 dissect_fcdns_swils_entries (tvb
, req_tree
, offset
);
1334 dissect_fcdns_gept (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1336 int offset
= 16; /* past the fc_ct header */
1340 proto_tree_add_item (req_tree
, hf_fcdns_req_ptype
, tvb
, offset
+3,
1345 dissect_fcdns_swils_entries (tvb
, req_tree
, offset
);
1350 dissect_fcdns_gezm (tvbuff_t
*tvb
, packet_info
* pinfo
, proto_tree
*req_tree
, bool isreq
)
1352 int offset
= 16; /* past the fc_ct header */
1355 dissect_fcdns_zone_mbr (tvb
, pinfo
, req_tree
, offset
);
1358 dissect_fcdns_swils_entries (tvb
, req_tree
, offset
);
1363 dissect_fcdns_gezn (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1365 int offset
= 16; /* past the fc_ct header */
1370 str_len
= tvb_get_uint8 (tvb
, offset
);
1371 proto_tree_add_uint(req_tree
, hf_fcdns_zonelen
, tvb
, offset
, 1, str_len
);
1372 proto_tree_add_item (req_tree
, hf_fcdns_zonenm
, tvb
, offset
+3,
1373 str_len
, ENC_ASCII
);
1377 dissect_fcdns_swils_entries (tvb
, req_tree
, offset
);
1382 dissect_fcdns_geipp (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1384 int offset
= 16; /* past the fc_ct header */
1388 proto_tree_add_item (req_tree
, hf_fcdns_portip
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1392 dissect_fcdns_swils_entries (tvb
, req_tree
, offset
);
1397 dissect_fcdns_geff (tvbuff_t
*tvb
, proto_tree
*req_tree
, bool isreq
)
1399 int offset
= 16; /* past the fc_ct header */
1403 dissect_fc4features(req_tree
, tvb
, offset
);
1407 dissect_fcdns_swils_entries (tvb
, req_tree
, offset
);
1412 dissect_fcdns_rjt (tvbuff_t
*tvb
, proto_tree
*req_tree
)
1417 proto_tree_add_item (req_tree
, hf_fcdns_reason
, tvb
, offset
+13, 1, ENC_BIG_ENDIAN
);
1418 proto_tree_add_item (req_tree
, hf_fcdns_rjtdetail
, tvb
, offset
+14, 1,
1420 proto_tree_add_item (req_tree
, hf_fcdns_vendor
, tvb
, offset
+15, 1, ENC_BIG_ENDIAN
);
1425 dissect_fcdns (tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data
)
1427 /* Set up structures needed to add the protocol subtree and manage it */
1428 proto_item
*ti
= NULL
;
1429 proto_tree
*fcdns_tree
= NULL
;
1434 fc_ct_preamble cthdr
;
1435 conversation_t
*conversation
;
1436 fcdns_conv_data_t
*cdata
;
1437 fcdns_conv_key_t ckey
, *req_key
;
1440 /* Reject the packet if data is NULL */
1443 fchdr
= (fc_hdr
*)data
;
1445 tvb_memcpy (tvb
, (uint8_t *)&cthdr
, offset
, FCCT_PRMBL_SIZE
);
1446 cthdr
.revision
= tvb_get_uint8 (tvb
, offset
);
1447 cthdr
.in_id
= tvb_get_ntoh24 (tvb
, offset
+1);
1448 cthdr
.opcode
= g_ntohs (cthdr
.opcode
);
1449 opcode
= cthdr
.opcode
;
1450 cthdr
.maxres_size
= g_ntohs (cthdr
.maxres_size
);
1452 /* Determine the type of server the request/response is for */
1453 if (cthdr
.gstype
== FCCT_GSTYPE_DIRSVC
)
1454 col_set_str (pinfo
->cinfo
, COL_PROTOCOL
, "dNS");
1456 col_set_str (pinfo
->cinfo
, COL_PROTOCOL
, "Unzoned NS");
1459 if (cthdr
.gstype
== FCCT_GSTYPE_DIRSVC
) {
1460 ti
= proto_tree_add_protocol_format (tree
, proto_fcdns
, tvb
, 0,
1463 fcdns_tree
= proto_item_add_subtree (ti
, ett_fcdns
);
1466 ti
= proto_tree_add_protocol_format (tree
, proto_fcdns
, tvb
, 0,
1469 fcdns_tree
= proto_item_add_subtree (ti
, ett_fcdns
);
1473 if ((opcode
!= FCCT_MSG_ACC
) && (opcode
!= FCCT_MSG_RJT
)) {
1474 conversation
= find_conversation (pinfo
->num
, &pinfo
->src
, &pinfo
->dst
,
1475 conversation_pt_to_conversation_type(pinfo
->ptype
), fchdr
->oxid
,
1476 fchdr
->rxid
, NO_PORT_B
);
1477 if (!conversation
) {
1478 conversation
= conversation_new (pinfo
->num
, &pinfo
->src
, &pinfo
->dst
,
1479 conversation_pt_to_conversation_type(pinfo
->ptype
), fchdr
->oxid
,
1480 fchdr
->rxid
, NO_PORT2
);
1483 ckey
.conv_idx
= conversation
->conv_index
;
1485 cdata
= (fcdns_conv_data_t
*)wmem_map_lookup (fcdns_req_hash
,
1488 /* Since we never free the memory used by an exchange, this maybe a
1489 * case of another request using the same exchange as a previous
1492 cdata
->opcode
= opcode
;
1495 req_key
= wmem_new(wmem_file_scope(), fcdns_conv_key_t
);
1496 req_key
->conv_idx
= conversation
->conv_index
;
1498 cdata
= wmem_new(wmem_file_scope(), fcdns_conv_data_t
);
1499 cdata
->opcode
= opcode
;
1501 wmem_map_insert (fcdns_req_hash
, req_key
, cdata
);
1503 col_add_str (pinfo
->cinfo
, COL_INFO
, val_to_str (opcode
, fc_dns_opcode_val
,
1507 /* Opcode is ACC or RJT */
1508 conversation
= find_conversation (pinfo
->num
, &pinfo
->src
, &pinfo
->dst
,
1509 conversation_pt_to_conversation_type(pinfo
->ptype
), fchdr
->oxid
,
1510 fchdr
->rxid
, NO_PORT_B
);
1512 if (!conversation
) {
1513 if (opcode
== FCCT_MSG_ACC
) {
1514 col_add_str (pinfo
->cinfo
, COL_INFO
,
1515 val_to_str (opcode
, fc_dns_opcode_val
,
1517 /* No record of what this accept is for. Can't decode */
1518 proto_tree_add_expert(fcdns_tree
, pinfo
, &ei_fcdns_no_record_of_exchange
, tvb
, 0, -1);
1523 ckey
.conv_idx
= conversation
->conv_index
;
1525 cdata
= (fcdns_conv_data_t
*)wmem_map_lookup (fcdns_req_hash
, &ckey
);
1527 if (cdata
!= NULL
) {
1528 if (opcode
== FCCT_MSG_ACC
) {
1529 opcode
= cdata
->opcode
;
1532 failed_opcode
= cdata
->opcode
;
1535 if (opcode
!= FCCT_MSG_RJT
) {
1536 col_add_fstr (pinfo
->cinfo
, COL_INFO
, "ACC (%s)",
1537 val_to_str (opcode
, fc_dns_opcode_val
,
1541 col_add_fstr (pinfo
->cinfo
, COL_INFO
, "RJT (%s)",
1542 val_to_str (failed_opcode
,
1548 if ((cdata
== NULL
) && (opcode
!= FCCT_MSG_RJT
)) {
1549 /* No record of what this accept is for. Can't decode */
1550 proto_tree_add_expert(fcdns_tree
, pinfo
, &ei_fcdns_no_record_of_exchange
, tvb
, 0, -1);
1558 proto_tree_add_item (fcdns_tree
, hf_fcdns_opcode
, tvb
, offset
+8, 2, ENC_BIG_ENDIAN
);
1559 proto_tree_add_item (fcdns_tree
, hf_fcdns_maxres_size
, tvb
, offset
+10,
1565 dissect_fcdns_rjt (tvb
, fcdns_tree
);
1568 dissect_fcdns_ganxt (tvb
, fcdns_tree
, isreq
);
1571 dissect_fcdns_gpnid (tvb
, fcdns_tree
, isreq
);
1574 dissect_fcdns_gnnid (tvb
, fcdns_tree
, isreq
);
1577 dissect_fcdns_gcsid (tvb
, fcdns_tree
, isreq
);
1580 dissect_fcdns_gftid (tvb
, fcdns_tree
, isreq
);
1583 dissect_fcdns_gspnid (tvb
, fcdns_tree
, isreq
);
1586 dissect_fcdns_gptid (tvb
, fcdns_tree
, isreq
);
1589 dissect_fcdns_gfpnid (tvb
, fcdns_tree
, isreq
);
1592 dissect_fcdns_gfdid (tvb
, fcdns_tree
, isreq
);
1595 dissect_fcdns_gffid (tvb
, fcdns_tree
, isreq
);
1598 dissect_fcdns_gidpn (tvb
, fcdns_tree
, isreq
);
1601 dissect_fcdns_gipppn (tvb
, fcdns_tree
, isreq
);
1604 dissect_fcdns_gidnn (tvb
, fcdns_tree
, isreq
);
1607 dissect_fcdns_gpnnn (tvb
, fcdns_tree
, isreq
);
1610 dissect_fcdns_gipnn (tvb
, fcdns_tree
, isreq
);
1613 dissect_fcdns_gsnnnn (tvb
, fcdns_tree
, isreq
);
1616 dissect_fcdns_gidft (tvb
, fcdns_tree
, isreq
);
1619 dissect_fcdns_gpnft (tvb
, fcdns_tree
, isreq
);
1622 dissect_fcdns_gnnft (tvb
, fcdns_tree
, isreq
);
1625 dissect_fcdns_gidpt (tvb
, fcdns_tree
, isreq
);
1628 dissect_fcdns_gidipp (tvb
, fcdns_tree
, isreq
);
1631 dissect_fcdns_gidff (tvb
, fcdns_tree
, isreq
);
1634 dissect_fcdns_rpnid (tvb
, fcdns_tree
, isreq
);
1637 dissect_fcdns_rnnid (tvb
, fcdns_tree
, isreq
);
1640 dissect_fcdns_rcsid (tvb
, fcdns_tree
, isreq
);
1643 dissect_fcdns_rptid (tvb
, fcdns_tree
, isreq
);
1646 dissect_fcdns_rftid (tvb
, fcdns_tree
, isreq
);
1649 dissect_fcdns_rspnid (tvb
, fcdns_tree
, isreq
);
1652 dissect_fcdns_rippid (tvb
, fcdns_tree
, isreq
);
1655 dissect_fcdns_rfdid (tvb
, fcdns_tree
, isreq
);
1658 dissect_fcdns_rffid (tvb
, fcdns_tree
, isreq
);
1661 dissect_fcdns_ripnn (tvb
, fcdns_tree
, isreq
);
1664 dissect_fcdns_rsnnnn (tvb
, fcdns_tree
, isreq
);
1667 dissect_fcdns_daid (tvb
, fcdns_tree
, isreq
);
1670 dissect_fcdns_geid (tvb
, fcdns_tree
, isreq
);
1673 dissect_fcdns_gepn (tvb
, fcdns_tree
, isreq
);
1676 dissect_fcdns_genn (tvb
, fcdns_tree
, isreq
);
1679 dissect_fcdns_geip (tvb
, fcdns_tree
, isreq
);
1682 dissect_fcdns_geft (tvb
, fcdns_tree
, isreq
);
1685 dissect_fcdns_gept (tvb
, fcdns_tree
, isreq
);
1688 dissect_fcdns_gezm (tvb
, pinfo
, fcdns_tree
, isreq
);
1691 dissect_fcdns_gezn (tvb
, fcdns_tree
, isreq
);
1694 dissect_fcdns_geipp (tvb
, fcdns_tree
, isreq
);
1697 dissect_fcdns_geff (tvb
, fcdns_tree
, isreq
);
1703 return tvb_captured_length(tvb
);
1706 /* Register the protocol with Wireshark */
1709 proto_register_fcdns (void)
1711 static hf_register_info hf
[] = {
1713 { "Opcode", "fcdns.opcode",
1714 FT_UINT16
, BASE_HEX
, VALS (fc_dns_opcode_val
), 0x0,
1718 { "Reason Code", "fcdns.rply.reason",
1719 FT_UINT8
, BASE_HEX
, VALS (fc_ct_rjt_code_vals
), 0x0,
1723 { "Vendor Unique Reject Code", "fcdns.rply.vendor",
1724 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1727 { &hf_fcdns_req_portid
,
1728 { "Port Identifier", "fcdns.req.portid",
1729 FT_BYTES
, SEP_DOT
, NULL
, 0x0,
1732 { &hf_fcdns_rply_pname
,
1733 { "Port Name", "fcdns.rply.pname",
1734 FT_FCWWN
, BASE_NONE
, NULL
, 0x0,
1737 { &hf_fcdns_rply_nname
,
1738 { "Node Name", "fcdns.rply.nname",
1739 FT_FCWWN
, BASE_NONE
, NULL
, 0x0,
1742 { &hf_fcdns_rply_gft
,
1743 { "FC-4 Types Supported", "fcdns.rply.gft",
1744 FT_NONE
, BASE_NONE
, NULL
, 0x0,
1747 { &hf_fcdns_rply_snamelen
,
1748 { "Symbolic Node Name Length", "fcdns.rply.snamelen",
1749 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1752 { &hf_fcdns_rply_sname
,
1753 { "Symbolic Node Name", "fcdns.rply.sname",
1754 FT_STRING
, BASE_NONE
, NULL
, 0x0,
1757 { &hf_fcdns_rply_ptype
,
1758 { "Port Type", "fcdns.rply.porttype",
1759 FT_UINT8
, BASE_HEX
, VALS (fc_dns_port_type_val
), 0x0,
1762 { &hf_fcdns_rply_fpname
,
1763 { "Fabric Port Name", "fcdns.rply.fpname",
1764 FT_FCWWN
, BASE_NONE
, NULL
, 0x0,
1767 { &hf_fcdns_fc4type
,
1768 { "FC-4 Types", "fcdns.req.fc4types",
1769 FT_NONE
, BASE_NONE
, NULL
, 0x0,
1772 { &hf_fcdns_rply_fc4type
,
1773 { "FC-4 Descriptor Type", "fcdns.rply.fc4type",
1774 FT_UINT8
, BASE_HEX
, VALS (fc_fc4_val
), 0x0,
1777 { &hf_fcdns_rply_fc4desc
,
1778 { "FC-4 Descriptor", "fcdns.rply.fc4desc",
1779 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1782 { &hf_fcdns_req_pname
,
1783 { "Port Name", "fcdns.req.portname",
1784 FT_FCWWN
, BASE_NONE
, NULL
, 0x0,
1787 { &hf_fcdns_rply_portid
,
1788 { "Port Identifier", "fcdns.rply.portid",
1789 FT_BYTES
, SEP_DOT
, NULL
, 0x0,
1792 { &hf_fcdns_req_nname
,
1793 { "Node Name", "fcdns.req.nname",
1794 FT_FCWWN
, BASE_NONE
, NULL
, 0x0,
1797 { &hf_fcdns_req_domainscope
,
1798 { "Domain ID Scope", "fcdns.req.domainid",
1799 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1802 { &hf_fcdns_req_areascope
,
1803 { "Area ID Scope", "fcdns.req.areaid",
1804 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1807 { &hf_fcdns_req_ptype
,
1808 { "Port Type", "fcdns.req.porttype",
1809 FT_UINT8
, BASE_HEX
, VALS (fc_dns_port_type_val
), 0x0,
1812 { &hf_fcdns_req_cos
,
1813 { "Requested Class of Service", "fcdns.req.class",
1814 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1817 { &hf_fcdns_req_fc4types
,
1818 { "FC-4 Types Supported", "fcdns.req.fc4types",
1819 FT_NONE
, BASE_NONE
, NULL
, 0x0,
1822 { &hf_fcdns_req_snamelen
,
1823 { "Symbolic Name Length", "fcdns.req.snamelen",
1824 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1827 { &hf_fcdns_req_sname
,
1828 { "Symbolic Port Name", "fcdns.req.sname",
1829 FT_STRING
, BASE_NONE
, NULL
, 0x0,
1832 { &hf_fcdns_rply_spnamelen
,
1833 { "Symbolic Port Name Length", "fcdns.rply.spnamelen",
1834 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1837 { &hf_fcdns_rply_spname
,
1838 { "Symbolic Port Name", "fcdns.rply.spname",
1839 FT_STRING
, BASE_NONE
, NULL
, 0x0,
1842 { &hf_fcdns_req_spnamelen
,
1843 { "Symbolic Port Name Length", "fcdns.req.spnamelen",
1844 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1847 { &hf_fcdns_req_spname
,
1848 { "Symbolic Port Name", "fcdns.req.spname",
1849 FT_STRING
, BASE_NONE
, NULL
, 0x0,
1852 { &hf_fcdns_rply_ipa
,
1853 { "Initial Process Associator", "fcdns.rply.ipa",
1854 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
1857 { &hf_fcdns_rply_ipnode
,
1858 { "Node IP Address", "fcdns.rply.ipnode",
1859 FT_IPv6
, BASE_NONE
, NULL
, 0x0,
1862 { &hf_fcdns_rply_ipport
,
1863 { "Port IP Address", "fcdns.rply.ipport",
1864 FT_IPv6
, BASE_NONE
, NULL
, 0x0,
1867 { &hf_fcdns_rply_fc4desclen
,
1868 { "FC-4 Descriptor Length", "fcdns.rply.fc4desclen",
1869 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1872 { &hf_fcdns_rply_hrdaddr
,
1873 { "Hard Address", "fcdns.rply.hrdaddr",
1874 FT_BYTES
, SEP_DOT
, NULL
, 0x0,
1877 { &hf_fcdns_req_fdesclen
,
1878 { "FC-4 Descriptor Length", "fcdns.req.fc4desclen",
1879 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1882 { &hf_fcdns_req_fdesc
,
1883 { "FC-4 Descriptor", "fcdns.req.fc4desc",
1884 FT_STRING
, BASE_NONE
, NULL
, 0x0,
1888 { "IP Address", "fcdns.req.ip",
1889 FT_IPv6
, BASE_NONE
, NULL
, 0x0,
1892 { &hf_fcdns_rjtdetail
,
1893 { "Reason Code Explanation", "fcdns.rply.reasondet",
1894 FT_UINT8
, BASE_HEX
, VALS (fc_dns_rjt_det_code_val
), 0x0,
1897 { &hf_fcdns_zone_mbrtype
,
1898 { "Zone Member Type", "fcdns.zone.mbrtype",
1899 FT_UINT8
, BASE_HEX
, VALS (fc_swils_zonembr_type_val
), 0x0,
1902 { &hf_fcdns_zone_mbrid
,
1903 { "Member Identifier", "fcdns.zone.mbrid",
1904 FT_STRING
, BASE_NONE
, NULL
, 0x0,
1907 { &hf_fcdns_zone_mbrid_wwn
,
1908 { "Member Identifier", "fcdns.zone.mbrid.wwn",
1909 FT_FCWWN
, BASE_NONE
, NULL
, 0x0,
1912 { &hf_fcdns_zone_mbrid_uint
,
1913 { "Member Identifier", "fcdns.zone.mbrid.uint",
1914 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1917 { &hf_fcdns_zone_mbrid_fc
,
1918 { "Member Identifier", "fcdns.zone.mbrid.fc",
1919 FT_BYTES
, SEP_DOT
, NULL
, 0x0,
1922 { &hf_fcdns_id_length
,
1923 { "Identifier Length", "fcdns.id_length",
1924 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1927 { &hf_fcdns_zone_flags
,
1928 { "Flags", "fcdns.zone_flags",
1929 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1932 { &hf_fcdns_zonelen
,
1933 { "Name Length", "fcdns.zone_len",
1934 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1938 { "Zone Name", "fcdns.zonename",
1939 FT_STRING
, BASE_NONE
, NULL
, 0x0,
1943 { "Port IP Address", "fcdns.portip",
1944 FT_IPv4
, BASE_NONE
, NULL
, 0x0,
1947 { &hf_fcdns_num_entries
,
1948 { "Number of Entries", "fcdns.num_entries",
1949 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1952 { &hf_fcdns_sw2_objfmt
,
1953 { "Name Entry Object Format", "fcdns.entry.objfmt",
1954 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1957 { &hf_fcdns_num_fc4desc
,
1958 { "Number of FC4 Descriptors Registered", "fcdns.entry.numfc4desc",
1959 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1962 { &hf_fcdns_rply_ownerid
,
1963 { "Owner Id", "fcdns.rply.ownerid",
1964 FT_BYTES
, SEP_DOT
, NULL
, 0x0,
1967 { &hf_fcdns_maxres_size
,
1968 { "Maximum/Residual Size", "fcdns.maxres_size",
1969 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1972 { &hf_fcdns_reply_cos
,
1973 { "Class of Service Supported", "fcdns.reply.cos",
1974 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1978 { "F", "fcdns.cos.f",
1979 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000001,
1983 { "1", "fcdns.cos.1",
1984 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000002,
1988 { "2", "fcdns.cos.2",
1989 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000004,
1993 { "3", "fcdns.cos.3",
1994 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000008,
1998 { "4", "fcdns.cos.4",
1999 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000010,
2003 { "6", "fcdns.cos.6",
2004 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000040,
2007 { &hf_fcdns_fc4type_llcsnap
,
2008 { "LLC/SNAP", "fcdns.fc4types.llc_snap",
2009 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000010,
2012 { &hf_fcdns_fc4type_ip
,
2013 { "IP", "fcdns.fc4types.ip",
2014 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000020,
2017 { &hf_fcdns_fc4type_fcp
,
2018 { "FCP", "fcdns.fc4types.fcp",
2019 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000100,
2022 { &hf_fcdns_fc4type_swils
,
2023 { "SW_ILS", "fcdns.fc4types.swils",
2024 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000010,
2027 { &hf_fcdns_fc4type_snmp
,
2028 { "SNMP", "fcdns.fc4types.snmp",
2029 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000004,
2032 { &hf_fcdns_fc4type_gs3
,
2033 { "GS3", "fcdns.fc4types.gs3",
2034 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000001,
2037 { &hf_fcdns_fc4type_vi
,
2038 { "VI", "fcdns.fc4types.vi",
2039 FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000001,
2042 { &hf_fcdns_fc4features
,
2043 { "FC-4 Feature Bits", "fcdns.fc4features",
2044 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
2047 { &hf_fcdns_fc4features_i
,
2048 { "I", "fcdns.fc4features.i",
2049 FT_BOOLEAN
, 8, TFS(&tfs_set_notset
), 0x02,
2052 { &hf_fcdns_fc4features_t
,
2053 { "T", "fcdns.fc4features.t",
2054 FT_BOOLEAN
, 8, TFS(&tfs_set_notset
), 0x01,
2057 { &hf_fcdns_req_fc4type
,
2058 { "FC-4 Type", "fcdns.req.fc4type",
2059 FT_UINT8
, BASE_HEX
, VALS (fc_fc4_val
), 0x0,
2064 static int *ett
[] = {
2071 static ei_register_info ei
[] = {
2072 { &ei_fcdns_no_record_of_exchange
, { "fcdns.no_record_of_exchange", PI_UNDECODED
, PI_WARN
, "No record of Exchg. Unable to decode MSG_ACC/RJT", EXPFILL
}},
2073 { &ei_fcdns_zone_mbrid
, { "fcdns.zone.mbrid.unknown_type", PI_PROTOCOL
, PI_WARN
, "Unknown member type format", EXPFILL
}},
2076 expert_module_t
* expert_fcdns
;
2078 proto_fcdns
= proto_register_protocol("Fibre Channel Name Server", "FC-dNS", "fcdns");
2079 proto_register_field_array(proto_fcdns
, hf
, array_length(hf
));
2080 proto_register_subtree_array(ett
, array_length(ett
));
2081 expert_fcdns
= expert_register_protocol(proto_fcdns
);
2082 expert_register_field_array(expert_fcdns
, ei
, array_length(ei
));
2084 fcdns_req_hash
= wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), fcdns_hash
, fcdns_equal
);
2086 dns_handle
= register_dissector("fcdns", dissect_fcdns
, proto_fcdns
);
2090 proto_reg_handoff_fcdns (void)
2092 dissector_add_uint("fcct.server", FCCT_GSRVR_DNS
, dns_handle
);
2093 dissector_add_uint("fcct.server", FCCT_GSRVR_UNS
, dns_handle
);
2097 * Editor modelines - https://www.wireshark.org/tools/modelines.html
2102 * indent-tabs-mode: nil
2105 * vi: set shiftwidth=4 tabstop=8 expandtab:
2106 * :indentSize=4:tabSize=8:noTabs=true: