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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
36 #include <epan/packet.h>
37 #include <epan/exceptions.h>
38 #include <epan/conversation.h>
39 #include "packet-tcp.h"
40 #include <epan/prefs.h>
42 void proto_register_isns(void);
43 void proto_reg_handoff_isns(void);
45 #define ISNS_PROTO_VER 0x1
46 #define ISNS_HEADER_SIZE 12
48 #define ISNS_TCP_PORT 3205
49 #define ISNS_UDP_PORT 3205
51 #define ISNS_OTHER_PORT 0
52 #define ISNS_ESI_PORT 1
53 #define ISNS_SCN_PORT 2
56 static dissector_handle_t isns_tcp_handle;
57 static dissector_handle_t isns_udp_handle;
59 static gint ett_isns_flags = -1;
60 static gint ett_isns_payload = -1;
61 static gint ett_isns_attribute = -1;
62 static gint ett_isns_port = -1;
63 static gint ett_isns_isnt = -1;
65 static guint AddAttribute(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree,
66 guint offset, guint16 function_id);
68 /* Initialize the protocol and registered fields */
69 static int proto_isns = -1;
73 static int hf_isns_version = -1;
74 static int hf_isns_function_id = -1;
75 static int hf_isns_pdu_length = -1;
76 static int hf_isns_flags = -1;
77 static int hf_isns_transaction_id = -1;
78 static int hf_isns_sequence_id = -1;
79 static int hf_isns_payload = -1;
80 static int hf_isns_first_pdu = -1;
81 static int hf_isns_last_pdu = -1;
82 static int hf_isns_replace = -1;
83 static int hf_isns_auth = -1;
84 static int hf_isns_server = -1;
85 static int hf_isns_client = -1;
88 static int hf_isns_scn_bitmap = -1;
89 static int hf_isns_scn_bitmap_initiator_and_self_information_only = -1;
90 static int hf_isns_scn_bitmap_target_and_self_information_only = -1;
91 static int hf_isns_scn_bitmap_management_registration_scn = -1;
92 static int hf_isns_scn_bitmap_object_removed = -1;
93 static int hf_isns_scn_bitmap_object_added = -1;
94 static int hf_isns_scn_bitmap_object_updated = -1;
95 static int hf_isns_scn_bitmap_dd_dds_member_removed = -1;
96 static int hf_isns_scn_bitmap_dd_dds_member_added = -1;
97 static int hf_isns_isnt_control = -1;
98 static int hf_isns_isnt_initiator = -1;
99 static int hf_isns_isnt_target = -1;
101 static int hf_isns_psb = -1;
102 static int hf_isns_psb_tunnel_mode = -1;
103 static int hf_isns_psb_transport_mode = -1;
104 static int hf_isns_psb_pfs = -1;
105 static int hf_isns_psb_aggressive_mode = -1;
106 static int hf_isns_psb_main_mode = -1;
107 static int hf_isns_psb_ike_ipsec = -1;
108 static int hf_isns_psb_bitmap = -1;
110 static int hf_isns_dd_member_portal_port = -1;
111 static int hf_isns_portal_port = -1;
112 static int hf_isns_esi_port = -1;
113 static int hf_isns_scn_port = -1;
114 static int hf_isns_port_type = -1;
116 static int hf_isns_entity_protocol = -1;
117 static int hf_isns_iscsi_node_type = -1;
118 static int hf_isns_resp_errorcode = -1;
119 static int hf_isns_attr_tag = -1;
120 static int hf_isns_attr_len = -1;
121 static int hf_isns_heartbeat_ipv6_addr = -1;
122 static int hf_isns_heartbeat_udp_port = -1;
123 static int hf_isns_heartbeat_tcp_port = -1;
124 static int hf_isns_heartbeat_interval = -1;
125 static int hf_isns_heartbeat_counter = -1;
127 static int hf_isns_mgmt_ip_addr = -1;
128 static int hf_isns_node_ip_addr = -1;
129 static int hf_isns_port_ip_addr = -1;
130 static int hf_isns_portal_ip_addr = -1;
131 static int hf_isns_dd_member_portal_ip_addr = -1;
132 static int hf_isns_iscsi_name = -1;
133 static int hf_isns_switch_name = -1;
134 static int hf_isns_dd_member_iscsi_name = -1;
135 static int hf_isns_virtual_fabric_id = -1;
136 static int hf_isns_proxy_iscsi_name = -1;
137 static int hf_isns_fc4_descriptor = -1;
138 static int hf_isns_iscsi_auth_method = -1;
139 static int hf_isns_iscsi_alias = -1;
140 static int hf_isns_portal_symbolic_name = -1;
141 static int hf_isns_dd_set_symbolic_name = -1;
142 static int hf_isns_dd_symbolic_name = -1;
143 static int hf_isns_symbolic_port_name = -1;
144 static int hf_isns_symbolic_node_name = -1;
145 static int hf_isns_entity_identifier = -1;
146 static int hf_isns_dd_id_next_id = -1;
147 static int hf_isns_member_iscsi_index = -1;
148 static int hf_isns_member_portal_index = -1;
149 static int hf_isns_member_fc_port_name = -1;
150 static int hf_isns_vendor_oui = -1;
151 static int hf_isns_preferred_id = -1;
152 static int hf_isns_assigned_id = -1;
153 static int hf_isns_dd_id = -1;
154 static int hf_isns_dd_set_id = -1;
155 static int hf_isns_dd_set_next_id = -1;
156 static int hf_isns_node_index = -1;
157 static int hf_isns_node_next_index = -1;
158 static int hf_isns_entity_index = -1;
159 static int hf_isns_portal_index = -1;
160 static int hf_isns_portal_next_index = -1;
161 static int hf_isns_entity_next_index = -1;
162 static int hf_isns_timestamp = -1;
163 static int hf_isns_esi_interval = -1;
164 static int hf_isns_registration_period = -1;
165 static int hf_isns_port_id = -1;
166 static int hf_isns_hard_address = -1;
167 static int hf_isns_wwnn_token = -1;
168 static int hf_isns_node_ipa = -1;
169 static int hf_isns_fc_port_name_wwpn = -1;
170 static int hf_isns_fc_node_name_wwnn = -1;
171 static int hf_isns_fabric_port_name = -1;
172 static int hf_isns_permanent_port_name = -1;
173 static int hf_isns_delimiter = -1;
174 static int hf_isns_not_decoded_yet = -1;
175 static int hf_isns_portal_group_tag = -1;
176 static int hf_isns_pg_iscsi_name = -1;
177 static int hf_isns_pg_portal_ip_addr = -1;
178 static int hf_isns_pg_portal_port = -1;
179 static int hf_isns_pg_index = -1;
180 static int hf_isns_pg_next_index = -1;
184 /* Desegment iSNS over TCP messages */
185 static gboolean isns_desegment = TRUE;
188 #define ISNS_FUNC_DEVATTRREG 0x0001
189 #define ISNS_FUNC_DEVATTRQRY 0x0002
190 #define ISNS_FUNC_DEVGETNEXT 0x0003
191 #define ISNS_FUNC_DEREGDEV 0x0004
192 #define ISNS_FUNC_SCNREG 0x0005
193 #define ISNS_FUNC_SCNDEREG 0x0006
194 #define ISNS_FUNC_SCNEVENT 0x0007
195 #define ISNS_FUNC_SCN 0x0008
196 #define ISNS_FUNC_DDREG 0x0009
197 #define ISNS_FUNC_DDDEREG 0x000a
198 #define ISNS_FUNC_DDSREG 0x000b
199 #define ISNS_FUNC_DDSDEREG 0x000c
200 #define ISNS_FUNC_ESI 0x000d
201 #define ISNS_FUNC_HEARTBEAT 0x000e
202 #define ISNS_FUNC_RQSTDOMID 0x0011
203 #define ISNS_FUNC_RLSEDOMID 0x0012
204 #define ISNS_FUNC_GETDOMID 0x0013
206 #define ISNS_FUNC_RSP_DEVATTRREG 0x8001
207 #define ISNS_FUNC_RSP_DEVATTRQRY 0x8002
208 #define ISNS_FUNC_RSP_DEVGETNEXT 0x8003
209 #define ISNS_FUNC_RSP_DEREGDEV 0x8004
210 #define ISNS_FUNC_RSP_SCNREG 0x8005
211 #define ISNS_FUNC_RSP_SCNDEREG 0x8006
212 #define ISNS_FUNC_RSP_SCNEVENT 0x8007
213 #define ISNS_FUNC_RSP_SCN 0x8008
214 #define ISNS_FUNC_RSP_DDREG 0x8009
215 #define ISNS_FUNC_RSP_DDDEREG 0x800a
216 #define ISNS_FUNC_RSP_DDSREG 0x800b
217 #define ISNS_FUNC_RSP_DDSDEREG 0x800c
218 #define ISNS_FUNC_RSP_ESI 0x800d
219 #define ISNS_FUNC_RSP_RQSTDOMID 0x8011
220 #define ISNS_FUNC_RSP_RLSEDOMID 0x8012
221 #define ISNS_FUNC_RSP_GETDOMID 0x8013
223 static const value_string isns_function_ids[] = {
225 {ISNS_FUNC_DEVATTRREG, "DevAttrReg"},
226 {ISNS_FUNC_DEVATTRQRY, "DevAttrQry"},
227 {ISNS_FUNC_DEVGETNEXT, "DevGetNext"},
228 {ISNS_FUNC_DEREGDEV, "DeregDev"},
229 {ISNS_FUNC_SCNREG, "SCNReg"},
230 {ISNS_FUNC_SCNDEREG, "SCNDereg"},
231 {ISNS_FUNC_SCNEVENT, "SCNEvent"},
232 {ISNS_FUNC_SCN, "SCN"},
233 {ISNS_FUNC_DDREG, "DDReg"},
234 {ISNS_FUNC_DDDEREG, "DDDereg"},
235 {ISNS_FUNC_DDSREG, "DDSReg"},
236 {ISNS_FUNC_DDSDEREG, "DDSDereg"},
237 {ISNS_FUNC_ESI, "ESI"},
238 {ISNS_FUNC_HEARTBEAT, "Heartbeat"},
239 {ISNS_FUNC_RQSTDOMID, "RqstDomId"},
240 {ISNS_FUNC_RLSEDOMID, "RlseDomId"},
241 {ISNS_FUNC_GETDOMID, "GetDomId"},
244 {ISNS_FUNC_RSP_DEVATTRREG, "DevAttrRegRsp"},
245 {ISNS_FUNC_RSP_DEVATTRQRY, "DevAttrQryRsp"},
246 {ISNS_FUNC_RSP_DEVGETNEXT, "DevGetNextRsp"},
247 {ISNS_FUNC_RSP_DEREGDEV, "DeregDevRsp"},
248 {ISNS_FUNC_RSP_SCNREG, "SCNRegRsp"},
249 {ISNS_FUNC_RSP_SCNDEREG, "SCNDeregRsp"},
250 {ISNS_FUNC_RSP_SCNEVENT, "SCNEventRsp"},
251 {ISNS_FUNC_RSP_SCN, "SCNRsp"},
252 {ISNS_FUNC_RSP_DDREG, "DDRegRsp"},
253 {ISNS_FUNC_RSP_DDDEREG, "DDDeregRsp"},
254 {ISNS_FUNC_RSP_DDSREG, "DDSRegRsp"},
255 {ISNS_FUNC_RSP_DDSDEREG, "DDSDeregRsp"},
256 {ISNS_FUNC_RSP_ESI, "ESIRsp"},
257 {ISNS_FUNC_RSP_RQSTDOMID, "RqstDomIdRsp"},
258 {ISNS_FUNC_RSP_RLSEDOMID, "RlseDomIdRsp"},
259 {ISNS_FUNC_RSP_GETDOMID, "GetDomIdRsp"},
263 static value_string_ext isns_function_ids_ext = VALUE_STRING_EXT_INIT(isns_function_ids);
265 #define ISNS_ENTITY_PROTOCOL_NO_PROTOCOL 1
266 #define ISNS_ENTITY_PROTOCOL_ISCSI 2
267 #define ISNS_ENTITY_PROTOCOL_IFCP 3
270 static const value_string isns_entity_protocol[] = {
271 {ISNS_ENTITY_PROTOCOL_NO_PROTOCOL, "No Protocol"},
272 {ISNS_ENTITY_PROTOCOL_ISCSI, "iSCSI"},
273 {ISNS_ENTITY_PROTOCOL_IFCP, "iFCP"},
278 static const value_string isns_errorcode[] = {
280 { 1,"Unknown Error"},
281 { 2,"Message Format Error"},
282 { 3,"Invalid Registration"},
284 { 5,"Invalid Query"},
285 { 6,"Source Unknown"},
286 { 7,"Source Absent"},
287 { 8,"Source Unauthorized"},
288 { 9,"No such Entry"},
289 {10,"Version Not Supported"},
290 {11,"Internal Error"},
292 {13,"Option Not Understood"},
293 {14,"Invalid Update"},
294 {15,"Message (FUNCTION_ID) Not supported"},
295 {16,"SCN Event Rejected"},
296 {17,"SCN Registration Rejected"},
297 {18,"Attribute Not Implemented"},
298 {19,"FC_DOMAIN_ID Not available"},
299 {20,"FC_DOMAIN_ID not allocated"},
300 {21,"ESI Not Available"},
301 {22,"Invalid Deregistration"},
302 {23,"Registration Feature Not Supported"},
306 static value_string_ext isns_errorcode_ext = VALUE_STRING_EXT_INIT(isns_errorcode);
309 #define ISNS_ATTR_TAG_DELIMITER 0
310 #define ISNS_ATTR_TAG_ENTITY_IDENTIFIER 1
311 #define ISNS_ATTR_TAG_ENTITY_PROTOCOL 2
312 #define ISNS_ATTR_TAG_MGMT_IP_ADDRESS 3
313 #define ISNS_ATTR_TAG_TIMESTAMP 4
314 #define ISNS_ATTR_TAG_PROTOCOL_VERSION_RANGE 5
315 #define ISNS_ATTR_TAG_REGISTRATION_PERIOD 6
316 #define ISNS_ATTR_TAG_ENTITY_INDEX 7
317 #define ISNS_ATTR_TAG_ENTITY_NEXT_INDEX 8
318 #define ISNS_ATTR_TAG_ENTITY_ISAKMP_PHASE_1 11
319 #define ISNS_ATTR_TAG_ENTITY_CERTIFICATE 12
320 #define ISNS_ATTR_TAG_PORTAL_IP_ADDRESS 16
321 #define ISNS_ATTR_TAG_PORTAL_PORT 17
322 #define ISNS_ATTR_TAG_PORTAL_SYMBOLIC_NAME 18
323 #define ISNS_ATTR_TAG_ESI_INTERVAL 19
324 #define ISNS_ATTR_TAG_ESI_PORT 20
325 #define ISNS_ATTR_TAG_PORTAL_INDEX 22
326 #define ISNS_ATTR_TAG_SCN_PORT 23
327 #define ISNS_ATTR_TAG_PORTAL_NEXT_INDEX 24
328 #define ISNS_ATTR_TAG_PORTAL_SECURITY_BITMAP 27
329 #define ISNS_ATTR_TAG_PORTAL_ISAKMP_PHASE_1 28
330 #define ISNS_ATTR_TAG_PORTAL_ISAKMP_PHASE_2 29
331 #define ISNS_ATTR_TAG_PORTAL_CERTIFICATE 31
332 #define ISNS_ATTR_TAG_ISCSI_NAME 32
333 #define ISNS_ATTR_TAG_ISCSI_NODE_TYPE 33
334 #define ISNS_ATTR_TAG_ISCSI_ALIAS 34
335 #define ISNS_ATTR_TAG_ISCSI_SCN_BITMAP 35
336 #define ISNS_ATTR_TAG_ISCSI_NODE_INDEX 36
337 #define ISNS_ATTR_TAG_WWNN_TOKEN 37
338 #define ISNS_ATTR_TAG_ISCSI_NODE_NEXT_INDEX 38
339 #define ISNS_ATTR_TAG_ISCSI_AUTH_METHOD 42
340 #define ISNS_ATTR_TAG_PG_ISCSI_NAME 48
341 #define ISNS_ATTR_TAG_PG_PORTAL_IP_ADDR 49
342 #define ISNS_ATTR_TAG_PG_PORTAL_PORT 50
343 #define ISNS_ATTR_TAG_PORTAL_GROUP_TAG 51
344 #define ISNS_ATTR_TAG_PORTAL_GROUP_INDEX 52
345 #define ISNS_ATTR_TAG_PORTAL_GROUP_NEXT_INDEX 53
346 #define ISNS_ATTR_TAG_FC_PORT_NAME_WWPN 64
347 #define ISNS_ATTR_TAG_PORT_ID 65
348 #define ISNS_ATTR_TAG_FC_PORT_TYPE 66
349 #define ISNS_ATTR_TAG_SYMBOLIC_PORT_NAME 67
350 #define ISNS_ATTR_TAG_FABRIC_PORT_NAME 68
351 #define ISNS_ATTR_TAG_HARD_ADDRESS 69
352 #define ISNS_ATTR_TAG_PORT_IP_ADDRESS 70
353 #define ISNS_ATTR_TAG_CLASS_OF_SERVICE 71
354 #define ISNS_ATTR_TAG_FC4_TYPES 72
355 #define ISNS_ATTR_TAG_FC4_DESCRIPTOR 73
356 #define ISNS_ATTR_TAG_FC4_FEATURES 74
357 #define ISNS_ATTR_TAG_IFCP_SCN_BITMAP 75
358 #define ISNS_ATTR_TAG_PORT_ROLE 76
359 #define ISNS_ATTR_TAG_PERMANENT_PORT_NAME 77
360 #define ISNS_ATTR_TAG_FC4_TYPE_CODE 95
361 #define ISNS_ATTR_TAG_FC_NODE_NAME_WWNN 96
362 #define ISNS_ATTR_TAG_SYMBOLIC_NODE_NAME 97
363 #define ISNS_ATTR_TAG_NODE_IP_ADDRESS 98
364 #define ISNS_ATTR_TAG_NODE_IPA 99
365 #define ISNS_ATTR_TAG_PROXY_ISCSI_NAME 101
366 #define ISNS_ATTR_TAG_SWITCH_NAME 128
367 #define ISNS_ATTR_TAG_PREFERRED_ID 129
368 #define ISNS_ATTR_TAG_ASSIGNED_ID 130
369 #define ISNS_ATTR_TAG_VIRTUAL_FABRIC_ID 131
370 #define ISNS_ATTR_TAG_VENDOR_OUI 256
371 #define ISNS_ATTR_TAG_DD_SET_ID 2049
372 #define ISNS_ATTR_TAG_DD_SET_SYMBOLIC_NAME 2050
373 #define ISNS_ATTR_TAG_DD_SET_STATUS 2051
374 #define ISNS_ATTR_TAG_DD_SET_NEXT_ID 2052
375 #define ISNS_ATTR_TAG_DD_ID 2065
376 #define ISNS_ATTR_TAG_DD_SYMBOLIC_NAME 2066
377 #define ISNS_ATTR_TAG_DD_MEMBER_ISCSI_INDEX 2067
378 #define ISNS_ATTR_TAG_DD_MEMBER_ISCSI_NAME 2068
379 #define ISNS_ATTR_TAG_DD_MEMBER_FC_PORT_NAME 2069
380 #define ISNS_ATTR_TAG_DD_MEMBER_PORTAL_INDEX 2070
381 #define ISNS_ATTR_TAG_DD_MEMBER_PORTAL_IP_ADDRESS 2071
382 #define ISNS_ATTR_TAG_DD_MEMBER_PORTAL_PORT 2072
383 #define ISNS_ATTR_TAG_DD_FEATURES 2078
384 #define ISNS_ATTR_TAG_DD_ID_NEXT_ID 2079
387 static const value_string isns_attribute_tags[] = {
388 {ISNS_ATTR_TAG_DELIMITER, "Delimiter"},
389 {ISNS_ATTR_TAG_ENTITY_IDENTIFIER, "Entity Identifier (EID)"},
390 {ISNS_ATTR_TAG_ENTITY_PROTOCOL, "Entity Protocol"},
391 {ISNS_ATTR_TAG_MGMT_IP_ADDRESS, "Management IP Address"},
392 {ISNS_ATTR_TAG_TIMESTAMP, "Timestamp"},
393 {ISNS_ATTR_TAG_PROTOCOL_VERSION_RANGE, "Protocol Version Range"},
394 {ISNS_ATTR_TAG_REGISTRATION_PERIOD, "Registration Period"},
395 {ISNS_ATTR_TAG_ENTITY_INDEX, "Entity Index"},
396 {ISNS_ATTR_TAG_ENTITY_NEXT_INDEX, "Entity Next Index"},
397 {ISNS_ATTR_TAG_ENTITY_ISAKMP_PHASE_1, "Entity ISAKMP Phase-1"},
398 {ISNS_ATTR_TAG_ENTITY_CERTIFICATE, "Entity Certificate"},
399 {ISNS_ATTR_TAG_PORTAL_IP_ADDRESS, "Portal IP Address"},
400 {ISNS_ATTR_TAG_PORTAL_PORT, "Portal TCP/UDP Port"},
401 {ISNS_ATTR_TAG_PORTAL_SYMBOLIC_NAME, "Portal Symbolic Name"},
402 {ISNS_ATTR_TAG_ESI_INTERVAL, "ESI Interval"},
403 {ISNS_ATTR_TAG_ESI_PORT, "ESI Port"},
404 {ISNS_ATTR_TAG_PORTAL_INDEX, "Portal Index"},
405 {ISNS_ATTR_TAG_SCN_PORT, "SCN Port"},
406 {ISNS_ATTR_TAG_PORTAL_NEXT_INDEX, "Portal Next Index"},
407 {ISNS_ATTR_TAG_PORTAL_SECURITY_BITMAP, "Portal Security Bitmap"},
408 {ISNS_ATTR_TAG_PORTAL_ISAKMP_PHASE_1, "Portal ISAKMP Phase-1"},
409 {ISNS_ATTR_TAG_PORTAL_ISAKMP_PHASE_2, "Portal ISAKMP Phase-2"},
410 {ISNS_ATTR_TAG_PORTAL_CERTIFICATE, "Portal Certificate"},
411 {ISNS_ATTR_TAG_ISCSI_NAME, "iSCSI Name"},
412 {ISNS_ATTR_TAG_ISCSI_NODE_TYPE, "iSCSI Node Type"},
413 {ISNS_ATTR_TAG_ISCSI_ALIAS, "iSCSI Alias"},
414 {ISNS_ATTR_TAG_ISCSI_SCN_BITMAP, "iSCSI SCN Bitmap"},
415 {ISNS_ATTR_TAG_ISCSI_NODE_INDEX, "iSCSI Node Index"},
416 {ISNS_ATTR_TAG_WWNN_TOKEN, "WWNN Token"},
417 {ISNS_ATTR_TAG_ISCSI_NODE_NEXT_INDEX, "iSCSI Node Next Index"},
418 {ISNS_ATTR_TAG_ISCSI_AUTH_METHOD, "iSCSI AuthMethod"},
419 {ISNS_ATTR_TAG_PG_ISCSI_NAME, "PG iSCSI Name"},
420 {ISNS_ATTR_TAG_PG_PORTAL_IP_ADDR, "PG Portal IP Addr"},
421 {ISNS_ATTR_TAG_PG_PORTAL_PORT, "PG Portal Port"},
422 {ISNS_ATTR_TAG_PORTAL_GROUP_TAG, "Portal Group Tag"},
423 {ISNS_ATTR_TAG_PORTAL_GROUP_INDEX, "PG Index"},
424 {ISNS_ATTR_TAG_PORTAL_GROUP_NEXT_INDEX, "PG Next Index"},
425 {ISNS_ATTR_TAG_FC_PORT_NAME_WWPN, "FC Port Name WWPN"},
426 {ISNS_ATTR_TAG_PORT_ID, "Port ID"},
427 {ISNS_ATTR_TAG_FC_PORT_TYPE, "FC Port Type"},
428 {ISNS_ATTR_TAG_SYMBOLIC_PORT_NAME, "Symbolic Port Name"},
429 {ISNS_ATTR_TAG_FABRIC_PORT_NAME, "Fabric Port Name"},
430 {ISNS_ATTR_TAG_HARD_ADDRESS, "Hard Address"},
431 {ISNS_ATTR_TAG_PORT_IP_ADDRESS, "Port IP-Address"},
432 {ISNS_ATTR_TAG_CLASS_OF_SERVICE, "Class of Service"},
433 {ISNS_ATTR_TAG_FC4_TYPES, "FC-4 Types"},
434 {ISNS_ATTR_TAG_FC4_DESCRIPTOR, "FC-4 Descriptor"},
435 {ISNS_ATTR_TAG_FC4_FEATURES, "FC-4 Features"},
436 {ISNS_ATTR_TAG_IFCP_SCN_BITMAP, "iFCP SCN bitmap"},
437 {ISNS_ATTR_TAG_PORT_ROLE, "Port Role"},
438 {ISNS_ATTR_TAG_PERMANENT_PORT_NAME, "Permanent Port Name"},
439 {ISNS_ATTR_TAG_FC4_TYPE_CODE, "FC-4 Type Code"},
440 {ISNS_ATTR_TAG_FC_NODE_NAME_WWNN, "FC Node Name WWNN"},
441 {ISNS_ATTR_TAG_SYMBOLIC_NODE_NAME, "Symbolic Node Name"},
442 {ISNS_ATTR_TAG_NODE_IP_ADDRESS, "Node IP-Address"},
443 {ISNS_ATTR_TAG_NODE_IPA, "Node IPA"},
444 {ISNS_ATTR_TAG_PROXY_ISCSI_NAME, "Proxy iSCSI Name"},
445 {ISNS_ATTR_TAG_SWITCH_NAME, "Switch Name"},
446 {ISNS_ATTR_TAG_PREFERRED_ID, "Preferred ID"},
447 {ISNS_ATTR_TAG_ASSIGNED_ID, "Assigned ID"},
448 {ISNS_ATTR_TAG_VIRTUAL_FABRIC_ID, "Virtual_Fabric_ID"},
449 {ISNS_ATTR_TAG_VENDOR_OUI, "iSNS Server Vendor OUI"},
450 {ISNS_ATTR_TAG_DD_SET_ID, "DD_Set ID"},
451 {ISNS_ATTR_TAG_DD_SET_SYMBOLIC_NAME, "DD_Set Sym Name"},
452 {ISNS_ATTR_TAG_DD_SET_STATUS, "DD_Set Status"},
453 {ISNS_ATTR_TAG_DD_SET_NEXT_ID, "DD_Set_Next_ID"},
454 {ISNS_ATTR_TAG_DD_ID, "DD_ID"},
455 {ISNS_ATTR_TAG_DD_SYMBOLIC_NAME, "DD_Symbolic Name"},
456 {ISNS_ATTR_TAG_DD_MEMBER_ISCSI_INDEX, "DD_Member iSCSI Index"},
457 {ISNS_ATTR_TAG_DD_MEMBER_ISCSI_NAME, "DD_Member iSCSI Name"},
458 {ISNS_ATTR_TAG_DD_MEMBER_FC_PORT_NAME, "DD_Member FC Port Name"},
459 {ISNS_ATTR_TAG_DD_MEMBER_PORTAL_INDEX, "DD Member Portal Index"},
460 {ISNS_ATTR_TAG_DD_MEMBER_PORTAL_IP_ADDRESS, "DD_Member Portal IP Addr"},
461 {ISNS_ATTR_TAG_DD_MEMBER_PORTAL_PORT, "DD Member Portal TCP/UDP"},
462 {ISNS_ATTR_TAG_DD_FEATURES, "DD_Features"},
463 {ISNS_ATTR_TAG_DD_ID_NEXT_ID, "DD_ID Next ID"},
467 static value_string_ext isns_attribute_tags_ext = VALUE_STRING_EXT_INIT(isns_attribute_tags);
470 #define ISNS_FLAGS_CLIENT 0x8000
471 #define ISNS_FLAGS_SERVER 0x4000
472 #define ISNS_FLAGS_AUTH 0x2000
473 #define ISNS_FLAGS_REPLACE 0x1000
474 #define ISNS_FLAGS_LAST_PDU 0x0800
475 #define ISNS_FLAGS_FIRST_PDU 0x0400
478 #define tfs_isns_scn_bitmap_initiator_and_self_information_only tfs_true_false
479 #define tfs_isns_scn_bitmap_target_and_self_information_only tfs_true_false
480 #define tfs_isns_scn_bitmap_management_registration_scn tfs_true_false
481 #define tfs_isns_scn_bitmap_object_removed tfs_true_false
482 #define tfs_isns_scn_bitmap_object_added tfs_true_false
483 #define tfs_isns_scn_bitmap_object_updated tfs_true_false
484 #define tfs_isns_scn_bitmap_dd_dds_member_removed tfs_true_false
485 #define tfs_isns_scn_bitmap_dd_dds_member_added tfs_true_false
487 static const true_false_string tfs_isns_preferred = {
492 #define tfs_isns_psb_tunnel_mode tfs_isns_preferred
493 #define tfs_isns_psb_transport_mode tfs_isns_preferred
495 #define tfs_isns_psb_pfs tfs_enabled_disabled
496 #define tfs_isns_psb_aggressive_mode tfs_enabled_disabled
497 #define tfs_isns_psb_main_mode tfs_enabled_disabled
498 #define tfs_isns_psb_ike_ipsec tfs_enabled_disabled
500 static const true_false_string tfs_isns_psb_bitmap = {
505 #define tfs_isns_isnt_control tfs_yes_no
506 #define tfs_isns_isnt_initiator tfs_yes_no
507 #define tfs_isns_isnt_target tfs_yes_no
509 static const true_false_string tfs_isns_port_type = {
514 static const true_false_string tfs_isns_flag_first_pdu = {
515 "First PDU of iSNS Message",
516 "Not the first PDU of iSNS Message"
519 static const true_false_string tfs_isns_flag_last_pdu = {
520 "Last PDU of iSNS Message",
521 "Not the Last PDU of iSNS Message"
524 static const true_false_string tfs_isns_flag_replace = {
529 static const true_false_string tfs_isns_flag_auth = {
530 "Authentication Block is PRESENT",
531 "No authentication block"
534 static const true_false_string tfs_isns_flag_server = {
535 "Sender is iSNS server",
536 "Sender is not iSNS server"
539 static const true_false_string tfs_isns_flag_client = {
540 "Sender is iSNS client",
541 "Sender is not iSNS client"
545 /* Initialize the subtree pointers */
546 static gint ett_isns = -1;
549 /* Code to actually dissect the packets */
551 dissect_isns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
557 proto_tree *isns_tree;
561 proto_item *tpayload;
563 /* Make entries in Protocol column and Info column on summary display */
564 col_set_str(pinfo->cinfo, COL_PROTOCOL, "iSNS");
565 col_clear(pinfo->cinfo, COL_INFO);
567 /* Get the function id from the packet */
568 function_id = tvb_get_ntohs(tvb, offset + 2);
570 /* Add the function name in the info col */
571 col_add_str(pinfo->cinfo, COL_INFO,
572 val_to_str_ext(function_id, &isns_function_ids_ext,
573 "Unknown function ID 0x%04x"));
576 return tvb_length(tvb);
578 /* create display subtree for the protocol */
579 ti = proto_tree_add_item(tree, proto_isns, tvb, 0, -1, ENC_NA);
580 isns_tree = proto_item_add_subtree(ti, ett_isns);
582 /* OK... Sort out the header */
583 proto_tree_add_item(isns_tree, hf_isns_version, tvb, offset, 2, ENC_BIG_ENDIAN);
584 proto_tree_add_item(isns_tree, hf_isns_function_id, tvb, offset+2, 2, ENC_BIG_ENDIAN);
585 proto_tree_add_item(isns_tree, hf_isns_pdu_length, tvb, offset+4, 2, ENC_BIG_ENDIAN);
588 flags = tvb_get_ntohs(tvb, offset + 6);
589 tflags = proto_tree_add_item(isns_tree, hf_isns_flags, tvb, offset+6, 2, ENC_BIG_ENDIAN);
590 tt = proto_item_add_subtree(tflags, ett_isns_flags);
592 proto_tree_add_boolean(tt, hf_isns_client, tvb, offset+6, 2, flags);
593 proto_tree_add_boolean(tt, hf_isns_server, tvb, offset+6, 2, flags);
594 proto_tree_add_boolean(tt, hf_isns_auth, tvb, offset+6, 2, flags);
595 proto_tree_add_boolean(tt, hf_isns_replace, tvb, offset+6, 2, flags);
596 proto_tree_add_boolean(tt, hf_isns_last_pdu, tvb, offset+6, 2, flags);
597 proto_tree_add_boolean(tt, hf_isns_first_pdu, tvb, offset+6, 2, flags);
599 proto_tree_add_item(isns_tree, hf_isns_transaction_id, tvb, offset+8, 2, ENC_BIG_ENDIAN);
601 proto_tree_add_item(isns_tree, hf_isns_sequence_id, tvb, offset+10, 2, ENC_BIG_ENDIAN);
603 tpayload = proto_tree_add_item(isns_tree, hf_isns_payload, tvb, offset+12, -1, ENC_NA);
604 tt = proto_item_add_subtree(tpayload, ett_isns_payload);
606 /* Now set the offset to the start of the payload */
607 offset += ISNS_HEADER_SIZE;
609 /* Decode those attributes baby - Yeah!*/
612 case ISNS_FUNC_HEARTBEAT:
613 proto_tree_add_item(tt,hf_isns_heartbeat_ipv6_addr, tvb, offset, 16, ENC_NA);
616 proto_tree_add_item(tt,hf_isns_heartbeat_tcp_port, tvb, offset, 2, ENC_BIG_ENDIAN);
619 proto_tree_add_item(tt,hf_isns_heartbeat_udp_port, tvb, offset, 2, ENC_BIG_ENDIAN);
622 proto_tree_add_item(tt,hf_isns_heartbeat_interval, tvb, offset, 4, ENC_BIG_ENDIAN);
625 proto_tree_add_item(tt,hf_isns_heartbeat_counter, tvb, offset, 4, ENC_BIG_ENDIAN);
630 case ISNS_FUNC_RSP_DEVATTRREG:
631 case ISNS_FUNC_RSP_DEVATTRQRY:
632 case ISNS_FUNC_RSP_DEVGETNEXT:
633 case ISNS_FUNC_RSP_DEREGDEV:
634 case ISNS_FUNC_RSP_SCNREG:
635 case ISNS_FUNC_RSP_SCNDEREG:
636 case ISNS_FUNC_RSP_SCNEVENT:
637 case ISNS_FUNC_RSP_SCN:
638 case ISNS_FUNC_RSP_DDREG:
639 case ISNS_FUNC_RSP_DDDEREG:
640 case ISNS_FUNC_RSP_DDSREG:
641 case ISNS_FUNC_RSP_DDSDEREG:
642 case ISNS_FUNC_RSP_ESI:
643 case ISNS_FUNC_RSP_RQSTDOMID:
644 case ISNS_FUNC_RSP_RLSEDOMID:
645 case ISNS_FUNC_RSP_GETDOMID:
647 /* Get the Error message of the response */
648 /* The Error field exists only at the beginning of a message (i.e., in the first PDU */
649 if(flags&ISNS_FLAGS_FIRST_PDU){
650 proto_tree_add_item(tt,hf_isns_resp_errorcode, tvb, offset, 4, ENC_BIG_ENDIAN);
654 /* Fall Thru if there are attributes */
655 if (tvb_reported_length_remaining(tvb, offset) == 0)
656 return tvb_length(tvb);
659 case ISNS_FUNC_DEVATTRREG:
660 case ISNS_FUNC_DEVATTRQRY:
661 case ISNS_FUNC_DEVGETNEXT:
662 case ISNS_FUNC_DEREGDEV:
663 case ISNS_FUNC_SCNREG:
664 case ISNS_FUNC_SCNDEREG:
665 case ISNS_FUNC_SCNEVENT:
667 case ISNS_FUNC_DDREG:
668 case ISNS_FUNC_DDDEREG:
669 case ISNS_FUNC_DDSREG:
670 case ISNS_FUNC_DDSDEREG:
672 case ISNS_FUNC_RQSTDOMID:
673 case ISNS_FUNC_RLSEDOMID:
674 case ISNS_FUNC_GETDOMID:
676 /* we can only look at the attributes for the first PDU */
677 if(!(flags&ISNS_FLAGS_FIRST_PDU)){
678 proto_tree_add_text(tt, tvb, offset, -1, "This is not the first PDU. The attributes are not decoded");
679 return tvb_length(tvb);
682 packet_len = tvb_reported_length(tvb);
683 while( offset < packet_len )
685 offset = AddAttribute(pinfo, tvb, tt, offset, function_id);
689 return tvb_length(tvb);
693 get_isns_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
697 isns_len = tvb_get_ntohs(tvb, offset+4);
698 return (isns_len+ISNS_HEADER_SIZE);
702 dissect_isns_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
704 gint length = tvb_length(tvb);
705 guint16 isns_protocol_version;
708 if (length < ISNS_HEADER_SIZE) {
710 * Not enough room to see if this is valid iSNS.
715 /* Get the protocol version - only version one at the moment*/
716 isns_protocol_version = tvb_get_ntohs(tvb, 0);
717 if (isns_protocol_version != ISNS_PROTO_VER)
720 /* Get the function id from the packet */
721 function_id = tvb_get_ntohs(tvb, 2);
722 if (try_val_to_str_ext(function_id, &isns_function_ids_ext) == NULL) {
723 /* Unknown function ID */
727 tcp_dissect_pdus(tvb, pinfo, tree, isns_desegment, ISNS_HEADER_SIZE, get_isns_pdu_len,
728 dissect_isns_pdu, data);
733 dissect_isns_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
735 gint length = tvb_length(tvb);
736 guint16 isns_protocol_version;
739 if (length < ISNS_HEADER_SIZE) {
741 * Not enough room to see if this is valid iSNS.
746 /* Get the protocol version - only version one at the moment*/
747 isns_protocol_version = tvb_get_ntohs(tvb, 0);
748 if (isns_protocol_version != ISNS_PROTO_VER)
751 /* Get the function id from the packet */
752 function_id = tvb_get_ntohs(tvb, 2);
753 if (try_val_to_str_ext(function_id, &isns_function_ids_ext) == NULL) {
754 /* Unknown function ID */
758 dissect_isns_pdu(tvb, pinfo, tree, data);
764 dissect_isns_attr_ip_address(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, int hf_index, guint32 tag, guint32 len)
771 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset + 8, len, ENC_BIG_ENDIAN);
772 tree = proto_item_add_subtree(item, ett_isns_attribute);
774 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
775 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
782 dissect_isns_attr_string(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, int hf_index, guint32 tag, guint32 len)
788 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset + 8, len, ENC_BIG_ENDIAN);
789 tree = proto_item_add_subtree(item, ett_isns_attribute);
791 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
792 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
799 dissect_isns_attr_integer(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, int hf_index, guint32 tag, guint32 len, guint16 function_id)
803 * in a DevAttrReg , the PGT (tag 51) may be sent as 0 length
804 * which then means that we wish to register the portal group tag
806 * (At least) some servers will respond with PGT as a 0 length
807 * value in these instances in the DevAttrRegRsp (eventhough I can
808 * not find this mentioned in the standard) so allow it for the
816 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset + 8, len, ENC_BIG_ENDIAN);
817 tree = proto_item_add_subtree(item, ett_isns_attribute);
818 } else if((tag==ISNS_ATTR_TAG_PORTAL_GROUP_TAG)&&((function_id==ISNS_FUNC_DEVATTRREG)||(function_id==ISNS_FUNC_RSP_DEVATTRREG))){
820 item = proto_tree_add_uint_format_value(parent_tree, hf_isns_portal_group_tag, tvb, offset, 8, 0, "<NULL>");
821 tree = proto_item_add_subtree(item, ett_isns_attribute);
823 item = proto_tree_add_text(parent_tree, tvb, offset, 8, "Oops, you surprised me here. a 0 byte integer.");
824 tree = proto_item_add_subtree(item, ett_isns_attribute);
827 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
828 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
835 dissect_isns_attr_port(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, int hf_index, guint32 tag, guint32 len,
836 guint16 isns_port_type, packet_info *pinfo)
838 guint16 port = tvb_get_ntohs(tvb, offset + 10);
839 guint16 isudp = tvb_get_ntohs(tvb, offset + 8)&0x01;
840 conversation_t *conversation;
846 item = proto_tree_add_uint(parent_tree, hf_index, tvb, offset+8, 4, port);
847 tree = proto_item_add_subtree(item, ett_isns_port);
849 proto_tree_add_boolean(tree, hf_isns_port_type, tvb, offset+8, 2, isudp);
851 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
852 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
855 if ((isns_port_type == ISNS_ESI_PORT) || (isns_port_type == ISNS_SCN_PORT)) {
857 conversation = find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst, PT_UDP,
859 if (conversation == NULL) {
860 conversation = conversation_new (pinfo->fd->num, &pinfo->src, &pinfo->dst,
861 PT_UDP, port, 0, NO_PORT2_FORCE);
862 conversation_set_dissector (conversation, isns_udp_handle);
866 conversation = find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst, PT_TCP,
868 if (conversation == NULL) {
869 conversation = conversation_new (pinfo->fd->num, &pinfo->src, &pinfo->dst,
870 PT_TCP, port, 0, NO_PORT2_FORCE);
871 conversation_set_dissector (conversation, isns_tcp_handle);
880 dissect_isns_attr_none(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, int hf_index, guint32 tag, guint32 len)
886 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 8, ENC_BIG_ENDIAN);
887 tree = proto_item_add_subtree(item, ett_isns_port);
889 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
890 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
897 dissect_isns_attr_not_decoded_yet(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, int hf_index, guint32 tag, guint32 len)
903 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset + 8, len, ENC_BIG_ENDIAN);
904 tree = proto_item_add_subtree(item, ett_isns_port);
906 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
907 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
914 dissect_isns_attr_iscsi_node_type(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, int hf_index, guint32 tag, guint32 len)
919 guint32 node_type = tvb_get_ntohl(tvb, offset + 8);
921 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset + 8, len, ENC_BIG_ENDIAN);
922 tree = proto_item_add_subtree(item, ett_isns_attribute);
924 proto_tree_add_boolean(tree, hf_isns_isnt_control, tvb, offset+8, 4, node_type);
925 if(node_type&0x00000004){
926 proto_item_append_text(item, " Control");
928 proto_tree_add_boolean(tree, hf_isns_isnt_initiator, tvb, offset+8, 4, node_type);
929 if(node_type&0x00000002){
930 proto_item_append_text(item, " Initiator");
932 proto_tree_add_boolean(tree, hf_isns_isnt_target, tvb, offset+8, 4, node_type);
933 if(node_type&0x00000001){
934 proto_item_append_text(item, " Target");
937 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
938 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
947 dissect_isns_attr_portal_security_bitmap(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, int hf_index, guint32 tag, guint32 len)
952 guint32 psb = tvb_get_ntohl(tvb, offset + 8);
954 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset + 8, len, ENC_BIG_ENDIAN);
955 tree = proto_item_add_subtree(item, ett_isns_attribute);
957 proto_tree_add_boolean(tree, hf_isns_psb_tunnel_mode, tvb, offset+8, 4, psb);
958 proto_tree_add_boolean(tree, hf_isns_psb_transport_mode, tvb, offset+8, 4, psb);
959 proto_tree_add_boolean(tree, hf_isns_psb_pfs, tvb, offset+8, 4, psb);
960 proto_tree_add_boolean(tree, hf_isns_psb_aggressive_mode, tvb, offset+8, 4, psb);
961 proto_tree_add_boolean(tree, hf_isns_psb_main_mode, tvb, offset+8, 4, psb);
962 proto_tree_add_boolean(tree, hf_isns_psb_ike_ipsec, tvb, offset+8, 4, psb);
963 proto_tree_add_boolean(tree, hf_isns_psb_bitmap, tvb, offset+8, 4, psb);
965 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
966 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
975 dissect_isns_attr_scn_bitmap(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, int hf_index, guint32 tag, guint32 len)
980 guint32 scn_bitmap = tvb_get_ntohl(tvb, offset + 8);
982 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset + 8, len, ENC_BIG_ENDIAN);
983 tree = proto_item_add_subtree(item, ett_isns_attribute);
986 24 INITIATOR AND SELF INFORMATION ONLY
987 25 TARGET AND SELF INFORMATION ONLY
988 26 MANAGEMENT REGISTRATION/SCN
992 30 DD/DDS MEMBER REMOVED (Mgmt Reg/SCN only)
993 31 (Lsb) DD/DDS MEMBER ADDED (Mgmt Reg/SCN only)
995 proto_tree_add_boolean(tree, hf_isns_scn_bitmap_initiator_and_self_information_only, tvb, offset+8, 4, scn_bitmap);
996 proto_tree_add_boolean(tree, hf_isns_scn_bitmap_target_and_self_information_only, tvb, offset+8, 4, scn_bitmap);
997 proto_tree_add_boolean(tree, hf_isns_scn_bitmap_management_registration_scn, tvb, offset+8, 4, scn_bitmap);
998 proto_tree_add_boolean(tree, hf_isns_scn_bitmap_object_removed, tvb, offset+8, 4, scn_bitmap);
999 proto_tree_add_boolean(tree, hf_isns_scn_bitmap_object_added, tvb, offset+8, 4, scn_bitmap);
1000 proto_tree_add_boolean(tree, hf_isns_scn_bitmap_object_updated, tvb, offset+8, 4, scn_bitmap);
1001 proto_tree_add_boolean(tree, hf_isns_scn_bitmap_dd_dds_member_removed, tvb, offset+8, 4, scn_bitmap);
1002 proto_tree_add_boolean(tree, hf_isns_scn_bitmap_dd_dds_member_added, tvb, offset+8, 4, scn_bitmap);
1004 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
1005 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
1008 return offset+8+len;
1013 AddAttribute(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, guint offset,
1014 guint16 function_id)
1020 tag = tvb_get_ntohl(tvb, offset);
1022 /* Now the Length */
1023 len = tvb_get_ntohl(tvb, offset + 4);
1027 proto_tree_add_uint(tree, hf_isns_attr_tag, tvb, offset, 4, tag);
1028 proto_tree_add_uint(tree, hf_isns_attr_len, tvb, offset+4, 4, len);
1033 tvb_ensure_bytes_exist(tvb, offset, len+8);
1037 case ISNS_ATTR_TAG_DELIMITER:
1038 dissect_isns_attr_none(tvb, offset, tree, hf_isns_delimiter, tag, len);
1040 case ISNS_ATTR_TAG_ENTITY_IDENTIFIER:
1041 dissect_isns_attr_string(tvb, offset, tree, hf_isns_entity_identifier, tag, len);
1043 case ISNS_ATTR_TAG_ENTITY_PROTOCOL:
1044 if(len != 4) THROW(ReportedBoundsError);
1045 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_entity_protocol, tag, len, function_id);
1047 case ISNS_ATTR_TAG_MGMT_IP_ADDRESS:
1048 if(len != 16) THROW(ReportedBoundsError);
1049 dissect_isns_attr_ip_address(tvb, offset, tree, hf_isns_mgmt_ip_addr, tag, len);
1051 case ISNS_ATTR_TAG_TIMESTAMP:
1052 if(len != 8) THROW(ReportedBoundsError);
1053 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_timestamp, tag, len, function_id);
1055 case ISNS_ATTR_TAG_PROTOCOL_VERSION_RANGE:
1056 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1058 case ISNS_ATTR_TAG_REGISTRATION_PERIOD:
1059 if(len != 4) THROW(ReportedBoundsError);
1060 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_registration_period, tag, len, function_id);
1062 case ISNS_ATTR_TAG_ENTITY_INDEX:
1063 if(len != 4) THROW(ReportedBoundsError);
1064 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_entity_index, tag, len, function_id);
1066 case ISNS_ATTR_TAG_ENTITY_NEXT_INDEX:
1067 if(len != 4) THROW(ReportedBoundsError);
1068 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_entity_next_index, tag, len, function_id);
1070 case ISNS_ATTR_TAG_ENTITY_ISAKMP_PHASE_1:
1071 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1073 case ISNS_ATTR_TAG_ENTITY_CERTIFICATE:
1074 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1076 case ISNS_ATTR_TAG_PORTAL_IP_ADDRESS:
1079 proto_tree_add_text(tree, tvb, offset, -1, "Broken iSNS implementation. The PORTAL_IP_ADDRESS tag should be 16 bytes in length");
1081 dissect_isns_attr_ip_address(tvb, offset, tree, hf_isns_portal_ip_addr, tag, 16);
1084 THROW(ReportedBoundsError);
1087 case ISNS_ATTR_TAG_PORTAL_PORT:
1088 if(len != 4) THROW(ReportedBoundsError);
1089 dissect_isns_attr_port(tvb, offset, tree, hf_isns_portal_port, tag, len, ISNS_OTHER_PORT, pinfo);
1091 case ISNS_ATTR_TAG_PORTAL_SYMBOLIC_NAME:
1092 dissect_isns_attr_string(tvb, offset, tree, hf_isns_portal_symbolic_name, tag, len);
1094 case ISNS_ATTR_TAG_ESI_INTERVAL:
1095 if(len != 4) THROW(ReportedBoundsError);
1096 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_esi_interval, tag, len, function_id);
1098 case ISNS_ATTR_TAG_ESI_PORT:
1099 if(len != 4) THROW(ReportedBoundsError);
1100 dissect_isns_attr_port(tvb, offset, tree, hf_isns_esi_port, tag, len, ISNS_ESI_PORT, pinfo);
1102 case ISNS_ATTR_TAG_PORTAL_INDEX:
1103 if(len != 4) THROW(ReportedBoundsError);
1104 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_portal_index, tag, len, function_id);
1106 case ISNS_ATTR_TAG_SCN_PORT:
1107 if(len != 4) THROW(ReportedBoundsError);
1108 dissect_isns_attr_port(tvb, offset, tree, hf_isns_scn_port, tag, len, ISNS_SCN_PORT, pinfo);
1110 case ISNS_ATTR_TAG_PORTAL_NEXT_INDEX:
1111 if(len != 4) THROW(ReportedBoundsError);
1112 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_portal_next_index, tag, len, function_id);
1114 case ISNS_ATTR_TAG_PORTAL_SECURITY_BITMAP:
1115 if(len != 4) THROW(ReportedBoundsError);
1116 dissect_isns_attr_portal_security_bitmap(tvb, offset, tree, hf_isns_psb, tag, len);
1118 case ISNS_ATTR_TAG_PORTAL_ISAKMP_PHASE_1:
1119 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1121 case ISNS_ATTR_TAG_PORTAL_ISAKMP_PHASE_2:
1122 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1124 case ISNS_ATTR_TAG_PORTAL_CERTIFICATE:
1125 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1127 case ISNS_ATTR_TAG_ISCSI_NAME:
1128 dissect_isns_attr_string(tvb, offset, tree, hf_isns_iscsi_name, tag, len);
1130 case ISNS_ATTR_TAG_ISCSI_NODE_TYPE:
1131 if(len != 4) THROW(ReportedBoundsError);
1132 dissect_isns_attr_iscsi_node_type(tvb, offset, tree, hf_isns_iscsi_node_type, tag, len);
1134 case ISNS_ATTR_TAG_ISCSI_ALIAS:
1135 dissect_isns_attr_string(tvb, offset, tree, hf_isns_iscsi_alias, tag, len);
1137 case ISNS_ATTR_TAG_ISCSI_SCN_BITMAP:
1138 if(len != 4) THROW(ReportedBoundsError);
1139 dissect_isns_attr_scn_bitmap(tvb, offset, tree, hf_isns_scn_bitmap, tag, len);
1141 case ISNS_ATTR_TAG_ISCSI_NODE_INDEX:
1142 if(len != 4) THROW(ReportedBoundsError);
1143 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_node_index, tag, len, function_id);
1145 case ISNS_ATTR_TAG_WWNN_TOKEN:
1146 if(len != 8) THROW(ReportedBoundsError);
1147 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_wwnn_token, tag, len, function_id);
1149 case ISNS_ATTR_TAG_ISCSI_NODE_NEXT_INDEX:
1150 if(len != 4) THROW(ReportedBoundsError);
1151 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_node_next_index, tag, len, function_id);
1153 case ISNS_ATTR_TAG_ISCSI_AUTH_METHOD:
1154 dissect_isns_attr_string(tvb, offset, tree, hf_isns_iscsi_auth_method, tag, len);
1156 case ISNS_ATTR_TAG_PG_ISCSI_NAME:
1157 dissect_isns_attr_string(tvb, offset, tree, hf_isns_pg_iscsi_name, tag, len);
1159 case ISNS_ATTR_TAG_PG_PORTAL_IP_ADDR:
1162 proto_tree_add_text(tree, tvb, offset, -1, "Broken iSNS implementation. The PG_PORTAL_IP_ADDRESS tag should be 16 bytes in length");
1164 dissect_isns_attr_ip_address(tvb, offset, tree, hf_isns_pg_portal_ip_addr, tag, 16);
1167 THROW(ReportedBoundsError);
1170 case ISNS_ATTR_TAG_PG_PORTAL_PORT:
1171 if(len != 4) THROW(ReportedBoundsError);
1172 dissect_isns_attr_port(tvb, offset, tree, hf_isns_pg_portal_port, tag, len, ISNS_OTHER_PORT, pinfo);
1174 case ISNS_ATTR_TAG_PORTAL_GROUP_TAG:
1175 if(len != 4) THROW(ReportedBoundsError);
1176 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_portal_group_tag, tag, len, function_id);
1178 case ISNS_ATTR_TAG_PORTAL_GROUP_INDEX:
1179 if(len != 4) THROW(ReportedBoundsError);
1180 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_pg_index, tag, len, function_id);
1182 case ISNS_ATTR_TAG_PORTAL_GROUP_NEXT_INDEX:
1183 if(len != 4) THROW(ReportedBoundsError);
1184 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_pg_next_index, tag, len, function_id);
1186 case ISNS_ATTR_TAG_FC_PORT_NAME_WWPN:
1187 if(len != 8) THROW(ReportedBoundsError);
1188 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_fc_port_name_wwpn, tag, len, function_id);
1190 case ISNS_ATTR_TAG_PORT_ID:
1191 if(len != 3) THROW(ReportedBoundsError);
1192 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_port_id, tag, len, function_id);
1194 case ISNS_ATTR_TAG_FC_PORT_TYPE:
1195 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1198 0x0000 Unidentified/Null Entry
1199 0x0001 Fibre Channel N_Port
1200 0x0002 Fibre Channel NL_Port
1201 0x0003 Fibre Channel F/NL_Port
1202 0x0081 Fibre Channel F_Port
1203 0x0082 Fibre Channel FL_Port
1204 0x0084 Fibre Channel E_Port
1207 case ISNS_ATTR_TAG_SYMBOLIC_PORT_NAME:
1208 dissect_isns_attr_string(tvb, offset, tree, hf_isns_symbolic_port_name, tag, len);
1210 case ISNS_ATTR_TAG_FABRIC_PORT_NAME:
1211 if(len != 8) THROW(ReportedBoundsError);
1212 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_fabric_port_name, tag, len, function_id);
1214 case ISNS_ATTR_TAG_HARD_ADDRESS:
1215 if(len != 3) THROW(ReportedBoundsError);
1216 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_hard_address, tag, len, function_id);
1218 case ISNS_ATTR_TAG_PORT_IP_ADDRESS:
1219 if(len != 16) THROW(ReportedBoundsError);
1220 dissect_isns_attr_ip_address(tvb, offset, tree, hf_isns_port_ip_addr, tag, len);
1222 case ISNS_ATTR_TAG_CLASS_OF_SERVICE:
1223 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1226 bit 29 Fibre Channel Class 2 Supported
1227 bit 28 Fibre Channel Class 3 Supported
1229 case ISNS_ATTR_TAG_FC4_TYPES:
1230 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1232 case ISNS_ATTR_TAG_FC4_DESCRIPTOR:
1233 dissect_isns_attr_string(tvb, offset, tree, hf_isns_fc4_descriptor, tag, len);
1235 case ISNS_ATTR_TAG_FC4_FEATURES:
1236 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1238 case ISNS_ATTR_TAG_IFCP_SCN_BITMAP:
1239 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1242 bit 24 INITIATOR AND SELF INFORMATION ONLY
1243 bit 25 TARGET AND SELF INFORMATION ONLY
1244 bit 26 MANAGEMENT REGISTRATION/SCN
1245 bit 27 OBJECT REMOVED
1247 bit 29 OBJECT UPDATED
1248 bit 30 DD/DDS MEMBER REMOVED (Mgmt Reg/SCN only)
1249 bit 31 (Lsb) DD/DDS MEMBER ADDED (Mgmt Reg/SCN only)
1251 case ISNS_ATTR_TAG_PORT_ROLE:
1252 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1256 bit 30 FCP Initiator
1257 bit 31 (Lsb) FCP Target
1259 case ISNS_ATTR_TAG_PERMANENT_PORT_NAME:
1260 if(len != 8) THROW(ReportedBoundsError);
1261 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_permanent_port_name, tag, len, function_id);
1263 case ISNS_ATTR_TAG_FC4_TYPE_CODE:
1264 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1266 /* 8bit type code in byte0 */
1267 case ISNS_ATTR_TAG_FC_NODE_NAME_WWNN:
1268 if(len != 8) THROW(ReportedBoundsError);
1269 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_fc_node_name_wwnn, tag, len, function_id);
1271 case ISNS_ATTR_TAG_SYMBOLIC_NODE_NAME:
1272 dissect_isns_attr_string(tvb, offset, tree, hf_isns_symbolic_node_name, tag, len);
1274 case ISNS_ATTR_TAG_NODE_IP_ADDRESS:
1275 if(len != 16) THROW(ReportedBoundsError);
1276 dissect_isns_attr_ip_address(tvb, offset, tree, hf_isns_node_ip_addr, tag, len);
1278 case ISNS_ATTR_TAG_NODE_IPA:
1279 if(len != 8) THROW(ReportedBoundsError);
1280 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_node_ipa, tag, len, function_id);
1282 case ISNS_ATTR_TAG_PROXY_ISCSI_NAME:
1283 dissect_isns_attr_string(tvb, offset, tree, hf_isns_proxy_iscsi_name, tag, len);
1285 case ISNS_ATTR_TAG_SWITCH_NAME:
1286 if(len != 8) THROW(ReportedBoundsError);
1287 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_switch_name, tag, len, function_id);
1289 case ISNS_ATTR_TAG_PREFERRED_ID:
1290 if(len != 4) THROW(ReportedBoundsError);
1291 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_preferred_id, tag, len, function_id);
1293 case ISNS_ATTR_TAG_ASSIGNED_ID:
1294 if(len != 4) THROW(ReportedBoundsError);
1295 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_assigned_id, tag, len, function_id);
1297 case ISNS_ATTR_TAG_VIRTUAL_FABRIC_ID:
1298 dissect_isns_attr_string(tvb, offset, tree, hf_isns_virtual_fabric_id, tag, len);
1300 case ISNS_ATTR_TAG_VENDOR_OUI:
1301 if(len != 4) THROW(ReportedBoundsError);
1302 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_vendor_oui, tag, len, function_id);
1304 case ISNS_ATTR_TAG_DD_SET_ID:
1305 if(len != 4) THROW(ReportedBoundsError);
1306 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_dd_set_id, tag, len, function_id);
1308 case ISNS_ATTR_TAG_DD_SET_SYMBOLIC_NAME:
1309 dissect_isns_attr_string(tvb, offset, tree, hf_isns_dd_set_symbolic_name, tag, len);
1311 case ISNS_ATTR_TAG_DD_SET_STATUS:
1312 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1314 case ISNS_ATTR_TAG_DD_SET_NEXT_ID:
1315 if(len != 4) THROW(ReportedBoundsError);
1316 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_dd_set_next_id, tag, len, function_id);
1318 case ISNS_ATTR_TAG_DD_ID:
1319 if(len != 4) THROW(ReportedBoundsError);
1320 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_dd_id, tag, len, function_id);
1322 case ISNS_ATTR_TAG_DD_SYMBOLIC_NAME:
1323 dissect_isns_attr_string(tvb, offset, tree, hf_isns_dd_symbolic_name, tag, len);
1325 case ISNS_ATTR_TAG_DD_MEMBER_ISCSI_INDEX:
1326 if(len != 4) THROW(ReportedBoundsError);
1327 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_member_iscsi_index, tag, len, function_id);
1329 case ISNS_ATTR_TAG_DD_MEMBER_ISCSI_NAME:
1330 dissect_isns_attr_string(tvb, offset, tree, hf_isns_dd_member_iscsi_name, tag, len);
1332 case ISNS_ATTR_TAG_DD_MEMBER_FC_PORT_NAME:
1333 if(len != 4) THROW(ReportedBoundsError);
1334 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_member_fc_port_name, tag, len, function_id);
1336 case ISNS_ATTR_TAG_DD_MEMBER_PORTAL_INDEX:
1337 if(len != 4) THROW(ReportedBoundsError);
1338 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_member_portal_index, tag, len, function_id);
1340 case ISNS_ATTR_TAG_DD_MEMBER_PORTAL_IP_ADDRESS:
1341 if(len != 16) THROW(ReportedBoundsError);
1342 dissect_isns_attr_ip_address(tvb, offset, tree, hf_isns_dd_member_portal_ip_addr, tag, len);
1344 case ISNS_ATTR_TAG_DD_MEMBER_PORTAL_PORT:
1345 if(len != 4) THROW(ReportedBoundsError);
1346 dissect_isns_attr_port(tvb, offset, tree, hf_isns_dd_member_portal_port,
1347 tag, len, ISNS_OTHER_PORT, pinfo);
1349 case ISNS_ATTR_TAG_DD_FEATURES:
1350 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1352 case ISNS_ATTR_TAG_DD_ID_NEXT_ID:
1353 if(len != 4) THROW(ReportedBoundsError);
1354 dissect_isns_attr_integer(tvb, offset, tree, hf_isns_dd_id_next_id, tag, len, function_id);
1357 dissect_isns_attr_not_decoded_yet(tvb, offset, tree, hf_isns_not_decoded_yet, tag, len);
1361 /* move on the offset to next attribute */
1363 return offset+len+8;
1368 /* Register the protocol with Wireshark */
1370 void proto_register_isns(void)
1372 /* Setup list of header fields See Section 1.6.1 for details*/
1373 static hf_register_info hf[] = {
1374 /* The Header Stuff */
1376 { "iSNSP Version", "isns.PVer",
1377 FT_UINT16, BASE_DEC, NULL, 0,
1380 { &hf_isns_function_id,
1381 { "Function ID", "isns.functionid",
1382 FT_UINT16, BASE_DEC|BASE_EXT_STRING, &isns_function_ids_ext, 0,
1385 { &hf_isns_pdu_length,
1386 { "PDU Length", "isns.pdulength",
1387 FT_UINT16, BASE_DEC, NULL, 0,
1392 { "Flags", "isns.flags",
1393 FT_UINT16, BASE_HEX, NULL, 0,
1397 { "Client", "isns.flags.client",
1398 FT_BOOLEAN, 16, TFS(&tfs_isns_flag_client), ISNS_FLAGS_CLIENT,
1402 { "Server", "isns.flags.server",
1403 FT_BOOLEAN, 16, TFS(&tfs_isns_flag_server), ISNS_FLAGS_SERVER,
1407 { "Auth", "isns.flags.authentication_block",
1408 FT_BOOLEAN, 16, TFS(&tfs_isns_flag_auth), ISNS_FLAGS_AUTH,
1409 "is iSNS Authentication Block present?", HFILL}
1412 { "Replace", "isns.flags.replace",
1413 FT_BOOLEAN, 16, TFS(&tfs_isns_flag_replace), ISNS_FLAGS_REPLACE,
1416 { &hf_isns_last_pdu,
1417 { "Last PDU", "isns.flags.lastpdu",
1418 FT_BOOLEAN, 16, TFS(&tfs_isns_flag_last_pdu), ISNS_FLAGS_LAST_PDU,
1421 { &hf_isns_first_pdu,
1422 { "First PDU", "isns.flags.firstpdu",
1423 FT_BOOLEAN, 16, TFS(&tfs_isns_flag_first_pdu), ISNS_FLAGS_FIRST_PDU,
1428 { &hf_isns_transaction_id,
1429 { "Transaction ID", "isns.transactionid",
1430 FT_UINT16, BASE_DEC, NULL, 0,
1433 { &hf_isns_sequence_id,
1434 { "Sequence ID", "isns.sequenceid",
1435 FT_UINT16, BASE_DEC, NULL, 0,
1439 { &hf_isns_entity_protocol,
1440 { "Entity Protocol", "isns.entity_protocol",
1441 FT_UINT32, BASE_DEC, VALS(isns_entity_protocol), 0,
1444 /* The Payload stuff */
1446 { &hf_isns_dd_member_portal_port,
1447 { "DD Member Portal Port", "isns.dd_member_portal_port",
1448 FT_UINT32, BASE_DEC, NULL, 0,
1449 "TCP/UDP DD Member Portal Port", HFILL }
1452 { &hf_isns_iscsi_node_type,
1453 { "iSCSI Node Type", "isns.iscsi.node_type",
1454 FT_UINT32, BASE_HEX, NULL, 0,
1458 { &hf_isns_esi_port,
1459 { "ESI Port", "isns.esi_port",
1460 FT_UINT32, BASE_DEC, NULL, 0,
1461 "TCP/UDP ESI Port", HFILL }
1464 { &hf_isns_scn_port,
1465 { "SCN Port", "isns.scn_port",
1466 FT_UINT32, BASE_DEC, NULL, 0,
1467 "TCP/UDP SCN Port", HFILL }
1470 { &hf_isns_portal_port,
1471 { "Portal Port", "isns.portal_port",
1472 FT_UINT32, BASE_DEC, NULL, 0,
1473 "TCP/UDP Portal Port", HFILL }
1476 { &hf_isns_pg_portal_port,
1477 { "PG Portal Port", "isns.pg.portal_port",
1478 FT_UINT32, BASE_DEC, NULL, 0,
1479 "PG Portal TCP/UDP Port", HFILL }
1482 { &hf_isns_port_type,
1483 { "Port Type", "isns.port.port_type",
1484 FT_BOOLEAN, 16, TFS(&tfs_isns_port_type), 0x01, /* bit 15 (or bit 1 of a 16bit word) */
1489 { "Portal Security Bitmap", "isns.psb",
1490 FT_UINT32, BASE_HEX, NULL, 0,
1493 { &hf_isns_psb_tunnel_mode,
1494 { "Tunnel Mode", "isns.psb.tunnel",
1495 FT_BOOLEAN, 32, TFS(&tfs_isns_psb_tunnel_mode), 0x0040, /* bit 25 */
1496 "Tunnel Mode Preferred", HFILL }
1498 { &hf_isns_psb_transport_mode,
1499 { "Transport Mode", "isns.psb.transport",
1500 FT_BOOLEAN, 32, TFS(&tfs_isns_psb_transport_mode), 0x0020, /* bit 26 */
1504 { "PFS", "isns.psb.pfs",
1505 FT_BOOLEAN, 32, TFS(&tfs_isns_psb_pfs), 0x0010, /* bit 27 */
1508 { &hf_isns_psb_aggressive_mode,
1509 { "Aggressive Mode", "isns.psb.aggressive_mode",
1510 FT_BOOLEAN, 32, TFS(&tfs_isns_psb_aggressive_mode), 0x0008, /* bit 28 */
1513 { &hf_isns_psb_main_mode,
1514 { "Main Mode", "isns.psb.main_mode",
1515 FT_BOOLEAN, 32, TFS(&tfs_isns_psb_main_mode), 0x0004, /* bit 29 */
1518 { &hf_isns_psb_ike_ipsec,
1519 { "IKE/IPSec", "isns.psb.ike_ipsec",
1520 FT_BOOLEAN, 32, TFS(&tfs_isns_psb_ike_ipsec), 0x0002, /* bit 30 */
1523 { &hf_isns_psb_bitmap,
1524 { "Bitmap", "isns.psb.bitmap",
1525 FT_BOOLEAN, 32, TFS(&tfs_isns_psb_bitmap), 0x0001, /* bit 31 */
1531 { &hf_isns_scn_bitmap,
1532 { "iSCSI SCN Bitmap", "isns.scn_bitmap",
1533 FT_UINT32, BASE_HEX, NULL, 0,
1536 { &hf_isns_scn_bitmap_initiator_and_self_information_only,
1537 { "Initiator And Self Information Only", "isns.scn_bitmap.initiator_and_self_information_only",
1538 FT_BOOLEAN, 32, TFS(&tfs_isns_scn_bitmap_initiator_and_self_information_only), 0x0080, /* bit 24 */
1541 { &hf_isns_scn_bitmap_target_and_self_information_only,
1542 { "Target And Self Information Only", "isns.scn_bitmap.target_and_self_information_only",
1543 FT_BOOLEAN, 32, TFS(&tfs_isns_scn_bitmap_target_and_self_information_only), 0x0040, /* bit 25 */
1546 { &hf_isns_scn_bitmap_management_registration_scn,
1547 { "Management Registration/SCN", "isns.scn_bitmap.management_registration_scn",
1548 FT_BOOLEAN, 32, TFS(&tfs_isns_scn_bitmap_management_registration_scn), 0x0020, /* bit 26 */
1551 { &hf_isns_scn_bitmap_object_removed,
1552 { "Object Removed", "isns.scn_bitmap.object_removed",
1553 FT_BOOLEAN, 32, TFS(&tfs_isns_scn_bitmap_object_removed), 0x0010, /* bit 27 */
1556 { &hf_isns_scn_bitmap_object_added,
1557 { "Object Added", "isns.scn_bitmap.object_added",
1558 FT_BOOLEAN, 32, TFS(&tfs_isns_scn_bitmap_object_added), 0x0008, /* bit 28 */
1561 { &hf_isns_scn_bitmap_object_updated,
1562 { "Object Updated", "isns.scn_bitmap.object_updated",
1563 FT_BOOLEAN, 32, TFS(&tfs_isns_scn_bitmap_object_updated), 0x0004, /* bit 29 */
1566 { &hf_isns_scn_bitmap_dd_dds_member_removed,
1567 { "DD/DDS Member Removed (Mgmt Reg/SCN only)", "isns.scn_bitmap.dd_dds_member_removed",
1568 FT_BOOLEAN, 32, TFS(&tfs_isns_scn_bitmap_dd_dds_member_removed), 0x0002, /* bit 30 */
1571 { &hf_isns_scn_bitmap_dd_dds_member_added,
1572 { "DD/DDS Member Added (Mgmt Reg/SCN only)", "isns.scn_bitmap.dd_dds_member_added",
1573 FT_BOOLEAN, 32, TFS(&tfs_isns_scn_bitmap_dd_dds_member_added), 0x0001, /* bit 31 */
1578 { &hf_isns_isnt_control,
1579 { "Control", "isns.isnt.control",
1580 FT_BOOLEAN, 32, TFS(&tfs_isns_isnt_control), 0x0004, /* bit 29 */
1583 { &hf_isns_isnt_initiator,
1584 { "Initiator", "isns.isnt.initiator",
1585 FT_BOOLEAN, 32, TFS(&tfs_isns_isnt_initiator), 0x0002, /* bit 30 */
1588 { &hf_isns_isnt_target,
1589 { "Target", "isns.isnt.target",
1590 FT_BOOLEAN, 32, TFS(&tfs_isns_isnt_target), 0x0001, /* bit 31 */
1595 { &hf_isns_resp_errorcode,
1596 { "ErrorCode", "isns.errorcode",
1597 FT_UINT32, BASE_DEC|BASE_EXT_STRING, &isns_errorcode_ext, 0,
1598 "iSNS Response Error Code", HFILL}
1601 { &hf_isns_attr_tag,
1602 { "Attribute Tag", "isns.attr.tag",
1603 FT_UINT32, BASE_DEC|BASE_EXT_STRING, &isns_attribute_tags_ext, 0,
1607 { &hf_isns_attr_len,
1608 { "Attribute Length", "isns.attr.len",
1609 FT_UINT32, BASE_DEC, NULL, 0,
1613 { &hf_isns_delimiter,
1614 { "Delimiter", "isns.delimiter",
1615 FT_NONE, BASE_NONE, NULL,0,
1619 { &hf_isns_not_decoded_yet,
1620 { "Not Decoded Yet", "isns.not_decoded_yet",
1621 FT_NONE, BASE_NONE, NULL, 0,
1622 "This tag is not yet decoded by Wireshark", HFILL}
1625 { &hf_isns_heartbeat_ipv6_addr,
1626 { "Heartbeat Address (ipv6)", "isns.heartbeat.address",
1627 FT_IPv6, BASE_NONE, NULL, 0x0,
1628 "Server IPv6 Address", HFILL }},
1630 { &hf_isns_heartbeat_tcp_port,
1631 { "Heartbeat TCP Port", "isns.heartbeat.tcpport",
1632 FT_UINT16, BASE_DEC, NULL, 0x0,
1633 "Server TCP Port", HFILL }},
1635 { &hf_isns_heartbeat_udp_port,
1636 { "Heartbeat UDP Port", "isns.heartbeat.udpport",
1637 FT_UINT16, BASE_DEC, NULL, 0x0,
1638 "Server UDP Port", HFILL }},
1641 { &hf_isns_heartbeat_interval,
1642 { "Heartbeat Interval (secs)", "isns.heartbeat.interval",
1643 FT_UINT32, BASE_DEC, NULL, 0x0,
1644 "Server Heartbeat interval", HFILL }},
1646 { &hf_isns_heartbeat_counter,
1647 { "Heartbeat counter", "isns.heartbeat.counter",
1648 FT_UINT32, BASE_DEC, NULL, 0x0,
1649 "Server Heartbeat Counter", HFILL }},
1651 { &hf_isns_iscsi_name,
1652 { "iSCSI Name", "isns.iscsi_name",
1653 FT_STRING, BASE_NONE, NULL, 0x0,
1654 "iSCSI Name of device", HFILL }},
1656 { &hf_isns_dd_member_iscsi_name,
1657 { "DD Member iSCSI Name", "isns.dd_member.iscsi_name",
1658 FT_STRING, BASE_NONE, NULL, 0x0,
1659 "DD Member iSCSI Name of device", HFILL }},
1661 { &hf_isns_virtual_fabric_id,
1662 { "Virtual Fabric ID", "isns.virtual_fabric_id",
1663 FT_STRING, BASE_NONE, NULL, 0x0,
1666 { &hf_isns_proxy_iscsi_name,
1667 { "Proxy iSCSI Name", "isns.proxy_iscsi_name",
1668 FT_STRING, BASE_NONE, NULL, 0x0,
1671 { &hf_isns_fc4_descriptor,
1672 { "FC4 Descriptor", "isns.fc4_descriptor",
1673 FT_STRING, BASE_NONE, NULL, 0x0,
1674 "FC4 Descriptor of this device", HFILL }},
1676 { &hf_isns_iscsi_auth_method,
1677 { "iSCSI Auth Method", "isns.iscsi_auth_method",
1678 FT_STRING, BASE_NONE, NULL, 0x0,
1679 "Authentication Method required by this device", HFILL }},
1681 { &hf_isns_iscsi_alias,
1682 { "iSCSI Alias", "isns.iscsi_alias",
1683 FT_STRING, BASE_NONE, NULL, 0x0,
1684 "iSCSI Alias of device", HFILL }},
1686 { &hf_isns_portal_symbolic_name,
1687 { "Portal Symbolic Name", "isns.portal.symbolic_name",
1688 FT_STRING, BASE_NONE, NULL, 0x0,
1689 "Symbolic name of this portal", HFILL }},
1691 { &hf_isns_dd_set_symbolic_name,
1692 { "DD Set Symbolic Name", "isns.dd_set.symbolic_name",
1693 FT_STRING, BASE_NONE, NULL, 0x0,
1694 "Symbolic name of this DD Set", HFILL }},
1696 { &hf_isns_dd_symbolic_name,
1697 { "DD Symbolic Name", "isns.dd.symbolic_name",
1698 FT_STRING, BASE_NONE, NULL, 0x0,
1699 "Symbolic name of this DD", HFILL }},
1701 { &hf_isns_symbolic_port_name,
1702 { "Symbolic Port Name", "isns.port.symbolic_name",
1703 FT_STRING, BASE_NONE, NULL, 0x0,
1704 "Symbolic name of this port", HFILL }},
1706 { &hf_isns_symbolic_node_name,
1707 { "Symbolic Node Name", "isns.node.symbolic_name",
1708 FT_STRING, BASE_NONE, NULL, 0x0,
1709 "Symbolic name of this node", HFILL }},
1711 { &hf_isns_entity_identifier,
1712 { "Entity Identifier", "isns.entity_identifier",
1713 FT_STRING, BASE_NONE, NULL, 0x0,
1714 "Entity Identifier of this object", HFILL }},
1716 { &hf_isns_mgmt_ip_addr,
1717 { "Management IP Address", "isns.mgmt.ip_address",
1718 FT_IPv6, BASE_NONE, NULL, 0x0,
1719 "Management IPv4/IPv6 Address", HFILL }},
1721 { &hf_isns_node_ip_addr,
1722 { "Node IP Address", "isns.node.ip_address",
1723 FT_IPv6, BASE_NONE, NULL, 0x0,
1724 "Node IPv4/IPv6 Address", HFILL }},
1726 { &hf_isns_port_ip_addr,
1727 { "Port IP Address", "isns.port.ip_address",
1728 FT_IPv6, BASE_NONE, NULL, 0x0,
1729 "Port IPv4/IPv6 Address", HFILL }},
1731 { &hf_isns_portal_ip_addr,
1732 { "Portal IP Address", "isns.portal.ip_address",
1733 FT_IPv6, BASE_NONE, NULL, 0x0,
1734 "Portal IPv4/IPv6 Address", HFILL }},
1736 { &hf_isns_dd_member_portal_ip_addr,
1737 { "DD Member Portal IP Address", "isns.dd.member_portal.ip_address",
1738 FT_IPv6, BASE_NONE, NULL, 0x0,
1739 "DD Member Portal IPv4/IPv6 Address", HFILL }},
1741 { &hf_isns_pg_iscsi_name,
1742 { "PG iSCSI Name", "isns.pg_iscsi_name",
1743 FT_STRING, BASE_NONE, NULL, 0x0,
1746 { &hf_isns_pg_portal_ip_addr,
1747 { "PG Portal IP Address", "isns.pg_portal.ip_address",
1748 FT_IPv6, BASE_NONE, NULL, 0x0,
1749 "PG Portal IPv4/IPv6 Address", HFILL }},
1751 { &hf_isns_pg_index,
1752 { "PG Index", "isns.pg_index",
1753 FT_UINT32, BASE_DEC, NULL, 0x0,
1756 { &hf_isns_pg_next_index,
1757 { "PG Next Index", "isns.pg_next_index",
1758 FT_UINT32, BASE_DEC, NULL, 0x0,
1761 { &hf_isns_dd_id_next_id,
1762 { "DD ID Next ID", "isns.dd_id_next_id",
1763 FT_UINT32, BASE_DEC, NULL, 0x0,
1766 { &hf_isns_member_iscsi_index,
1767 { "Member iSCSI Index", "isns.member_iscsi_index",
1768 FT_UINT32, BASE_DEC, NULL, 0x0,
1771 { &hf_isns_member_portal_index,
1772 { "Member Portal Index", "isns.member_portal_index",
1773 FT_UINT32, BASE_DEC, NULL, 0x0,
1776 { &hf_isns_member_fc_port_name,
1777 { "Member FC Port Name", "isns.member_fc_port_name",
1778 FT_UINT32, BASE_DEC, NULL, 0x0,
1781 { &hf_isns_vendor_oui,
1782 { "Vendor OUI", "isns.vendor_oui",
1783 FT_UINT32, BASE_DEC, NULL, 0x0,
1786 { &hf_isns_preferred_id,
1787 { "Preferred ID", "isns.preferred_id",
1788 FT_UINT32, BASE_DEC, NULL, 0x0,
1791 { &hf_isns_dd_set_id,
1792 { "DD Set ID", "isns.dd_set_id",
1793 FT_UINT32, BASE_DEC, NULL, 0x0,
1797 { "DD ID", "isns.dd_id",
1798 FT_UINT32, BASE_DEC, NULL, 0x0,
1802 { "Port ID", "isns.port_id",
1803 FT_UINT24, BASE_HEX, NULL, 0x0,
1806 { &hf_isns_hard_address,
1807 { "Hard Address", "isns.hard_address",
1808 FT_UINT24, BASE_HEX, NULL, 0x0,
1811 { &hf_isns_wwnn_token,
1812 { "WWNN Token", "isns.wwnn_token",
1813 FT_UINT64, BASE_HEX, NULL, 0x0,
1816 { &hf_isns_fc_port_name_wwpn,
1817 { "FC Port Name WWPN", "isns.fc_port_name_wwpn",
1818 FT_UINT64, BASE_HEX, NULL, 0x0,
1821 { &hf_isns_fc_node_name_wwnn,
1822 { "FC Node Name WWNN", "isns.fc_node_name_wwnn",
1823 FT_UINT64, BASE_HEX, NULL, 0x0,
1826 { &hf_isns_node_ipa,
1827 { "Node IPA", "isns.node_ipa",
1828 FT_UINT64, BASE_HEX, NULL, 0x0,
1831 { &hf_isns_fabric_port_name,
1832 { "Fabric Port Name", "isns.fabric_port_name",
1833 FT_UINT64, BASE_HEX, NULL, 0x0,
1836 { &hf_isns_permanent_port_name,
1837 { "Permanent Port Name", "isns.permanent_port_name",
1838 FT_UINT64, BASE_HEX, NULL, 0x0,
1841 { &hf_isns_switch_name,
1842 { "Switch Name", "isns.switch_name",
1843 FT_UINT64, BASE_HEX, NULL, 0x0,
1846 { &hf_isns_dd_set_next_id,
1847 { "DD Set Next ID", "isns.dd_set_next_id",
1848 FT_UINT32, BASE_DEC, NULL, 0x0,
1851 { &hf_isns_assigned_id,
1852 { "Assigned ID", "isns.assigned_id",
1853 FT_UINT32, BASE_DEC, NULL, 0x0,
1856 { &hf_isns_node_index,
1857 { "Node Index", "isns.node.index",
1858 FT_UINT32, BASE_DEC, NULL, 0x0,
1861 { &hf_isns_node_next_index,
1862 { "Node Next Index", "isns.node.next_index",
1863 FT_UINT32, BASE_DEC, NULL, 0x0,
1864 "Node INext index", HFILL }},
1866 { &hf_isns_portal_index,
1867 { "Portal Index", "isns.portal.index",
1868 FT_UINT32, BASE_DEC, NULL, 0x0,
1871 { &hf_isns_portal_next_index,
1872 { "Portal Next Index", "isns.portal.next_index",
1873 FT_UINT32, BASE_DEC, NULL, 0x0,
1876 { &hf_isns_entity_index,
1877 { "Entity Index", "isns.entity.index",
1878 FT_UINT32, BASE_DEC, NULL, 0x0,
1881 { &hf_isns_entity_next_index,
1882 { "Entity Next Index", "isns.entity.next_index",
1883 FT_UINT32, BASE_DEC, NULL, 0x0,
1884 "Next Entity Index", HFILL }},
1886 { &hf_isns_timestamp,
1887 { "Timestamp", "isns.timestamp",
1888 FT_UINT64, BASE_DEC, NULL, 0x0,
1889 "Timestamp in Seconds", HFILL }},
1891 { &hf_isns_esi_interval,
1892 { "ESI Interval", "isns.esi_interval",
1893 FT_UINT32, BASE_DEC, NULL, 0x0,
1894 "ESI Interval in Seconds", HFILL }},
1896 { &hf_isns_registration_period,
1897 { "Registration Period", "isns.registration_period",
1898 FT_UINT32, BASE_DEC, NULL, 0x0,
1899 "Registration Period in Seconds", HFILL }},
1901 { &hf_isns_portal_group_tag,
1902 { "PG Tag", "isns.portal_group_tag",
1903 FT_UINT32, BASE_DEC, NULL, 0x0,
1904 "Portal Group Tag", HFILL }},
1907 { "Payload", "isns.payload",
1908 FT_BYTES, BASE_NONE, NULL, 0,
1913 /* Setup protocol subtree array */
1914 static gint *ett[] = {
1918 &ett_isns_attribute,
1922 module_t *isns_module;
1924 /* Register the protocol name and description */
1925 proto_isns = proto_register_protocol("iSNS",
1927 proto_register_field_array(proto_isns, hf, array_length(hf));
1928 proto_register_subtree_array(ett, array_length(ett));
1930 /* Register preferences */
1931 isns_module = prefs_register_protocol(proto_isns, NULL);
1932 prefs_register_bool_preference(isns_module, "desegment",
1933 "Reassemble iSNS messages spanning multiple TCP segments",
1934 "Whether the iSNS dissector should reassemble messages spanning multiple TCP segments."
1935 " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
1940 proto_reg_handoff_isns(void)
1942 isns_tcp_handle = new_create_dissector_handle(dissect_isns_tcp,proto_isns);
1943 isns_udp_handle = new_create_dissector_handle(dissect_isns_udp,proto_isns);
1945 dissector_add_uint("tcp.port",ISNS_TCP_PORT,isns_tcp_handle);
1946 dissector_add_uint("udp.port",ISNS_UDP_PORT,isns_udp_handle);