2 * Routines for FC distributed Name Server (dNS)
3 * Copyright 2001, Dinesh G Dutt <ddutt@andiamo.com>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * Copied from WHATEVER_FILE_YOU_USED (where "WHATEVER_FILE_YOU_USED"
12 * is a dissector file; if you just copied this from README.developer,
13 * don't bother with the "Copied from" - you don't even need to put
14 * in a "Copied from" if you copied an existing dissector, especially
15 * if the bulk of the code in the new dissector is your code)
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version 2
20 * of the License, or (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
40 #ifdef HAVE_SYS_TYPES_H
41 # include <sys/types.h>
44 #ifdef HAVE_NETINET_IN_H
45 # include <netinet/in.h>
50 #include <epan/packet.h>
51 #include <epan/emem.h>
52 #include <epan/conversation.h>
53 #include <epan/etypes.h>
54 #include "packet-scsi.h"
55 #include "packet-fc.h"
56 #include "packet-fcct.h"
57 #include "packet-fcdns.h"
58 #include "packet-fcswils.h"
64 /* Initialize the protocol and registered fields */
65 static int proto_fcdns = -1;
66 static int hf_fcdns_gssubtype = -1;
67 static int hf_fcdns_opcode = -1;
68 static int hf_fcdns_reason = -1;
69 static int hf_fcdns_vendor = -1;
70 static int hf_fcdns_req_portid = -1;
71 static int hf_fcdns_rply_pname = -1;
72 static int hf_fcdns_rply_nname = -1;
73 static int hf_fcdns_rply_gft = -1;
74 static int hf_fcdns_rply_snamelen = -1;
75 static int hf_fcdns_rply_sname = -1;
76 static int hf_fcdns_rply_ptype = -1;
77 static int hf_fcdns_rply_fpname = -1;
78 static int hf_fcdns_fc4type = -1;
79 static int hf_fcdns_rply_fc4type = -1;
80 static int hf_fcdns_rply_fc4desc = -1;
81 static int hf_fcdns_req_pname = -1;
82 static int hf_fcdns_rply_portid = -1;
83 static int hf_fcdns_req_nname = -1;
84 static int hf_fcdns_req_domainscope = -1;
85 static int hf_fcdns_req_areascope = -1;
86 static int hf_fcdns_req_ptype = -1;
87 static int hf_fcdns_req_cos = -1;
88 static int hf_fcdns_req_fc4types = -1;
89 static int hf_fcdns_req_snamelen = -1;
90 static int hf_fcdns_req_sname = -1;
91 static int hf_fcdns_rply_spnamelen = -1;
92 static int hf_fcdns_rply_spname = -1;
93 static int hf_fcdns_req_spnamelen = -1;
94 static int hf_fcdns_req_spname = -1;
95 static int hf_fcdns_rply_ipa = -1;
96 static int hf_fcdns_rply_ipnode = -1;
97 static int hf_fcdns_rply_ipport = -1;
98 static int hf_fcdns_rply_fc4desclen = -1;
99 static int hf_fcdns_rply_hrdaddr = -1;
100 static int hf_fcdns_req_fdesclen = -1;
101 static int hf_fcdns_req_fdesc = -1;
102 static int hf_fcdns_req_ip = -1;
103 static int hf_fcdns_rjtdetail = -1;
104 static int hf_fcdns_zone_mbrtype = -1;
105 static int hf_fcdns_zone_mbrid = -1;
106 static int hf_fcdns_zonenm = -1;
107 static int hf_fcdns_portip = -1;
108 static int hf_fcdns_sw2_objfmt = -1;
109 static int hf_fcdns_num_fc4desc = -1;
110 static int hf_fcdns_rply_ownerid = -1;
111 static int hf_fcdns_maxres_size = -1;
112 static int hf_fcdns_reply_cos = -1;
113 static int hf_fcdns_cos_f = -1;
114 static int hf_fcdns_cos_1 = -1;
115 static int hf_fcdns_cos_2 = -1;
116 static int hf_fcdns_cos_3 = -1;
117 static int hf_fcdns_cos_4 = -1;
118 static int hf_fcdns_cos_6 = -1;
119 static int hf_fcdns_fc4type_llcsnap = -1;
120 static int hf_fcdns_fc4type_ip = -1;
121 static int hf_fcdns_fc4type_fcp = -1;
122 static int hf_fcdns_fc4type_swils = -1;
123 static int hf_fcdns_fc4type_snmp = -1;
124 static int hf_fcdns_fc4type_gs3 = -1;
125 static int hf_fcdns_fc4type_vi = -1;
126 static int hf_fcdns_fc4features = -1;
127 static int hf_fcdns_fc4features_i = -1;
128 static int hf_fcdns_fc4features_t = -1;
129 static int hf_fcdns_req_fc4type = -1;
131 /* Initialize the subtree pointers */
132 static gint ett_fcdns = -1;
133 static gint ett_cos_flags = -1;
134 static gint ett_fc4flags = -1;
135 static gint ett_fc4features = -1;
137 typedef struct _fcdns_conv_key {
141 typedef struct _fcdns_conv_data {
145 GHashTable *fcdns_req_hash = NULL;
147 static dissector_handle_t data_handle;
153 fcdns_equal(gconstpointer v, gconstpointer w)
155 const fcdns_conv_key_t *v1 = v;
156 const fcdns_conv_key_t *v2 = w;
158 return (v1->conv_idx == v2->conv_idx);
162 fcdns_hash (gconstpointer v)
164 const fcdns_conv_key_t *key = v;
173 * Protocol initialization
176 fcdns_init_protocol(void)
179 g_hash_table_destroy(fcdns_req_hash);
181 fcdns_req_hash = g_hash_table_new(fcdns_hash, fcdns_equal);
185 static const true_false_string tfs_fcdns_cos_f = {
189 static const true_false_string tfs_fcdns_cos_1 = {
193 static const true_false_string tfs_fcdns_cos_2 = {
197 static const true_false_string tfs_fcdns_cos_3 = {
201 static const true_false_string tfs_fcdns_cos_4 = {
205 static const true_false_string tfs_fcdns_cos_6 = {
210 dissect_cos_flags (proto_tree *parent_tree, tvbuff_t *tvb, int offset, int hfindex)
212 proto_item *item=NULL;
213 proto_tree *tree=NULL;
216 flags = tvb_get_ntohl (tvb, offset);
218 item=proto_tree_add_uint(parent_tree, hfindex,
219 tvb, offset, 1, flags);
220 tree=proto_item_add_subtree(item, ett_cos_flags);
224 proto_tree_add_boolean(tree, hf_fcdns_cos_f, tvb, offset, 4, flags);
226 proto_item_append_text(item, " F");
230 proto_tree_add_boolean(tree, hf_fcdns_cos_1, tvb, offset, 4, flags);
232 proto_item_append_text(item, " 1");
236 proto_tree_add_boolean(tree, hf_fcdns_cos_2, tvb, offset, 4, flags);
238 proto_item_append_text(item, " 2");
242 proto_tree_add_boolean(tree, hf_fcdns_cos_3, tvb, offset, 4, flags);
244 proto_item_append_text(item, " 3");
248 proto_tree_add_boolean(tree, hf_fcdns_cos_4, tvb, offset, 4, flags);
250 proto_item_append_text(item, " 4");
254 proto_tree_add_boolean(tree, hf_fcdns_cos_6, tvb, offset, 4, flags);
256 proto_item_append_text(item, " 6");
262 static const true_false_string tfs_fcdns_fc4features_i = {
266 static const true_false_string tfs_fcdns_fc4features_t = {
271 /* The feature routines just decode FCP's FC-4 features field
272 * based on the flahs in offset and the type in offset+1
275 dissect_fc4features_and_type (proto_tree *parent_tree, tvbuff_t *tvb, int offset)
277 proto_item *item=NULL;
278 proto_tree *tree=NULL;
281 flags = tvb_get_guint8(tvb, offset);
282 type = tvb_get_guint8(tvb, offset+1);
284 item=proto_tree_add_uint(parent_tree, hf_fcdns_fc4features,
285 tvb, offset, 1, flags);
286 tree=proto_item_add_subtree(item, ett_fc4features);
289 if(type==FC_TYPE_SCSI){
290 proto_tree_add_boolean(tree, hf_fcdns_fc4features_i, tvb, offset, 1, flags);
292 proto_item_append_text(item, " I");
296 proto_tree_add_boolean(tree, hf_fcdns_fc4features_t, tvb, offset, 1, flags);
298 proto_item_append_text(item, " T");
303 proto_tree_add_item (tree, hf_fcdns_req_fc4type, tvb, offset+1, 1, 0);
306 /* The feature routines just decode FCP's FC-4 features field
309 dissect_fc4features (proto_tree *parent_tree, tvbuff_t *tvb, int offset)
311 proto_item *item=NULL;
312 proto_tree *tree=NULL;
315 flags = tvb_get_guint8(tvb, offset);
317 item=proto_tree_add_uint(parent_tree, hf_fcdns_fc4features,
318 tvb, offset, 1, flags);
319 tree=proto_item_add_subtree(item, ett_fc4features);
322 proto_tree_add_boolean(tree, hf_fcdns_fc4features_i, tvb, offset, 1, flags);
324 proto_item_append_text(item, " I");
328 proto_tree_add_boolean(tree, hf_fcdns_fc4features_t, tvb, offset, 1, flags);
330 proto_item_append_text(item, " T");
336 static const true_false_string tfs_fcdns_fc4type_llcsnap = {
338 "Llc/snap is NOT set"
340 static const true_false_string tfs_fcdns_fc4type_ip = {
344 static const true_false_string tfs_fcdns_fc4type_fcp = {
348 static const true_false_string tfs_fcdns_fc4type_swils = {
352 static const true_false_string tfs_fcdns_fc4type_snmp = {
356 static const true_false_string tfs_fcdns_fc4type_gs3 = {
360 static const true_false_string tfs_fcdns_fc4type_vi = {
365 /* Decodes LLC/SNAP, IP, FCP, VI, GS, SW_ILS types only */
367 dissect_fc4type (proto_tree *parent_tree, tvbuff_t *tvb, int offset, int hfindex)
369 proto_item *item=NULL;
370 proto_tree *tree=NULL;
374 item=proto_tree_add_item(parent_tree, hfindex, tvb, offset,
376 tree=proto_item_add_subtree(item, ett_fc4flags);
379 flags = tvb_get_ntohl (tvb, offset);
381 proto_tree_add_boolean(tree, hf_fcdns_fc4type_fcp, tvb, offset, 4, flags);
383 proto_item_append_text(item, " FCP");
385 flags&=(~( 0x0100 ));
387 proto_tree_add_boolean(tree, hf_fcdns_fc4type_ip, tvb, offset, 4, flags);
389 proto_item_append_text(item, " IP");
391 flags&=(~( 0x0020 ));
393 proto_tree_add_boolean(tree, hf_fcdns_fc4type_llcsnap, tvb, offset, 4, flags);
395 proto_item_append_text(item, " LLC/SNAP");
397 flags&=(~( 0x0010 ));
400 flags = tvb_get_ntohl (tvb, offset+4);
402 proto_tree_add_boolean(tree, hf_fcdns_fc4type_swils, tvb, offset+4, 4, flags);
404 proto_item_append_text(item, " SW_ILS");
406 flags&=(~( 0x0010 ));
408 proto_tree_add_boolean(tree, hf_fcdns_fc4type_snmp, tvb, offset+4, 4, flags);
410 proto_item_append_text(item, " SNMP");
412 flags&=(~( 0x0004 ));
414 proto_tree_add_boolean(tree, hf_fcdns_fc4type_gs3, tvb, offset+4, 4, flags);
416 proto_item_append_text(item, " GS3");
418 flags&=(~( 0x0001 ));
421 flags = tvb_get_ntohl (tvb, offset+8);
423 proto_tree_add_boolean(tree, hf_fcdns_fc4type_vi, tvb, offset+8, 4, flags);
425 proto_item_append_text(item, " VI");
427 flags&=(~( 0x0001 ));
430 /* Code to actually dissect the packets */
432 /* A bunch of get routines have a similar req packet format. The first few
433 * routines deal with this decoding. All assume that tree is valid */
435 dissect_fcdns_req_portid (tvbuff_t *tvb, proto_tree *tree, int offset)
438 proto_tree_add_string (tree, hf_fcdns_req_portid, tvb, offset, 3,
439 fc_to_str (tvb_get_ptr (tvb, offset, 3)));
444 dissect_fcdns_ganxt (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
446 int offset = 16; /* past the fc_ct header */
451 dissect_fcdns_req_portid (tvb, req_tree, offset+1);
454 proto_tree_add_item (req_tree, hf_fcdns_rply_ptype, tvb, offset,
456 proto_tree_add_string (req_tree, hf_fcdns_rply_portid, tvb,
458 fc_to_str (tvb_get_ptr (tvb, offset+1, 3)));
459 proto_tree_add_string (req_tree, hf_fcdns_rply_pname, tvb,
461 fcwwn_to_str (tvb_get_ptr (tvb, offset+4,
463 len = tvb_get_guint8 (tvb, offset+12);
464 proto_tree_add_item (req_tree, hf_fcdns_rply_spnamelen, tvb,
466 if (!tvb_offset_exists (tvb, 29+len))
470 proto_tree_add_item (req_tree, hf_fcdns_rply_spname, tvb,
474 if (tvb_offset_exists (tvb, 292)) {
475 proto_tree_add_string (req_tree, hf_fcdns_rply_nname, tvb,
477 fcwwn_to_str (tvb_get_ptr (tvb,
481 if (tvb_offset_exists (tvb, 548)) {
482 len = tvb_get_guint8 (tvb, offset+276);
483 proto_tree_add_item (req_tree, hf_fcdns_rply_snamelen, tvb,
486 proto_tree_add_item (req_tree, hf_fcdns_rply_sname, tvb,
490 if (tvb_offset_exists (tvb, 556)) {
491 proto_tree_add_item (req_tree, hf_fcdns_rply_ipa, tvb,
494 if (tvb_offset_exists (tvb, 572)) {
495 proto_tree_add_item (req_tree, hf_fcdns_rply_ipnode, tvb,
498 if (tvb_offset_exists (tvb, 576)) {
499 dissect_cos_flags(req_tree, tvb, offset+556, hf_fcdns_reply_cos);
501 if (tvb_offset_exists (tvb, 608)) {
502 dissect_fc4type(req_tree, tvb, offset+560, hf_fcdns_rply_gft);
504 if (tvb_offset_exists (tvb, 624)) {
505 proto_tree_add_item (req_tree, hf_fcdns_rply_ipport, tvb,
508 if (tvb_offset_exists (tvb, 632)) {
509 proto_tree_add_string (req_tree, hf_fcdns_rply_fpname, tvb,
511 fcwwn_to_str (tvb_get_ptr (tvb, offset+608,
514 if (tvb_offset_exists (tvb, 635)) {
515 proto_tree_add_string (req_tree, hf_fcdns_rply_hrdaddr, tvb,
517 fc_to_str (tvb_get_ptr (tvb, offset+617,
525 dissect_fcdns_gpnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
527 int offset = 16; /* past the fc_ct header */
531 dissect_fcdns_req_portid (tvb, req_tree, offset+1);
534 proto_tree_add_string (req_tree, hf_fcdns_rply_pname, tvb, offset,
535 8, fcwwn_to_str (tvb_get_ptr (tvb, offset,
542 dissect_fcdns_gnnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
544 int offset = 16; /* past the fc_ct header */
548 dissect_fcdns_req_portid (tvb, req_tree, offset+1);
551 proto_tree_add_string (req_tree, hf_fcdns_rply_nname, tvb,
553 fcwwn_to_str (tvb_get_ptr (tvb, offset,
560 dissect_fcdns_gcsid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
562 int offset = 16; /* past the fc_ct header */
566 dissect_fcdns_req_portid (tvb, req_tree, offset);
569 dissect_cos_flags(req_tree, tvb, offset, hf_fcdns_reply_cos);
575 dissect_fcdns_gftid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
577 int offset = 16; /* past the fc_ct header */
581 dissect_fcdns_req_portid (tvb, req_tree, offset+1);
584 dissect_fc4type(req_tree, tvb, offset, hf_fcdns_rply_gft);
590 dissect_fcdns_gspnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
592 int offset = 16; /* past the fc_ct header */
597 dissect_fcdns_req_portid (tvb, req_tree, offset+1);
600 len = tvb_get_guint8 (tvb, offset);
601 proto_tree_add_item (req_tree, hf_fcdns_rply_spnamelen,
603 proto_tree_add_string (req_tree, hf_fcdns_rply_spname, tvb,
605 tvb_get_ptr (tvb, offset+1, len));
611 dissect_fcdns_gptid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
613 int offset = 16; /* past the fc_ct header */
617 dissect_fcdns_req_portid (tvb, req_tree, offset+1);
620 proto_tree_add_item (req_tree, hf_fcdns_rply_ptype, tvb,
627 dissect_fcdns_gfpnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
629 int offset = 16; /* past the fc_ct header */
633 dissect_fcdns_req_portid (tvb, req_tree, offset+1);
636 proto_tree_add_string (req_tree, hf_fcdns_rply_fpname, tvb,
638 fcwwn_to_str (tvb_get_ptr (tvb, offset,
646 dissect_fcdns_gfdid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
648 int offset = 16; /* past the fc_ct header */
649 int tot_len, desclen;
653 dissect_fcdns_req_portid (tvb, req_tree, offset+1);
654 dissect_fc4type(req_tree, tvb, offset+4, hf_fcdns_fc4type);
657 tot_len = tvb_length (tvb) - offset; /* excluding CT header */
658 while (tot_len > 0) {
659 /* The count of the descriptors is not returned and so we have
660 * to track the display by the length field */
661 desclen = tvb_get_guint8 (tvb, offset);
662 proto_tree_add_item (req_tree, hf_fcdns_rply_fc4desc, tvb,
664 tot_len -= 255; /* descriptors are aligned to 255 bytes */
672 dissect_fcdns_gffid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
674 int offset = 16; /* past the fc_ct header */
678 dissect_fcdns_req_portid (tvb, req_tree, offset+1);
681 dissect_fc4features(req_tree, tvb, offset);
687 dissect_fcdns_gidpn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
689 int offset = 16; /* past the fc_ct header */
693 proto_tree_add_string (req_tree, hf_fcdns_req_pname, tvb,
695 fcwwn_to_str (tvb_get_ptr (tvb, offset,
699 proto_tree_add_string (req_tree, hf_fcdns_rply_portid, tvb,
701 fc_to_str (tvb_get_ptr (tvb, offset+1,
708 dissect_fcdns_gipppn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
710 int offset = 16; /* past the fc_ct header */
714 proto_tree_add_string (req_tree, hf_fcdns_req_pname, tvb,
716 fcwwn_to_str (tvb_get_ptr (tvb, offset,
720 proto_tree_add_item (req_tree, hf_fcdns_rply_ipport, tvb, offset,
727 dissect_fcdns_gidnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
729 int offset = 16; /* past the fc_ct header */
734 proto_tree_add_string (req_tree, hf_fcdns_req_nname, tvb,
736 fcwwn_to_str (tvb_get_ptr (tvb, offset,
741 islast = tvb_get_guint8 (tvb, offset);
742 proto_tree_add_string (req_tree, hf_fcdns_rply_portid,
744 fc_to_str (tvb_get_ptr (tvb, offset+1,
747 } while (!(islast & 0x80));
753 dissect_fcdns_gipnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
755 int offset = 16; /* past the fc_ct header */
759 proto_tree_add_string (req_tree, hf_fcdns_req_nname, tvb,
761 fcwwn_to_str (tvb_get_ptr (tvb, offset,
765 proto_tree_add_item (req_tree, hf_fcdns_rply_ipnode, tvb, offset,
772 dissect_fcdns_gpnnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
774 int offset = 16; /* past the fc_ct header */
779 proto_tree_add_string (req_tree, hf_fcdns_req_nname, tvb,
781 fcwwn_to_str (tvb_get_ptr (tvb, offset,
786 islast = tvb_get_guint8 (tvb, offset);
787 proto_tree_add_string (req_tree, hf_fcdns_rply_portid,
789 fc_to_str (tvb_get_ptr (tvb, offset+1,
791 proto_tree_add_string (req_tree, hf_fcdns_rply_pname,
793 fcwwn_to_str (tvb_get_ptr (tvb,
797 } while (!(islast & 0x80));
803 dissect_fcdns_gsnnnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
805 int offset = 16; /* past the fc_ct header */
810 proto_tree_add_string (req_tree, hf_fcdns_req_nname, tvb,
812 fcwwn_to_str (tvb_get_ptr (tvb, offset,
816 len = tvb_get_guint8 (tvb, offset);
817 proto_tree_add_item (req_tree, hf_fcdns_rply_snamelen, tvb,
819 proto_tree_add_item (req_tree, hf_fcdns_rply_sname, tvb,
826 dissect_fcdns_gidft (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
828 int offset = 16; /* past the fc_ct header */
833 proto_tree_add_item (req_tree, hf_fcdns_req_domainscope,
834 tvb, offset+1, 1, 0);
835 proto_tree_add_item (req_tree, hf_fcdns_req_areascope,
836 tvb, offset+2, 1, 0);
837 proto_tree_add_item (req_tree, hf_fcdns_req_fc4type,
838 tvb, offset+3, 1, 0);
842 islast = tvb_get_guint8 (tvb, offset);
843 proto_tree_add_string (req_tree, hf_fcdns_rply_portid,
845 fc_to_str (tvb_get_ptr (tvb, offset+1,
848 } while (!(islast & 0x80));
854 dissect_fcdns_gpnft (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
856 int offset = 16; /* past the fc_ct header */
861 proto_tree_add_item (req_tree, hf_fcdns_req_domainscope,
862 tvb, offset+1, 1, 0);
863 proto_tree_add_item (req_tree, hf_fcdns_req_areascope,
864 tvb, offset+2, 1, 0);
865 proto_tree_add_item (req_tree, hf_fcdns_req_fc4type,
866 tvb, offset+3, 1, 0);
870 islast = tvb_get_guint8 (tvb, offset);
871 proto_tree_add_string (req_tree, hf_fcdns_rply_portid,
873 fc_to_str (tvb_get_ptr (tvb, offset+1,
875 proto_tree_add_string (req_tree, hf_fcdns_rply_pname,
877 fcwwn_to_str (tvb_get_ptr (tvb, offset+8,
880 } while (!(islast & 0x80));
886 dissect_fcdns_gnnft (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
888 int offset = 16; /* past the fc_ct header */
893 proto_tree_add_item (req_tree, hf_fcdns_req_domainscope,
894 tvb, offset+1, 1, 0);
895 proto_tree_add_item (req_tree, hf_fcdns_req_areascope,
896 tvb, offset+2, 1, 0);
897 proto_tree_add_item (req_tree, hf_fcdns_req_fc4type,
898 tvb, offset+3, 1, 0);
902 islast = tvb_get_guint8 (tvb, offset);
903 proto_tree_add_string (req_tree, hf_fcdns_rply_portid,
905 fc_to_str (tvb_get_ptr (tvb, offset+1,
907 proto_tree_add_string (req_tree, hf_fcdns_rply_nname,
909 fcwwn_to_str (tvb_get_ptr (tvb, offset+8,
912 } while (!(islast & 0x80));
918 dissect_fcdns_gidpt (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
920 int offset = 16; /* past the fc_ct header */
925 proto_tree_add_item (req_tree, hf_fcdns_req_ptype,
927 proto_tree_add_item (req_tree, hf_fcdns_req_domainscope,
928 tvb, offset+1, 1, 0);
929 proto_tree_add_item (req_tree, hf_fcdns_req_areascope,
930 tvb, offset+2, 1, 0);
934 islast = tvb_get_guint8 (tvb, offset);
935 proto_tree_add_string (req_tree, hf_fcdns_rply_portid,
937 fc_to_str (tvb_get_ptr (tvb, offset+1,
940 } while (!(islast & 0x80));
946 dissect_fcdns_gidipp (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
948 int offset = 16; /* past the fc_ct header */
953 proto_tree_add_item (req_tree, hf_fcdns_req_ip, tvb, offset,
958 islast = tvb_get_guint8 (tvb, offset);
959 proto_tree_add_string (req_tree, hf_fcdns_rply_portid,
961 fc_to_str (tvb_get_ptr (tvb, offset+1,
964 } while (!(islast & 0x80));
970 dissect_fcdns_gidff (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
972 int offset = 16; /* past the fc_ct header */
977 proto_tree_add_item (req_tree, hf_fcdns_req_domainscope, tvb,
979 proto_tree_add_item (req_tree, hf_fcdns_req_areascope, tvb,
981 dissect_fc4features_and_type(req_tree, tvb, offset+6);
985 islast = tvb_get_guint8 (tvb, offset);
986 proto_tree_add_string (req_tree, hf_fcdns_rply_portid,
988 fc_to_str (tvb_get_ptr (tvb, offset+1,
991 } while (!(islast & 0x80));
997 dissect_fcdns_rpnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
999 int offset = 16; /* past the fc_ct header */
1003 proto_tree_add_string (req_tree, hf_fcdns_req_portid,
1005 fc_to_str (tvb_get_ptr (tvb, offset+1,
1007 proto_tree_add_string (req_tree, hf_fcdns_req_pname, tvb,
1009 fcwwn_to_str (tvb_get_ptr (tvb, offset+4,
1016 dissect_fcdns_rnnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1018 int offset = 16; /* past the fc_ct header */
1022 proto_tree_add_string (req_tree, hf_fcdns_req_portid,
1024 fc_to_str (tvb_get_ptr (tvb, offset+1,
1026 proto_tree_add_string (req_tree, hf_fcdns_req_nname, tvb,
1028 fcwwn_to_str (tvb_get_ptr (tvb, offset+4,
1035 dissect_fcdns_rcsid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1037 int offset = 16; /* past the fc_ct header */
1039 if (req_tree && isreq) {
1040 proto_tree_add_string (req_tree, hf_fcdns_req_portid, tvb,
1042 fc_to_str (tvb_get_ptr (tvb, offset+1,
1044 dissect_cos_flags(req_tree, tvb, offset+4, hf_fcdns_req_cos);
1049 dissect_fcdns_rptid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1051 int offset = 16; /* past the fc_ct header */
1053 if (req_tree && isreq) {
1054 proto_tree_add_string (req_tree, hf_fcdns_req_portid, tvb,
1056 fc_to_str (tvb_get_ptr (tvb, offset+1,
1058 proto_tree_add_item (req_tree, hf_fcdns_req_ptype, tvb,
1064 dissect_fcdns_rftid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1066 int offset = 16; /* past the fc_ct header */
1068 if (req_tree && isreq) {
1069 proto_tree_add_string (req_tree, hf_fcdns_req_portid, tvb,
1071 fc_to_str (tvb_get_ptr (tvb, offset+1,
1073 dissect_fc4type(req_tree, tvb, offset+4, hf_fcdns_req_fc4types);
1078 dissect_fcdns_rspnid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1080 int offset = 16; /* past the fc_ct header */
1083 if (req_tree && isreq) {
1084 proto_tree_add_string (req_tree, hf_fcdns_req_portid, tvb,
1086 fc_to_str (tvb_get_ptr (tvb, offset+1,
1088 proto_tree_add_item (req_tree, hf_fcdns_req_spnamelen, tvb,
1090 len = tvb_get_guint8 (tvb, offset+4);
1092 proto_tree_add_item (req_tree, hf_fcdns_req_spname, tvb, offset+5,
1098 dissect_fcdns_rippid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1100 int offset = 16; /* past the fc_ct header */
1102 if (req_tree && isreq) {
1103 proto_tree_add_string (req_tree, hf_fcdns_req_portid, tvb,
1105 fc_to_str (tvb_get_ptr (tvb, offset+1,
1107 proto_tree_add_item (req_tree, hf_fcdns_req_ip, tvb,
1113 dissect_fcdns_rfdid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1115 int offset = 16; /* past the fc_ct header */
1118 if (req_tree && isreq) {
1119 proto_tree_add_string (req_tree, hf_fcdns_req_portid, tvb,
1121 fc_to_str (tvb_get_ptr (tvb, offset+1,
1123 dissect_fc4type(req_tree, tvb, offset+4, hf_fcdns_req_fc4types);
1125 len = tvb_length (tvb) - offset - 36;
1129 dlen = tvb_get_guint8 (tvb, offset);
1130 proto_tree_add_item (req_tree, hf_fcdns_req_fdesclen, tvb, offset,
1132 proto_tree_add_item (req_tree, hf_fcdns_req_fdesc, tvb, offset+1,
1141 dissect_fcdns_rffid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1143 int offset = 16; /* past the fc_ct header */
1145 if (req_tree && isreq) {
1146 proto_tree_add_string (req_tree, hf_fcdns_req_portid, tvb, offset+1, 3,
1147 fc_to_str (tvb_get_ptr (tvb, offset+1, 3)));
1148 dissect_fc4features_and_type(req_tree, tvb, offset+6);
1153 dissect_fcdns_ripnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1155 int offset = 16; /* past the fc_ct header */
1157 if (req_tree && isreq) {
1158 proto_tree_add_string (req_tree, hf_fcdns_req_nname, tvb, offset, 8,
1159 fcwwn_to_str (tvb_get_ptr (tvb, offset, 8)));
1160 proto_tree_add_item (req_tree, hf_fcdns_req_ip, tvb, offset+8, 16, 0);
1165 dissect_fcdns_rsnnnn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1167 int offset = 16; /* past the fc_ct header */
1170 if (req_tree && isreq) {
1171 proto_tree_add_string (req_tree, hf_fcdns_req_nname, tvb, offset, 8,
1172 fcwwn_to_str (tvb_get_ptr (tvb, offset, 8)));
1173 len = tvb_get_guint8 (tvb, offset+8);
1175 proto_tree_add_item (req_tree, hf_fcdns_req_snamelen, tvb, offset+8,
1177 proto_tree_add_item (req_tree, hf_fcdns_req_sname, tvb, offset+9,
1183 dissect_fcdns_daid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1185 int offset = 16; /* past the fc_ct header */
1187 if (req_tree && isreq) {
1188 proto_tree_add_string (req_tree, hf_fcdns_req_portid, tvb, offset+1, 3,
1189 fc_to_str (tvb_get_ptr (tvb, offset+1, 3)));
1194 zonenm_to_str (tvbuff_t *tvb, gint offset)
1196 int len = tvb_get_guint8 (tvb, offset);
1197 return tvb_get_ephemeral_string (tvb, offset+4, len);
1201 dissect_fcdns_zone_mbr (tvbuff_t *tvb, proto_tree *zmbr_tree, int offset)
1208 mbrtype = tvb_get_guint8 (tvb, offset);
1209 proto_tree_add_uint (zmbr_tree, hf_fcdns_zone_mbrtype, tvb,
1210 offset, 1, mbrtype);
1211 proto_tree_add_text (zmbr_tree, tvb, offset+2, 1, "Flags: 0x%x",
1212 tvb_get_guint8 (tvb, offset+2));
1213 idlen = tvb_get_guint8 (tvb, offset+3);
1214 proto_tree_add_text (zmbr_tree, tvb, offset+3, 1,
1215 "Identifier Length: %d", idlen);
1217 case FC_SWILS_ZONEMBR_WWN:
1218 proto_tree_add_string (zmbr_tree, hf_fcdns_zone_mbrid, tvb,
1220 fcwwn_to_str (tvb_get_ptr (tvb,
1224 case FC_SWILS_ZONEMBR_DP:
1225 g_snprintf(dpbuf, sizeof(dpbuf), "0x%08x", tvb_get_ntohl (tvb, offset+4));
1226 proto_tree_add_string (zmbr_tree, hf_fcdns_zone_mbrid, tvb,
1227 offset+4, 4, dpbuf);
1229 case FC_SWILS_ZONEMBR_FCID:
1230 proto_tree_add_string (zmbr_tree, hf_fcdns_zone_mbrid, tvb,
1232 fc_to_str (tvb_get_ptr (tvb,
1236 case FC_SWILS_ZONEMBR_ALIAS:
1237 str = zonenm_to_str (tvb, offset+4);
1238 proto_tree_add_string (zmbr_tree, hf_fcdns_zone_mbrid, tvb,
1239 offset+4, idlen, str);
1242 proto_tree_add_string (zmbr_tree, hf_fcdns_zone_mbrid, tvb,
1244 "Unknown member type format");
1250 dissect_fcdns_swils_entries (tvbuff_t *tvb, proto_tree *tree, int offset)
1255 numrec = tvb_get_ntohl (tvb, offset);
1258 proto_tree_add_text (tree, tvb, offset, 4, "Number of Entries: %d",
1262 for (i = 0; i < numrec; i++) {
1263 objfmt = tvb_get_guint8 (tvb, offset);
1265 proto_tree_add_item (tree, hf_fcdns_sw2_objfmt, tvb, offset, 1, 0);
1266 proto_tree_add_string (tree, hf_fcdns_rply_ownerid, tvb, offset+1,
1267 3, fc_to_str (tvb_get_ptr (tvb, offset+1,
1269 proto_tree_add_item (tree, hf_fcdns_rply_ptype, tvb, offset+4,
1271 proto_tree_add_string (tree, hf_fcdns_rply_portid, tvb, offset+5, 3,
1272 fc_to_str (tvb_get_ptr (tvb, offset+5, 3)));
1273 proto_tree_add_string (tree, hf_fcdns_rply_pname, tvb, offset+8, 8,
1274 fcwwn_to_str (tvb_get_ptr (tvb, offset+8,
1277 if (!(objfmt & 0x1)) {
1278 len = tvb_get_guint8 (tvb, offset);
1279 proto_tree_add_item (tree, hf_fcdns_rply_spnamelen, tvb,
1281 proto_tree_add_item (tree, hf_fcdns_rply_spname, tvb,
1285 proto_tree_add_string (tree, hf_fcdns_rply_nname, tvb, offset, 8,
1286 fcwwn_to_str (tvb_get_ptr (tvb, offset, 8)));
1288 if (!(objfmt & 0x1)) {
1289 len = tvb_get_guint8 (tvb, offset);
1290 proto_tree_add_item (tree, hf_fcdns_rply_snamelen, tvb,
1292 proto_tree_add_item (tree, hf_fcdns_rply_sname, tvb,
1296 proto_tree_add_item (tree, hf_fcdns_rply_ipa, tvb, offset, 8, 0);
1297 proto_tree_add_item (tree, hf_fcdns_rply_ipnode, tvb, offset+8, 16,
1299 dissect_cos_flags(tree, tvb, offset+24, hf_fcdns_reply_cos);
1300 dissect_fc4type(tree, tvb, offset+28, hf_fcdns_rply_gft);
1301 proto_tree_add_item (tree, hf_fcdns_rply_ipport, tvb, offset+60,
1303 proto_tree_add_string (tree, hf_fcdns_rply_fpname, tvb, offset+76,
1304 8, fcwwn_to_str (tvb_get_ptr (tvb,
1307 proto_tree_add_string (tree, hf_fcdns_rply_hrdaddr, tvb, offset+85,
1308 3, fc_to_str (tvb_get_ptr (tvb, offset+85,
1312 dissect_fc4features(tree, tvb, offset);
1313 if (tvb_get_guint8 (tvb, offset+129)) {
1314 proto_tree_add_item (tree, hf_fcdns_rply_fc4type, tvb,
1316 proto_tree_add_item (tree, hf_fcdns_num_fc4desc, tvb,
1318 len = tvb_get_guint8 (tvb, offset+132);
1319 proto_tree_add_item (tree, hf_fcdns_rply_fc4desclen, tvb,
1321 proto_tree_add_item (tree, hf_fcdns_rply_fc4desc, tvb,
1322 offset+133, len, 0);
1325 proto_tree_add_item (tree, hf_fcdns_num_fc4desc, tvb,
1328 offset += 388; /* FC4 desc is 260 bytes, maybe padded */
1335 dissect_fcdns_geid (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1337 int offset = 16; /* past the fc_ct header */
1341 proto_tree_add_string (req_tree, hf_fcdns_req_portid, tvb, offset+1,
1342 3, fc_to_str (tvb_get_ptr (tvb, offset+1,
1347 dissect_fcdns_swils_entries (tvb, req_tree, offset);
1352 dissect_fcdns_gepn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1354 int offset = 16; /* past the fc_ct header */
1357 proto_tree_add_string (req_tree, hf_fcdns_req_pname, tvb, offset, 8,
1358 fcwwn_to_str (tvb_get_ptr (tvb, offset, 8)));
1362 dissect_fcdns_swils_entries (tvb, req_tree, offset);
1367 dissect_fcdns_genn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1369 int offset = 16; /* past the fc_ct header */
1373 proto_tree_add_string (req_tree, hf_fcdns_req_nname, tvb, offset, 8,
1374 fcwwn_to_str (tvb_get_ptr (tvb, offset, 8)));
1378 dissect_fcdns_swils_entries (tvb, req_tree, offset);
1383 dissect_fcdns_geip (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1385 int offset = 16; /* past the fc_ct header */
1389 proto_tree_add_item (req_tree, hf_fcdns_req_ip, tvb, offset, 16, 0);
1393 dissect_fcdns_swils_entries (tvb, req_tree, offset);
1398 dissect_fcdns_geft (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1400 int offset = 16; /* past the fc_ct header */
1404 dissect_fc4type(req_tree, tvb, offset, hf_fcdns_fc4type);
1408 dissect_fcdns_swils_entries (tvb, req_tree, offset);
1413 dissect_fcdns_gept (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1415 int offset = 16; /* past the fc_ct header */
1419 proto_tree_add_item (req_tree, hf_fcdns_req_ptype, tvb, offset+3,
1424 dissect_fcdns_swils_entries (tvb, req_tree, offset);
1429 dissect_fcdns_gezm (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1431 int offset = 16; /* past the fc_ct header */
1435 dissect_fcdns_zone_mbr (tvb, req_tree, offset);
1439 dissect_fcdns_swils_entries (tvb, req_tree, offset);
1444 dissect_fcdns_gezn (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1446 int offset = 16; /* past the fc_ct header */
1451 strlen = tvb_get_guint8 (tvb, offset);
1452 proto_tree_add_text (req_tree, tvb, offset, 1, "Name Length: %d",
1454 proto_tree_add_string (req_tree, hf_fcdns_zonenm, tvb, offset+3,
1455 strlen, tvb_get_ptr (tvb, offset+3, strlen));
1459 dissect_fcdns_swils_entries (tvb, req_tree, offset);
1464 dissect_fcdns_geipp (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1466 int offset = 16; /* past the fc_ct header */
1470 proto_tree_add_item (req_tree, hf_fcdns_portip, tvb, offset, 4, 0);
1474 dissect_fcdns_swils_entries (tvb, req_tree, offset);
1479 dissect_fcdns_geff (tvbuff_t *tvb, proto_tree *req_tree, gboolean isreq)
1481 int offset = 16; /* past the fc_ct header */
1485 dissect_fc4features(req_tree, tvb, offset);
1489 dissect_fcdns_swils_entries (tvb, req_tree, offset);
1494 dissect_fcdns_rjt (tvbuff_t *tvb, proto_tree *req_tree)
1499 proto_tree_add_item (req_tree, hf_fcdns_reason, tvb, offset+13, 1, 0);
1500 proto_tree_add_item (req_tree, hf_fcdns_rjtdetail, tvb, offset+14, 1,
1502 proto_tree_add_item (req_tree, hf_fcdns_vendor, tvb, offset+15, 1, 0);
1507 dissect_fcdns (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1509 /* Set up structures needed to add the protocol subtree and manage it */
1510 proto_item *ti = NULL;
1511 proto_tree *fcdns_tree = NULL;
1516 fc_ct_preamble cthdr;
1517 conversation_t *conversation;
1518 fcdns_conv_data_t *cdata;
1519 fcdns_conv_key_t ckey, *req_key;
1521 tvb_memcpy (tvb, (guint8 *)&cthdr, offset, FCCT_PRMBL_SIZE);
1522 cthdr.revision = tvb_get_guint8 (tvb, offset);
1523 cthdr.in_id = tvb_get_ntoh24 (tvb, offset+1);
1524 cthdr.opcode = ntohs (cthdr.opcode);
1525 opcode = cthdr.opcode;
1526 cthdr.maxres_size = ntohs (cthdr.maxres_size);
1528 /* Determine the type of server the request/response is for */
1529 if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
1530 if (cthdr.gstype == FCCT_GSTYPE_DIRSVC)
1531 col_set_str (pinfo->cinfo, COL_PROTOCOL, "dNS");
1533 col_set_str (pinfo->cinfo, COL_PROTOCOL, "Unzoned NS");
1537 if (cthdr.gstype == FCCT_GSTYPE_DIRSVC) {
1538 ti = proto_tree_add_protocol_format (tree, proto_fcdns, tvb, 0,
1539 tvb_reported_length (tvb),
1541 fcdns_tree = proto_item_add_subtree (ti, ett_fcdns);
1544 ti = proto_tree_add_protocol_format (tree, proto_fcdns, tvb, 0,
1545 tvb_reported_length (tvb),
1547 fcdns_tree = proto_item_add_subtree (ti, ett_fcdns);
1551 if ((opcode != FCCT_MSG_ACC) && (opcode != FCCT_MSG_RJT)) {
1552 conversation = find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst,
1553 pinfo->ptype, pinfo->oxid,
1554 pinfo->rxid, NO_PORT2);
1555 if (!conversation) {
1556 conversation = conversation_new (pinfo->fd->num, &pinfo->src, &pinfo->dst,
1557 pinfo->ptype, pinfo->oxid,
1558 pinfo->rxid, NO_PORT2);
1561 ckey.conv_idx = conversation->index;
1563 cdata = (fcdns_conv_data_t *)g_hash_table_lookup (fcdns_req_hash,
1566 /* Since we never free the memory used by an exchange, this maybe a
1567 * case of another request using the same exchange as a previous
1570 cdata->opcode = opcode;
1573 req_key = se_alloc (sizeof(fcdns_conv_key_t));
1574 req_key->conv_idx = conversation->index;
1576 cdata = se_alloc (sizeof(fcdns_conv_data_t));
1577 cdata->opcode = opcode;
1579 g_hash_table_insert (fcdns_req_hash, req_key, cdata);
1581 if (check_col (pinfo->cinfo, COL_INFO)) {
1582 col_set_str (pinfo->cinfo, COL_INFO, val_to_str (opcode, fc_dns_opcode_val,
1587 /* Opcode is ACC or RJT */
1588 conversation = find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst,
1589 pinfo->ptype, pinfo->oxid,
1590 pinfo->rxid, NO_PORT2);
1592 if (!conversation) {
1593 if (tree && (opcode == FCCT_MSG_ACC)) {
1594 if (check_col (pinfo->cinfo, COL_INFO)) {
1595 col_set_str (pinfo->cinfo, COL_INFO,
1596 val_to_str (opcode, fc_dns_opcode_val,
1599 /* No record of what this accept is for. Can't decode */
1600 proto_tree_add_text (fcdns_tree, tvb, 0, tvb_length (tvb),
1601 "No record of Exchg. Unable to decode MSG_ACC/RJT");
1606 ckey.conv_idx = conversation->index;
1608 cdata = (fcdns_conv_data_t *)g_hash_table_lookup (fcdns_req_hash, &ckey);
1610 if (cdata != NULL) {
1611 if (opcode == FCCT_MSG_ACC) {
1612 opcode = cdata->opcode;
1615 failed_opcode = cdata->opcode;
1618 if (check_col (pinfo->cinfo, COL_INFO)) {
1619 if (opcode != FCCT_MSG_RJT) {
1620 col_add_fstr (pinfo->cinfo, COL_INFO, "ACC (%s)",
1621 val_to_str (opcode, fc_dns_opcode_val,
1625 col_add_fstr (pinfo->cinfo, COL_INFO, "RJT (%s)",
1626 val_to_str (failed_opcode,
1633 if ((cdata == NULL) && (opcode != FCCT_MSG_RJT)) {
1634 /* No record of what this accept is for. Can't decode */
1635 proto_tree_add_text (fcdns_tree, tvb, 0, tvb_length (tvb),
1636 "No record of Exchg. Unable to decode MSG_ACC/RJT");
1644 proto_tree_add_item (fcdns_tree, hf_fcdns_opcode, tvb, offset+8, 2, 0);
1645 proto_tree_add_item (fcdns_tree, hf_fcdns_maxres_size, tvb, offset+10,
1651 dissect_fcdns_rjt (tvb, fcdns_tree);
1654 dissect_fcdns_ganxt (tvb, fcdns_tree, isreq);
1657 dissect_fcdns_gpnid (tvb, fcdns_tree, isreq);
1660 dissect_fcdns_gnnid (tvb, fcdns_tree, isreq);
1663 dissect_fcdns_gcsid (tvb, fcdns_tree, isreq);
1666 dissect_fcdns_gftid (tvb, fcdns_tree, isreq);
1669 dissect_fcdns_gspnid (tvb, fcdns_tree, isreq);
1672 dissect_fcdns_gptid (tvb, fcdns_tree, isreq);
1675 dissect_fcdns_gfpnid (tvb, fcdns_tree, isreq);
1678 dissect_fcdns_gfdid (tvb, fcdns_tree, isreq);
1681 dissect_fcdns_gffid (tvb, fcdns_tree, isreq);
1684 dissect_fcdns_gidpn (tvb, fcdns_tree, isreq);
1687 dissect_fcdns_gipppn (tvb, fcdns_tree, isreq);
1690 dissect_fcdns_gidnn (tvb, fcdns_tree, isreq);
1693 dissect_fcdns_gpnnn (tvb, fcdns_tree, isreq);
1696 dissect_fcdns_gipnn (tvb, fcdns_tree, isreq);
1699 dissect_fcdns_gsnnnn (tvb, fcdns_tree, isreq);
1702 dissect_fcdns_gidft (tvb, fcdns_tree, isreq);
1705 dissect_fcdns_gpnft (tvb, fcdns_tree, isreq);
1708 dissect_fcdns_gnnft (tvb, fcdns_tree, isreq);
1711 dissect_fcdns_gidpt (tvb, fcdns_tree, isreq);
1714 dissect_fcdns_gidipp (tvb, fcdns_tree, isreq);
1717 dissect_fcdns_gidff (tvb, fcdns_tree, isreq);
1720 dissect_fcdns_rpnid (tvb, fcdns_tree, isreq);
1723 dissect_fcdns_rnnid (tvb, fcdns_tree, isreq);
1726 dissect_fcdns_rcsid (tvb, fcdns_tree, isreq);
1729 dissect_fcdns_rptid (tvb, fcdns_tree, isreq);
1732 dissect_fcdns_rftid (tvb, fcdns_tree, isreq);
1735 dissect_fcdns_rspnid (tvb, fcdns_tree, isreq);
1738 dissect_fcdns_rippid (tvb, fcdns_tree, isreq);
1741 dissect_fcdns_rfdid (tvb, fcdns_tree, isreq);
1744 dissect_fcdns_rffid (tvb, fcdns_tree, isreq);
1747 dissect_fcdns_ripnn (tvb, fcdns_tree, isreq);
1750 dissect_fcdns_rsnnnn (tvb, fcdns_tree, isreq);
1753 dissect_fcdns_daid (tvb, fcdns_tree, isreq);
1756 dissect_fcdns_geid (tvb, fcdns_tree, isreq);
1759 dissect_fcdns_gepn (tvb, fcdns_tree, isreq);
1762 dissect_fcdns_genn (tvb, fcdns_tree, isreq);
1765 dissect_fcdns_geip (tvb, fcdns_tree, isreq);
1768 dissect_fcdns_geft (tvb, fcdns_tree, isreq);
1771 dissect_fcdns_gept (tvb, fcdns_tree, isreq);
1774 dissect_fcdns_gezm (tvb, fcdns_tree, isreq);
1777 dissect_fcdns_gezn (tvb, fcdns_tree, isreq);
1780 dissect_fcdns_geipp (tvb, fcdns_tree, isreq);
1783 dissect_fcdns_geff (tvb, fcdns_tree, isreq);
1790 /* Register the protocol with Wireshark */
1792 /* this format is required because a script is used to build the C function
1793 that calls all the protocol registration.
1797 proto_register_fcdns (void)
1800 /* Setup list of header fields See Section 1.6.1 for details*/
1801 static hf_register_info hf[] = {
1802 { &hf_fcdns_gssubtype,
1803 {"GS_Subtype", "fcdns.gssubtype", FT_UINT8, BASE_HEX,
1804 VALS (fc_dns_subtype_val), 0x0, "", HFILL}},
1806 {"Opcode", "fcdns.opcode", FT_UINT16, BASE_HEX, VALS (fc_dns_opcode_val),
1808 { &hf_fcdns_req_portid,
1809 {"Port Identifier", "fcdns.req.portid", FT_STRING, BASE_HEX, NULL, 0x0,
1811 { &hf_fcdns_rply_pname,
1812 {"Port Name", "fcdns.rply.pname", FT_STRING, BASE_HEX, NULL, 0x0, "",
1814 { &hf_fcdns_rply_nname,
1815 {"Node Name", "fcdns.rply.nname", FT_STRING, BASE_HEX, NULL, 0x0, "",
1817 { &hf_fcdns_rply_snamelen,
1818 {"Symbolic Node Name Length", "fcdns.rply.snamelen", FT_UINT8, BASE_DEC,
1819 NULL, 0x0, "", HFILL}},
1820 { &hf_fcdns_rply_sname,
1821 {"Symbolic Node Name", "fcdns.rply.sname", FT_STRING, BASE_HEX, NULL,
1823 { &hf_fcdns_rply_ptype,
1824 {"Port Type", "fcdns.rply.porttype", FT_UINT8, BASE_HEX,
1825 VALS (fc_dns_port_type_val), 0x0, "", HFILL}},
1826 { &hf_fcdns_rply_fpname,
1827 {"Fabric Port Name", "fcdns.rply.fpname", FT_STRING, BASE_HEX, NULL,
1829 { &hf_fcdns_req_pname,
1830 {"Port Name", "fcdns.req.portname", FT_STRING, BASE_HEX, NULL, 0x0,
1832 { &hf_fcdns_rply_portid,
1833 {"Port Identifier", "fcdns.rply.portid", FT_STRING, BASE_HEX, NULL,
1835 { &hf_fcdns_req_nname,
1836 {"Node Name", "fcdns.req.nname", FT_STRING, BASE_HEX, NULL, 0x0,
1838 { &hf_fcdns_req_domainscope,
1839 {"Domain ID Scope", "fcdns.req.domainid", FT_UINT8, BASE_HEX, NULL,
1841 { &hf_fcdns_req_areascope,
1842 {"Area ID Scope", "fcdns.req.areaid", FT_UINT8, BASE_HEX, NULL,
1844 { &hf_fcdns_req_fc4type,
1845 {"FC-4 Type", "fcdns.req.fc4type", FT_UINT8, BASE_HEX,
1846 VALS (fc_fc4_val), 0x0, "", HFILL}},
1847 { &hf_fcdns_req_ptype,
1848 {"Port Type", "fcdns.req.porttype", FT_UINT8, BASE_HEX,
1849 VALS (fc_dns_port_type_val), 0x0, "", HFILL}},
1851 {"IP Address", "fcdns.req.ip", FT_IPv6, BASE_DEC, NULL, 0x0,
1853 { &hf_fcdns_rply_fc4type,
1854 {"FC-4 Descriptor Type", "fcdns.rply.fc4type", FT_UINT8, BASE_HEX,
1855 VALS (fc_fc4_val), 0x0, "", HFILL}},
1856 { &hf_fcdns_req_snamelen,
1857 {"Symbolic Name Length", "fcdns.req.snamelen", FT_UINT8, BASE_DEC,
1858 NULL, 0x0, "", HFILL}},
1859 { &hf_fcdns_req_sname,
1860 {"Symbolic Port Name", "fcdns.req.sname", FT_STRING, BASE_HEX, NULL,
1862 { &hf_fcdns_rply_spnamelen,
1863 {"Symbolic Port Name Length", "fcdns.rply.spnamelen", FT_UINT8,
1864 BASE_DEC, NULL, 0x0, "", HFILL}},
1865 {&hf_fcdns_rply_spname,
1866 {"Symbolic Port Name", "fcdns.rply.spname", FT_STRING, BASE_HEX, NULL,
1868 { &hf_fcdns_rply_ipa,
1869 {"Initial Process Associator", "fcdns.rply.ipa", FT_BYTES, BASE_HEX,
1870 NULL, 0x0, "", HFILL}},
1871 { &hf_fcdns_rply_ipnode,
1872 {"Node IP Address", "fcdns.rply.ipnode", FT_IPv6, BASE_DEC, NULL,
1874 { &hf_fcdns_rply_ipport,
1875 {"Port IP Address", "fcdns.rply.ipport", FT_IPv6, BASE_DEC, NULL,
1877 { &hf_fcdns_rply_fc4desclen,
1878 {"FC-4 Descriptor Length", "fcdns.rply.fc4desclen", FT_UINT8,
1879 BASE_DEC, NULL, 0x0, "", HFILL}},
1880 { &hf_fcdns_rply_fc4desc,
1881 {"FC-4 Descriptor", "fcdns.rply.fc4desc", FT_BYTES, BASE_HEX, NULL,
1883 { &hf_fcdns_rply_hrdaddr,
1884 {"Hard Address", "fcdns.rply.hrdaddr", FT_STRING, BASE_HEX, NULL,
1886 { &hf_fcdns_req_fdesclen,
1887 {"FC-4 Descriptor Length", "fcdns.req.fc4desclen", FT_UINT8, BASE_DEC,
1888 NULL, 0x0, "", HFILL}},
1889 { &hf_fcdns_req_fdesc,
1890 {"FC-4 Descriptor", "fcdns.req.fc4desc", FT_STRING, BASE_HEX, NULL,
1892 { &hf_fcdns_req_spnamelen,
1893 {"Symbolic Port Name Length", "fcdns.req.spnamelen", FT_UINT8,
1894 BASE_DEC, NULL, 0x0, "", HFILL}},
1895 { &hf_fcdns_req_spname,
1896 {"Symbolic Port Name", "fcdns.req.spname", FT_STRING, BASE_HEX, NULL,
1899 {"Reason Code", "fcdns.rply.reason", FT_UINT8, BASE_HEX,
1900 VALS (fc_ct_rjt_code_vals), 0x0, "", HFILL}},
1901 { &hf_fcdns_rjtdetail,
1902 {"Reason Code Explanantion", "fcdns.rply.reasondet", FT_UINT8,
1903 BASE_HEX, VALS (fc_dns_rjt_det_code_val), 0x0, "", HFILL}},
1905 {"Vendor Unique Reject Code", "fcdns.rply.vendor", FT_UINT8,
1906 BASE_HEX, NULL, 0x0, "", HFILL}},
1907 { &hf_fcdns_zone_mbrtype,
1908 {"Zone Member Type", "fcdns.zone.mbrtype", FT_UINT8, BASE_HEX,
1909 VALS (fc_swils_zonembr_type_val), 0x0, "", HFILL}},
1910 { &hf_fcdns_zone_mbrid,
1911 {"Member Identifier", "swils.zone.mbrid", FT_STRING, BASE_HEX, NULL,
1914 {"Zone Name", "fcdns.zonename", FT_STRING, BASE_HEX, NULL, 0x0, "",
1917 {"Port IP Address", "fcdns.portip", FT_IPv4, BASE_DEC, NULL, 0x0,
1919 { &hf_fcdns_sw2_objfmt,
1920 {"Name Entry Object Format", "fcdns.entry.objfmt", FT_UINT8, BASE_HEX,
1921 NULL, 0x0, "", HFILL}},
1922 { &hf_fcdns_num_fc4desc,
1923 {"Number of FC4 Descriptors Registered", "fcdns.entry.numfc4desc",
1924 FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}},
1925 { &hf_fcdns_rply_ownerid,
1926 {"Owner Id", "fcdns.rply.ownerid", FT_STRING, BASE_HEX, NULL, 0x0, "",
1928 { &hf_fcdns_maxres_size,
1929 {"Maximum/Residual Size", "fcdns.maxres_size", FT_UINT16, BASE_DEC,
1930 NULL, 0x0, "", HFILL}},
1931 { &hf_fcdns_reply_cos,
1932 {"Class of Service Supported", "fcdns.reply.cos", FT_UINT32, BASE_HEX,
1933 NULL, 0x0, "", HFILL}},
1934 { &hf_fcdns_req_cos,
1935 {"Requested Class of Service", "fcdns.req.class", FT_UINT32, BASE_HEX,
1936 NULL, 0x0, "", HFILL}},
1938 {"F", "fcdns.cos.f", FT_BOOLEAN, 32,
1939 TFS(&tfs_fcdns_cos_f), 0x01, "", HFILL}},
1941 {"1", "fcdns.cos.1", FT_BOOLEAN, 32,
1942 TFS(&tfs_fcdns_cos_1), 0x02, "", HFILL}},
1944 {"2", "fcdns.cos.2", FT_BOOLEAN, 32,
1945 TFS(&tfs_fcdns_cos_2), 0x04, "", HFILL}},
1947 {"3", "fcdns.cos.3", FT_BOOLEAN, 32,
1948 TFS(&tfs_fcdns_cos_3), 0x08, "", HFILL}},
1950 {"4", "fcdns.cos.4", FT_BOOLEAN, 32,
1951 TFS(&tfs_fcdns_cos_4), 0x10, "", HFILL}},
1953 {"6", "fcdns.cos.6", FT_BOOLEAN, 32,
1954 TFS(&tfs_fcdns_cos_6), 0x40, "", HFILL}},
1955 { &hf_fcdns_fc4type_llcsnap,
1956 {"LLC/SNAP", "fcdns.fc4types.llc_snap", FT_BOOLEAN, 32,
1957 TFS(&tfs_fcdns_fc4type_llcsnap), 0x0010, "", HFILL}},
1958 { &hf_fcdns_fc4type_ip,
1959 {"IP", "fcdns.fc4types.ip", FT_BOOLEAN, 32,
1960 TFS(&tfs_fcdns_fc4type_ip), 0x0020, "", HFILL}},
1961 { &hf_fcdns_fc4type_fcp,
1962 {"FCP", "fcdns.fc4types.fcp", FT_BOOLEAN, 32,
1963 TFS(&tfs_fcdns_fc4type_fcp), 0x0100, "", HFILL}},
1964 { &hf_fcdns_fc4type_swils,
1965 {"SW_ILS", "fcdns.fc4types.swils", FT_BOOLEAN, 32,
1966 TFS(&tfs_fcdns_fc4type_swils), 0x0010, "", HFILL}},
1967 { &hf_fcdns_fc4type_snmp,
1968 {"SNMP", "fcdns.fc4types.snmp", FT_BOOLEAN, 32,
1969 TFS(&tfs_fcdns_fc4type_snmp), 0x0004, "", HFILL}},
1970 { &hf_fcdns_fc4type_gs3,
1971 {"GS3", "fcdns.fc4types.gs3", FT_BOOLEAN, 32,
1972 TFS(&tfs_fcdns_fc4type_gs3), 0x0001, "", HFILL}},
1973 { &hf_fcdns_fc4type_vi,
1974 {"VI", "fcdns.fc4types.vi", FT_BOOLEAN, 32,
1975 TFS(&tfs_fcdns_fc4type_vi), 0x0001, "", HFILL}},
1976 { &hf_fcdns_rply_gft,
1977 {"FC-4 Types Supported", "fcdns.rply.fc4type", FT_NONE, BASE_HEX,
1978 NULL, 0x0, "", HFILL}},
1979 { &hf_fcdns_req_fc4types,
1980 {"FC-4 Types Supported", "fcdns.req.fc4types", FT_NONE, BASE_HEX,
1981 NULL, 0x0, "", HFILL}},
1982 { &hf_fcdns_fc4type,
1983 {"FC-4 Types", "fcdns.req.fc4type", FT_NONE, BASE_HEX,
1984 NULL, 0x0, "", HFILL}},
1985 { &hf_fcdns_fc4features,
1986 {"FC-4 Feature Bits", "fcdns.fc4features", FT_UINT8,
1987 BASE_HEX, NULL, 0x0, "", HFILL}},
1988 { &hf_fcdns_fc4features_i,
1989 {"I", "fcdns.fc4features.i", FT_BOOLEAN, 8,
1990 TFS(&tfs_fcdns_fc4features_i), 0x02, "", HFILL}},
1991 { &hf_fcdns_fc4features_t,
1992 {"T", "fcdns.fc4features.t", FT_BOOLEAN, 8,
1993 TFS(&tfs_fcdns_fc4features_t), 0x01, "", HFILL}},
1996 static gint *ett[] = {
2003 /* Register the protocol name and description */
2004 proto_fcdns = proto_register_protocol("Fibre Channel Name Server",
2007 /* Required function calls to register the header fields and subtrees used */
2008 proto_register_field_array(proto_fcdns, hf, array_length(hf));
2009 proto_register_subtree_array(ett, array_length(ett));
2010 register_init_routine (&fcdns_init_protocol);
2013 /* If this dissector uses sub-dissector registration add a registration routine.
2014 This format is required because a script is used to find these routines and
2015 create the code that calls these routines.
2018 proto_reg_handoff_fcdns (void)
2020 dissector_handle_t dns_handle;
2022 dns_handle = create_dissector_handle (dissect_fcdns, proto_fcdns);
2023 dissector_add("fcct.server", FCCT_GSRVR_DNS, dns_handle);
2024 dissector_add("fcct.server", FCCT_GSRVR_UNS, dns_handle);
2026 data_handle = find_dissector ("data");