1 /* XXX fixme can not reassemple multiple isns PDU fragments into one
6 * Routines for iSNS dissection
7 * Copyright 2003, Elipsan, Gareth Bushell <gbushell@elipsan.com>
8 * (c) 2004 Ronnie Sahlberg updates
9 * (c) 2004 Ming Zhang updates
13 * Wireshark - Network traffic analyzer
14 * By Gerald Combs <gerald@wireshark.org>
15 * Copyright 1998 Gerald Combs
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/conversation.h>
52 #include "packet-tcp.h"
53 #include <epan/prefs.h>
56 #define ISNS_PROTO_VER 0x1
57 #define ISNS_HEADER_SIZE 12
59 #define ISNS_TCP_PORT 3205
60 #define ISNS_UDP_PORT 3205
62 #define ISNS_OTHER_PORT 0
63 #define ISNS_ESI_PORT 1
64 #define ISNS_SCN_PORT 2
67 static dissector_handle_t isns_tcp_handle;
68 static dissector_handle_t isns_udp_handle;
70 static gint ett_isns_flags = -1;
71 static gint ett_isns_payload = -1;
72 static gint ett_isns_attribute = -1;
73 static gint ett_isns_port = -1;
74 static gint ett_isns_isnt = -1;
76 static guint AddAttribute(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree,
77 guint offset, guint16 function_id);
79 /* Initialize the protocol and registered fields */
80 static int proto_isns = -1;
84 static int hf_isns_version = -1;
85 static int hf_isns_function_id = -1;
86 static int hf_isns_pdu_length = -1;
87 static int hf_isns_flags = -1;
88 static int hf_isns_transaction_id = -1;
89 static int hf_isns_sequence_id = -1;
90 static int hf_isns_payload = -1;
91 static int hf_isns_first_pdu = -1;
92 static int hf_isns_last_pdu = -1;
93 static int hf_isns_replace = -1;
94 static int hf_isns_auth = -1;
95 static int hf_isns_server = -1;
96 static int hf_isns_client = -1;
99 static int hf_isns_scn_bitmap = -1;
100 static int hf_isns_scn_bitmap_initiator_and_self_information_only = -1;
101 static int hf_isns_scn_bitmap_target_and_self_information_only = -1;
102 static int hf_isns_scn_bitmap_management_registration_scn = -1;
103 static int hf_isns_scn_bitmap_object_removed = -1;
104 static int hf_isns_scn_bitmap_object_added = -1;
105 static int hf_isns_scn_bitmap_object_updated = -1;
106 static int hf_isns_scn_bitmap_dd_dds_member_removed = -1;
107 static int hf_isns_scn_bitmap_dd_dds_member_added = -1;
108 static int hf_isns_isnt_control = -1;
109 static int hf_isns_isnt_initiator = -1;
110 static int hf_isns_isnt_target = -1;
112 static int hf_isns_psb = -1;
113 static int hf_isns_psb_tunnel_mode = -1;
114 static int hf_isns_psb_transport_mode = -1;
115 static int hf_isns_psb_pfs = -1;
116 static int hf_isns_psb_aggressive_mode = -1;
117 static int hf_isns_psb_main_mode = -1;
118 static int hf_isns_psb_ike_ipsec = -1;
119 static int hf_isns_psb_bitmap = -1;
121 static int hf_isns_dd_member_portal_port = -1;
122 static int hf_isns_portal_port = -1;
123 static int hf_isns_esi_port = -1;
124 static int hf_isns_scn_port = -1;
125 static int hf_isns_port_type = -1;
127 static int hf_isns_entity_protocol = -1;
128 static int hf_isns_iscsi_node_type = -1;
129 static int hf_isns_resp_errorcode = -1;
130 static int hf_isns_attr_tag = -1;
131 static int hf_isns_attr_len = -1;
132 static int hf_isns_heartbeat_ipv6_addr = -1;
133 static int hf_isns_heartbeat_udp_port = -1;
134 static int hf_isns_heartbeat_tcp_port = -1;
135 static int hf_isns_heartbeat_interval = -1;
136 static int hf_isns_heartbeat_counter = -1;
138 static int hf_isns_mgmt_ip_addr = -1;
139 static int hf_isns_node_ip_addr = -1;
140 static int hf_isns_port_ip_addr = -1;
141 static int hf_isns_portal_ip_addr = -1;
142 static int hf_isns_dd_member_portal_ip_addr = -1;
143 static int hf_isns_iscsi_name = -1;
144 static int hf_isns_switch_name = -1;
145 static int hf_isns_dd_member_iscsi_name = -1;
146 static int hf_isns_virtual_fabric_id = -1;
147 static int hf_isns_proxy_iscsi_name = -1;
148 static int hf_isns_fc4_descriptor = -1;
149 static int hf_isns_iscsi_auth_method = -1;
150 static int hf_isns_iscsi_alias = -1;
151 static int hf_isns_portal_symbolic_name = -1;
152 static int hf_isns_dd_set_symbolic_name = -1;
153 static int hf_isns_dd_symbolic_name = -1;
154 static int hf_isns_symbolic_port_name = -1;
155 static int hf_isns_symbolic_node_name = -1;
156 static int hf_isns_entity_identifier = -1;
157 static int hf_isns_dd_id_next_id = -1;
158 static int hf_isns_member_iscsi_index = -1;
159 static int hf_isns_member_portal_index = -1;
160 static int hf_isns_member_fc_port_name = -1;
161 static int hf_isns_vendor_oui = -1;
162 static int hf_isns_preferred_id = -1;
163 static int hf_isns_assigned_id = -1;
164 static int hf_isns_dd_id = -1;
165 static int hf_isns_dd_set_id = -1;
166 static int hf_isns_dd_set_next_id = -1;
167 static int hf_isns_node_index = -1;
168 static int hf_isns_node_next_index = -1;
169 static int hf_isns_entity_index = -1;
170 static int hf_isns_portal_index = -1;
171 static int hf_isns_portal_next_index = -1;
172 static int hf_isns_entity_next_index = -1;
173 static int hf_isns_timestamp = -1;
174 static int hf_isns_esi_interval = -1;
175 static int hf_isns_registration_period = -1;
176 static int hf_isns_port_id = -1;
177 static int hf_isns_hard_address = -1;
178 static int hf_isns_wwnn_token = -1;
179 static int hf_isns_node_ipa = -1;
180 static int hf_isns_fc_port_name_wwpn = -1;
181 static int hf_isns_fc_node_name_wwnn = -1;
182 static int hf_isns_fabric_port_name = -1;
183 static int hf_isns_permanent_port_name = -1;
184 static int hf_isns_delimiter = -1;
185 static int hf_isns_not_decoded_yet = -1;
186 static int hf_isns_portal_group_tag = -1;
187 static int hf_isns_pg_iscsi_name = -1;
188 static int hf_isns_pg_portal_ip_addr = -1;
189 static int hf_isns_pg_portal_port = -1;
190 static int hf_isns_pg_index = -1;
191 static int hf_isns_pg_next_index = -1;
195 /* Desegment iSNS over TCP messages */
196 static gboolean isns_desegment = TRUE;
199 #define ISNS_FUNC_DEVATTRREG 0x0001
200 #define ISNS_FUNC_DEVATTRQRY 0x0002
201 #define ISNS_FUNC_DEVGETNEXT 0x0003
202 #define ISNS_FUNC_DEREGDEV 0x0004
203 #define ISNS_FUNC_SCNREG 0x0005
204 #define ISNS_FUNC_SCNDEREG 0x0006
205 #define ISNS_FUNC_SCNEVENT 0x0007
206 #define ISNS_FUNC_SCN 0x0008
207 #define ISNS_FUNC_DDREG 0x0009
208 #define ISNS_FUNC_DDDEREG 0x000a
209 #define ISNS_FUNC_DDSREG 0x000b
210 #define ISNS_FUNC_DDSDEREG 0x000c
211 #define ISNS_FUNC_ESI 0x000d
212 #define ISNS_FUNC_HEARTBEAT 0x000e
213 #define ISNS_FUNC_RQSTDOMID 0x0011
214 #define ISNS_FUNC_RLSEDOMID 0x0012
215 #define ISNS_FUNC_GETDOMID 0x0013
217 #define ISNS_FUNC_RSP_DEVATTRREG 0x8001
218 #define ISNS_FUNC_RSP_DEVATTRQRY 0x8002
219 #define ISNS_FUNC_RSP_DEVGETNEXT 0x8003
220 #define ISNS_FUNC_RSP_DEREGDEV 0x8004
221 #define ISNS_FUNC_RSP_SCNREG 0x8005
222 #define ISNS_FUNC_RSP_SCNDEREG 0x8006
223 #define ISNS_FUNC_RSP_SCNEVENT 0x8007
224 #define ISNS_FUNC_RSP_SCN 0x8008
225 #define ISNS_FUNC_RSP_DDREG 0x8009
226 #define ISNS_FUNC_RSP_DDDEREG 0x800a
227 #define ISNS_FUNC_RSP_DDSREG 0x800b
228 #define ISNS_FUNC_RSP_DDSDEREG 0x800c
229 #define ISNS_FUNC_RSP_ESI 0x800d
230 #define ISNS_FUNC_RSP_RQSTDOMID 0x8011
231 #define ISNS_FUNC_RSP_RLSEDOMID 0x8012
232 #define ISNS_FUNC_RSP_GETDOMID 0x8013
234 static const value_string isns_function_ids[] = {
236 {ISNS_FUNC_DEVATTRREG, "DevAttrReg"},
237 {ISNS_FUNC_DEVATTRQRY, "DevAttrQry"},
238 {ISNS_FUNC_DEVGETNEXT, "DevGetNext"},
239 {ISNS_FUNC_DEREGDEV, "DeregDev"},
240 {ISNS_FUNC_SCNREG, "SCNReg"},
241 {ISNS_FUNC_SCNDEREG, "SCNDereg"},
242 {ISNS_FUNC_SCNEVENT, "SCNEvent"},
243 {ISNS_FUNC_SCN, "SCN"},
244 {ISNS_FUNC_DDREG, "DDReg"},
245 {ISNS_FUNC_DDDEREG, "DDDereg"},
246 {ISNS_FUNC_DDSREG, "DDSReg"},
247 {ISNS_FUNC_DDSDEREG, "DDSDereg"},
248 {ISNS_FUNC_ESI, "ESI"},
249 {ISNS_FUNC_HEARTBEAT, "Heartbeat"},
250 {ISNS_FUNC_RQSTDOMID, "RqstDomId"},
251 {ISNS_FUNC_RLSEDOMID, "RlseDomId"},
252 {ISNS_FUNC_GETDOMID, "GetDomId"},
255 {ISNS_FUNC_RSP_DEVATTRREG, "DevAttrRegRsp"},
256 {ISNS_FUNC_RSP_DEVATTRQRY, "DevAttrQryRsp"},
257 {ISNS_FUNC_RSP_DEVGETNEXT, "DevGetNextRsp"},
258 {ISNS_FUNC_RSP_DEREGDEV, "DeregDevRsp"},
259 {ISNS_FUNC_RSP_SCNREG, "SCNRegRsp"},
260 {ISNS_FUNC_RSP_SCNDEREG, "SCNDeregRsp"},
261 {ISNS_FUNC_RSP_SCNEVENT, "SCNEventRsp"},
262 {ISNS_FUNC_RSP_SCN, "SCNRsp"},
263 {ISNS_FUNC_RSP_DDREG, "DDRegRsp"},
264 {ISNS_FUNC_RSP_DDDEREG, "DDDeregRsp"},
265 {ISNS_FUNC_RSP_DDSREG, "DDSRegRsp"},
266 {ISNS_FUNC_RSP_DDSDEREG, "DDSDeregRsp"},
267 {ISNS_FUNC_RSP_ESI, "ESIRsp"},
268 {ISNS_FUNC_RSP_RQSTDOMID, "RqstDomIdRsp"},
269 {ISNS_FUNC_RSP_RLSEDOMID, "RlseDomIdRsp"},
270 {ISNS_FUNC_RSP_GETDOMID, "GetDomIdRsp"},
275 #define ISNS_ENTITY_PROTOCOL_NO_PROTOCOL 1
276 #define ISNS_ENTITY_PROTOCOL_ISCSI 2
277 #define ISNS_ENTITY_PROTOCOL_IFCP 3
280 static const value_string isns_entity_protocol[] = {
281 {ISNS_ENTITY_PROTOCOL_NO_PROTOCOL, "No Protocol"},
282 {ISNS_ENTITY_PROTOCOL_ISCSI, "iSCSI"},
283 {ISNS_ENTITY_PROTOCOL_IFCP, "iFCP"},
288 static const value_string isns_errorcode[] = {
290 { 1,"Unknown Error"},
291 { 2,"Message Format Error"},
292 { 3,"Invalid Registration"},
294 { 5,"Invalid Query"},
295 { 6,"Source Unknown"},
296 { 7,"Source Absent"},
297 { 8,"Source Unauthorized"},
298 { 9,"No such Entry"},
299 {10,"Version Not Supported"},
300 {11,"Internal Error"},
302 {13,"Option Not Understood"},
303 {14,"Invalid Update"},
304 {15,"Message (FUNCTION_ID) Not supported"},
305 {16,"SCN Event Rejected"},
306 {17,"SCN Registration Rejected"},
307 {18,"Attribute Not Implemented"},
308 {19,"FC_DOMAIN_ID Not available"},
309 {20,"FC_DOMAIN_ID not allocated"},
310 {21,"ESI Not Available"},
311 {22,"Invalid Deregistration"},
312 {23,"Registration Feature Not Supported"},
318 #define ISNS_ATTR_TAG_DELIMITER 0
319 #define ISNS_ATTR_TAG_ENTITY_IDENTIFIER 1
320 #define ISNS_ATTR_TAG_ENTITY_PROTOCOL 2
321 #define ISNS_ATTR_TAG_MGMT_IP_ADDRESS 3
322 #define ISNS_ATTR_TAG_TIMESTAMP 4
323 #define ISNS_ATTR_TAG_PROTOCOL_VERSION_RANGE 5
324 #define ISNS_ATTR_TAG_REGISTRATION_PERIOD 6
325 #define ISNS_ATTR_TAG_ENTITY_INDEX 7
326 #define ISNS_ATTR_TAG_ENTITY_NEXT_INDEX 8
327 #define ISNS_ATTR_TAG_ENTITY_ISAKMP_PHASE_1 11
328 #define ISNS_ATTR_TAG_ENTITY_CERTIFICATE 12
329 #define ISNS_ATTR_TAG_PORTAL_IP_ADDRESS 16
330 #define ISNS_ATTR_TAG_PORTAL_PORT 17
331 #define ISNS_ATTR_TAG_PORTAL_SYMBOLIC_NAME 18
332 #define ISNS_ATTR_TAG_ESI_INTERVAL 19
333 #define ISNS_ATTR_TAG_ESI_PORT 20
334 #define ISNS_ATTR_TAG_PORTAL_INDEX 22
335 #define ISNS_ATTR_TAG_SCN_PORT 23
336 #define ISNS_ATTR_TAG_PORTAL_NEXT_INDEX 24
337 #define ISNS_ATTR_TAG_PORTAL_SECURITY_BITMAP 27
338 #define ISNS_ATTR_TAG_PORTAL_ISAKMP_PHASE_1 28
339 #define ISNS_ATTR_TAG_PORTAL_ISAKMP_PHASE_2 29
340 #define ISNS_ATTR_TAG_PORTAL_CERTIFICATE 31
341 #define ISNS_ATTR_TAG_ISCSI_NAME 32
342 #define ISNS_ATTR_TAG_ISCSI_NODE_TYPE 33
343 #define ISNS_ATTR_TAG_ISCSI_ALIAS 34
344 #define ISNS_ATTR_TAG_ISCSI_SCN_BITMAP 35
345 #define ISNS_ATTR_TAG_ISCSI_NODE_INDEX 36
346 #define ISNS_ATTR_TAG_WWNN_TOKEN 37
347 #define ISNS_ATTR_TAG_ISCSI_NODE_NEXT_INDEX 38
348 #define ISNS_ATTR_TAG_ISCSI_AUTH_METHOD 42
349 #define ISNS_ATTR_TAG_PG_ISCSI_NAME 48
350 #define ISNS_ATTR_TAG_PG_PORTAL_IP_ADDR 49
351 #define ISNS_ATTR_TAG_PG_PORTAL_PORT 50
352 #define ISNS_ATTR_TAG_PORTAL_GROUP_TAG 51
353 #define ISNS_ATTR_TAG_PORTAL_GROUP_INDEX 52
354 #define ISNS_ATTR_TAG_PORTAL_GROUP_NEXT_INDEX 53
355 #define ISNS_ATTR_TAG_FC_PORT_NAME_WWPN 64
356 #define ISNS_ATTR_TAG_PORT_ID 65
357 #define ISNS_ATTR_TAG_FC_PORT_TYPE 66
358 #define ISNS_ATTR_TAG_SYMBOLIC_PORT_NAME 67
359 #define ISNS_ATTR_TAG_FABRIC_PORT_NAME 68
360 #define ISNS_ATTR_TAG_HARD_ADDRESS 69
361 #define ISNS_ATTR_TAG_PORT_IP_ADDRESS 70
362 #define ISNS_ATTR_TAG_CLASS_OF_SERVICE 71
363 #define ISNS_ATTR_TAG_FC4_TYPES 72
364 #define ISNS_ATTR_TAG_FC4_DESCRIPTOR 73
365 #define ISNS_ATTR_TAG_FC4_FEATURES 74
366 #define ISNS_ATTR_TAG_IFCP_SCN_BITMAP 75
367 #define ISNS_ATTR_TAG_PORT_ROLE 76
368 #define ISNS_ATTR_TAG_PERMANENT_PORT_NAME 77
369 #define ISNS_ATTR_TAG_FC4_TYPE_CODE 95
370 #define ISNS_ATTR_TAG_FC_NODE_NAME_WWNN 96
371 #define ISNS_ATTR_TAG_SYMBOLIC_NODE_NAME 97
372 #define ISNS_ATTR_TAG_NODE_IP_ADDRESS 98
373 #define ISNS_ATTR_TAG_NODE_IPA 99
374 #define ISNS_ATTR_TAG_PROXY_ISCSI_NAME 101
375 #define ISNS_ATTR_TAG_SWITCH_NAME 128
376 #define ISNS_ATTR_TAG_PREFERRED_ID 129
377 #define ISNS_ATTR_TAG_ASSIGNED_ID 130
378 #define ISNS_ATTR_TAG_VIRTUAL_FABRIC_ID 131
379 #define ISNS_ATTR_TAG_VENDOR_OUI 256
380 #define ISNS_ATTR_TAG_DD_SET_ID 2049
381 #define ISNS_ATTR_TAG_DD_SET_SYMBOLIC_NAME 2050
382 #define ISNS_ATTR_TAG_DD_SET_STATUS 2051
383 #define ISNS_ATTR_TAG_DD_SET_NEXT_ID 2052
384 #define ISNS_ATTR_TAG_DD_ID 2065
385 #define ISNS_ATTR_TAG_DD_SYMBOLIC_NAME 2066
386 #define ISNS_ATTR_TAG_DD_MEMBER_ISCSI_INDEX 2067
387 #define ISNS_ATTR_TAG_DD_MEMBER_ISCSI_NAME 2068
388 #define ISNS_ATTR_TAG_DD_MEMBER_FC_PORT_NAME 2069
389 #define ISNS_ATTR_TAG_DD_MEMBER_PORTAL_INDEX 2070
390 #define ISNS_ATTR_TAG_DD_MEMBER_PORTAL_IP_ADDRESS 2071
391 #define ISNS_ATTR_TAG_DD_MEMBER_PORTAL_PORT 2072
392 #define ISNS_ATTR_TAG_DD_FEATURES 2078
393 #define ISNS_ATTR_TAG_DD_ID_NEXT_ID 2079
396 static const value_string isns_attribute_tags[] = {
397 {ISNS_ATTR_TAG_DELIMITER, "Delimiter"},
398 {ISNS_ATTR_TAG_ENTITY_IDENTIFIER, "Entity Identifier (EID)"},
399 {ISNS_ATTR_TAG_ENTITY_PROTOCOL, "Entity Protocol"},
400 {ISNS_ATTR_TAG_MGMT_IP_ADDRESS, "Management IP Address"},
401 {ISNS_ATTR_TAG_TIMESTAMP, "Timestamp"},
402 {ISNS_ATTR_TAG_PROTOCOL_VERSION_RANGE, "Protocol Version Range"},
403 {ISNS_ATTR_TAG_REGISTRATION_PERIOD, "Registration Period"},
404 {ISNS_ATTR_TAG_ENTITY_INDEX, "Entity Index"},
405 {ISNS_ATTR_TAG_ENTITY_NEXT_INDEX, "Entity Next Index"},
406 {ISNS_ATTR_TAG_ENTITY_ISAKMP_PHASE_1, "Entity ISAKMP Phase-1"},
407 {ISNS_ATTR_TAG_ENTITY_CERTIFICATE, "Entity Certificate"},
408 {ISNS_ATTR_TAG_PORTAL_IP_ADDRESS, "Portal IP Address"},
409 {ISNS_ATTR_TAG_PORTAL_PORT, "Portal TCP/UDP Port"},
410 {ISNS_ATTR_TAG_PORTAL_SYMBOLIC_NAME, "Portal Symbolic Name"},
411 {ISNS_ATTR_TAG_ESI_INTERVAL, "ESI Interval"},
412 {ISNS_ATTR_TAG_ESI_PORT, "ESI Port"},
413 {ISNS_ATTR_TAG_PORTAL_INDEX, "Portal Index"},
414 {ISNS_ATTR_TAG_SCN_PORT, "SCN Port"},
415 {ISNS_ATTR_TAG_PORTAL_NEXT_INDEX, "Portal Next Index"},
416 {ISNS_ATTR_TAG_PORTAL_SECURITY_BITMAP, "Portal Security Bitmap"},
417 {ISNS_ATTR_TAG_PORTAL_ISAKMP_PHASE_1, "Portal ISAKMP Phase-1"},
418 {ISNS_ATTR_TAG_PORTAL_ISAKMP_PHASE_2, "Portal ISAKMP Phase-2"},
419 {ISNS_ATTR_TAG_PORTAL_CERTIFICATE, "Portal Certificate"},
420 {ISNS_ATTR_TAG_ISCSI_NAME, "iSCSI Name"},
421 {ISNS_ATTR_TAG_ISCSI_NODE_TYPE, "iSCSI Node Type"},
422 {ISNS_ATTR_TAG_ISCSI_ALIAS, "iSCSI Alias"},
423 {ISNS_ATTR_TAG_ISCSI_SCN_BITMAP, "iSCSI SCN Bitmap"},
424 {ISNS_ATTR_TAG_ISCSI_NODE_INDEX, "iSCSI Node Index"},
425 {ISNS_ATTR_TAG_WWNN_TOKEN, "WWNN Token"},
426 {ISNS_ATTR_TAG_ISCSI_NODE_NEXT_INDEX, "iSCSI Node Next Index"},
427 {ISNS_ATTR_TAG_ISCSI_AUTH_METHOD, "iSCSI AuthMethod"},
428 {ISNS_ATTR_TAG_PG_ISCSI_NAME, "PG iSCSI Name"},
429 {ISNS_ATTR_TAG_PG_PORTAL_IP_ADDR, "PG Portal IP Addr"},
430 {ISNS_ATTR_TAG_PG_PORTAL_PORT, "PG Portal Port"},
431 {ISNS_ATTR_TAG_PORTAL_GROUP_TAG, "Portal Group Tag"},
432 {ISNS_ATTR_TAG_PORTAL_GROUP_INDEX, "PG Index"},
433 {ISNS_ATTR_TAG_PORTAL_GROUP_NEXT_INDEX, "PG Next Index"},
434 {ISNS_ATTR_TAG_FC_PORT_NAME_WWPN, "FC Port Name WWPN"},
435 {ISNS_ATTR_TAG_PORT_ID, "Port ID"},
436 {ISNS_ATTR_TAG_FC_PORT_TYPE, "FC Port Type"},
437 {ISNS_ATTR_TAG_SYMBOLIC_PORT_NAME, "Symbolic Port Name"},
438 {ISNS_ATTR_TAG_FABRIC_PORT_NAME, "Fabric Port Name"},
439 {ISNS_ATTR_TAG_HARD_ADDRESS, "Hard Address"},
440 {ISNS_ATTR_TAG_PORT_IP_ADDRESS, "Port IP-Address"},
441 {ISNS_ATTR_TAG_CLASS_OF_SERVICE, "Class of Service"},
442 {ISNS_ATTR_TAG_FC4_TYPES, "FC-4 Types"},
443 {ISNS_ATTR_TAG_FC4_DESCRIPTOR, "FC-4 Descriptor"},
444 {ISNS_ATTR_TAG_FC4_FEATURES, "FC-4 Features"},
445 {ISNS_ATTR_TAG_IFCP_SCN_BITMAP, "iFCP SCN bitmap"},
446 {ISNS_ATTR_TAG_PORT_ROLE, "Port Role"},
447 {ISNS_ATTR_TAG_PERMANENT_PORT_NAME, "Permanent Port Name"},
448 {ISNS_ATTR_TAG_FC4_TYPE_CODE, "FC-4 Type Code"},
449 {ISNS_ATTR_TAG_FC_NODE_NAME_WWNN, "FC Node Name WWNN"},
450 {ISNS_ATTR_TAG_SYMBOLIC_NODE_NAME, "Symbolic Node Name"},
451 {ISNS_ATTR_TAG_NODE_IP_ADDRESS, "Node IP-Address"},
452 {ISNS_ATTR_TAG_NODE_IPA, "Node IPA"},
453 {ISNS_ATTR_TAG_PROXY_ISCSI_NAME, "Proxy iSCSI Name"},
454 {ISNS_ATTR_TAG_SWITCH_NAME, "Switch Name"},
455 {ISNS_ATTR_TAG_PREFERRED_ID, "Preferred ID"},
456 {ISNS_ATTR_TAG_ASSIGNED_ID, "Assigned ID"},
457 {ISNS_ATTR_TAG_VIRTUAL_FABRIC_ID, "Virtual_Fabric_ID"},
458 {ISNS_ATTR_TAG_VENDOR_OUI, "iSNS Server Vendor OUI"},
459 {ISNS_ATTR_TAG_DD_SET_ID, "DD_Set ID"},
460 {ISNS_ATTR_TAG_DD_SET_SYMBOLIC_NAME, "DD_Set Sym Name"},
461 {ISNS_ATTR_TAG_DD_SET_STATUS, "DD_Set Status"},
462 {ISNS_ATTR_TAG_DD_SET_NEXT_ID, "DD_Set_Next_ID"},
463 {ISNS_ATTR_TAG_DD_ID, "DD_ID"},
464 {ISNS_ATTR_TAG_DD_SYMBOLIC_NAME, "DD_Symbolic Name"},
465 {ISNS_ATTR_TAG_DD_MEMBER_ISCSI_INDEX, "DD_Member iSCSI Index"},
466 {ISNS_ATTR_TAG_DD_MEMBER_ISCSI_NAME, "DD_Member iSCSI Name"},
467 {ISNS_ATTR_TAG_DD_MEMBER_FC_PORT_NAME, "DD_Member FC Port Name"},
468 {ISNS_ATTR_TAG_DD_MEMBER_PORTAL_INDEX, "DD Member Portal Index"},
469 {ISNS_ATTR_TAG_DD_MEMBER_PORTAL_IP_ADDRESS, "DD_Member Portal IP Addr"},
470 {ISNS_ATTR_TAG_DD_MEMBER_PORTAL_PORT, "DD Member Portal TCP/UDP"},
471 {ISNS_ATTR_TAG_DD_FEATURES, "DD_Features"},
472 {ISNS_ATTR_TAG_DD_ID_NEXT_ID, "DD_ID Next ID"},
479 #define ISNS_FLAGS_CLIENT 0x8000
480 #define ISNS_FLAGS_SERVER 0x4000
481 #define ISNS_FLAGS_AUTH 0x2000
482 #define ISNS_FLAGS_REPLACE 0x1000
483 #define ISNS_FLAGS_LAST_PDU 0x0800
484 #define ISNS_FLAGS_FIRST_PDU 0x0400
487 static const true_false_string isns_scn_bitmap_initiator_and_self_information_only = {
491 static const true_false_string isns_scn_bitmap_target_and_self_information_only = {
495 static const true_false_string isns_scn_bitmap_management_registration_scn = {
499 static const true_false_string isns_scn_bitmap_object_removed = {
503 static const true_false_string isns_scn_bitmap_object_added = {
507 static const true_false_string isns_scn_bitmap_object_updated = {
511 static const true_false_string isns_scn_bitmap_dd_dds_member_removed = {
515 static const true_false_string isns_scn_bitmap_dd_dds_member_added = {
520 static const true_false_string isns_psb_tunnel_mode = {
524 static const true_false_string isns_psb_transport_mode = {
528 static const true_false_string isns_psb_pfs = {
532 static const true_false_string isns_psb_aggressive_mode = {
536 static const true_false_string isns_psb_main_mode = {
540 static const true_false_string isns_psb_ike_ipsec = {
544 static const true_false_string isns_psb_bitmap = {
549 static const true_false_string isns_isnt_control = {
553 static const true_false_string isns_isnt_initiator = {
557 static const true_false_string isns_isnt_target = {
562 static const true_false_string isns_port_type = {
567 static const true_false_string isns_flag_first_pdu = {
568 "First PDU of iSNS Message",
569 "Not the first PDU of iSNS Message"
572 static const true_false_string isns_flag_last_pdu = {
573 "Last PDU of iSNS Message",
574 "Not the Last PDU of iSNS Message"
577 static const true_false_string isns_flag_replace = {
582 static const true_false_string isns_flag_auth = {
583 "Authentication Block is PRESENT",
584 "No authentication block"
587 static const true_false_string isns_flag_server = {
588 "Sender is iSNS server",
589 "Sender is not iSNS server"
592 static const true_false_string isns_flag_client = {
593 "Sender is iSNS client",
594 "Sender is not iSNS client"
598 /* Initialize the subtree pointers */
599 static gint ett_isns = -1;
602 /* Code to actually dissect the packets */
604 dissect_isns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
608 guint16 isns_protocol_version;
609 guint32 packet_len = tvb_length(tvb);
610 /* Set up structures needed to add the protocol subtree and manage it */
611 proto_item *ti = NULL;
612 proto_tree *isns_tree = NULL;
614 /* Make entries in Protocol column and Info column on summary display */
615 col_set_str(pinfo->cinfo, COL_PROTOCOL, "iSNS");
616 if (check_col(pinfo->cinfo, COL_INFO))
617 col_clear(pinfo->cinfo, COL_INFO);
619 /* Get the protocol version - only version one at the moment*/
620 isns_protocol_version = tvb_get_ntohs(tvb, offset + 0);
622 /* Get the function id from the packet */
623 function_id = tvb_get_ntohs(tvb, offset + 2);
625 /* Add the function name in the info col */
626 if (check_col(pinfo->cinfo, COL_INFO))
627 col_add_str(pinfo->cinfo, COL_INFO,
628 val_to_str(function_id, isns_function_ids,
629 "Unknown function ID 0x%04x"));
631 /* In the interest of speed, if "tree" is NULL, don't do any work not
632 * necessary to generate protocol tree items.
639 proto_item *tpayload;
641 /* NOTE: The offset and length values in the call to
642 * "proto_tree_add_item()" define what data bytes to highlight in the hex
643 * display window when the line in the protocol tree display
644 * corresponding to that item is selected.
645 * tvb_length(tvb) is a handy way to highlight all data from the offset to
646 * the end of the packet.
649 /* create display subtree for the protocol */
650 ti = proto_tree_add_item(tree, proto_isns, tvb, 0, -1, FALSE);
651 isns_tree = proto_item_add_subtree(ti, ett_isns);
653 /* OK... Sort out the header */
654 b = tvb_get_ntohs(tvb, offset);
655 proto_tree_add_uint(isns_tree, hf_isns_version, tvb, offset, 2, b);
657 b = tvb_get_ntohs(tvb, offset + 2);
658 proto_tree_add_uint(isns_tree, hf_isns_function_id, tvb, offset+2, 2, b);
660 b = tvb_get_ntohs(tvb, offset + 4);
661 proto_tree_add_uint(isns_tree, hf_isns_pdu_length, tvb, offset+4, 2, b);
664 flags = tvb_get_ntohs(tvb, offset + 6);
665 tflags = proto_tree_add_uint(isns_tree, hf_isns_flags, tvb, offset+6, 2, flags);
666 tt = proto_item_add_subtree(tflags, ett_isns_flags);
668 proto_tree_add_boolean(tt, hf_isns_client, tvb, offset+6, 2, flags);
669 proto_tree_add_boolean(tt, hf_isns_server, tvb, offset+6, 2, flags);
670 proto_tree_add_boolean(tt, hf_isns_auth, tvb, offset+6, 2, flags);
671 proto_tree_add_boolean(tt, hf_isns_replace, tvb, offset+6, 2, flags);
672 proto_tree_add_boolean(tt, hf_isns_last_pdu, tvb, offset+6, 2, flags);
673 proto_tree_add_boolean(tt, hf_isns_first_pdu, tvb, offset+6, 2, flags);
675 b = tvb_get_ntohs(tvb, offset + 8);
676 proto_tree_add_uint(isns_tree, hf_isns_transaction_id, tvb, offset+8, 2, b);
678 b = tvb_get_ntohs(tvb, offset + 10);
679 proto_tree_add_uint(isns_tree, hf_isns_sequence_id, tvb, offset+10, 2, b);
681 tpayload = proto_tree_add_item(isns_tree, hf_isns_payload, tvb, offset+12, packet_len - 12 , FALSE);
682 tt = proto_item_add_subtree(tpayload, ett_isns_payload);
684 /* Now set the offset to the start of the payload */
685 offset += ISNS_HEADER_SIZE;
687 /* Decode those attributes baby - Yeah!*/
690 case ISNS_FUNC_HEARTBEAT:
695 tvb_memcpy(tvb,hb_ipv6,offset,16);
696 proto_tree_add_ipv6(tt,hf_isns_heartbeat_ipv6_addr, tvb, offset, 16, hb_ipv6);
699 port = tvb_get_ntohs(tvb, offset);
700 proto_tree_add_uint(tt,hf_isns_heartbeat_tcp_port, tvb, offset, 2, port);
703 port = tvb_get_ntohs(tvb, offset);
704 proto_tree_add_uint(tt,hf_isns_heartbeat_udp_port, tvb, offset, 2, port);
707 c = tvb_get_ntohl(tvb, offset);
708 proto_tree_add_uint(tt,hf_isns_heartbeat_interval, tvb, offset, 4, c);
711 c = tvb_get_ntohl(tvb, offset);
712 proto_tree_add_uint(tt,hf_isns_heartbeat_counter, tvb, offset, 4, c);
717 case ISNS_FUNC_RSP_DEVATTRREG:
718 case ISNS_FUNC_RSP_DEVATTRQRY:
719 case ISNS_FUNC_RSP_DEVGETNEXT:
720 case ISNS_FUNC_RSP_DEREGDEV:
721 case ISNS_FUNC_RSP_SCNREG:
722 case ISNS_FUNC_RSP_SCNDEREG:
723 case ISNS_FUNC_RSP_SCNEVENT:
724 case ISNS_FUNC_RSP_SCN:
725 case ISNS_FUNC_RSP_DDREG:
726 case ISNS_FUNC_RSP_DDDEREG:
727 case ISNS_FUNC_RSP_DDSREG:
728 case ISNS_FUNC_RSP_DDSDEREG:
729 case ISNS_FUNC_RSP_ESI:
730 case ISNS_FUNC_RSP_RQSTDOMID:
731 case ISNS_FUNC_RSP_RLSEDOMID:
732 case ISNS_FUNC_RSP_GETDOMID:
734 /* Get the Error message of the response */
735 guint32 errorcode = tvb_get_ntohl(tvb, offset);
736 proto_tree_add_uint(tt,hf_isns_resp_errorcode, tvb, offset, 4, errorcode);
740 case ISNS_FUNC_DEVATTRREG:
741 case ISNS_FUNC_DEVATTRQRY:
742 case ISNS_FUNC_DEVGETNEXT:
743 case ISNS_FUNC_DEREGDEV:
744 case ISNS_FUNC_SCNREG:
745 case ISNS_FUNC_SCNDEREG:
746 case ISNS_FUNC_SCNEVENT:
748 case ISNS_FUNC_DDREG:
749 case ISNS_FUNC_DDDEREG:
750 case ISNS_FUNC_DDSREG:
751 case ISNS_FUNC_DDSDEREG:
753 case ISNS_FUNC_RQSTDOMID:
754 case ISNS_FUNC_RLSEDOMID:
755 case ISNS_FUNC_GETDOMID:
757 /* we can only look at the attributes for the first PDU */
758 if(!(flags&ISNS_FLAGS_FIRST_PDU)){
759 proto_tree_add_text(tt, tvb, offset, packet_len-offset, "This is not the first PDU. The attributes are not decoded");
763 while( offset < packet_len )
765 offset = AddAttribute(pinfo, tvb, tt, offset, function_id);
774 get_isns_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
778 isns_len = tvb_get_ntohs(tvb, offset+4);
779 return (isns_len+ISNS_HEADER_SIZE);
783 dissect_isns_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
785 gint length = tvb_length(tvb);
786 guint16 isns_protocol_version;
789 if (length < ISNS_HEADER_SIZE) {
791 * Not enough room to see if this is valid iSNS.
796 /* Get the protocol version - only version one at the moment*/
797 isns_protocol_version = tvb_get_ntohs(tvb, 0);
798 if (isns_protocol_version != ISNS_PROTO_VER)
801 /* Get the function id from the packet */
802 function_id = tvb_get_ntohs(tvb, 2);
803 if (match_strval(function_id, isns_function_ids) == NULL) {
804 /* Unknown function ID */
808 tcp_dissect_pdus(tvb, pinfo, tree, isns_desegment, 12, get_isns_pdu_len,
814 dissect_isns_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
816 gint length = tvb_length(tvb);
817 guint16 isns_protocol_version;
820 if (length < ISNS_HEADER_SIZE) {
822 * Not enough room to see if this is valid iSNS.
827 /* Get the protocol version - only version one at the moment*/
828 isns_protocol_version = tvb_get_ntohs(tvb, 0);
829 if (isns_protocol_version != ISNS_PROTO_VER)
832 /* Get the function id from the packet */
833 function_id = tvb_get_ntohs(tvb, 2);
834 if (match_strval(function_id, isns_function_ids) == NULL) {
835 /* Unknown function ID */
839 dissect_isns_pdu(tvb, pinfo, tree);
845 dissect_isns_attr_ip_address(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, int hf_index, guint32 tag, guint32 len)
847 proto_item *item=NULL;
848 proto_tree *tree=NULL;
851 item=proto_tree_add_item(parent_tree, hf_index, tvb, offset + 8, len, FALSE);
852 tree = proto_item_add_subtree(item, ett_isns_attribute);
855 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
856 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
862 dissect_isns_attr_string(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, int hf_index, guint32 tag, guint32 len)
864 proto_item *item=NULL;
865 proto_tree *tree=NULL;
868 item=proto_tree_add_item(parent_tree, hf_index, tvb, offset + 8, len, FALSE);
869 tree = proto_item_add_subtree(item, ett_isns_attribute);
872 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
873 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
879 dissect_isns_attr_integer(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, int hf_index, guint32 tag, guint32 len, guint16 function_id)
881 proto_item *item=NULL;
882 proto_tree *tree=NULL;
886 * in a DevAttrReg , the PGT (tag 51) may be sent as 0 length
887 * which then means that we wish to register the portal group tag
889 * (At least) some servers will respond with PGT as a 0 length
890 * value in these instances in the DevAttrRegRsp (eventhough I can
891 * not find this mentioned in the standard) so allow it for the
896 item=proto_tree_add_item(parent_tree, hf_index, tvb, offset + 8, len, FALSE);
897 tree = proto_item_add_subtree(item, ett_isns_attribute);
899 } else if((tag==ISNS_ATTR_TAG_PORTAL_GROUP_TAG)&&((function_id==ISNS_FUNC_DEVATTRREG)||(function_id==ISNS_FUNC_RSP_DEVATTRREG))){
902 item=proto_tree_add_uint_format(parent_tree, hf_isns_portal_group_tag, tvb, offset, 8, 0, "PG Tag: <NULL>");
903 tree = proto_item_add_subtree(item, ett_isns_attribute);
907 item=proto_tree_add_text(parent_tree, tvb, offset, 8, "Oops, you surprised me here. a 0 byte integer.");
908 tree = proto_item_add_subtree(item, ett_isns_attribute);
912 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
913 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
919 dissect_isns_attr_port(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, int hf_index, guint32 tag, guint32 len,
920 guint16 port_type, packet_info *pinfo)
922 proto_item *tree=NULL;
923 proto_item *item=NULL;
924 guint16 port = tvb_get_ntohs(tvb, offset + 10);
925 guint16 isudp = tvb_get_ntohs(tvb, offset + 8)&0x01;
926 conversation_t *conversation;
929 item = proto_tree_add_uint(parent_tree, hf_index, tvb, offset+8, 4, port);
930 tree = proto_item_add_subtree(item, ett_isns_port);
933 proto_tree_add_boolean(tree, hf_isns_port_type, tvb, offset+8, 2, isudp);
935 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
936 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
938 if ((port_type == ISNS_ESI_PORT) || (port_type == ISNS_SCN_PORT)) {
940 conversation = find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst, PT_UDP,
942 if (conversation == NULL) {
943 conversation = conversation_new (pinfo->fd->num, &pinfo->src, &pinfo->dst,
944 PT_UDP, port, 0, NO_PORT2_FORCE);
945 conversation_set_dissector (conversation, isns_udp_handle);
949 conversation = find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst, PT_TCP,
951 if (conversation == NULL) {
952 conversation = conversation_new (pinfo->fd->num, &pinfo->src, &pinfo->dst,
953 PT_TCP, port, 0, NO_PORT2_FORCE);
954 conversation_set_dissector (conversation, isns_tcp_handle);
963 dissect_isns_attr_none(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, int hf_index, guint32 tag, guint32 len)
965 proto_item *tree=NULL;
966 proto_item *item=NULL;
969 item=proto_tree_add_item(parent_tree, hf_index, tvb, offset, 8, FALSE);
970 tree = proto_item_add_subtree(item, ett_isns_port);
973 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
974 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
980 dissect_isns_attr_not_decoded_yet(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, int hf_index, guint32 tag, guint32 len)
982 proto_item *tree=NULL;
983 proto_item *item=NULL;
986 item=proto_tree_add_item(parent_tree, hf_index, tvb, offset + 8, len, FALSE);
987 tree = proto_item_add_subtree(item, ett_isns_port);
990 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
991 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
997 dissect_isns_attr_iscsi_node_type(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, int hf_index, guint32 tag, guint32 len)
999 proto_item *item=NULL;
1000 proto_tree *tree=NULL;
1001 guint32 node_type=tvb_get_ntohl(tvb, offset + 8);
1004 item=proto_tree_add_item(parent_tree, hf_index, tvb, offset + 8, len, FALSE);
1005 tree = proto_item_add_subtree(item, ett_isns_attribute);
1008 proto_tree_add_boolean(tree, hf_isns_isnt_control, tvb, offset+8, 4, node_type);
1009 if(node_type&0x00000004){
1010 proto_item_append_text(item, " Control");
1012 proto_tree_add_boolean(tree, hf_isns_isnt_initiator, tvb, offset+8, 4, node_type);
1013 if(node_type&0x00000002){
1014 proto_item_append_text(item, " Initiator");
1016 proto_tree_add_boolean(tree, hf_isns_isnt_target, tvb, offset+8, 4, node_type);
1017 if(node_type&0x00000001){
1018 proto_item_append_text(item, " Target");
1021 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
1022 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
1024 return offset+8+len;
1030 dissect_isns_attr_portal_security_bitmap(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, int hf_index, guint32 tag, guint32 len)
1032 proto_item *item=NULL;
1033 proto_tree *tree=NULL;
1034 guint32 psb=tvb_get_ntohl(tvb, offset + 8);
1037 item=proto_tree_add_item(parent_tree, hf_index, tvb, offset + 8, len, FALSE);
1038 tree = proto_item_add_subtree(item, ett_isns_attribute);
1041 proto_tree_add_boolean(tree, hf_isns_psb_tunnel_mode, tvb, offset+8, 4, psb);
1042 proto_tree_add_boolean(tree, hf_isns_psb_transport_mode, tvb, offset+8, 4, psb);
1043 proto_tree_add_boolean(tree, hf_isns_psb_pfs, tvb, offset+8, 4, psb);
1044 proto_tree_add_boolean(tree, hf_isns_psb_aggressive_mode, tvb, offset+8, 4, psb);
1045 proto_tree_add_boolean(tree, hf_isns_psb_main_mode, tvb, offset+8, 4, psb);
1046 proto_tree_add_boolean(tree, hf_isns_psb_ike_ipsec, tvb, offset+8, 4, psb);
1047 proto_tree_add_boolean(tree, hf_isns_psb_bitmap, tvb, offset+8, 4, psb);
1049 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
1050 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
1052 return offset+8+len;
1058 dissect_isns_attr_scn_bitmap(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, int hf_index, guint32 tag, guint32 len)
1060 proto_item *item=NULL;
1061 proto_tree *tree=NULL;
1062 guint32 scn_bitmap=tvb_get_ntohl(tvb, offset + 8);
1065 item=proto_tree_add_item(parent_tree, hf_index, tvb, offset + 8, len, FALSE);
1066 tree = proto_item_add_subtree(item, ett_isns_attribute);
1071 24 INITIATOR AND SELF INFORMATION ONLY
1072 25 TARGET AND SELF INFORMATION ONLY
1073 26 MANAGEMENT REGISTRATION/SCN
1077 30 DD/DDS MEMBER REMOVED (Mgmt Reg/SCN only)
1078 31 (Lsb) DD/DDS MEMBER ADDED (Mgmt Reg/SCN only)
1080 proto_tree_add_boolean(tree, hf_isns_scn_bitmap_initiator_and_self_information_only, tvb, offset+8, 4, scn_bitmap);
1081 proto_tree_add_boolean(tree, hf_isns_scn_bitmap_target_and_self_information_only, tvb, offset+8, 4, scn_bitmap);
1082 proto_tree_add_boolean(tree, hf_isns_scn_bitmap_management_registration_scn, tvb, offset+8, 4, scn_bitmap);
1083 proto_tree_add_boolean(tree, hf_isns_scn_bitmap_object_removed, tvb, offset+8, 4, scn_bitmap);
1084 proto_tree_add_boolean(tree, hf_isns_scn_bitmap_object_added, tvb, offset+8, 4, scn_bitmap);
1085 proto_tree_add_boolean(tree, hf_isns_scn_bitmap_object_updated, tvb, offset+8, 4, scn_bitmap);
1086 proto_tree_add_boolean(tree, hf_isns_scn_bitmap_dd_dds_member_removed, tvb, offset+8, 4, scn_bitmap);
1087 proto_tree_add_boolean(tree, hf_isns_scn_bitmap_dd_dds_member_added, tvb, offset+8, 4, scn_bitmap);
1089 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
1090 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
1092 return offset+8+len;
1099 AddAttribute(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, guint offset,
1100 guint16 function_id)
1106 tag = tvb_get_ntohl(tvb, offset);
1108 /* Now the Length */
1109 len = tvb_get_ntohl(tvb, offset + 4);
1113 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
1114 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
1119 tvb_ensure_bytes_exist(tvb, offset, len+8);
1123 case ISNS_ATTR_TAG_DELIMITER:
1124 dissect_isns_attr_none(tvb, offset, tree, hf_isns_delimiter, tag, len);
1126 case ISNS_ATTR_TAG_ENTITY_IDENTIFIER:
1127 dissect_isns_attr_string(tvb, offset, tree, hf_isns_entity_identifier, tag, len);
1129 case ISNS_ATTR_TAG_ENTITY_PROTOCOL:
1130 if(len != 4) THROW(ReportedBoundsError);
1131 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_entity_protocol, tag, len, function_id);
1133 case ISNS_ATTR_TAG_MGMT_IP_ADDRESS:
1134 if(len != 16) THROW(ReportedBoundsError);
1135 dissect_isns_attr_ip_address(tvb, offset, tree, hf_isns_mgmt_ip_addr, tag, len);
1137 case ISNS_ATTR_TAG_TIMESTAMP:
1138 if(len != 8) THROW(ReportedBoundsError);
1139 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_timestamp, tag, len, function_id);
1141 case ISNS_ATTR_TAG_PROTOCOL_VERSION_RANGE:
1142 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1144 case ISNS_ATTR_TAG_REGISTRATION_PERIOD:
1145 if(len != 4) THROW(ReportedBoundsError);
1146 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_registration_period, tag, len, function_id);
1148 case ISNS_ATTR_TAG_ENTITY_INDEX:
1149 if(len != 4) THROW(ReportedBoundsError);
1150 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_entity_index, tag, len, function_id);
1152 case ISNS_ATTR_TAG_ENTITY_NEXT_INDEX:
1153 if(len != 4) THROW(ReportedBoundsError);
1154 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_entity_next_index, tag, len, function_id);
1156 case ISNS_ATTR_TAG_ENTITY_ISAKMP_PHASE_1:
1157 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1159 case ISNS_ATTR_TAG_ENTITY_CERTIFICATE:
1160 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1162 case ISNS_ATTR_TAG_PORTAL_IP_ADDRESS:
1165 proto_tree_add_text(tree, tvb, offset, -1, "Broken iSNS implementation. The PORTAL_IP_ADDRESS tag should be 16 bytes in length");
1167 dissect_isns_attr_ip_address(tvb, offset, tree, hf_isns_portal_ip_addr, tag, 16);
1170 THROW(ReportedBoundsError);
1173 case ISNS_ATTR_TAG_PORTAL_PORT:
1174 if(len != 4) THROW(ReportedBoundsError);
1175 dissect_isns_attr_port(tvb, offset, tree, hf_isns_portal_port, tag, len, ISNS_OTHER_PORT, pinfo);
1177 case ISNS_ATTR_TAG_PORTAL_SYMBOLIC_NAME:
1178 dissect_isns_attr_string(tvb, offset, tree, hf_isns_portal_symbolic_name, tag, len);
1180 case ISNS_ATTR_TAG_ESI_INTERVAL:
1181 if(len != 4) THROW(ReportedBoundsError);
1182 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_esi_interval, tag, len, function_id);
1184 case ISNS_ATTR_TAG_ESI_PORT:
1185 if(len != 4) THROW(ReportedBoundsError);
1186 dissect_isns_attr_port(tvb, offset, tree, hf_isns_esi_port, tag, len, ISNS_ESI_PORT, pinfo);
1188 case ISNS_ATTR_TAG_PORTAL_INDEX:
1189 if(len != 4) THROW(ReportedBoundsError);
1190 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_portal_index, tag, len, function_id);
1192 case ISNS_ATTR_TAG_SCN_PORT:
1193 if(len != 4) THROW(ReportedBoundsError);
1194 dissect_isns_attr_port(tvb, offset, tree, hf_isns_scn_port, tag, len, ISNS_SCN_PORT, pinfo);
1196 case ISNS_ATTR_TAG_PORTAL_NEXT_INDEX:
1197 if(len != 4) THROW(ReportedBoundsError);
1198 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_portal_next_index, tag, len, function_id);
1200 case ISNS_ATTR_TAG_PORTAL_SECURITY_BITMAP:
1201 if(len != 4) THROW(ReportedBoundsError);
1202 dissect_isns_attr_portal_security_bitmap(tvb, offset, tree, hf_isns_psb, tag, len);
1204 case ISNS_ATTR_TAG_PORTAL_ISAKMP_PHASE_1:
1205 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1207 case ISNS_ATTR_TAG_PORTAL_ISAKMP_PHASE_2:
1208 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1210 case ISNS_ATTR_TAG_PORTAL_CERTIFICATE:
1211 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1213 case ISNS_ATTR_TAG_ISCSI_NAME:
1214 dissect_isns_attr_string(tvb, offset, tree, hf_isns_iscsi_name, tag, len);
1216 case ISNS_ATTR_TAG_ISCSI_NODE_TYPE:
1217 if(len != 4) THROW(ReportedBoundsError);
1218 dissect_isns_attr_iscsi_node_type(tvb, offset, tree, hf_isns_iscsi_node_type, tag, len);
1220 case ISNS_ATTR_TAG_ISCSI_ALIAS:
1221 dissect_isns_attr_string(tvb, offset, tree, hf_isns_iscsi_alias, tag, len);
1223 case ISNS_ATTR_TAG_ISCSI_SCN_BITMAP:
1224 if(len != 4) THROW(ReportedBoundsError);
1225 dissect_isns_attr_scn_bitmap(tvb, offset, tree, hf_isns_scn_bitmap, tag, len);
1227 case ISNS_ATTR_TAG_ISCSI_NODE_INDEX:
1228 if(len != 4) THROW(ReportedBoundsError);
1229 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_node_index, tag, len, function_id);
1231 case ISNS_ATTR_TAG_WWNN_TOKEN:
1232 if(len != 8) THROW(ReportedBoundsError);
1233 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_wwnn_token, tag, len, function_id);
1235 case ISNS_ATTR_TAG_ISCSI_NODE_NEXT_INDEX:
1236 if(len != 4) THROW(ReportedBoundsError);
1237 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_node_next_index, tag, len, function_id);
1239 case ISNS_ATTR_TAG_ISCSI_AUTH_METHOD:
1240 dissect_isns_attr_string(tvb, offset, tree, hf_isns_iscsi_auth_method, tag, len);
1242 case ISNS_ATTR_TAG_PG_ISCSI_NAME:
1243 dissect_isns_attr_string(tvb, offset, tree, hf_isns_pg_iscsi_name, tag, len);
1245 case ISNS_ATTR_TAG_PG_PORTAL_IP_ADDR:
1248 proto_tree_add_text(tree, tvb, offset, -1, "Broken iSNS implementation. The PG_PORTAL_IP_ADDRESS tag should be 16 bytes in length");
1250 dissect_isns_attr_ip_address(tvb, offset, tree, hf_isns_pg_portal_ip_addr, tag, 16);
1253 THROW(ReportedBoundsError);
1256 case ISNS_ATTR_TAG_PG_PORTAL_PORT:
1257 if(len != 4) THROW(ReportedBoundsError);
1258 dissect_isns_attr_port(tvb, offset, tree, hf_isns_pg_portal_port, tag, len, ISNS_OTHER_PORT, pinfo);
1260 case ISNS_ATTR_TAG_PORTAL_GROUP_TAG:
1261 if(len != 4) THROW(ReportedBoundsError);
1262 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_portal_group_tag, tag, len, function_id);
1264 case ISNS_ATTR_TAG_PORTAL_GROUP_INDEX:
1265 if(len != 4) THROW(ReportedBoundsError);
1266 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_pg_index, tag, len, function_id);
1268 case ISNS_ATTR_TAG_PORTAL_GROUP_NEXT_INDEX:
1269 if(len != 4) THROW(ReportedBoundsError);
1270 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_pg_next_index, tag, len, function_id);
1272 case ISNS_ATTR_TAG_FC_PORT_NAME_WWPN:
1273 if(len != 8) THROW(ReportedBoundsError);
1274 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_fc_port_name_wwpn, tag, len, function_id);
1276 case ISNS_ATTR_TAG_PORT_ID:
1277 if(len != 3) THROW(ReportedBoundsError);
1278 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_port_id, tag, len, function_id);
1280 case ISNS_ATTR_TAG_FC_PORT_TYPE:
1281 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1284 0x0000 Unidentified/Null Entry
1285 0x0001 Fibre Channel N_Port
1286 0x0002 Fibre Channel NL_Port
1287 0x0003 Fibre Channel F/NL_Port
1288 0x0081 Fibre Channel F_Port
1289 0x0082 Fibre Channel FL_Port
1290 0x0084 Fibre Channel E_Port
1293 case ISNS_ATTR_TAG_SYMBOLIC_PORT_NAME:
1294 dissect_isns_attr_string(tvb, offset, tree, hf_isns_symbolic_port_name, tag, len);
1296 case ISNS_ATTR_TAG_FABRIC_PORT_NAME:
1297 if(len != 8) THROW(ReportedBoundsError);
1298 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_fabric_port_name, tag, len, function_id);
1300 case ISNS_ATTR_TAG_HARD_ADDRESS:
1301 if(len != 3) THROW(ReportedBoundsError);
1302 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_hard_address, tag, len, function_id);
1304 case ISNS_ATTR_TAG_PORT_IP_ADDRESS:
1305 if(len != 16) THROW(ReportedBoundsError);
1306 dissect_isns_attr_ip_address(tvb, offset, tree, hf_isns_port_ip_addr, tag, len);
1308 case ISNS_ATTR_TAG_CLASS_OF_SERVICE:
1309 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1312 bit 29 Fibre Channel Class 2 Supported
1313 bit 28 Fibre Channel Class 3 Supported
1315 case ISNS_ATTR_TAG_FC4_TYPES:
1316 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1318 case ISNS_ATTR_TAG_FC4_DESCRIPTOR:
1319 dissect_isns_attr_string(tvb, offset, tree, hf_isns_fc4_descriptor, tag, len);
1321 case ISNS_ATTR_TAG_FC4_FEATURES:
1322 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1324 case ISNS_ATTR_TAG_IFCP_SCN_BITMAP:
1325 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1328 bit 24 INITIATOR AND SELF INFORMATION ONLY
1329 bit 25 TARGET AND SELF INFORMATION ONLY
1330 bit 26 MANAGEMENT REGISTRATION/SCN
1331 bit 27 OBJECT REMOVED
1333 bit 29 OBJECT UPDATED
1334 bit 30 DD/DDS MEMBER REMOVED (Mgmt Reg/SCN only)
1335 bit 31 (Lsb) DD/DDS MEMBER ADDED (Mgmt Reg/SCN only)
1337 case ISNS_ATTR_TAG_PORT_ROLE:
1338 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1342 bit 30 FCP Initiator
1343 bit 31 (Lsb) FCP Target
1345 case ISNS_ATTR_TAG_PERMANENT_PORT_NAME:
1346 if(len != 8) THROW(ReportedBoundsError);
1347 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_permanent_port_name, tag, len, function_id);
1349 case ISNS_ATTR_TAG_FC4_TYPE_CODE:
1350 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1352 /* 8bit type code in byte0 */
1353 case ISNS_ATTR_TAG_FC_NODE_NAME_WWNN:
1354 if(len != 8) THROW(ReportedBoundsError);
1355 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_fc_node_name_wwnn, tag, len, function_id);
1357 case ISNS_ATTR_TAG_SYMBOLIC_NODE_NAME:
1358 dissect_isns_attr_string(tvb, offset, tree, hf_isns_symbolic_node_name, tag, len);
1360 case ISNS_ATTR_TAG_NODE_IP_ADDRESS:
1361 if(len != 16) THROW(ReportedBoundsError);
1362 dissect_isns_attr_ip_address(tvb, offset, tree, hf_isns_node_ip_addr, tag, len);
1364 case ISNS_ATTR_TAG_NODE_IPA:
1365 if(len != 8) THROW(ReportedBoundsError);
1366 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_node_ipa, tag, len, function_id);
1368 case ISNS_ATTR_TAG_PROXY_ISCSI_NAME:
1369 dissect_isns_attr_string(tvb, offset, tree, hf_isns_proxy_iscsi_name, tag, len);
1371 case ISNS_ATTR_TAG_SWITCH_NAME:
1372 if(len != 8) THROW(ReportedBoundsError);
1373 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_switch_name, tag, len, function_id);
1375 case ISNS_ATTR_TAG_PREFERRED_ID:
1376 if(len != 4) THROW(ReportedBoundsError);
1377 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_preferred_id, tag, len, function_id);
1379 case ISNS_ATTR_TAG_ASSIGNED_ID:
1380 if(len != 4) THROW(ReportedBoundsError);
1381 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_assigned_id, tag, len, function_id);
1383 case ISNS_ATTR_TAG_VIRTUAL_FABRIC_ID:
1384 dissect_isns_attr_string(tvb, offset, tree, hf_isns_virtual_fabric_id, tag, len);
1386 case ISNS_ATTR_TAG_VENDOR_OUI:
1387 if(len != 4) THROW(ReportedBoundsError);
1388 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_vendor_oui, tag, len, function_id);
1390 case ISNS_ATTR_TAG_DD_SET_ID:
1391 if(len != 4) THROW(ReportedBoundsError);
1392 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_dd_set_id, tag, len, function_id);
1394 case ISNS_ATTR_TAG_DD_SET_SYMBOLIC_NAME:
1395 dissect_isns_attr_string(tvb, offset, tree, hf_isns_dd_set_symbolic_name, tag, len);
1397 case ISNS_ATTR_TAG_DD_SET_STATUS:
1398 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1400 case ISNS_ATTR_TAG_DD_SET_NEXT_ID:
1401 if(len != 4) THROW(ReportedBoundsError);
1402 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_dd_set_next_id, tag, len, function_id);
1404 case ISNS_ATTR_TAG_DD_ID:
1405 if(len != 4) THROW(ReportedBoundsError);
1406 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_dd_id, tag, len, function_id);
1408 case ISNS_ATTR_TAG_DD_SYMBOLIC_NAME:
1409 dissect_isns_attr_string(tvb, offset, tree, hf_isns_dd_symbolic_name, tag, len);
1411 case ISNS_ATTR_TAG_DD_MEMBER_ISCSI_INDEX:
1412 if(len != 4) THROW(ReportedBoundsError);
1413 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_member_iscsi_index, tag, len, function_id);
1415 case ISNS_ATTR_TAG_DD_MEMBER_ISCSI_NAME:
1416 dissect_isns_attr_string(tvb, offset, tree, hf_isns_dd_member_iscsi_name, tag, len);
1418 case ISNS_ATTR_TAG_DD_MEMBER_FC_PORT_NAME:
1419 if(len != 4) THROW(ReportedBoundsError);
1420 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_member_fc_port_name, tag, len, function_id);
1422 case ISNS_ATTR_TAG_DD_MEMBER_PORTAL_INDEX:
1423 if(len != 4) THROW(ReportedBoundsError);
1424 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_member_portal_index, tag, len, function_id);
1426 case ISNS_ATTR_TAG_DD_MEMBER_PORTAL_IP_ADDRESS:
1427 if(len != 16) THROW(ReportedBoundsError);
1428 dissect_isns_attr_ip_address(tvb, offset, tree, hf_isns_dd_member_portal_ip_addr, tag, len);
1430 case ISNS_ATTR_TAG_DD_MEMBER_PORTAL_PORT:
1431 if(len != 4) THROW(ReportedBoundsError);
1432 dissect_isns_attr_port(tvb, offset, tree, hf_isns_dd_member_portal_port,
1433 tag, len, ISNS_OTHER_PORT, pinfo);
1435 case ISNS_ATTR_TAG_DD_FEATURES:
1436 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1438 case ISNS_ATTR_TAG_DD_ID_NEXT_ID:
1439 if(len != 4) THROW(ReportedBoundsError);
1440 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_dd_id_next_id, tag, len, function_id);
1443 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1447 /* move on the offset to next attribute */
1449 return offset+len+8;
1454 /* Register the protocol with Wireshark */
1456 /* this format is require because a script is used to build the C function
1457 that calls all the protocol registration.
1460 void proto_register_isns(void)
1462 /* Setup list of header fields See Section 1.6.1 for details*/
1463 static hf_register_info hf[] = {
1464 /* The Header Stuff */
1466 { "iSNSP Version","isns.PVer",
1467 FT_UINT16, BASE_DEC, NULL, 0,
1468 "iSNS Protocol Version" ,HFILL}
1470 { &hf_isns_function_id,
1471 { "Function ID","isns.functionid",
1472 FT_UINT16, BASE_DEC,VALS(&isns_function_ids),0,
1473 "iSNS Function ID" ,HFILL}
1475 { &hf_isns_pdu_length,
1476 { "PDU Length","isns.pdulength",
1477 FT_UINT16, BASE_DEC,NULL,0,
1478 "iSNS PDU Length" ,HFILL}
1482 { "Flags","isns.flags",
1483 FT_UINT16, BASE_HEX,NULL,0,
1484 "iSNS Flags" ,HFILL}
1487 { "Client","isns.flags.client",
1488 FT_BOOLEAN, 16, TFS(&isns_flag_client), ISNS_FLAGS_CLIENT,
1489 "iSNS Client" ,HFILL}
1492 { "Server","isns.flags.server",
1493 FT_BOOLEAN, 16, TFS(&isns_flag_server), ISNS_FLAGS_SERVER,
1494 "iSNS Server" ,HFILL}
1497 { "Auth","isns.flags.authentication_block",
1498 FT_BOOLEAN, 16, TFS(&isns_flag_auth), ISNS_FLAGS_AUTH,
1499 "is iSNS Authentication Block present?" ,HFILL}
1502 { "Replace","isns.flags.replace",
1503 FT_BOOLEAN, 16, TFS(&isns_flag_replace), ISNS_FLAGS_REPLACE,
1504 "iSNS Replace" ,HFILL}
1506 { &hf_isns_last_pdu,
1507 { "Last PDU","isns.flags.lastpdu",
1508 FT_BOOLEAN, 16, TFS(&isns_flag_last_pdu), ISNS_FLAGS_LAST_PDU,
1509 "iSNS Last PDU" ,HFILL}
1511 { &hf_isns_first_pdu,
1512 { "First PDU","isns.flags.firstpdu",
1513 FT_BOOLEAN, 16, TFS(&isns_flag_first_pdu), ISNS_FLAGS_FIRST_PDU,
1514 "iSNS First PDU",HFILL }
1518 { &hf_isns_transaction_id,
1519 { "Transaction ID","isns.transactionid",
1520 FT_UINT16, BASE_DEC,NULL,0,
1521 "iSNS transaction ID" ,HFILL}
1523 { &hf_isns_sequence_id,
1524 { "Sequence ID","isns.sequenceid",
1525 FT_UINT16, BASE_DEC,NULL,0,
1526 "iSNS sequence ID" ,HFILL}
1529 { &hf_isns_entity_protocol,
1530 { "Entity Protocol","isns.entity_protocol",
1531 FT_UINT32, BASE_DEC,VALS(isns_entity_protocol),0,
1532 "iSNS Entity Protocol" ,HFILL}
1534 /* The Payload stuff */
1536 { &hf_isns_dd_member_portal_port,
1537 { "DD Member Portal Port","isns.dd_member_portal_port",
1538 FT_UINT32, BASE_DEC, NULL, 0,
1539 "TCP/UDP DD Member Portal Port", HFILL }
1542 { &hf_isns_iscsi_node_type,
1543 { "iSCSI Node Type","isns.iscsi.node_type",
1544 FT_UINT32, BASE_HEX, NULL, 0,
1548 { &hf_isns_esi_port,
1549 { "ESI Port","isns.esi_port",
1550 FT_UINT32, BASE_DEC, NULL, 0,
1551 "TCP/UDP ESI Port", HFILL }
1554 { &hf_isns_scn_port,
1555 { "SCN Port","isns.scn_port",
1556 FT_UINT32, BASE_DEC, NULL, 0,
1557 "TCP/UDP SCN Port", HFILL }
1560 { &hf_isns_portal_port,
1561 { "Portal Port","isns.portal_port",
1562 FT_UINT32, BASE_DEC, NULL, 0,
1563 "TCP/UDP Portal Port", HFILL }
1566 { &hf_isns_pg_portal_port,
1567 { "PG Portal Port","isns.pg.portal_port",
1568 FT_UINT32, BASE_DEC, NULL, 0,
1569 "PG Portal TCP/UDP Port", HFILL }
1572 { &hf_isns_port_type,
1573 { "Port Type","isns.port.port_type",
1574 FT_BOOLEAN, 16, TFS(&isns_port_type), 0x01, /* bit 15 (or bit 1 of a 16bit word) */
1579 { "Portal Security Bitmap","isns.psb",
1580 FT_UINT32, BASE_HEX, NULL, 0,
1583 { &hf_isns_psb_tunnel_mode,
1584 { "Tunnel Mode","isns.psb.tunnel",
1585 FT_BOOLEAN, 32, TFS(&isns_psb_tunnel_mode), 0x0040, /* bit 25 */
1586 "Tunnel Mode Preferred",HFILL }
1588 { &hf_isns_psb_transport_mode,
1589 { "Transport Mode","isns.psb.transport",
1590 FT_BOOLEAN, 32, TFS(&isns_psb_transport_mode), 0x0020, /* bit 26 */
1594 { "PFS","isns.psb.pfs",
1595 FT_BOOLEAN, 32, TFS(&isns_psb_pfs), 0x0010, /* bit 27 */
1598 { &hf_isns_psb_aggressive_mode,
1599 { "Aggressive Mode","isns.psb.aggressive_mode",
1600 FT_BOOLEAN, 32, TFS(&isns_psb_aggressive_mode), 0x0008, /* bit 28 */
1603 { &hf_isns_psb_main_mode,
1604 { "Main Mode","isns.psb.main_mode",
1605 FT_BOOLEAN, 32, TFS(&isns_psb_main_mode), 0x0004, /* bit 29 */
1608 { &hf_isns_psb_ike_ipsec,
1609 { "IKE/IPSec","isns.psb.ike_ipsec",
1610 FT_BOOLEAN, 32, TFS(&isns_psb_ike_ipsec), 0x0002, /* bit 30 */
1613 { &hf_isns_psb_bitmap,
1614 { "Bitmap","isns.psb.bitmap",
1615 FT_BOOLEAN, 32, TFS(&isns_psb_bitmap), 0x0001, /* bit 31 */
1621 { &hf_isns_scn_bitmap,
1622 { "iSCSI SCN Bitmap","isns.scn_bitmap",
1623 FT_UINT32, BASE_HEX, NULL, 0,
1626 { &hf_isns_scn_bitmap_initiator_and_self_information_only,
1627 { "Initiator And Self Information Only","isns.scn_bitmap.initiator_and_self_information_only",
1628 FT_BOOLEAN, 32, TFS(&isns_scn_bitmap_initiator_and_self_information_only), 0x0080, /* bit 24 */
1631 { &hf_isns_scn_bitmap_target_and_self_information_only,
1632 { "Target And Self Information Only","isns.scn_bitmap.target_and_self_information_only",
1633 FT_BOOLEAN, 32, TFS(&isns_scn_bitmap_target_and_self_information_only), 0x0040, /* bit 25 */
1636 { &hf_isns_scn_bitmap_management_registration_scn,
1637 { "Management Registration/SCN","isns.scn_bitmap.management_registration_scn",
1638 FT_BOOLEAN, 32, TFS(&isns_scn_bitmap_management_registration_scn), 0x0020, /* bit 26 */
1641 { &hf_isns_scn_bitmap_object_removed,
1642 { "Object Removed","isns.scn_bitmap.object_removed",
1643 FT_BOOLEAN, 32, TFS(&isns_scn_bitmap_object_removed), 0x0010, /* bit 27 */
1646 { &hf_isns_scn_bitmap_object_added,
1647 { "Object Added","isns.scn_bitmap.object_added",
1648 FT_BOOLEAN, 32, TFS(&isns_scn_bitmap_object_added), 0x0008, /* bit 28 */
1651 { &hf_isns_scn_bitmap_object_updated,
1652 { "Object Updated","isns.scn_bitmap.object_updated",
1653 FT_BOOLEAN, 32, TFS(&isns_scn_bitmap_object_updated), 0x0004, /* bit 29 */
1656 { &hf_isns_scn_bitmap_dd_dds_member_removed,
1657 { "DD/DDS Member Removed (Mgmt Reg/SCN only)","isns.scn_bitmap.dd_dds_member_removed",
1658 FT_BOOLEAN, 32, TFS(&isns_scn_bitmap_dd_dds_member_removed), 0x0002, /* bit 30 */
1661 { &hf_isns_scn_bitmap_dd_dds_member_added,
1662 { "DD/DDS Member Added (Mgmt Reg/SCN only)","isns.scn_bitmap.dd_dds_member_added",
1663 FT_BOOLEAN, 32, TFS(&isns_scn_bitmap_dd_dds_member_added), 0x0001, /* bit 31 */
1668 { &hf_isns_isnt_control,
1669 { "Control","isns.isnt.control",
1670 FT_BOOLEAN, 32, TFS(&isns_isnt_control), 0x0004, /* bit 29 */
1673 { &hf_isns_isnt_initiator,
1674 { "Initiator","isns.isnt.initiator",
1675 FT_BOOLEAN, 32, TFS(&isns_isnt_initiator), 0x0002, /* bit 30 */
1678 { &hf_isns_isnt_target,
1679 { "Target","isns.isnt.target",
1680 FT_BOOLEAN, 32, TFS(&isns_isnt_target), 0x0001, /* bit 31 */
1685 { &hf_isns_resp_errorcode,
1686 { "ErrorCode","isns.errorcode",
1687 FT_UINT32, BASE_DEC,VALS(isns_errorcode),0,
1688 "iSNS Response Error Code" ,HFILL}
1691 { &hf_isns_attr_tag,
1692 { "Attribute Tag","isns.attr.tag",
1693 FT_UINT32, BASE_DEC,VALS(isns_attribute_tags),0,
1694 "iSNS Attribute Tag" ,HFILL}
1697 { &hf_isns_attr_len,
1698 { "Attribute Length","isns.attr.len",
1699 FT_UINT32, BASE_DEC,NULL,0,
1700 "iSNS Attribute Length" ,HFILL}
1703 { &hf_isns_delimiter,
1704 { "Delimiter","isns.delimiter",
1705 FT_NONE, BASE_NONE, NULL,0,
1706 "iSNS Delimiter" ,HFILL}
1709 { &hf_isns_not_decoded_yet,
1710 { "Not Decoded Yet","isns.not_decoded_yet",
1711 FT_NONE, BASE_NONE, NULL,0,
1712 "This tag is not yet decoded by wireshark" ,HFILL}
1715 { &hf_isns_heartbeat_ipv6_addr,
1716 { "Heartbeat Address (ipv6)","isns.heartbeat.address",
1717 FT_IPv6, BASE_NONE, NULL, 0x0,
1718 "Server IPv6 Address", HFILL }},
1720 { &hf_isns_heartbeat_tcp_port,
1721 { "Heartbeat TCP Port","isns.heartbeat.tcpport",
1722 FT_UINT16, BASE_DEC, NULL, 0x0,
1723 "Server TCP Port", HFILL }},
1725 { &hf_isns_heartbeat_udp_port,
1726 { "Heartbeat UDP Port","isns.heartbeat.udpport",
1727 FT_UINT16, BASE_DEC, NULL, 0x0,
1728 "Server UDP Port", HFILL }},
1731 { &hf_isns_heartbeat_interval,
1732 { "Heartbeat Interval (secs)","isns.heartbeat.interval",
1733 FT_UINT32, BASE_DEC, NULL, 0x0,
1734 "Server Heartbeat interval", HFILL }},
1736 { &hf_isns_heartbeat_counter,
1737 { "Heartbeat counter","isns.heartbeat.counter",
1738 FT_UINT32, BASE_DEC, NULL, 0x0,
1739 "Server Heartbeat Counter", HFILL }},
1741 { &hf_isns_iscsi_name,
1742 { "iSCSI Name","isns.iscsi_name",
1743 FT_STRING, BASE_NONE, NULL, 0x0,
1744 "iSCSI Name of device", HFILL }},
1746 { &hf_isns_dd_member_iscsi_name,
1747 { "DD Member iSCSI Name","isns.dd_member.iscsi_name",
1748 FT_STRING, BASE_NONE, NULL, 0x0,
1749 "DD Member iSCSI Name of device", HFILL }},
1751 { &hf_isns_virtual_fabric_id,
1752 { "Virtual Fabric ID","isns.virtual_fabric_id",
1753 FT_STRING, BASE_NONE, NULL, 0x0,
1754 "Virtual fabric ID", HFILL }},
1756 { &hf_isns_proxy_iscsi_name,
1757 { "Proxy iSCSI Name","isns.proxy_iscsi_name",
1758 FT_STRING, BASE_NONE, NULL, 0x0,
1761 { &hf_isns_fc4_descriptor,
1762 { "FC4 Descriptor","isns.fc4_descriptor",
1763 FT_STRING, BASE_NONE, NULL, 0x0,
1764 "FC4 Descriptor of this device", HFILL }},
1766 { &hf_isns_iscsi_auth_method,
1767 { "iSCSI Auth Method","isns.iscsi_auth_method",
1768 FT_STRING, BASE_NONE, NULL, 0x0,
1769 "Authentication Method required by this device", HFILL }},
1771 { &hf_isns_iscsi_alias,
1772 { "iSCSI Alias","isns.iscsi_alias",
1773 FT_STRING, BASE_NONE, NULL, 0x0,
1774 "iSCSI Alias of device", HFILL }},
1776 { &hf_isns_portal_symbolic_name,
1777 { "Portal Symbolic Name","isns.portal.symbolic_name",
1778 FT_STRING, BASE_NONE, NULL, 0x0,
1779 "Symbolic name of this portal", HFILL }},
1781 { &hf_isns_dd_set_symbolic_name,
1782 { "DD Set Symbolic Name","isns.dd_set.symbolic_name",
1783 FT_STRING, BASE_NONE, NULL, 0x0,
1784 "Symbolic name of this DD Set", HFILL }},
1786 { &hf_isns_dd_symbolic_name,
1787 { "DD Symbolic Name","isns.dd.symbolic_name",
1788 FT_STRING, BASE_NONE, NULL, 0x0,
1789 "Symbolic name of this DD", HFILL }},
1791 { &hf_isns_symbolic_port_name,
1792 { "Symbolic Port Name","isns.port.symbolic_name",
1793 FT_STRING, BASE_NONE, NULL, 0x0,
1794 "Symbolic name of this port", HFILL }},
1796 { &hf_isns_symbolic_node_name,
1797 { "Symbolic Node Name","isns.node.symbolic_name",
1798 FT_STRING, BASE_NONE, NULL, 0x0,
1799 "Symbolic name of this node", HFILL }},
1801 { &hf_isns_entity_identifier,
1802 { "Entity Identifier","isns.entity_identifier",
1803 FT_STRING, BASE_NONE, NULL, 0x0,
1804 "Entity Identifier of this object", HFILL }},
1806 { &hf_isns_mgmt_ip_addr,
1807 { "Management IP Address","isns.mgmt.ip_address",
1808 FT_IPv6, BASE_NONE, NULL, 0x0,
1809 "Management IPv4/IPv6 Address", HFILL }},
1811 { &hf_isns_node_ip_addr,
1812 { "Node IP Address","isns.node.ip_address",
1813 FT_IPv6, BASE_NONE, NULL, 0x0,
1814 "Node IPv4/IPv6 Address", HFILL }},
1816 { &hf_isns_port_ip_addr,
1817 { "Port IP Address","isns.port.ip_address",
1818 FT_IPv6, BASE_NONE, NULL, 0x0,
1819 "Port IPv4/IPv6 Address", HFILL }},
1821 { &hf_isns_portal_ip_addr,
1822 { "Portal IP Address","isns.portal.ip_address",
1823 FT_IPv6, BASE_NONE, NULL, 0x0,
1824 "Portal IPv4/IPv6 Address", HFILL }},
1826 { &hf_isns_dd_member_portal_ip_addr,
1827 { "DD Member Portal IP Address","isns.dd.member_portal.ip_address",
1828 FT_IPv6, BASE_NONE, NULL, 0x0,
1829 "DD Member Portal IPv4/IPv6 Address", HFILL }},
1831 { &hf_isns_pg_iscsi_name,
1832 { "PG iSCSI Name","isns.pg_iscsi_name",
1833 FT_STRING, BASE_NONE, NULL, 0x0,
1836 { &hf_isns_pg_portal_ip_addr,
1837 { "PG Portal IP Address","isns.pg_portal.ip_address",
1838 FT_IPv6, BASE_NONE, NULL, 0x0,
1839 "PG Portal IPv4/IPv6 Address", HFILL }},
1841 { &hf_isns_pg_index,
1842 { "PG Index","isns.pg_index",
1843 FT_UINT32, BASE_DEC, NULL, 0x0,
1846 { &hf_isns_pg_next_index,
1847 { "PG Next Index","isns.pg_next_index",
1848 FT_UINT32, BASE_DEC, NULL, 0x0,
1851 { &hf_isns_dd_id_next_id,
1852 { "DD ID Next ID","isns.index",
1853 FT_UINT32, BASE_DEC, NULL, 0x0,
1856 { &hf_isns_member_iscsi_index,
1857 { "Member iSCSI Index","isns.member_iscsi_index",
1858 FT_UINT32, BASE_DEC, NULL, 0x0,
1861 { &hf_isns_member_portal_index,
1862 { "Member Portal Index","isns.member_portal_index",
1863 FT_UINT32, BASE_DEC, NULL, 0x0,
1866 { &hf_isns_member_fc_port_name,
1867 { "Member FC Port Name","isns.member_fc_port_name",
1868 FT_UINT32, BASE_DEC, NULL, 0x0,
1871 { &hf_isns_vendor_oui,
1872 { "Vendor OUI","isns.index",
1873 FT_UINT32, BASE_DEC, NULL, 0x0,
1876 { &hf_isns_preferred_id,
1877 { "Preferred ID","isns.preferred_id",
1878 FT_UINT32, BASE_DEC, NULL, 0x0,
1881 { &hf_isns_dd_set_id,
1882 { "DD Set ID","isns.dd_set_id",
1883 FT_UINT32, BASE_DEC, NULL, 0x0,
1887 { "DD ID","isns.dd_id",
1888 FT_UINT32, BASE_DEC, NULL, 0x0,
1892 { "Port ID","isns.port_id",
1893 FT_UINT24, BASE_HEX, NULL, 0x0,
1896 { &hf_isns_hard_address,
1897 { "Hard Address","isns.hard_address",
1898 FT_UINT24, BASE_HEX, NULL, 0x0,
1901 { &hf_isns_wwnn_token,
1902 { "WWNN Token","isns.wwnn_token",
1903 FT_UINT64, BASE_HEX, NULL, 0x0,
1906 { &hf_isns_fc_port_name_wwpn,
1907 { "FC Port Name WWPN","isns.fc_port_name_wwpn",
1908 FT_UINT64, BASE_HEX, NULL, 0x0,
1911 { &hf_isns_fc_node_name_wwnn,
1912 { "FC Node Name WWNN","isns.fc_node_name_wwnn",
1913 FT_UINT64, BASE_HEX, NULL, 0x0,
1916 { &hf_isns_node_ipa,
1917 { "Node IPA","isns.node_ipa",
1918 FT_UINT64, BASE_HEX, NULL, 0x0,
1921 { &hf_isns_fabric_port_name,
1922 { "Fabric Port Name","isns.fabric_port_name",
1923 FT_UINT64, BASE_HEX, NULL, 0x0,
1926 { &hf_isns_permanent_port_name,
1927 { "Permanent Port Name","isns.permanent_port_name",
1928 FT_UINT64, BASE_HEX, NULL, 0x0,
1931 { &hf_isns_switch_name,
1932 { "Switch Name","isns.switch_name",
1933 FT_UINT64, BASE_HEX, NULL, 0x0,
1936 { &hf_isns_dd_set_next_id,
1937 { "DD Set Next ID","isns.dd_set_next_id",
1938 FT_UINT32, BASE_DEC, NULL, 0x0,
1941 { &hf_isns_assigned_id,
1942 { "Assigned ID","isns.assigned_id",
1943 FT_UINT32, BASE_DEC, NULL, 0x0,
1946 { &hf_isns_node_index,
1947 { "Node Index","isns.node.index",
1948 FT_UINT32, BASE_DEC, NULL, 0x0,
1951 { &hf_isns_node_next_index,
1952 { "Node Next Index","isns.node.next_index",
1953 FT_UINT32, BASE_DEC, NULL, 0x0,
1954 "Node INext ndex", HFILL }},
1956 { &hf_isns_portal_index,
1957 { "Portal Index","isns.portal.index",
1958 FT_UINT32, BASE_DEC, NULL, 0x0,
1961 { &hf_isns_portal_next_index,
1962 { "Portal Next Index","isns.portal.next_index",
1963 FT_UINT32, BASE_DEC, NULL, 0x0,
1966 { &hf_isns_entity_index,
1967 { "Entity Index","isns.entity.index",
1968 FT_UINT32, BASE_DEC, NULL, 0x0,
1971 { &hf_isns_entity_next_index,
1972 { "Entity Next Index","isns.entity.next_index",
1973 FT_UINT32, BASE_DEC, NULL, 0x0,
1974 "Next Entity Index", HFILL }},
1976 { &hf_isns_timestamp,
1977 { "Timestamp","isns.timestamp",
1978 FT_UINT64, BASE_DEC, NULL, 0x0,
1979 "Timestamp in Seconds", HFILL }},
1981 { &hf_isns_esi_interval,
1982 { "ESI Interval","isns.esi_interval",
1983 FT_UINT32, BASE_DEC, NULL, 0x0,
1984 "ESI Interval in Seconds", HFILL }},
1986 { &hf_isns_registration_period,
1987 { "Registration Period","isns.registration_period",
1988 FT_UINT32, BASE_DEC, NULL, 0x0,
1989 "Registration Period in Seconds", HFILL }},
1991 { &hf_isns_portal_group_tag,
1992 { "PG Tag","isns.portal_group_tag",
1993 FT_UINT32, BASE_DEC, NULL, 0x0,
1994 "Portal Group Tag", HFILL }},
1997 { "Payload", "isns.payload",
1998 FT_BYTES, BASE_NONE, NULL, 0,
2003 /* Setup protocol subtree array */
2004 static gint *ett[] = {
2008 &ett_isns_attribute,
2012 module_t *isns_module;
2014 /* Register the protocol name and description */
2015 proto_isns = proto_register_protocol("iSNS",
2017 proto_register_field_array(proto_isns, hf, array_length(hf));
2018 proto_register_subtree_array(ett, array_length(ett));
2020 /* Register preferences */
2021 isns_module = prefs_register_protocol(proto_isns, NULL);
2022 prefs_register_bool_preference(isns_module, "desegment",
2023 "Reassemble iSNS messages spanning multiple TCP segments",
2024 "Whether the iSNS dissector should reassemble messages spanning multiple TCP segments."
2025 " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
2029 /* If this dissector uses sub-dissector registration add a registration routine.
2030 This format is required because a script is used to find these routines and
2031 create the code that calls these routines.
2035 proto_reg_handoff_isns(void)
2037 isns_tcp_handle = new_create_dissector_handle(dissect_isns_tcp,proto_isns);
2038 isns_udp_handle = new_create_dissector_handle(dissect_isns_udp,proto_isns);
2040 dissector_add("tcp.port",ISNS_TCP_PORT,isns_tcp_handle);
2041 dissector_add("udp.port",ISNS_UDP_PORT,isns_udp_handle);