aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2011-11-09 02:48:51 +0000
committerBill Meier <wmeier@newsguy.com>2011-11-09 02:48:51 +0000
commita25e421a101a8ae1f8deab2aa6dd34389b0fda30 (patch)
treee6dceebce328dfd99b50a6c4b73f9dc018fc1e59 /epan/dissectors
parent9799f948615d27065d69b7716efa4fd9dc5e4b9b (diff)
Fix some [-Wunused-but-set-variable] warnings
(in some cases by changing proto_tree_add_item() to use what appears to be the correct 'tree' arg); Do whitespace cleanup. svn path=/trunk/; revision=39772
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-dtn.c890
-rw-r--r--epan/dissectors/packet-gtpv2.c74
-rw-r--r--epan/dissectors/packet-iscsi.c4212
-rw-r--r--epan/dissectors/packet-vxlan.c224
4 files changed, 2699 insertions, 2701 deletions
diff --git a/epan/dissectors/packet-dtn.c b/epan/dissectors/packet-dtn.c
index a5400fb2a1..2152e673e7 100644
--- a/epan/dissectors/packet-dtn.c
+++ b/epan/dissectors/packet-dtn.c
@@ -1769,7 +1769,7 @@ dissect_admin_record(proto_tree *primary_tree, tvbuff_t *tvb, int offset)
}
else {
proto_item_set_text(timestamp_sequence_item,
- "Timestamp Sequence Number: %d", timestamp_sequence);
+ "Timestamp Sequence Number: %d", timestamp_sequence);
}
offset += sdnv_length; record_size += sdnv_length;
@@ -1953,7 +1953,7 @@ display_metadata_block(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean *la
int control_flags;
proto_tree *block_flag_tree = NULL;
int num_eid_ref = 0;
- int i = 0, ref_scheme = 0, ref_ssp = 0;
+ int i = 0;
type = tvb_get_guint8(tvb, offset);
header_start = offset; /*Used to compute total payload length*/
@@ -1976,32 +1976,32 @@ display_metadata_block(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean *la
block_flag_tree = proto_item_add_subtree(block_item, ett_block_flags);
proto_tree_add_boolean(block_flag_tree, hf_block_control_replicate,
- tvb, offset, sdnv_length, control_flags);
+ tvb, offset, sdnv_length, control_flags);
proto_tree_add_boolean(block_flag_tree, hf_block_control_transmit_status,
- tvb, offset, sdnv_length, control_flags);
+ tvb, offset, sdnv_length, control_flags);
proto_tree_add_boolean(block_flag_tree, hf_block_control_delete_bundle,
- tvb, offset, sdnv_length, control_flags);
+ tvb, offset, sdnv_length, control_flags);
proto_tree_add_boolean(block_flag_tree, hf_block_control_last_block,
- tvb, offset, sdnv_length, control_flags);
+ tvb, offset, sdnv_length, control_flags);
proto_tree_add_boolean(block_flag_tree, hf_block_control_discard_block,
- tvb, offset, sdnv_length, control_flags);
+ tvb, offset, sdnv_length, control_flags);
proto_tree_add_boolean(block_flag_tree, hf_block_control_not_processed,
- tvb, offset, sdnv_length, control_flags);
+ tvb, offset, sdnv_length, control_flags);
proto_tree_add_boolean(block_flag_tree, hf_block_control_eid_reference,
- tvb, offset, sdnv_length, control_flags);
+ tvb, offset, sdnv_length, control_flags);
if (control_flags & BLOCK_CONTROL_EID_REFERENCE) {
- num_eid_ref = evaluate_sdnv(tvb, header_start + offset, &sdnv_length);
- offset += sdnv_length;
+ num_eid_ref = evaluate_sdnv(tvb, header_start + offset, &sdnv_length);
+ offset += sdnv_length;
- for (i = 0; i < num_eid_ref; i++)
- {
- ref_scheme = evaluate_sdnv(tvb, header_start + offset, &sdnv_length);
- offset += sdnv_length;
+ for (i = 0; i < num_eid_ref; i++)
+ {
+ evaluate_sdnv(tvb, header_start + offset, &sdnv_length);
+ offset += sdnv_length;
- ref_ssp = evaluate_sdnv(tvb, header_start + offset, &sdnv_length);
- offset += sdnv_length;
- }
+ evaluate_sdnv(tvb, header_start + offset, &sdnv_length);
+ offset += sdnv_length;
+ }
}
block_length = evaluate_sdnv(tvb, header_start + offset, &sdnv_length);
@@ -2172,433 +2172,433 @@ void
proto_register_bundle(void)
{
- static hf_register_info hf[] = {
- {&hf_bundle_pdu_version,
- {"Bundle Version", "bundle.version",
- FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
- },
- {&hf_contact_hdr_version,
- {"Version", "bundle.tcp_conv.contact_hdr.version",
- FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
- },
- {&hf_contact_hdr_flags,
- {"Flags", "bundle.tcp_conv.contact_hdr.flags",
- FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_contact_hdr_flags_ack_req,
- {"Bundle Acks Requested", "bundle.tcp_conv.contact_hdr.flags.ackreq",
- FT_BOOLEAN, 8, NULL, TCP_CONV_BUNDLE_ACK_FLAG, NULL, HFILL}
- },
- {&hf_contact_hdr_flags_frag_enable,
- {"Reactive Fragmentation Enabled", "bundle.tcp_conv.contact_hdr.flags.fragen",
- FT_BOOLEAN, 8, NULL, TCP_CONV_REACTIVE_FRAG_FLAG, NULL, HFILL}
- },
- {&hf_contact_hdr_flags_nak,
- {"Support Negative Acknowledgements", "bundle.tcp_conv.contact_hdr.flags.nak",
- FT_BOOLEAN, 8, NULL, TCP_CONV_CONNECTOR_RCVR_FLAG, NULL, HFILL}
- },
- {&hf_contact_hdr_keep_alive,
- {"Keep Alive", "bundle.tcp_conv.contact_hdr.keep_alive",
- FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
- },
- {&hf_tcp_convergence_data_procflags,
- {"TCP Convergence Data Flags", "bundle.tcp_conv.data.proc.flag",
- FT_UINT8, BASE_HEX, NULL, TCP_CONVERGENCE_DATA_FLAGS, NULL, HFILL}
- },
- {&hf_tcp_convergence_data_procflags_start,
- {"Segment contains start of bundle", "bundle.tcp_conv.data.proc.start",
- FT_BOOLEAN, 8, NULL, TCP_CONVERGENCE_DATA_START_FLAG, NULL, HFILL}
- },
- {&hf_tcp_convergence_data_procflags_end,
- {"Segment contains end of Bundle", "bundle.tcp_conv.data.proc.end",
- FT_BOOLEAN, 8, NULL, TCP_CONVERGENCE_DATA_END_FLAG, NULL, HFILL}
- },
- {&hf_tcp_convergence_shutdown_flags,
- {"TCP Convergence Shutdown Flags", "bundle.tcp_conv.shutdown.flags",
- FT_UINT8, BASE_HEX, NULL, TCP_CONVERGENCE_SHUTDOWN_FLAGS, NULL, HFILL}
- },
- {&hf_tcp_convergence_shutdown_flags_reason,
- {"Shutdown includes Reason Code", "bundle.tcp_conv.shutdown.reason.flag",
- FT_BOOLEAN, 8, NULL, TCP_CONVERGENCE_SHUTDOWN_REASON, NULL, HFILL}
- },
- {&hf_tcp_convergence_shutdown_flags_delay,
- {"Shutdown includes Reconnection Delay", "bundle.tcp_conv.shutdown.delay.flag",
- FT_BOOLEAN, 8, NULL, TCP_CONVERGENCE_SHUTDOWN_DELAY, NULL, HFILL}
- },
- {&hf_tcp_convergence_shutdown_reason,
- {"Shutdown Reason Code", "bundle.tcp_conv.shutdown.reason",
- FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
- },
- {&hf_tcp_convergence_shutdown_delay,
- {"Shutdown Reconnection Delay", "bundle.tcp_conv.shutdown.delay",
- FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
- },
-
- {&hf_msg_fragments,
- {"Message Fragments", "bundle.msg.fragments",
- FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}
- },
- {&hf_msg_fragment,
- {"Message Fragment", "bundle.msg.fragment",
- FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL}
- },
- {&hf_msg_fragment_overlap,
- {"Message fragment overlap", "bundle.msg.fragment.overlap",
- FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}
- },
- {&hf_msg_fragment_overlap_conflicts,
- {"Message fragment overlapping with conflicting data",
- "bundle.msg.fragment.overlap.conflicts",
- FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}
- },
- {&hf_msg_fragment_multiple_tails,
- {"Message has multiple tails", "bundle.msg.fragment.multiple_tails",
- FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}
- },
- {&hf_msg_fragment_too_long_fragment,
- {"Message fragment too long", "bundle.msg.fragment.too_long_fragment",
- FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}
- },
- {&hf_msg_fragment_error,
- {"Message defragmentation error", "bundle.msg.fragment.error",
- FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL}
- },
- {&hf_msg_fragment_count,
- {"Message fragment count", "bundle.msg.fragment.count",
- FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
- },
- {&hf_msg_reassembled_in,
- {"Reassembled in", "bundle.msg.reassembled.in",
- FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL}
- },
- {&hf_msg_reassembled_length,
- {"Reassembled DTN length", "bundle.msg.reassembled.length",
- FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_procflags,
- {"Primary Header Processing Flags", "bundle.primary.proc.flag",
- FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_procflags_fragment,
- {"Bundle is a Fragment", "bundle.primary.proc.frag",
- FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_FRAG_MASK, NULL, HFILL}
- },
- {&hf_bundle_procflags_admin,
- {"Administrative Record", "bundle.primary.proc.admin",
- FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_ADMIN_MASK, NULL, HFILL}
- },
- {&hf_bundle_procflags_dont_fragment,
- {"Do Not Fragment Bundle", "bundle.primary.proc.dontfrag",
- FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_DONTFRAG_MASK, NULL, HFILL}
- },
- {&hf_bundle_procflags_cust_xfer_req,
- {"Request Custody Transfer", "bundle.primary.proc.xferreq",
- FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_XFERREQ_MASK, NULL, HFILL}
- },
- {&hf_bundle_procflags_dest_singleton,
- {"Destination is Singleton", "bundle.primary.proc.single",
- FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_SINGLETON_MASK, NULL, HFILL}
- },
- {&hf_bundle_procflags_application_ack,
- {"Request Acknowledgement by Application", "bundle.primary.proc.ack",
- FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_APP_ACK_MASK, NULL, HFILL}
- },
- {&hf_bundle_control_flags,
- {"Bundle Processing Control Flags", "bundle.primary.proc.flag",
- FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_procflags_general,
- {"General Flags", "bundle.primary.proc.gen",
- FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_procflags_cos,
- {"Cloass of Service Flags", "bundle.primary.proc.cos",
- FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_procflags_status,
- {"Status Report Flags", "bundle.primary.proc.status",
- FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_cosflags,
- {"Primary Header COS Flags", "bundle.primary.cos.flags",
- FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_cosflags_priority,
- {"Priority", "bundle.primary.cos.priority",
- FT_UINT8, BASE_DEC, NULL, BUNDLE_COSFLAGS_PRIORITY_MASK, NULL, HFILL}
- },
- {&hf_bundle_srrflags,
- {"Primary Header Report Request Flags", "bundle.primary.srr.flag",
- FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_srrflags_report_receipt,
- {"Request Reception Report", "bundle.primary.srr.report",
- FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_REPORT_MASK, NULL, HFILL}
- },
- {&hf_bundle_srrflags_report_cust_accept,
- {"Request Report of Custody Acceptance", "bundle.primary.srr.custaccept",
- FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_CUSTODY_MASK, NULL, HFILL}
- },
- {&hf_bundle_srrflags_report_forward,
- {"Request Report of Bundle Forwarding", "bundle.primary.srr.forward",
- FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_FORWARD_MASK, NULL, HFILL}
- },
- {&hf_bundle_srrflags_report_delivery,
- {"Request Report of Bundle Delivery", "bundle.primary.srr.delivery",
- FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_DELIVERY_MASK, NULL, HFILL}
- },
- {&hf_bundle_srrflags_report_deletion,
- {"Request Report of Bundle Deletion", "bundle.primary.srr.delete",
- FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_DELETION_MASK, NULL, HFILL}
- },
- {&hf_bundle_srrflags_report_ack,
- {"Request Report of Application Ack", "bundle.primary.srr.ack",
- FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_ACK_MASK, NULL, HFILL}
- },
- {&hf_bundle_primary_header_len,
- {"Bundle Header Length", "bundle.primary.len",
- FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_dest_scheme_offset,
- {"Destination Scheme Offset", "bundle.primary.destschemeoff",
- FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_dest_ssp_offset,
- {"Destination SSP Offset", "bundle.primary.destssspoff",
- FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_source_scheme_offset,
- {"Source Scheme Offset", "bundle.primary.srcschemeoff",
- FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_source_ssp_offset,
- {"Source SSP Offset", "bundle.primary.srcsspoff",
- FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_report_scheme_offset,
- {"Report Scheme Offset", "bundle.primary.rptschemeoff",
- FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_report_ssp_offset,
- {"Report SSP Offset", "bundle.primary.rptsspoff",
- FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_cust_scheme_offset,
- {"Custodian Scheme Offset", "bundle.primary.custschemeoff",
- FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_cust_ssp_offset,
- {"Custodian SSP Offset", "bundle.primary.custsspoff",
- FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_dest_scheme,
- {"Destination Scheme", "bundle.primary.destination_scheme",
- FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_dest_ssp,
- {"Destination", "bundle.primary.destination",
- FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_source_scheme,
- {"Source Scheme", "bundle.primary.source_scheme",
- FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_source_ssp,
- {"Source", "bundle.primary.source",
- FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_report_scheme,
- {"Report Scheme", "bundle.primary.report_scheme",
- FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_report_ssp,
- {"Report", "bundle.primary.report",
- FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_custodian_scheme,
- {"Custodian Scheme", "bundle.primary.custodian_scheme",
- FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_custodian_ssp,
- {"Custodian", "bundle.primary.custodian",
- FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_creation_timestamp,
- {"Creation Timestamp", "bundle.primary.timestamp",
- FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_lifetime,
- {"Lifetime", "bundle.primary.lifetime",
- FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_payload_flags,
- {"Payload Header Processing Flags", "bundle.payload.proc.flag",
- FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_payload_flags_replicate_hdr,
- {"Replicate Header in Every Fragment", "bundle.payload.proc.replicate",
- FT_BOOLEAN, 8, NULL, PAYLOAD_PROCFLAGS_REPLICATE_MASK, NULL, HFILL}
- },
- {&hf_bundle_payload_flags_xmit_report,
- {"Report if Can't Process Header", "bundle.payload.proc.report",
- FT_BOOLEAN, 8, NULL, PAYLOAD_PROCFLAGS_XMIT_STATUS, NULL, HFILL}
- },
- {&hf_bundle_payload_flags_discard_on_fail,
- {"Discard if Can't Process Header", "bundle.payload.proc.discard",
- FT_BOOLEAN, 8, NULL, PAYLOAD_PROCFLAGS_DISCARD_FAILURE, NULL, HFILL}
- },
- {&hf_bundle_payload_flags_last_header,
- {"Last Header", "bundle.payload.proc.lastheader",
- FT_BOOLEAN, 8, NULL, PAYLOAD_PROCFLAGS_LAST_HEADER, NULL, HFILL}
- },
- {&hf_bundle_admin_statflags,
- {"Administrative Record Status Flags", "bundle.admin.status.flag",
- FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_admin_rcvd,
- {"Reporting Node Received Bundle", "bundle.admin.status.rcvd",
- FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_RECEIVED, NULL, HFILL}
- },
- {&hf_bundle_admin_accepted,
- {"Reporting Node Accepted Custody", "bundle.admin.status.accept",
- FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_ACCEPTED, NULL, HFILL}
- },
- {&hf_bundle_admin_forwarded,
- {"Reporting Node Forwarded Bundle", "bundle.admin.status.forward",
- FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_FORWARDED, NULL, HFILL}
- },
- {&hf_bundle_admin_delivered,
- {"Reporting Node Delivered Bundle", "bundle.admin.status.delivered",
- FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_DELIVERED, NULL, HFILL}
- },
- {&hf_bundle_admin_deleted,
- {"Reporting Node Deleted Bundle", "bundle.admin.status.delete",
- FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_DELETED, NULL, HFILL}
- },
- {&hf_bundle_admin_acked,
- {"Acknowledged by Application", "bundle.admin.status.ack",
- FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_ACKNOWLEDGED, NULL, HFILL}
- },
- {&hf_bundle_admin_receipt_time,
- {"Time of Receipt", "bundle.admin.status.receipttime",
- FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_admin_accept_time,
- {"Time of Custody Acceptance", "bundle.admin.status.accepttime",
- FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_admin_forward_time,
- {"Time of Forwarding", "bundle.admin.status.forwardtime",
- FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_admin_delivery_time,
- {"Time of Delivery", "bundle.admin.status.deliverytime",
- FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_admin_delete_time,
- {"Time of Deletion", "bundle.admin.status.deletetime",
- FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_admin_ack_time,
- {"Time of Acknowledgement", "bundle.admin.status.acktime",
- FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_admin_timestamp_copy,
- {"Copy of Creation Timestamp", "bundle.admin.status.timecopy",
- FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_bundle_admin_signal_time,
- {"Time of Signal", "bundle.admin.signal.time",
- FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_block_control_flags,
- {"Block Processing Control Flags", "bundle.block.control.flags",
- FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
- },
- {&hf_block_control_replicate,
- {"Replicate Block in Every Fragment", "bundle.block.control.replicate",
- FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_REPLICATE, NULL, HFILL}
- },
- {&hf_block_control_transmit_status,
- {"Transmit Status if Block Can't be Processeed", "bundle.block.control.status",
- FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_TRANSMIT_STATUS, NULL, HFILL}
- },
- {&hf_block_control_delete_bundle,
- {"Delete Bundle if Block Can't be Processeed", "bundle.block.control.delete",
- FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_DELETE_BUNDLE, NULL, HFILL}
- },
- {&hf_block_control_last_block,
- {"Last Block", "bundle.block.control.last",
- FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_LAST_BLOCK, NULL, HFILL}
- },
- {&hf_block_control_discard_block,
- {"Discard Block If Can't Process", "bundle.block.control.discard",
- FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_DISCARD_BLOCK, NULL, HFILL}
- },
- {&hf_block_control_not_processed,
- {"Block Was Forwarded Without Processing", "bundle.block.control.process",
- FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_NOT_PROCESSED, NULL, HFILL}
- },
- {&hf_block_control_eid_reference,
- {"Block Contains an EID-reference Field", "bundle.block.control.eid",
- FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_EID_REFERENCE, NULL, HFILL}
- }
- };
-
- static gint *ett[] = {
- &ett_bundle,
- &ett_tcp_conv,
- &ett_tcp_conv_hdr,
- &ett_msg_fragment,
- &ett_msg_fragments,
- &ett_bundle_hdr,
- &ett_primary_hdr,
- &ett_proc_flags,
- &ett_gen_flags,
- &ett_cos_flags,
- &ett_srr_flags,
- &ett_dictionary,
- &ett_payload_hdr,
- &ett_payload_flags,
- &ett_block_flags,
- &ett_contact_hdr_flags,
- &ett_conv_flags,
- &ett_shutdown_flags,
- &ett_admin_record,
- &ett_admin_rec_status,
- &ett_metadata_hdr
- };
-
- module_t *bundle_module;
-
- proto_bundle = proto_register_protocol (
- "Bundle Protocol",
- "Bundle",
- "bundle"
- );
- bundle_module = prefs_register_protocol(proto_bundle, proto_reg_handoff_bundle);
-
- proto_tcp_conv = proto_register_protocol (
- "DTN TCP Convergence Layer Protocol",
- "TCPCL",
- "tcpcl"
- );
-
- prefs_register_uint_preference(bundle_module, "tcp.port",
- "Bundle Protocol TCP Port",
- "TCP Port to Accept Bundle Protocol Connections",
- 10,
- &bundle_tcp_port);
-
- prefs_register_uint_preference(bundle_module, "udp.port",
- "Bundle Protocol UDP Port",
- "UDP Port to Accept Bundle Protocol Connections",
- 10,
- &bundle_udp_port);
-
- proto_register_field_array(proto_bundle, hf, array_length(hf));
- proto_register_subtree_array(ett, array_length(ett));
- register_init_routine(bundle_defragment_init);
+ static hf_register_info hf[] = {
+ {&hf_bundle_pdu_version,
+ {"Bundle Version", "bundle.version",
+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_contact_hdr_version,
+ {"Version", "bundle.tcp_conv.contact_hdr.version",
+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_contact_hdr_flags,
+ {"Flags", "bundle.tcp_conv.contact_hdr.flags",
+ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_contact_hdr_flags_ack_req,
+ {"Bundle Acks Requested", "bundle.tcp_conv.contact_hdr.flags.ackreq",
+ FT_BOOLEAN, 8, NULL, TCP_CONV_BUNDLE_ACK_FLAG, NULL, HFILL}
+ },
+ {&hf_contact_hdr_flags_frag_enable,
+ {"Reactive Fragmentation Enabled", "bundle.tcp_conv.contact_hdr.flags.fragen",
+ FT_BOOLEAN, 8, NULL, TCP_CONV_REACTIVE_FRAG_FLAG, NULL, HFILL}
+ },
+ {&hf_contact_hdr_flags_nak,
+ {"Support Negative Acknowledgements", "bundle.tcp_conv.contact_hdr.flags.nak",
+ FT_BOOLEAN, 8, NULL, TCP_CONV_CONNECTOR_RCVR_FLAG, NULL, HFILL}
+ },
+ {&hf_contact_hdr_keep_alive,
+ {"Keep Alive", "bundle.tcp_conv.contact_hdr.keep_alive",
+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_tcp_convergence_data_procflags,
+ {"TCP Convergence Data Flags", "bundle.tcp_conv.data.proc.flag",
+ FT_UINT8, BASE_HEX, NULL, TCP_CONVERGENCE_DATA_FLAGS, NULL, HFILL}
+ },
+ {&hf_tcp_convergence_data_procflags_start,
+ {"Segment contains start of bundle", "bundle.tcp_conv.data.proc.start",
+ FT_BOOLEAN, 8, NULL, TCP_CONVERGENCE_DATA_START_FLAG, NULL, HFILL}
+ },
+ {&hf_tcp_convergence_data_procflags_end,
+ {"Segment contains end of Bundle", "bundle.tcp_conv.data.proc.end",
+ FT_BOOLEAN, 8, NULL, TCP_CONVERGENCE_DATA_END_FLAG, NULL, HFILL}
+ },
+ {&hf_tcp_convergence_shutdown_flags,
+ {"TCP Convergence Shutdown Flags", "bundle.tcp_conv.shutdown.flags",
+ FT_UINT8, BASE_HEX, NULL, TCP_CONVERGENCE_SHUTDOWN_FLAGS, NULL, HFILL}
+ },
+ {&hf_tcp_convergence_shutdown_flags_reason,
+ {"Shutdown includes Reason Code", "bundle.tcp_conv.shutdown.reason.flag",
+ FT_BOOLEAN, 8, NULL, TCP_CONVERGENCE_SHUTDOWN_REASON, NULL, HFILL}
+ },
+ {&hf_tcp_convergence_shutdown_flags_delay,
+ {"Shutdown includes Reconnection Delay", "bundle.tcp_conv.shutdown.delay.flag",
+ FT_BOOLEAN, 8, NULL, TCP_CONVERGENCE_SHUTDOWN_DELAY, NULL, HFILL}
+ },
+ {&hf_tcp_convergence_shutdown_reason,
+ {"Shutdown Reason Code", "bundle.tcp_conv.shutdown.reason",
+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_tcp_convergence_shutdown_delay,
+ {"Shutdown Reconnection Delay", "bundle.tcp_conv.shutdown.delay",
+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
+ },
+
+ {&hf_msg_fragments,
+ {"Message Fragments", "bundle.msg.fragments",
+ FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_msg_fragment,
+ {"Message Fragment", "bundle.msg.fragment",
+ FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_msg_fragment_overlap,
+ {"Message fragment overlap", "bundle.msg.fragment.overlap",
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_msg_fragment_overlap_conflicts,
+ {"Message fragment overlapping with conflicting data",
+ "bundle.msg.fragment.overlap.conflicts",
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_msg_fragment_multiple_tails,
+ {"Message has multiple tails", "bundle.msg.fragment.multiple_tails",
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_msg_fragment_too_long_fragment,
+ {"Message fragment too long", "bundle.msg.fragment.too_long_fragment",
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_msg_fragment_error,
+ {"Message defragmentation error", "bundle.msg.fragment.error",
+ FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_msg_fragment_count,
+ {"Message fragment count", "bundle.msg.fragment.count",
+ FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_msg_reassembled_in,
+ {"Reassembled in", "bundle.msg.reassembled.in",
+ FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_msg_reassembled_length,
+ {"Reassembled DTN length", "bundle.msg.reassembled.length",
+ FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_procflags,
+ {"Primary Header Processing Flags", "bundle.primary.proc.flag",
+ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_procflags_fragment,
+ {"Bundle is a Fragment", "bundle.primary.proc.frag",
+ FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_FRAG_MASK, NULL, HFILL}
+ },
+ {&hf_bundle_procflags_admin,
+ {"Administrative Record", "bundle.primary.proc.admin",
+ FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_ADMIN_MASK, NULL, HFILL}
+ },
+ {&hf_bundle_procflags_dont_fragment,
+ {"Do Not Fragment Bundle", "bundle.primary.proc.dontfrag",
+ FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_DONTFRAG_MASK, NULL, HFILL}
+ },
+ {&hf_bundle_procflags_cust_xfer_req,
+ {"Request Custody Transfer", "bundle.primary.proc.xferreq",
+ FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_XFERREQ_MASK, NULL, HFILL}
+ },
+ {&hf_bundle_procflags_dest_singleton,
+ {"Destination is Singleton", "bundle.primary.proc.single",
+ FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_SINGLETON_MASK, NULL, HFILL}
+ },
+ {&hf_bundle_procflags_application_ack,
+ {"Request Acknowledgement by Application", "bundle.primary.proc.ack",
+ FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_APP_ACK_MASK, NULL, HFILL}
+ },
+ {&hf_bundle_control_flags,
+ {"Bundle Processing Control Flags", "bundle.primary.proc.flag",
+ FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_procflags_general,
+ {"General Flags", "bundle.primary.proc.gen",
+ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_procflags_cos,
+ {"Cloass of Service Flags", "bundle.primary.proc.cos",
+ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_procflags_status,
+ {"Status Report Flags", "bundle.primary.proc.status",
+ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_cosflags,
+ {"Primary Header COS Flags", "bundle.primary.cos.flags",
+ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_cosflags_priority,
+ {"Priority", "bundle.primary.cos.priority",
+ FT_UINT8, BASE_DEC, NULL, BUNDLE_COSFLAGS_PRIORITY_MASK, NULL, HFILL}
+ },
+ {&hf_bundle_srrflags,
+ {"Primary Header Report Request Flags", "bundle.primary.srr.flag",
+ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_srrflags_report_receipt,
+ {"Request Reception Report", "bundle.primary.srr.report",
+ FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_REPORT_MASK, NULL, HFILL}
+ },
+ {&hf_bundle_srrflags_report_cust_accept,
+ {"Request Report of Custody Acceptance", "bundle.primary.srr.custaccept",
+ FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_CUSTODY_MASK, NULL, HFILL}
+ },
+ {&hf_bundle_srrflags_report_forward,
+ {"Request Report of Bundle Forwarding", "bundle.primary.srr.forward",
+ FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_FORWARD_MASK, NULL, HFILL}
+ },
+ {&hf_bundle_srrflags_report_delivery,
+ {"Request Report of Bundle Delivery", "bundle.primary.srr.delivery",
+ FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_DELIVERY_MASK, NULL, HFILL}
+ },
+ {&hf_bundle_srrflags_report_deletion,
+ {"Request Report of Bundle Deletion", "bundle.primary.srr.delete",
+ FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_DELETION_MASK, NULL, HFILL}
+ },
+ {&hf_bundle_srrflags_report_ack,
+ {"Request Report of Application Ack", "bundle.primary.srr.ack",
+ FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_ACK_MASK, NULL, HFILL}
+ },
+ {&hf_bundle_primary_header_len,
+ {"Bundle Header Length", "bundle.primary.len",
+ FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_dest_scheme_offset,
+ {"Destination Scheme Offset", "bundle.primary.destschemeoff",
+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_dest_ssp_offset,
+ {"Destination SSP Offset", "bundle.primary.destssspoff",
+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_source_scheme_offset,
+ {"Source Scheme Offset", "bundle.primary.srcschemeoff",
+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_source_ssp_offset,
+ {"Source SSP Offset", "bundle.primary.srcsspoff",
+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_report_scheme_offset,
+ {"Report Scheme Offset", "bundle.primary.rptschemeoff",
+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_report_ssp_offset,
+ {"Report SSP Offset", "bundle.primary.rptsspoff",
+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_cust_scheme_offset,
+ {"Custodian Scheme Offset", "bundle.primary.custschemeoff",
+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_cust_ssp_offset,
+ {"Custodian SSP Offset", "bundle.primary.custsspoff",
+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_dest_scheme,
+ {"Destination Scheme", "bundle.primary.destination_scheme",
+ FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_dest_ssp,
+ {"Destination", "bundle.primary.destination",
+ FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_source_scheme,
+ {"Source Scheme", "bundle.primary.source_scheme",
+ FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_source_ssp,
+ {"Source", "bundle.primary.source",
+ FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_report_scheme,
+ {"Report Scheme", "bundle.primary.report_scheme",
+ FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_report_ssp,
+ {"Report", "bundle.primary.report",
+ FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_custodian_scheme,
+ {"Custodian Scheme", "bundle.primary.custodian_scheme",
+ FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_custodian_ssp,
+ {"Custodian", "bundle.primary.custodian",
+ FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_creation_timestamp,
+ {"Creation Timestamp", "bundle.primary.timestamp",
+ FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_lifetime,
+ {"Lifetime", "bundle.primary.lifetime",
+ FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_payload_flags,
+ {"Payload Header Processing Flags", "bundle.payload.proc.flag",
+ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_payload_flags_replicate_hdr,
+ {"Replicate Header in Every Fragment", "bundle.payload.proc.replicate",
+ FT_BOOLEAN, 8, NULL, PAYLOAD_PROCFLAGS_REPLICATE_MASK, NULL, HFILL}
+ },
+ {&hf_bundle_payload_flags_xmit_report,
+ {"Report if Can't Process Header", "bundle.payload.proc.report",
+ FT_BOOLEAN, 8, NULL, PAYLOAD_PROCFLAGS_XMIT_STATUS, NULL, HFILL}
+ },
+ {&hf_bundle_payload_flags_discard_on_fail,
+ {"Discard if Can't Process Header", "bundle.payload.proc.discard",
+ FT_BOOLEAN, 8, NULL, PAYLOAD_PROCFLAGS_DISCARD_FAILURE, NULL, HFILL}
+ },
+ {&hf_bundle_payload_flags_last_header,
+ {"Last Header", "bundle.payload.proc.lastheader",
+ FT_BOOLEAN, 8, NULL, PAYLOAD_PROCFLAGS_LAST_HEADER, NULL, HFILL}
+ },
+ {&hf_bundle_admin_statflags,
+ {"Administrative Record Status Flags", "bundle.admin.status.flag",
+ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_admin_rcvd,
+ {"Reporting Node Received Bundle", "bundle.admin.status.rcvd",
+ FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_RECEIVED, NULL, HFILL}
+ },
+ {&hf_bundle_admin_accepted,
+ {"Reporting Node Accepted Custody", "bundle.admin.status.accept",
+ FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_ACCEPTED, NULL, HFILL}
+ },
+ {&hf_bundle_admin_forwarded,
+ {"Reporting Node Forwarded Bundle", "bundle.admin.status.forward",
+ FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_FORWARDED, NULL, HFILL}
+ },
+ {&hf_bundle_admin_delivered,
+ {"Reporting Node Delivered Bundle", "bundle.admin.status.delivered",
+ FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_DELIVERED, NULL, HFILL}
+ },
+ {&hf_bundle_admin_deleted,
+ {"Reporting Node Deleted Bundle", "bundle.admin.status.delete",
+ FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_DELETED, NULL, HFILL}
+ },
+ {&hf_bundle_admin_acked,
+ {"Acknowledged by Application", "bundle.admin.status.ack",
+ FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_ACKNOWLEDGED, NULL, HFILL}
+ },
+ {&hf_bundle_admin_receipt_time,
+ {"Time of Receipt", "bundle.admin.status.receipttime",
+ FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_admin_accept_time,
+ {"Time of Custody Acceptance", "bundle.admin.status.accepttime",
+ FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_admin_forward_time,
+ {"Time of Forwarding", "bundle.admin.status.forwardtime",
+ FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_admin_delivery_time,
+ {"Time of Delivery", "bundle.admin.status.deliverytime",
+ FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_admin_delete_time,
+ {"Time of Deletion", "bundle.admin.status.deletetime",
+ FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_admin_ack_time,
+ {"Time of Acknowledgement", "bundle.admin.status.acktime",
+ FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_admin_timestamp_copy,
+ {"Copy of Creation Timestamp", "bundle.admin.status.timecopy",
+ FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_bundle_admin_signal_time,
+ {"Time of Signal", "bundle.admin.signal.time",
+ FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_block_control_flags,
+ {"Block Processing Control Flags", "bundle.block.control.flags",
+ FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
+ },
+ {&hf_block_control_replicate,
+ {"Replicate Block in Every Fragment", "bundle.block.control.replicate",
+ FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_REPLICATE, NULL, HFILL}
+ },
+ {&hf_block_control_transmit_status,
+ {"Transmit Status if Block Can't be Processeed", "bundle.block.control.status",
+ FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_TRANSMIT_STATUS, NULL, HFILL}
+ },
+ {&hf_block_control_delete_bundle,
+ {"Delete Bundle if Block Can't be Processeed", "bundle.block.control.delete",
+ FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_DELETE_BUNDLE, NULL, HFILL}
+ },
+ {&hf_block_control_last_block,
+ {"Last Block", "bundle.block.control.last",
+ FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_LAST_BLOCK, NULL, HFILL}
+ },
+ {&hf_block_control_discard_block,
+ {"Discard Block If Can't Process", "bundle.block.control.discard",
+ FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_DISCARD_BLOCK, NULL, HFILL}
+ },
+ {&hf_block_control_not_processed,
+ {"Block Was Forwarded Without Processing", "bundle.block.control.process",
+ FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_NOT_PROCESSED, NULL, HFILL}
+ },
+ {&hf_block_control_eid_reference,
+ {"Block Contains an EID-reference Field", "bundle.block.control.eid",
+ FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_EID_REFERENCE, NULL, HFILL}
+ }
+ };
+
+ static gint *ett[] = {
+ &ett_bundle,
+ &ett_tcp_conv,
+ &ett_tcp_conv_hdr,
+ &ett_msg_fragment,
+ &ett_msg_fragments,
+ &ett_bundle_hdr,
+ &ett_primary_hdr,
+ &ett_proc_flags,
+ &ett_gen_flags,
+ &ett_cos_flags,
+ &ett_srr_flags,
+ &ett_dictionary,
+ &ett_payload_hdr,
+ &ett_payload_flags,
+ &ett_block_flags,
+ &ett_contact_hdr_flags,
+ &ett_conv_flags,
+ &ett_shutdown_flags,
+ &ett_admin_record,
+ &ett_admin_rec_status,
+ &ett_metadata_hdr
+ };
+
+ module_t *bundle_module;
+
+ proto_bundle = proto_register_protocol (
+ "Bundle Protocol",
+ "Bundle",
+ "bundle"
+ );
+ bundle_module = prefs_register_protocol(proto_bundle, proto_reg_handoff_bundle);
+
+ proto_tcp_conv = proto_register_protocol (
+ "DTN TCP Convergence Layer Protocol",
+ "TCPCL",
+ "tcpcl"
+ );
+
+ prefs_register_uint_preference(bundle_module, "tcp.port",
+ "Bundle Protocol TCP Port",
+ "TCP Port to Accept Bundle Protocol Connections",
+ 10,
+ &bundle_tcp_port);
+
+ prefs_register_uint_preference(bundle_module, "udp.port",
+ "Bundle Protocol UDP Port",
+ "UDP Port to Accept Bundle Protocol Connections",
+ 10,
+ &bundle_udp_port);
+
+ proto_register_field_array(proto_bundle, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
+ register_init_routine(bundle_defragment_init);
}
void
diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c
index cebd7111de..1452848c7d 100644
--- a/epan/dissectors/packet-gtpv2.c
+++ b/epan/dissectors/packet-gtpv2.c
@@ -2967,11 +2967,11 @@ static void
dissect_gtpv2_F_container(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type, guint8 instance _U_)
{
tvbuff_t *tvb_new;
- proto_item *bss_item;
- proto_tree *sub_tree;
+ proto_item *bss_item;
+ proto_tree *sub_tree;
int offset = 0;
guint8 container_type;
- guint8 container_flags, xid_len;
+ guint8 container_flags, xid_len;
/* Octets 8 7 6 5 4 3 2 1
* 5 Spare | Container Type
@@ -2988,25 +2988,25 @@ dissect_gtpv2_F_container(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, p
bss_item = proto_tree_add_text(tree, tvb, offset, length, "BSS container");
sub_tree = proto_item_add_subtree(bss_item, ett_bss_con);
/* The flags PFI, RP, SAPI and PHX in octet 6 indicate the corresponding type of paratemer */
- proto_tree_add_item(tree, hf_gtpv2_bss_container_phx, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(tree, hf_gtpv2_bss_con_sapi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(tree, hf_gtpv2_bss_con_rp_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(tree, hf_gtpv2_bss_con_pfi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(sub_tree, hf_gtpv2_bss_container_phx, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_sapi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_rp_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_pfi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
container_flags = tvb_get_guint8(tvb,offset);
offset++;
if((container_flags&0x01)==1){
/* Packet Flow ID present */
- proto_tree_add_item(tree, hf_gtpv2_bss_con_pfi, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_pfi, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
}
if(((container_flags&0x04)==4)||((container_flags&0x02)==2)){
if((container_flags&0x04)==4){
/* SAPI present */
- proto_tree_add_item(tree, hf_gtpv2_bss_con_sapi, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_sapi, tvb, offset, 1, ENC_BIG_ENDIAN);
}
if((container_flags&0x02)==2){
/* Radio Priority present */
- proto_tree_add_item(tree, hf_gtpv2_bss_con_rp, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_rp, tvb, offset, 1, ENC_BIG_ENDIAN);
}
offset++;
}
@@ -3015,9 +3015,9 @@ dissect_gtpv2_F_container(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, p
* XiD parameters are present in Octet d to n.
*/
xid_len = tvb_get_guint8(tvb,offset);
- proto_tree_add_item(tree, hf_gtpv2_bss_con_xid_len, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_xid_len, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
- proto_tree_add_item(tree, hf_gtpv2_bss_con_xid, tvb, offset, xid_len, ENC_BIG_ENDIAN);
+ proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_xid, tvb, offset, xid_len, ENC_BIG_ENDIAN);
offset += xid_len;
}
return;
@@ -3207,26 +3207,26 @@ dissect_gtpv2_target_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pro
/* Target ID field shall be same as the Octets 3 to 10 of the Cell Identifier IEI
* in 3GPP TS 48.018 [34].
*/
- tvb_new = tvb_new_subset_remaining(tvb, offset);
- de_bssgp_cell_id(tvb_new, tree, pinfo, 0, 0/* not used */, NULL, 0);
- return;
+ tvb_new = tvb_new_subset_remaining(tvb, offset);
+ de_bssgp_cell_id(tvb_new, tree, pinfo, 0, 0/* not used */, NULL, 0);
+ return;
case 3:
/* Home eNodeB ID */
tvb_new = tvb_new_subset_remaining(tvb, offset);
dissect_e212_mcc_mnc(tvb_new, pinfo, tree, 0, TRUE);
offset+=3;
- /* Octet 10 to 12 Home eNodeB ID
- * The Home eNodeB ID consists of 28 bits. See 3GPP TS 36.413 [10].
- * Bit 4 of Octet 9 is the most significant bit and bit 1 of Octet 12 is the least significant bit.
- * The coding of the Home eNodeB ID is the responsibility of each administration.
- * Coding using full hexadecimal representation shall be used.
- */
- proto_tree_add_item(tree, hf_gtpv2_home_enodeb_id, tvb, offset, 4 , ENC_BIG_ENDIAN);
- offset+=4;
+ /* Octet 10 to 12 Home eNodeB ID
+ * The Home eNodeB ID consists of 28 bits. See 3GPP TS 36.413 [10].
+ * Bit 4 of Octet 9 is the most significant bit and bit 1 of Octet 12 is the least significant bit.
+ * The coding of the Home eNodeB ID is the responsibility of each administration.
+ * Coding using full hexadecimal representation shall be used.
+ */
+ proto_tree_add_item(tree, hf_gtpv2_home_enodeb_id, tvb, offset, 4 , ENC_BIG_ENDIAN);
+ offset+=4;
/* Octet 13 to 14 Tracking Area Code (TAC) */
- proto_tree_add_item(tree, hf_gtpv2_tac, tvb, offset, 2 , ENC_BIG_ENDIAN);
- offset+=2;
- return;
+ proto_tree_add_item(tree, hf_gtpv2_tac, tvb, offset, 2 , ENC_BIG_ENDIAN);
+ offset+=2;
+ return;
default:
break;
@@ -5086,52 +5086,52 @@ void proto_register_gtpv2(void)
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL}
},
- { &hf_gtpv2_bss_container_phx,
+ { &hf_gtpv2_bss_container_phx,
{"PHX", "gtpv2.bss_cont.phx",
FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
NULL, HFILL}
},
- { &hf_gtpv2_bss_con_sapi_flg,
+ { &hf_gtpv2_bss_con_sapi_flg,
{"SAPI", "gtpv2.bss_cont.sapi_flg",
FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
NULL, HFILL}
},
- { &hf_gtpv2_bss_con_rp_flg,
+ { &hf_gtpv2_bss_con_rp_flg,
{"RP", "gtpv2.bss_cont.rp_flg",
FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
NULL, HFILL}
},
- { &hf_gtpv2_bss_con_pfi_flg,
+ { &hf_gtpv2_bss_con_pfi_flg,
{"PFI", "gtpv2.bss_cont.pfi_flg",
FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
NULL, HFILL}
},
- { &hf_gtpv2_bss_con_pfi,
+ { &hf_gtpv2_bss_con_pfi,
{"Packet Flow ID(PFI)", "gtpv2.bss_cont.pfi",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
- { &hf_gtpv2_bss_con_rp,
+ { &hf_gtpv2_bss_con_rp,
{"Radio Priority(RP)", "gtpv2.bss_cont.rp",
FT_UINT8, BASE_DEC, NULL, 0x07,
NULL, HFILL}
},
- { &hf_gtpv2_bss_con_sapi,
+ { &hf_gtpv2_bss_con_sapi,
{"SAPI", "gtpv2.bss_cont.sapi",
FT_UINT8, BASE_DEC, NULL, 0xf0,
NULL, HFILL}
},
- { &hf_gtpv2_bss_con_xid_len,
+ { &hf_gtpv2_bss_con_xid_len,
{"XiD parameters length", "gtpv2.bss_cont.xid_len",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL}
},
- { &hf_gtpv2_home_enodeb_id,
+ { &hf_gtpv2_home_enodeb_id,
{"Home eNodeB ID", "gtpv2.home_enodeb_id",
FT_UINT32, BASE_HEX, NULL, 0x0fffffff,
NULL, HFILL}
},
- { &hf_gtpv2_tac,
+ { &hf_gtpv2_tac,
{"Tracking Area Code (TAC)", "gtpv2.tac",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
@@ -5171,7 +5171,7 @@ void proto_register_gtpv2(void)
&ett_gtpv2_stn_sr,
&ett_gtpv2_ms_mark,
&ett_gtpv2_supp_codec_list,
- &ett_bss_con,
+ &ett_bss_con,
};
proto_gtpv2 = proto_register_protocol("GPRS Tunneling Protocol V2", "GTPv2", "gtpv2");
diff --git a/epan/dissectors/packet-iscsi.c b/epan/dissectors/packet-iscsi.c
index 700d7c438c..41b52999a1 100644
--- a/epan/dissectors/packet-iscsi.c
+++ b/epan/dissectors/packet-iscsi.c
@@ -90,7 +90,7 @@ static int dataDigestIsCRC32 = TRUE;
static guint dataDigestSize = 4;
-#define TCP_PORT_ISCSI_RANGE "3260"
+#define TCP_PORT_ISCSI_RANGE "3260"
static range_t *global_iscsi_port_range;
static guint iscsi_system_port = 860;
@@ -215,14 +215,14 @@ static gint ett_iscsi_RejectHeader = -1;
static gint ett_iscsi_ISID = -1;
/* #endif */
-#define ISCSI_HEADER_DIGEST_AUTO 0
-#define ISCSI_HEADER_DIGEST_NONE 1
-#define ISCSI_HEADER_DIGEST_CRC32 2
+#define ISCSI_HEADER_DIGEST_AUTO 0
+#define ISCSI_HEADER_DIGEST_NONE 1
+#define ISCSI_HEADER_DIGEST_CRC32 2
/* this structure contains session wide state for a specific tcp conversation */
typedef struct _iscsi_session_t {
- guint32 header_digest;
- emem_tree_t *itlq; /* indexed by ITT */
- emem_tree_t *itl; /* indexed by LUN */
+ guint32 header_digest;
+ emem_tree_t *itlq; /* indexed by ITT */
+ emem_tree_t *itl; /* indexed by LUN */
} iscsi_session_t;
@@ -533,65 +533,65 @@ typedef struct _iscsi_conv_data {
static void
iscsi_dissect_TargetAddress(packet_info *pinfo, proto_tree *tree _U_,char *val)
{
- address *addr = NULL;
- int port;
- char *value = ep_strdup(val);
- char *p = NULL, *pgt = NULL;
-
- if (value[0] == '[') {
- /* this looks like an ipv6 address */
- p = strchr(value, ']');
- if (p != NULL) {
- *p = 0;
- p += 2; /* skip past "]:" */
-
- pgt = strchr(p, ',');
- if (pgt != NULL) {
- *pgt++ = 0;
- }
-
- /* cant handle ipv6 yet */
- }
- } else {
- /* This is either a ipv4 address or a dns name */
- int i0,i1,i2,i3;
- if (sscanf(value, "%d.%d.%d.%d", &i0,&i1,&i2,&i3) == 4) {
- /* looks like a ipv4 address */
- p = strchr(value, ':');
- if (p != NULL) {
- *p++ = 0;
-
- pgt = strchr(p, ',');
- if (pgt != NULL) {
- *pgt++ = 0;
- }
-
- addr = ep_alloc(sizeof(address));
- addr->type = AT_IPv4;
- addr->len = 4;
- addr->data = ep_alloc(4);
- ((char *)addr->data)[0] = i0;
- ((char *)addr->data)[1] = i1;
- ((char *)addr->data)[2] = i2;
- ((char *)addr->data)[3] = i3;
-
- port = atoi(p);
- }
-
- }
- }
-
-
- /* attach a conversation dissector to this address/port tuple */
- if (addr && !pinfo->fd->flags.visited) {
- conversation_t *conv;
-
- conv = conversation_new(pinfo->fd->num, addr, addr, PT_TCP, port, port, NO_ADDR2|NO_PORT2);
- if (conv == NULL) {
- return;
- }
- conversation_set_dissector(conv, iscsi_handle);
- }
+ address *addr = NULL;
+ int port;
+ char *value = ep_strdup(val);
+ char *p = NULL, *pgt = NULL;
+
+ if (value[0] == '[') {
+ /* this looks like an ipv6 address */
+ p = strchr(value, ']');
+ if (p != NULL) {
+ *p = 0;
+ p += 2; /* skip past "]:" */
+
+ pgt = strchr(p, ',');
+ if (pgt != NULL) {
+ *pgt++ = 0;
+ }
+
+ /* cant handle ipv6 yet */
+ }
+ } else {
+ /* This is either a ipv4 address or a dns name */
+ int i0,i1,i2,i3;
+ if (sscanf(value, "%d.%d.%d.%d", &i0,&i1,&i2,&i3) == 4) {
+ /* looks like a ipv4 address */
+ p = strchr(value, ':');
+ if (p != NULL) {
+ *p++ = 0;
+
+ pgt = strchr(p, ',');
+ if (pgt != NULL) {
+ *pgt++ = 0;
+ }
+
+ addr = ep_alloc(sizeof(address));
+ addr->type = AT_IPv4;
+ addr->len = 4;
+ addr->data = ep_alloc(4);
+ ((char *)addr->data)[0] = i0;
+ ((char *)addr->data)[1] = i1;
+ ((char *)addr->data)[2] = i2;
+ ((char *)addr->data)[3] = i3;
+
+ port = atoi(p);
+ }
+
+ }
+ }
+
+
+ /* attach a conversation dissector to this address/port tuple */
+ if (addr && !pinfo->fd->flags.visited) {
+ conversation_t *conv;
+
+ conv = conversation_new(pinfo->fd->num, addr, addr, PT_TCP, port, port, NO_ADDR2|NO_PORT2);
+ if (conv == NULL) {
+ return;
+ }
+ conversation_set_dissector(conv, iscsi_handle);
+ }
}
@@ -600,31 +600,31 @@ addTextKeys(packet_info *pinfo, proto_tree *tt, tvbuff_t *tvb, gint offset, guin
const gint limit = offset + text_len;
while(offset < limit) {
- char *key = NULL, *value = NULL;
- gint len = tvb_strnlen(tvb, offset, limit - offset);
-
- if(len == -1) {
- len = limit - offset;
- } else {
- len = len + 1;
- }
-
- key = tvb_get_ephemeral_string(tvb, offset, len);
- if (key == NULL) {
- break;
- }
- value = strchr(key, '=');
- if (value == NULL) {
- break;
- }
- *value++ = 0;
-
- if (!strcmp(key, "TargetAddress")) {
- iscsi_dissect_TargetAddress(pinfo, tt, value);
- }
-
- proto_tree_add_item(tt, hf_iscsi_KeyValue, tvb, offset, len, ENC_ASCII|ENC_NA);
- offset += len;
+ char *key = NULL, *value = NULL;
+ gint len = tvb_strnlen(tvb, offset, limit - offset);
+
+ if(len == -1) {
+ len = limit - offset;
+ } else {
+ len = len + 1;
+ }
+
+ key = tvb_get_ephemeral_string(tvb, offset, len);
+ if (key == NULL) {
+ break;
+ }
+ value = strchr(key, '=');
+ if (value == NULL) {
+ break;
+ }
+ *value++ = 0;
+
+ if (!strcmp(key, "TargetAddress")) {
+ iscsi_dissect_TargetAddress(pinfo, tt, value);
+ }
+
+ proto_tree_add_item(tt, hf_iscsi_KeyValue, tvb, offset, len, ENC_ASCII|ENC_NA);
+ offset += len;
}
return offset;
}
@@ -635,16 +635,16 @@ handleHeaderDigest(iscsi_session_t *iscsi_session, proto_item *ti, tvbuff_t *tvb
switch(iscsi_session->header_digest){
case ISCSI_HEADER_DIGEST_CRC32:
- if(available_bytes >= (headerLen + 4)) {
- guint32 crc = ~crc32c_calculate(tvb_get_ptr(tvb, offset, headerLen), headerLen, CRC32C_PRELOAD);
- guint32 sent = tvb_get_ntohl(tvb, offset + headerLen);
- if(crc == sent) {
- proto_tree_add_uint_format(ti, hf_iscsi_HeaderDigest32, tvb, offset + headerLen, 4, sent, "HeaderDigest: 0x%08x (Good CRC32)", sent);
- } else {
- proto_tree_add_uint_format(ti, hf_iscsi_HeaderDigest32, tvb, offset + headerLen, 4, sent, "HeaderDigest: 0x%08x (Bad CRC32, should be 0x%08x)", sent, crc);
- }
- }
- return offset + headerLen + 4;
+ if(available_bytes >= (headerLen + 4)) {
+ guint32 crc = ~crc32c_calculate(tvb_get_ptr(tvb, offset, headerLen), headerLen, CRC32C_PRELOAD);
+ guint32 sent = tvb_get_ntohl(tvb, offset + headerLen);
+ if(crc == sent) {
+ proto_tree_add_uint_format(ti, hf_iscsi_HeaderDigest32, tvb, offset + headerLen, 4, sent, "HeaderDigest: 0x%08x (Good CRC32)", sent);
+ } else {
+ proto_tree_add_uint_format(ti, hf_iscsi_HeaderDigest32, tvb, offset + headerLen, 4, sent, "HeaderDigest: 0x%08x (Bad CRC32, should be 0x%08x)", sent, crc);
+ }
+ }
+ return offset + headerLen + 4;
}
return offset + headerLen;
}
@@ -653,23 +653,23 @@ static gint
handleDataDigest(proto_item *ti, tvbuff_t *tvb, guint offset, int dataLen) {
int available_bytes = tvb_length_remaining(tvb, offset);
if(enableDataDigests) {
- if(dataDigestIsCRC32) {
- if(available_bytes >= (dataLen + 4)) {
- guint32 crc = ~crc32c_calculate(tvb_get_ptr(tvb, offset, dataLen), dataLen, CRC32C_PRELOAD);
- guint32 sent = tvb_get_ntohl(tvb, offset + dataLen);
- if(crc == sent) {
- proto_tree_add_uint_format(ti, hf_iscsi_DataDigest32, tvb, offset + dataLen, 4, sent, "DataDigest: 0x%08x (Good CRC32)", sent);
- }
- else {
- proto_tree_add_uint_format(ti, hf_iscsi_DataDigest32, tvb, offset + dataLen, 4, sent, "DataDigest: 0x%08x (Bad CRC32, should be 0x%08x)", sent, crc);
- }
- }
- return offset + dataLen + 4;
- }
- if((unsigned)available_bytes >= (dataLen + dataDigestSize)) {
- proto_tree_add_item(ti, hf_iscsi_DataDigest, tvb, offset + dataLen, dataDigestSize, ENC_NA);
- }
- return offset + dataLen + dataDigestSize;
+ if(dataDigestIsCRC32) {
+ if(available_bytes >= (dataLen + 4)) {
+ guint32 crc = ~crc32c_calculate(tvb_get_ptr(tvb, offset, dataLen), dataLen, CRC32C_PRELOAD);
+ guint32 sent = tvb_get_ntohl(tvb, offset + dataLen);
+ if(crc == sent) {
+ proto_tree_add_uint_format(ti, hf_iscsi_DataDigest32, tvb, offset + dataLen, 4, sent, "DataDigest: 0x%08x (Good CRC32)", sent);
+ }
+ else {
+ proto_tree_add_uint_format(ti, hf_iscsi_DataDigest32, tvb, offset + dataLen, 4, sent, "DataDigest: 0x%08x (Bad CRC32, should be 0x%08x)", sent, crc);
+ }
+ }
+ return offset + dataLen + 4;
+ }
+ if((unsigned)available_bytes >= (dataLen + dataDigestSize)) {
+ proto_tree_add_item(ti, hf_iscsi_DataDigest, tvb, offset + dataLen, dataDigestSize, ENC_NA);
+ }
+ return offset + dataLen + dataDigestSize;
}
return offset + dataLen;
}
@@ -677,19 +677,19 @@ handleDataDigest(proto_item *ti, tvbuff_t *tvb, guint offset, int dataLen) {
static int
handleDataSegment(proto_item *ti, tvbuff_t *tvb, guint offset, guint dataSegmentLen, guint endOffset, int hf_id) {
if(endOffset > offset) {
- int dataOffset = offset;
- int dataLen = MIN(dataSegmentLen, endOffset - offset);
- if(dataLen > 0) {
- proto_tree_add_item(ti, hf_id, tvb, offset, dataLen, FALSE);
- offset += dataLen;
- }
- if(offset < endOffset && (offset & 3) != 0) {
- int padding = 4 - (offset & 3);
- proto_tree_add_item(ti, hf_iscsi_Padding, tvb, offset, padding, ENC_NA);
- offset += padding;
- }
- if(dataSegmentLen > 0 && offset < endOffset)
- offset = handleDataDigest(ti, tvb, dataOffset, offset - dataOffset);
+ int dataOffset = offset;
+ int dataLen = MIN(dataSegmentLen, endOffset - offset);
+ if(dataLen > 0) {
+ proto_tree_add_item(ti, hf_id, tvb, offset, dataLen, FALSE);
+ offset += dataLen;
+ }
+ if(offset < endOffset && (offset & 3) != 0) {
+ int padding = 4 - (offset & 3);
+ proto_tree_add_item(ti, hf_iscsi_Padding, tvb, offset, padding, ENC_NA);
+ offset += padding;
+ }
+ if(dataSegmentLen > 0 && offset < endOffset)
+ offset = handleDataDigest(ti, tvb, dataOffset, offset - dataOffset);
}
return offset;
@@ -698,20 +698,20 @@ handleDataSegment(proto_item *ti, tvbuff_t *tvb, guint offset, guint dataSegment
static int
handleDataSegmentAsTextKeys(packet_info *pinfo, proto_item *ti, tvbuff_t *tvb, guint offset, guint dataSegmentLen, guint endOffset, int digestsActive) {
if(endOffset > offset) {
- int dataOffset = offset;
- int textLen = MIN(dataSegmentLen, endOffset - offset);
- if(textLen > 0) {
- proto_item *tf = proto_tree_add_text(ti, tvb, offset, textLen, "Key/Value Pairs");
- proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_KeyValues);
- offset = addTextKeys(pinfo, tt, tvb, offset, textLen);
- }
- if(offset < endOffset && (offset & 3) != 0) {
- int padding = 4 - (offset & 3);
- proto_tree_add_item(ti, hf_iscsi_Padding, tvb, offset, padding, ENC_NA);
- offset += padding;
- }
- if(digestsActive && dataSegmentLen > 0 && offset < endOffset)
- offset = handleDataDigest(ti, tvb, dataOffset, offset - dataOffset);
+ int dataOffset = offset;
+ int textLen = MIN(dataSegmentLen, endOffset - offset);
+ if(textLen > 0) {
+ proto_item *tf = proto_tree_add_text(ti, tvb, offset, textLen, "Key/Value Pairs");
+ proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_KeyValues);
+ offset = addTextKeys(pinfo, tt, tvb, offset, textLen);
+ }
+ if(offset < endOffset && (offset & 3) != 0) {
+ int padding = 4 - (offset & 3);
+ proto_tree_add_item(ti, hf_iscsi_Padding, tvb, offset, padding, ENC_NA);
+ offset += padding;
+ }
+ if(digestsActive && dataSegmentLen > 0 && offset < endOffset)
+ offset = handleDataDigest(ti, tvb, dataOffset, offset - dataOffset);
}
return offset;
}
@@ -737,7 +737,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
guint32 data_offset=0;
if(paddedDataSegmentLength & 3)
- paddedDataSegmentLength += 4 - (paddedDataSegmentLength & 3);
+ paddedDataSegmentLength += 4 - (paddedDataSegmentLength & 3);
/* Make entries in Protocol column and Info column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "iSCSI");
@@ -748,9 +748,9 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
cdata = se_alloc (sizeof(iscsi_conv_data_t));
cdata->itlq.lun=0xffff;
cdata->itlq.scsi_opcode=0xffff;
- cdata->itlq.task_flags=0;
- cdata->itlq.data_length=0;
- cdata->itlq.bidir_data_length=0;
+ cdata->itlq.task_flags=0;
+ cdata->itlq.data_length=0;
+ cdata->itlq.bidir_data_length=0;
cdata->itlq.fc_time = pinfo->fd->abs_ts;
cdata->itlq.first_exchange_frame=0;
cdata->itlq.last_exchange_frame=0;
@@ -764,7 +764,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
}
if (opcode == ISCSI_OPCODE_SCSI_RESPONSE ||
- opcode == ISCSI_OPCODE_SCSI_DATA_IN) {
+ opcode == ISCSI_OPCODE_SCSI_DATA_IN) {
scsi_status = tvb_get_guint8 (tvb, offset+3);
}
@@ -795,19 +795,19 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
If bit 6 of first bit is 0 then just take second byte as the LUN
If bit 6 of first bit is 1, then take 6 bits from first byte
and all of second byte and pretend it is the lun value
- people that care can add host specific dissection of vsa later.
+ people that care can add host specific dissection of vsa later.
We need to keep track of this on a per transaction basis since
for error recoverylevel 0 and when the A bit is clear in a
Data-In PDU, there will not be a LUN field in teh iscsi layer.
*/
if(tvb_get_guint8(tvb, offset+8)&0x40){
- /* volume set addressing */
- lun=tvb_get_guint8(tvb,offset+8)&0x3f;
- lun<<=8;
- lun|=tvb_get_guint8(tvb,offset+9);
+ /* volume set addressing */
+ lun=tvb_get_guint8(tvb,offset+8)&0x3f;
+ lun<<=8;
+ lun|=tvb_get_guint8(tvb,offset+9);
} else {
- lun=tvb_get_guint8(tvb,offset+9);
+ lun=tvb_get_guint8(tvb,offset+9);
}
cdata->itlq.lun=lun;
@@ -834,686 +834,686 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
col_append_str(pinfo->cinfo, COL_INFO, opcode_str);
- if (opcode == ISCSI_OPCODE_SCSI_RESPONSE ||
- (opcode == ISCSI_OPCODE_SCSI_DATA_IN &&
- (tvb_get_guint8(tvb, offset + 1) & ISCSI_SCSI_DATA_FLAG_S))) {
- col_append_fstr (pinfo->cinfo, COL_INFO, " (%s)",
- val_to_str (scsi_status, scsi_status_val, "0x%x"));
- }
- else if (opcode == ISCSI_OPCODE_LOGIN_RESPONSE) {
- guint16 login_status = tvb_get_ntohs(tvb, offset+36);
- col_append_fstr (pinfo->cinfo, COL_INFO, " (%s)",
- val_to_str (login_status, iscsi_login_status, "0x%x"));
- }
- else if (opcode == ISCSI_OPCODE_LOGOUT_COMMAND) {
- guint8 logoutReason;
- if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08) {
- logoutReason = tvb_get_guint8(tvb, offset+11);
- } else if(iscsi_protocol_version >= ISCSI_PROTOCOL_DRAFT13) {
- logoutReason = tvb_get_guint8(tvb, offset+1) & 0x7f;
- }
- else {
- logoutReason = tvb_get_guint8(tvb, offset+23);
- }
- col_append_fstr (pinfo->cinfo, COL_INFO, " (%s)",
- val_to_str (logoutReason, iscsi_logout_reasons, "0x%x"));
- }
- else if (opcode == ISCSI_OPCODE_TASK_MANAGEMENT_FUNCTION) {
- guint8 tmf = tvb_get_guint8(tvb, offset + 1);
- col_append_fstr (pinfo->cinfo, COL_INFO, " (%s)",
- val_to_str (tmf, iscsi_task_management_functions, "0x%x"));
- }
- else if (opcode == ISCSI_OPCODE_TASK_MANAGEMENT_FUNCTION_RESPONSE) {
- guint8 resp = tvb_get_guint8(tvb, offset + 2);
- col_append_fstr (pinfo->cinfo, COL_INFO, " (%s)",
- val_to_str (resp, iscsi_task_management_responses, "0x%x"));
- }
- else if (opcode == ISCSI_OPCODE_REJECT) {
- guint8 reason = tvb_get_guint8(tvb, offset + 2);
- col_append_fstr (pinfo->cinfo, COL_INFO, " (%s)",
- val_to_str (reason, iscsi_reject_reasons, "0x%x"));
- }
- else if (opcode == ISCSI_OPCODE_ASYNC_MESSAGE) {
- guint8 asyncEvent = tvb_get_guint8(tvb, offset + 36);
- col_append_fstr (pinfo->cinfo, COL_INFO, " (%s)",
- val_to_str (asyncEvent, iscsi_asyncevents, "0x%x"));
- }
- }
+ if (opcode == ISCSI_OPCODE_SCSI_RESPONSE ||
+ (opcode == ISCSI_OPCODE_SCSI_DATA_IN &&
+ (tvb_get_guint8(tvb, offset + 1) & ISCSI_SCSI_DATA_FLAG_S))) {
+ col_append_fstr (pinfo->cinfo, COL_INFO, " (%s)",
+ val_to_str (scsi_status, scsi_status_val, "0x%x"));
+ }
+ else if (opcode == ISCSI_OPCODE_LOGIN_RESPONSE) {
+ guint16 login_status = tvb_get_ntohs(tvb, offset+36);
+ col_append_fstr (pinfo->cinfo, COL_INFO, " (%s)",
+ val_to_str (login_status, iscsi_login_status, "0x%x"));
+ }
+ else if (opcode == ISCSI_OPCODE_LOGOUT_COMMAND) {
+ guint8 logoutReason;
+ if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08) {
+ logoutReason = tvb_get_guint8(tvb, offset+11);
+ } else if(iscsi_protocol_version >= ISCSI_PROTOCOL_DRAFT13) {
+ logoutReason = tvb_get_guint8(tvb, offset+1) & 0x7f;
+ }
+ else {
+ logoutReason = tvb_get_guint8(tvb, offset+23);
+ }
+ col_append_fstr (pinfo->cinfo, COL_INFO, " (%s)",
+ val_to_str (logoutReason, iscsi_logout_reasons, "0x%x"));
+ }
+ else if (opcode == ISCSI_OPCODE_TASK_MANAGEMENT_FUNCTION) {
+ guint8 tmf = tvb_get_guint8(tvb, offset + 1);
+ col_append_fstr (pinfo->cinfo, COL_INFO, " (%s)",
+ val_to_str (tmf, iscsi_task_management_functions, "0x%x"));
+ }
+ else if (opcode == ISCSI_OPCODE_TASK_MANAGEMENT_FUNCTION_RESPONSE) {
+ guint8 resp = tvb_get_guint8(tvb, offset + 2);
+ col_append_fstr (pinfo->cinfo, COL_INFO, " (%s)",
+ val_to_str (resp, iscsi_task_management_responses, "0x%x"));
+ }
+ else if (opcode == ISCSI_OPCODE_REJECT) {
+ guint8 reason = tvb_get_guint8(tvb, offset + 2);
+ col_append_fstr (pinfo->cinfo, COL_INFO, " (%s)",
+ val_to_str (reason, iscsi_reject_reasons, "0x%x"));
+ }
+ else if (opcode == ISCSI_OPCODE_ASYNC_MESSAGE) {
+ guint8 asyncEvent = tvb_get_guint8(tvb, offset + 36);
+ col_append_fstr (pinfo->cinfo, COL_INFO, " (%s)",
+ val_to_str (asyncEvent, iscsi_asyncevents, "0x%x"));
+ }
+ }
}
/* In the interest of speed, if "tree" is NULL, don't do any
work not necessary to generate protocol tree items. */
if (tree) {
- proto_item *tp;
- /* create display subtree for the protocol */
- tp = proto_tree_add_protocol_format(tree, proto_iscsi, tvb,
- offset, -1, "iSCSI (%s)",
- opcode_str);
- ti = proto_item_add_subtree(tp, ett_iscsi);
+ proto_item *tp;
+ /* create display subtree for the protocol */
+ tp = proto_tree_add_protocol_format(tree, proto_iscsi, tvb,
+ offset, -1, "iSCSI (%s)",
+ opcode_str);
+ ti = proto_item_add_subtree(tp, ett_iscsi);
}
proto_tree_add_uint(ti, hf_iscsi_Opcode, tvb,
- offset + 0, 1, opcode);
+ offset + 0, 1, opcode);
if((opcode & TARGET_OPCODE_BIT) == 0) {
- /* initiator -> target */
- gint b = tvb_get_guint8(tvb, offset + 0);
- if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08) {
- if(opcode != ISCSI_OPCODE_SCSI_DATA_OUT &&
- opcode != ISCSI_OPCODE_LOGOUT_COMMAND &&
- opcode != ISCSI_OPCODE_SNACK_REQUEST)
- proto_tree_add_boolean(ti, hf_iscsi_X, tvb, offset + 0, 1, b);
- }
- if(opcode != ISCSI_OPCODE_SCSI_DATA_OUT &&
- opcode != ISCSI_OPCODE_LOGIN_COMMAND &&
- opcode != ISCSI_OPCODE_SNACK_REQUEST)
- proto_tree_add_boolean(ti, hf_iscsi_I, tvb, offset + 0, 1, b);
+ /* initiator -> target */
+ gint b = tvb_get_guint8(tvb, offset + 0);
+ if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08) {
+ if(opcode != ISCSI_OPCODE_SCSI_DATA_OUT &&
+ opcode != ISCSI_OPCODE_LOGOUT_COMMAND &&
+ opcode != ISCSI_OPCODE_SNACK_REQUEST)
+ proto_tree_add_boolean(ti, hf_iscsi_X, tvb, offset + 0, 1, b);
+ }
+ if(opcode != ISCSI_OPCODE_SCSI_DATA_OUT &&
+ opcode != ISCSI_OPCODE_LOGIN_COMMAND &&
+ opcode != ISCSI_OPCODE_SNACK_REQUEST)
+ proto_tree_add_boolean(ti, hf_iscsi_I, tvb, offset + 0, 1, b);
}
if(opcode == ISCSI_OPCODE_NOP_OUT) {
- /* NOP Out */
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- }
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
- proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_TargetTransferTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_CmdSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
- offset = handleDataSegment(ti, tvb, offset, data_segment_len, end_offset, hf_iscsi_ping_data);
+ /* NOP Out */
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
+ proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_TargetTransferTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_CmdSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
+ offset = handleDataSegment(ti, tvb, offset, data_segment_len, end_offset, hf_iscsi_ping_data);
} else if(opcode == ISCSI_OPCODE_NOP_IN) {
- /* NOP In */
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- }
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
- proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_TargetTransferTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
- offset = handleDataSegment(ti, tvb, offset, data_segment_len, end_offset, hf_iscsi_ping_data);
+ /* NOP In */
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
+ proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_TargetTransferTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
+ offset = handleDataSegment(ti, tvb, offset, data_segment_len, end_offset, hf_iscsi_ping_data);
} else if(opcode == ISCSI_OPCODE_SCSI_COMMAND) {
- /* SCSI Command */
- guint32 ahsLen = tvb_get_guint8(tvb, offset + 4) * 4;
- {
- gint b = tvb_get_guint8(tvb, offset + 1);
-
- proto_item *tf = proto_tree_add_uint(ti, hf_iscsi_Flags, tvb, offset + 1, 1, b);
- proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_Flags);
-
- proto_tree_add_boolean(tt, hf_iscsi_SCSICommand_F, tvb, offset + 1, 1, b);
- proto_tree_add_boolean(tt, hf_iscsi_SCSICommand_R, tvb, offset + 1, 1, b);
- if(b&0x40){
- cdata->itlq.task_flags|=SCSI_DATA_READ;
- }
- proto_tree_add_boolean(tt, hf_iscsi_SCSICommand_W, tvb, offset + 1, 1, b);
- if(b&0x20){
- cdata->itlq.task_flags|=SCSI_DATA_WRITE;
- }
- proto_tree_add_uint(tt, hf_iscsi_SCSICommand_Attr, tvb, offset + 1, 1, b);
- }
- if(iscsi_protocol_version < ISCSI_PROTOCOL_DRAFT12) {
- proto_tree_add_item(ti, hf_iscsi_SCSICommand_CRN, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
- }
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
- proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpectedDataTransferLength, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
- cdata->itlq.data_length=tvb_get_ntohl(tvb, offset+20);
- proto_tree_add_item(ti, hf_iscsi_CmdSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- if(ahsLen > 0) {
- guint ahs_offset=offset+48;
- guint16 ahs_length=0;
- guint8 ahs_type=0;
-
- while(ahs_offset<(offset+48+ahsLen)){
-
- ahs_length=tvb_get_ntohs(tvb, ahs_offset);
- proto_tree_add_item(ti, hf_iscsi_AHS_length, tvb, ahs_offset, 2, ENC_BIG_ENDIAN);
- ahs_offset+=2;
-
- ahs_type=tvb_get_guint8(tvb, ahs_offset);
- proto_tree_add_item(ti, hf_iscsi_AHS_type, tvb, ahs_offset, 1, ENC_BIG_ENDIAN);
- ahs_offset++;
-
- switch(ahs_type){
- case 0x01: /* extended CDB */
- /* additional cdb */
- ahs_cdb_offset=ahs_offset+1;
- ahs_cdb_length=ahs_length-1;
- proto_tree_add_item(ti, hf_iscsi_AHS_extended_cdb, tvb, ahs_cdb_offset, ahs_cdb_length, ENC_NA);
- ahs_offset+=ahs_length;
- break;
- case 0x02: /* bidirectional read data length */
- /* skip reserved byte */
- ahs_offset++;
- /* read data length */
- proto_tree_add_item(ti, hf_iscsi_AHS_read_data_length, tvb, ahs_offset, 4, ENC_BIG_ENDIAN);
- cdata->itlq.bidir_data_length=tvb_get_ntohl(tvb, ahs_offset);
- ahs_offset+=4;
- break;
- default:
- proto_tree_add_item(ti, hf_iscsi_AHS_blob, tvb, ahs_offset, ahs_length, ENC_NA);
- ahs_offset+=ahs_length;
- }
-
- /* strip off padding bytes */
- if(ahs_offset&0x0003){
- ahs_offset=(ahs_offset+3)&0xfffc;
- }
-
- }
-
- }
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48 + ahsLen);
-
- immediate_data_offset=offset;
- offset = handleDataSegment(ti, tvb, offset, data_segment_len, end_offset, hf_iscsi_immediate_data);
- immediate_data_length=offset-immediate_data_offset;
+ /* SCSI Command */
+ guint32 ahsLen = tvb_get_guint8(tvb, offset + 4) * 4;
+ {
+ gint b = tvb_get_guint8(tvb, offset + 1);
+
+ proto_item *tf = proto_tree_add_uint(ti, hf_iscsi_Flags, tvb, offset + 1, 1, b);
+ proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_Flags);
+
+ proto_tree_add_boolean(tt, hf_iscsi_SCSICommand_F, tvb, offset + 1, 1, b);
+ proto_tree_add_boolean(tt, hf_iscsi_SCSICommand_R, tvb, offset + 1, 1, b);
+ if(b&0x40){
+ cdata->itlq.task_flags|=SCSI_DATA_READ;
+ }
+ proto_tree_add_boolean(tt, hf_iscsi_SCSICommand_W, tvb, offset + 1, 1, b);
+ if(b&0x20){
+ cdata->itlq.task_flags|=SCSI_DATA_WRITE;
+ }
+ proto_tree_add_uint(tt, hf_iscsi_SCSICommand_Attr, tvb, offset + 1, 1, b);
+ }
+ if(iscsi_protocol_version < ISCSI_PROTOCOL_DRAFT12) {
+ proto_tree_add_item(ti, hf_iscsi_SCSICommand_CRN, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
+ proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpectedDataTransferLength, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
+ cdata->itlq.data_length=tvb_get_ntohl(tvb, offset+20);
+ proto_tree_add_item(ti, hf_iscsi_CmdSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ if(ahsLen > 0) {
+ guint ahs_offset=offset+48;
+ guint16 ahs_length=0;
+ guint8 ahs_type=0;
+
+ while(ahs_offset<(offset+48+ahsLen)){
+
+ ahs_length=tvb_get_ntohs(tvb, ahs_offset);
+ proto_tree_add_item(ti, hf_iscsi_AHS_length, tvb, ahs_offset, 2, ENC_BIG_ENDIAN);
+ ahs_offset+=2;
+
+ ahs_type=tvb_get_guint8(tvb, ahs_offset);
+ proto_tree_add_item(ti, hf_iscsi_AHS_type, tvb, ahs_offset, 1, ENC_BIG_ENDIAN);
+ ahs_offset++;
+
+ switch(ahs_type){
+ case 0x01: /* extended CDB */
+ /* additional cdb */
+ ahs_cdb_offset=ahs_offset+1;
+ ahs_cdb_length=ahs_length-1;
+ proto_tree_add_item(ti, hf_iscsi_AHS_extended_cdb, tvb, ahs_cdb_offset, ahs_cdb_length, ENC_NA);
+ ahs_offset+=ahs_length;
+ break;
+ case 0x02: /* bidirectional read data length */
+ /* skip reserved byte */
+ ahs_offset++;
+ /* read data length */
+ proto_tree_add_item(ti, hf_iscsi_AHS_read_data_length, tvb, ahs_offset, 4, ENC_BIG_ENDIAN);
+ cdata->itlq.bidir_data_length=tvb_get_ntohl(tvb, ahs_offset);
+ ahs_offset+=4;
+ break;
+ default:
+ proto_tree_add_item(ti, hf_iscsi_AHS_blob, tvb, ahs_offset, ahs_length, ENC_NA);
+ ahs_offset+=ahs_length;
+ }
+
+ /* strip off padding bytes */
+ if(ahs_offset&0x0003){
+ ahs_offset=(ahs_offset+3)&0xfffc;
+ }
+
+ }
+
+ }
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48 + ahsLen);
+
+ immediate_data_offset=offset;
+ offset = handleDataSegment(ti, tvb, offset, data_segment_len, end_offset, hf_iscsi_immediate_data);
+ immediate_data_length=offset-immediate_data_offset;
} else if(opcode == ISCSI_OPCODE_SCSI_RESPONSE) {
- /* SCSI Response */
- {
- gint b = tvb_get_guint8(tvb, offset + 1);
- proto_item *tf = proto_tree_add_uint(ti, hf_iscsi_Flags, tvb, offset + 1, 1, b);
- proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_Flags);
-
- proto_tree_add_boolean(tt, hf_iscsi_SCSIResponse_o, tvb, offset + 1, 1, b);
- proto_tree_add_boolean(tt, hf_iscsi_SCSIResponse_u, tvb, offset + 1, 1, b);
- proto_tree_add_boolean(tt, hf_iscsi_SCSIResponse_O, tvb, offset + 1, 1, b);
- proto_tree_add_boolean(tt, hf_iscsi_SCSIResponse_U, tvb, offset + 1, 1, b);
- }
- proto_tree_add_item(ti, hf_iscsi_SCSIResponse_Response, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_SCSIResponse_Status, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- }
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
- if(iscsi_protocol_version <= ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_SCSIResponse_ResidualCount, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
- }
- proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpDataSN, tvb, offset + 36, 4, ENC_BIG_ENDIAN);
- if(iscsi_protocol_version <= ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_SCSIResponse_BidiReadResidualCount, tvb, offset + 44, 4, ENC_BIG_ENDIAN);
- }
- else {
- proto_tree_add_item(ti, hf_iscsi_SCSIResponse_BidiReadResidualCount, tvb, offset + 40, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_SCSIResponse_ResidualCount, tvb, offset + 44, 4, ENC_BIG_ENDIAN);
- }
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
- /* do not update offset here because the data segment is
- * dissected below */
- handleDataDigest(ti, tvb, offset, paddedDataSegmentLength);
+ /* SCSI Response */
+ {
+ gint b = tvb_get_guint8(tvb, offset + 1);
+ proto_item *tf = proto_tree_add_uint(ti, hf_iscsi_Flags, tvb, offset + 1, 1, b);
+ proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_Flags);
+
+ proto_tree_add_boolean(tt, hf_iscsi_SCSIResponse_o, tvb, offset + 1, 1, b);
+ proto_tree_add_boolean(tt, hf_iscsi_SCSIResponse_u, tvb, offset + 1, 1, b);
+ proto_tree_add_boolean(tt, hf_iscsi_SCSIResponse_O, tvb, offset + 1, 1, b);
+ proto_tree_add_boolean(tt, hf_iscsi_SCSIResponse_U, tvb, offset + 1, 1, b);
+ }
+ proto_tree_add_item(ti, hf_iscsi_SCSIResponse_Response, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_SCSIResponse_Status, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
+ if(iscsi_protocol_version <= ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_SCSIResponse_ResidualCount, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpDataSN, tvb, offset + 36, 4, ENC_BIG_ENDIAN);
+ if(iscsi_protocol_version <= ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_SCSIResponse_BidiReadResidualCount, tvb, offset + 44, 4, ENC_BIG_ENDIAN);
+ }
+ else {
+ proto_tree_add_item(ti, hf_iscsi_SCSIResponse_BidiReadResidualCount, tvb, offset + 40, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_SCSIResponse_ResidualCount, tvb, offset + 44, 4, ENC_BIG_ENDIAN);
+ }
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
+ /* do not update offset here because the data segment is
+ * dissected below */
+ handleDataDigest(ti, tvb, offset, paddedDataSegmentLength);
} else if(opcode == ISCSI_OPCODE_TASK_MANAGEMENT_FUNCTION) {
- /* Task Management Function */
- proto_tree_add_item(ti, hf_iscsi_TaskManagementFunction_Function, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- }
- proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
- proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_TaskManagementFunction_ReferencedTaskTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_CmdSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_RefCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
+ /* Task Management Function */
+ proto_tree_add_item(ti, hf_iscsi_TaskManagementFunction_Function, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ }
+ proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
+ proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_TaskManagementFunction_ReferencedTaskTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_CmdSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_RefCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
} else if(opcode == ISCSI_OPCODE_TASK_MANAGEMENT_FUNCTION_RESPONSE) {
- /* Task Management Function Response */
- proto_tree_add_item(ti, hf_iscsi_TaskManagementFunction_Response, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
- if(iscsi_protocol_version <= ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- }
- proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
- if(iscsi_protocol_version < ISCSI_PROTOCOL_DRAFT12) {
- proto_tree_add_item(ti, hf_iscsi_TaskManagementFunction_ReferencedTaskTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
- }
- proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
+ /* Task Management Function Response */
+ proto_tree_add_item(ti, hf_iscsi_TaskManagementFunction_Response, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
+ if(iscsi_protocol_version <= ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ }
+ proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
+ if(iscsi_protocol_version < ISCSI_PROTOCOL_DRAFT12) {
+ proto_tree_add_item(ti, hf_iscsi_TaskManagementFunction_ReferencedTaskTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
} else if(opcode == ISCSI_OPCODE_LOGIN_COMMAND) {
- /* Login Command */
- int digestsActive = 0;
- {
- gint b = tvb_get_guint8(tvb, offset + 1);
- if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08) {
- if((b & CSG_MASK) >= ISCSI_CSG_OPERATIONAL_NEGOTIATION)
- digestsActive = 1;
- }
+ /* Login Command */
+ int digestsActive = 0;
+ {
+ gint b = tvb_get_guint8(tvb, offset + 1);
+ if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08) {
+ if((b & CSG_MASK) >= ISCSI_CSG_OPERATIONAL_NEGOTIATION)
+ digestsActive = 1;
+ }
#if 0
- proto_item *tf = proto_tree_add_uint(ti, hf_iscsi_Flags, tvb, offset + 1, 1, b);
- proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_Flags);
+ proto_item *tf = proto_tree_add_uint(ti, hf_iscsi_Flags, tvb, offset + 1, 1, b);
+ proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_Flags);
#endif
- proto_tree_add_boolean(ti, hf_iscsi_Login_T, tvb, offset + 1, 1, b);
- if(iscsi_protocol_version >= ISCSI_PROTOCOL_DRAFT13) {
- proto_tree_add_boolean(ti, hf_iscsi_Login_C, tvb, offset + 1, 1, b);
- }
- if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08) {
- proto_tree_add_boolean(ti, hf_iscsi_Login_X, tvb, offset + 1, 1, b);
- }
- proto_tree_add_item(ti, hf_iscsi_Login_CSG, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
-
- /* NSG is undefined unless T is set */
- if(b&0x80){
- proto_tree_add_item(ti, hf_iscsi_Login_NSG, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
- }
- }
- proto_tree_add_item(ti, hf_iscsi_VersionMax, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_VersionMin, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- }
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08) {
- proto_tree_add_item(ti, hf_iscsi_CID, tvb, offset + 8, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ISID8, tvb, offset + 12, 2, ENC_BIG_ENDIAN);
- }
- else {
- proto_item *tf = proto_tree_add_item(ti, hf_iscsi_ISID, tvb, offset + 8, 6, ENC_NA);
- proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_ISID);
- if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(tt, hf_iscsi_ISID_Type, tvb, offset + 8, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(tt, hf_iscsi_ISID_NamingAuthority, tvb, offset + 9, 3, ENC_BIG_ENDIAN);
- proto_tree_add_item(tt, hf_iscsi_ISID_Qualifier, tvb, offset + 12, 2, ENC_BIG_ENDIAN);
- }
- else {
- proto_tree_add_item(tt, hf_iscsi_ISID_t, tvb, offset + 8, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(tt, hf_iscsi_ISID_a, tvb, offset + 8, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(tt, hf_iscsi_ISID_b, tvb, offset + 9, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(tt, hf_iscsi_ISID_c, tvb, offset + 11, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(tt, hf_iscsi_ISID_d, tvb, offset + 12, 2, ENC_BIG_ENDIAN);
- }
- }
- if(iscsi_protocol_version < ISCSI_PROTOCOL_DRAFT12) {
- proto_tree_add_item(ti, hf_iscsi_TSID, tvb, offset + 14, 2, ENC_BIG_ENDIAN);
- }
- else {
- proto_tree_add_item(ti, hf_iscsi_TSIH, tvb, offset + 14, 2, ENC_BIG_ENDIAN);
- }
- proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT08) {
- proto_tree_add_item(ti, hf_iscsi_CID, tvb, offset + 20, 2, ENC_BIG_ENDIAN);
- }
- proto_tree_add_item(ti, hf_iscsi_CmdSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- if(digestsActive){
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
- } else {
- offset += 48;
- }
- offset = handleDataSegmentAsTextKeys(pinfo, ti, tvb, offset, data_segment_len, end_offset, digestsActive);
+ proto_tree_add_boolean(ti, hf_iscsi_Login_T, tvb, offset + 1, 1, b);
+ if(iscsi_protocol_version >= ISCSI_PROTOCOL_DRAFT13) {
+ proto_tree_add_boolean(ti, hf_iscsi_Login_C, tvb, offset + 1, 1, b);
+ }
+ if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08) {
+ proto_tree_add_boolean(ti, hf_iscsi_Login_X, tvb, offset + 1, 1, b);
+ }
+ proto_tree_add_item(ti, hf_iscsi_Login_CSG, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
+
+ /* NSG is undefined unless T is set */
+ if(b&0x80){
+ proto_tree_add_item(ti, hf_iscsi_Login_NSG, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
+ }
+ }
+ proto_tree_add_item(ti, hf_iscsi_VersionMax, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_VersionMin, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08) {
+ proto_tree_add_item(ti, hf_iscsi_CID, tvb, offset + 8, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ISID8, tvb, offset + 12, 2, ENC_BIG_ENDIAN);
+ }
+ else {
+ proto_item *tf = proto_tree_add_item(ti, hf_iscsi_ISID, tvb, offset + 8, 6, ENC_NA);
+ proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_ISID);
+ if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(tt, hf_iscsi_ISID_Type, tvb, offset + 8, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tt, hf_iscsi_ISID_NamingAuthority, tvb, offset + 9, 3, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tt, hf_iscsi_ISID_Qualifier, tvb, offset + 12, 2, ENC_BIG_ENDIAN);
+ }
+ else {
+ proto_tree_add_item(tt, hf_iscsi_ISID_t, tvb, offset + 8, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tt, hf_iscsi_ISID_a, tvb, offset + 8, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tt, hf_iscsi_ISID_b, tvb, offset + 9, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tt, hf_iscsi_ISID_c, tvb, offset + 11, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tt, hf_iscsi_ISID_d, tvb, offset + 12, 2, ENC_BIG_ENDIAN);
+ }
+ }
+ if(iscsi_protocol_version < ISCSI_PROTOCOL_DRAFT12) {
+ proto_tree_add_item(ti, hf_iscsi_TSID, tvb, offset + 14, 2, ENC_BIG_ENDIAN);
+ }
+ else {
+ proto_tree_add_item(ti, hf_iscsi_TSIH, tvb, offset + 14, 2, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT08) {
+ proto_tree_add_item(ti, hf_iscsi_CID, tvb, offset + 20, 2, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_item(ti, hf_iscsi_CmdSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ if(digestsActive){
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
+ } else {
+ offset += 48;
+ }
+ offset = handleDataSegmentAsTextKeys(pinfo, ti, tvb, offset, data_segment_len, end_offset, digestsActive);
} else if(opcode == ISCSI_OPCODE_LOGIN_RESPONSE) {
- /* Login Response */
- int digestsActive = 0;
- {
- gint b = tvb_get_guint8(tvb, offset + 1);
- if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08) {
- if((b & CSG_MASK) >= ISCSI_CSG_OPERATIONAL_NEGOTIATION)
- digestsActive = 1;
- }
+ /* Login Response */
+ int digestsActive = 0;
+ {
+ gint b = tvb_get_guint8(tvb, offset + 1);
+ if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08) {
+ if((b & CSG_MASK) >= ISCSI_CSG_OPERATIONAL_NEGOTIATION)
+ digestsActive = 1;
+ }
#if 0
- proto_item *tf = proto_tree_add_uint(ti, hf_iscsi_Flags, tvb, offset + 1, 1, b);
- proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_Flags);
+ proto_item *tf = proto_tree_add_uint(ti, hf_iscsi_Flags, tvb, offset + 1, 1, b);
+ proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_Flags);
#endif
- proto_tree_add_boolean(ti, hf_iscsi_Login_T, tvb, offset + 1, 1, b);
- if(iscsi_protocol_version >= ISCSI_PROTOCOL_DRAFT13) {
- proto_tree_add_boolean(ti, hf_iscsi_Login_C, tvb, offset + 1, 1, b);
- }
- proto_tree_add_item(ti, hf_iscsi_Login_CSG, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
- /* NSG is undefined unless T is set */
- if(b&0x80){
- proto_tree_add_item(ti, hf_iscsi_Login_NSG, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
- }
- }
-
- proto_tree_add_item(ti, hf_iscsi_VersionMax, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_VersionActive, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- }
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08) {
- proto_tree_add_item(ti, hf_iscsi_ISID8, tvb, offset + 12, 2, ENC_BIG_ENDIAN);
- }
- else {
- proto_item *tf = proto_tree_add_item(ti, hf_iscsi_ISID, tvb, offset + 8, 6, ENC_NA);
- proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_ISID);
- if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(tt, hf_iscsi_ISID_Type, tvb, offset + 8, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(tt, hf_iscsi_ISID_NamingAuthority, tvb, offset + 9, 3, ENC_BIG_ENDIAN);
- proto_tree_add_item(tt, hf_iscsi_ISID_Qualifier, tvb, offset + 12, 2, ENC_BIG_ENDIAN);
- }
- else {
- proto_tree_add_item(tt, hf_iscsi_ISID_t, tvb, offset + 8, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(tt, hf_iscsi_ISID_a, tvb, offset + 8, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(tt, hf_iscsi_ISID_b, tvb, offset + 9, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(tt, hf_iscsi_ISID_c, tvb, offset + 11, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(tt, hf_iscsi_ISID_d, tvb, offset + 12, 2, ENC_BIG_ENDIAN);
- }
- }
- if(iscsi_protocol_version < ISCSI_PROTOCOL_DRAFT12) {
- proto_tree_add_item(ti, hf_iscsi_TSID, tvb, offset + 14, 2, ENC_BIG_ENDIAN);
- }
- else {
- proto_tree_add_item(ti, hf_iscsi_TSIH, tvb, offset + 14, 2, ENC_BIG_ENDIAN);
- }
- proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_Login_Status, tvb, offset + 36, 2, ENC_BIG_ENDIAN);
- if(digestsActive){
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
- } else {
- offset += 48;
- }
- offset = handleDataSegmentAsTextKeys(pinfo, ti, tvb, offset, data_segment_len, end_offset, digestsActive);
+ proto_tree_add_boolean(ti, hf_iscsi_Login_T, tvb, offset + 1, 1, b);
+ if(iscsi_protocol_version >= ISCSI_PROTOCOL_DRAFT13) {
+ proto_tree_add_boolean(ti, hf_iscsi_Login_C, tvb, offset + 1, 1, b);
+ }
+ proto_tree_add_item(ti, hf_iscsi_Login_CSG, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
+ /* NSG is undefined unless T is set */
+ if(b&0x80){
+ proto_tree_add_item(ti, hf_iscsi_Login_NSG, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
+ }
+ }
+
+ proto_tree_add_item(ti, hf_iscsi_VersionMax, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_VersionActive, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08) {
+ proto_tree_add_item(ti, hf_iscsi_ISID8, tvb, offset + 12, 2, ENC_BIG_ENDIAN);
+ }
+ else {
+ proto_item *tf = proto_tree_add_item(ti, hf_iscsi_ISID, tvb, offset + 8, 6, ENC_NA);
+ proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_ISID);
+ if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(tt, hf_iscsi_ISID_Type, tvb, offset + 8, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tt, hf_iscsi_ISID_NamingAuthority, tvb, offset + 9, 3, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tt, hf_iscsi_ISID_Qualifier, tvb, offset + 12, 2, ENC_BIG_ENDIAN);
+ }
+ else {
+ proto_tree_add_item(tt, hf_iscsi_ISID_t, tvb, offset + 8, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tt, hf_iscsi_ISID_a, tvb, offset + 8, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tt, hf_iscsi_ISID_b, tvb, offset + 9, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tt, hf_iscsi_ISID_c, tvb, offset + 11, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tt, hf_iscsi_ISID_d, tvb, offset + 12, 2, ENC_BIG_ENDIAN);
+ }
+ }
+ if(iscsi_protocol_version < ISCSI_PROTOCOL_DRAFT12) {
+ proto_tree_add_item(ti, hf_iscsi_TSID, tvb, offset + 14, 2, ENC_BIG_ENDIAN);
+ }
+ else {
+ proto_tree_add_item(ti, hf_iscsi_TSIH, tvb, offset + 14, 2, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_Login_Status, tvb, offset + 36, 2, ENC_BIG_ENDIAN);
+ if(digestsActive){
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
+ } else {
+ offset += 48;
+ }
+ offset = handleDataSegmentAsTextKeys(pinfo, ti, tvb, offset, data_segment_len, end_offset, digestsActive);
} else if(opcode == ISCSI_OPCODE_TEXT_COMMAND) {
- /* Text Command */
- {
- gint b = tvb_get_guint8(tvb, offset + 1);
- proto_item *tf = proto_tree_add_uint(ti, hf_iscsi_Flags, tvb, offset + 1, 1, b);
- proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_Flags);
-
- proto_tree_add_boolean(tt, hf_iscsi_Text_F, tvb, offset + 1, 1, b);
- if(iscsi_protocol_version >= ISCSI_PROTOCOL_DRAFT13) {
- proto_tree_add_boolean(tt, hf_iscsi_Text_C, tvb, offset + 1, 1, b);
- }
- }
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- }
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
- }
- proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_TargetTransferTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_CmdSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
- offset = handleDataSegmentAsTextKeys(pinfo, ti, tvb, offset, data_segment_len, end_offset, TRUE);
+ /* Text Command */
+ {
+ gint b = tvb_get_guint8(tvb, offset + 1);
+ proto_item *tf = proto_tree_add_uint(ti, hf_iscsi_Flags, tvb, offset + 1, 1, b);
+ proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_Flags);
+
+ proto_tree_add_boolean(tt, hf_iscsi_Text_F, tvb, offset + 1, 1, b);
+ if(iscsi_protocol_version >= ISCSI_PROTOCOL_DRAFT13) {
+ proto_tree_add_boolean(tt, hf_iscsi_Text_C, tvb, offset + 1, 1, b);
+ }
+ }
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
+ }
+ proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_TargetTransferTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_CmdSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
+ offset = handleDataSegmentAsTextKeys(pinfo, ti, tvb, offset, data_segment_len, end_offset, TRUE);
} else if(opcode == ISCSI_OPCODE_TEXT_RESPONSE) {
- /* Text Response */
- {
- gint b = tvb_get_guint8(tvb, offset + 1);
- proto_item *tf = proto_tree_add_uint(ti, hf_iscsi_Flags, tvb, offset + 1, 1, b);
- proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_Flags);
-
- proto_tree_add_boolean(tt, hf_iscsi_Text_F, tvb, offset + 1, 1, b);
- if(iscsi_protocol_version >= ISCSI_PROTOCOL_DRAFT13) {
- proto_tree_add_boolean(tt, hf_iscsi_Text_C, tvb, offset + 1, 1, b);
- }
- }
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- }
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
- }
- proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_TargetTransferTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
- offset = handleDataSegmentAsTextKeys(pinfo, ti, tvb, offset, data_segment_len, end_offset, TRUE);
+ /* Text Response */
+ {
+ gint b = tvb_get_guint8(tvb, offset + 1);
+ proto_item *tf = proto_tree_add_uint(ti, hf_iscsi_Flags, tvb, offset + 1, 1, b);
+ proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_Flags);
+
+ proto_tree_add_boolean(tt, hf_iscsi_Text_F, tvb, offset + 1, 1, b);
+ if(iscsi_protocol_version >= ISCSI_PROTOCOL_DRAFT13) {
+ proto_tree_add_boolean(tt, hf_iscsi_Text_C, tvb, offset + 1, 1, b);
+ }
+ }
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
+ }
+ proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_TargetTransferTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
+ offset = handleDataSegmentAsTextKeys(pinfo, ti, tvb, offset, data_segment_len, end_offset, TRUE);
} else if(opcode == ISCSI_OPCODE_SCSI_DATA_OUT) {
- /* SCSI Data Out (write) */
- {
- gint b = tvb_get_guint8(tvb, offset + 1);
- proto_item *tf = proto_tree_add_uint(ti, hf_iscsi_Flags, tvb, offset + 1, 1, b);
- proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_Flags);
-
- proto_tree_add_boolean(tt, hf_iscsi_SCSIData_F, tvb, offset + 1, 1, b);
- }
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- }
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
- proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_TargetTransferTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_DataSN, tvb, offset + 36, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_BufferOffset, tvb, offset + 40, 4, ENC_BIG_ENDIAN);
- data_offset=tvb_get_ntohl(tvb, offset+40);
-
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
- /* do not update offset here because the data segment is
- * dissected below */
- handleDataDigest(ti, tvb, offset, paddedDataSegmentLength);
+ /* SCSI Data Out (write) */
+ {
+ gint b = tvb_get_guint8(tvb, offset + 1);
+ proto_item *tf = proto_tree_add_uint(ti, hf_iscsi_Flags, tvb, offset + 1, 1, b);
+ proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_Flags);
+
+ proto_tree_add_boolean(tt, hf_iscsi_SCSIData_F, tvb, offset + 1, 1, b);
+ }
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
+ proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_TargetTransferTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_DataSN, tvb, offset + 36, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_BufferOffset, tvb, offset + 40, 4, ENC_BIG_ENDIAN);
+ data_offset=tvb_get_ntohl(tvb, offset+40);
+
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
+ /* do not update offset here because the data segment is
+ * dissected below */
+ handleDataDigest(ti, tvb, offset, paddedDataSegmentLength);
} else if(opcode == ISCSI_OPCODE_SCSI_DATA_IN) {
- /* SCSI Data In (read) */
- {
- gint b = tvb_get_guint8(tvb, offset + 1);
- proto_item *tf = proto_tree_add_uint(ti, hf_iscsi_Flags, tvb, offset + 1, 1, b);
- proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_Flags);
-
- if(b&ISCSI_SCSI_DATA_FLAG_S){
- S_bit=TRUE;
- }
- proto_tree_add_boolean(tt, hf_iscsi_SCSIData_F, tvb, offset + 1, 1, b);
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT08) {
- proto_tree_add_boolean(tt, hf_iscsi_SCSIData_A, tvb, offset + 1, 1, b);
- }
- proto_tree_add_boolean(tt, hf_iscsi_SCSIData_O, tvb, offset + 1, 1, b);
- proto_tree_add_boolean(tt, hf_iscsi_SCSIData_U, tvb, offset + 1, 1, b);
- proto_tree_add_boolean(tt, hf_iscsi_SCSIData_S, tvb, offset + 1, 1, b);
- }
- if(S_bit){
- proto_tree_add_item(ti, hf_iscsi_SCSIResponse_Status, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
- }
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- }
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
- }
- proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
- if(iscsi_protocol_version <= ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_SCSIData_ResidualCount, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
- }
- else {
- proto_tree_add_item(ti, hf_iscsi_TargetTransferTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
- }
- proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_DataSN, tvb, offset + 36, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_BufferOffset, tvb, offset + 40, 4, ENC_BIG_ENDIAN);
- data_offset=tvb_get_ntohl(tvb, offset+40);
-
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_SCSIData_ResidualCount, tvb, offset + 44, 4, ENC_BIG_ENDIAN);
- }
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
- /* do not update offset here because the data segment is
- * dissected below */
- handleDataDigest(ti, tvb, offset, paddedDataSegmentLength);
+ /* SCSI Data In (read) */
+ {
+ gint b = tvb_get_guint8(tvb, offset + 1);
+ proto_item *tf = proto_tree_add_uint(ti, hf_iscsi_Flags, tvb, offset + 1, 1, b);
+ proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_Flags);
+
+ if(b&ISCSI_SCSI_DATA_FLAG_S){
+ S_bit=TRUE;
+ }
+ proto_tree_add_boolean(tt, hf_iscsi_SCSIData_F, tvb, offset + 1, 1, b);
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT08) {
+ proto_tree_add_boolean(tt, hf_iscsi_SCSIData_A, tvb, offset + 1, 1, b);
+ }
+ proto_tree_add_boolean(tt, hf_iscsi_SCSIData_O, tvb, offset + 1, 1, b);
+ proto_tree_add_boolean(tt, hf_iscsi_SCSIData_U, tvb, offset + 1, 1, b);
+ proto_tree_add_boolean(tt, hf_iscsi_SCSIData_S, tvb, offset + 1, 1, b);
+ }
+ if(S_bit){
+ proto_tree_add_item(ti, hf_iscsi_SCSIResponse_Status, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
+ }
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
+ }
+ proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
+ if(iscsi_protocol_version <= ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_SCSIData_ResidualCount, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
+ }
+ else {
+ proto_tree_add_item(ti, hf_iscsi_TargetTransferTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_DataSN, tvb, offset + 36, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_BufferOffset, tvb, offset + 40, 4, ENC_BIG_ENDIAN);
+ data_offset=tvb_get_ntohl(tvb, offset+40);
+
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_SCSIData_ResidualCount, tvb, offset + 44, 4, ENC_BIG_ENDIAN);
+ }
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
+ /* do not update offset here because the data segment is
+ * dissected below */
+ handleDataDigest(ti, tvb, offset, paddedDataSegmentLength);
} else if(opcode == ISCSI_OPCODE_LOGOUT_COMMAND) {
- /* Logout Command */
- if(iscsi_protocol_version >= ISCSI_PROTOCOL_DRAFT13) {
- proto_tree_add_item(ti, hf_iscsi_Logout_Reason, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
- }
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- }
- if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08) {
- proto_tree_add_item(ti, hf_iscsi_CID, tvb, offset + 8, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_Logout_Reason, tvb, offset + 11, 1, ENC_BIG_ENDIAN);
- }
- proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT08) {
- proto_tree_add_item(ti, hf_iscsi_CID, tvb, offset + 20, 2, ENC_BIG_ENDIAN);
- if(iscsi_protocol_version < ISCSI_PROTOCOL_DRAFT13) {
- proto_tree_add_item(ti, hf_iscsi_Logout_Reason, tvb, offset + 23, 1, ENC_BIG_ENDIAN);
- }
- }
- proto_tree_add_item(ti, hf_iscsi_CmdSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
+ /* Logout Command */
+ if(iscsi_protocol_version >= ISCSI_PROTOCOL_DRAFT13) {
+ proto_tree_add_item(ti, hf_iscsi_Logout_Reason, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
+ }
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ }
+ if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08) {
+ proto_tree_add_item(ti, hf_iscsi_CID, tvb, offset + 8, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_Logout_Reason, tvb, offset + 11, 1, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT08) {
+ proto_tree_add_item(ti, hf_iscsi_CID, tvb, offset + 20, 2, ENC_BIG_ENDIAN);
+ if(iscsi_protocol_version < ISCSI_PROTOCOL_DRAFT13) {
+ proto_tree_add_item(ti, hf_iscsi_Logout_Reason, tvb, offset + 23, 1, ENC_BIG_ENDIAN);
+ }
+ }
+ proto_tree_add_item(ti, hf_iscsi_CmdSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
} else if(opcode == ISCSI_OPCODE_LOGOUT_RESPONSE) {
- /* Logout Response */
- proto_tree_add_item(ti, hf_iscsi_Logout_Response, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- }
- proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_Time2Wait, tvb, offset + 40, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_Time2Retain, tvb, offset + 42, 2, ENC_BIG_ENDIAN);
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
+ /* Logout Response */
+ proto_tree_add_item(ti, hf_iscsi_Logout_Response, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ }
+ proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_Time2Wait, tvb, offset + 40, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_Time2Retain, tvb, offset + 42, 2, ENC_BIG_ENDIAN);
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
} else if(opcode == ISCSI_OPCODE_SNACK_REQUEST) {
- /* SNACK Request */
- {
+ /* SNACK Request */
+ {
#if 0
- gint b = tvb_get_guint8(tvb, offset + 1);
- proto_item *tf = proto_tree_add_uint(ti, hf_iscsi_Flags, tvb, offset + 1, 1, b);
- proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_Flags);
+ gint b = tvb_get_guint8(tvb, offset + 1);
+ proto_item *tf = proto_tree_add_uint(ti, hf_iscsi_Flags, tvb, offset + 1, 1, b);
+ proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_Flags);
#endif
- proto_tree_add_item(ti, hf_iscsi_snack_type, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
- }
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
- }
- proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
- if(iscsi_protocol_version <= ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_BegRun, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_RunLength, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpDataSN, tvb, offset + 36, 4, ENC_BIG_ENDIAN);
- }
- else {
- proto_tree_add_item(ti, hf_iscsi_TargetTransferTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_BegRun, tvb, offset + 40, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_RunLength, tvb, offset + 44, 4, ENC_BIG_ENDIAN);
- }
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
+ proto_tree_add_item(ti, hf_iscsi_snack_type, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
+ }
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
+ }
+ proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
+ if(iscsi_protocol_version <= ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_BegRun, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_RunLength, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpDataSN, tvb, offset + 36, 4, ENC_BIG_ENDIAN);
+ }
+ else {
+ proto_tree_add_item(ti, hf_iscsi_TargetTransferTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_BegRun, tvb, offset + 40, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_RunLength, tvb, offset + 44, 4, ENC_BIG_ENDIAN);
+ }
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
} else if(opcode == ISCSI_OPCODE_R2T) {
- /* R2T */
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
- }
- proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_TargetTransferTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_R2TSN, tvb, offset + 36, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_BufferOffset, tvb, offset + 40, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_DesiredDataLength, tvb, offset + 44, 4, ENC_BIG_ENDIAN);
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
+ /* R2T */
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
+ }
+ proto_tree_add_item(ti, hf_iscsi_InitiatorTaskTag, tvb, offset + 16, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_TargetTransferTag, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_R2TSN, tvb, offset + 36, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_BufferOffset, tvb, offset + 40, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_DesiredDataLength, tvb, offset + 44, 4, ENC_BIG_ENDIAN);
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
} else if(opcode == ISCSI_OPCODE_ASYNC_MESSAGE) {
- int dsl, snsl;
-
- /* Asynchronous Message */
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- }
- dsl=tvb_get_ntoh24(tvb, offset+5);
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
- proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_AsyncEvent, tvb, offset + 36, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_EventVendorCode, tvb, offset + 37, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_Parameter1, tvb, offset + 38, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_Parameter2, tvb, offset + 40, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_Parameter3, tvb, offset + 42, 2, ENC_BIG_ENDIAN);
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
-
- /* If we have a datasegment this contains scsi sense info followed
- * by iscsi event data. (rfc3720 10.9.4)
- */
- if(dsl){
- snsl=tvb_get_ntohs(tvb, offset);
- offset+=2;
- if(snsl){
- tvbuff_t *data_tvb;
- int tvb_len, tvb_rlen;
-
- tvb_len=tvb_length_remaining(tvb, offset);
- if(tvb_len>snsl)
- tvb_len=snsl;
- tvb_rlen=tvb_reported_length_remaining(tvb, offset);
- if(tvb_rlen>snsl)
- tvb_rlen=snsl;
- data_tvb=tvb_new_subset(tvb, offset, tvb_len, tvb_rlen);
- dissect_scsi_snsinfo (data_tvb, pinfo, tree, 0,
- tvb_len,
- &cdata->itlq, itl);
-
- offset+=snsl;
- }
- if((end_offset-offset)>0){
- proto_tree_add_item(ti, hf_iscsi_async_event_data, tvb, offset, end_offset-offset, ENC_NA);
- }
- }
- offset=end_offset;
+ int dsl, snsl;
+
+ /* Asynchronous Message */
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ }
+ dsl=tvb_get_ntoh24(tvb, offset+5);
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA);
+ proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_AsyncEvent, tvb, offset + 36, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_EventVendorCode, tvb, offset + 37, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_Parameter1, tvb, offset + 38, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_Parameter2, tvb, offset + 40, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_Parameter3, tvb, offset + 42, 2, ENC_BIG_ENDIAN);
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
+
+ /* If we have a datasegment this contains scsi sense info followed
+ * by iscsi event data. (rfc3720 10.9.4)
+ */
+ if(dsl){
+ snsl=tvb_get_ntohs(tvb, offset);
+ offset+=2;
+ if(snsl){
+ tvbuff_t *data_tvb;
+ int tvb_len, tvb_rlen;
+
+ tvb_len=tvb_length_remaining(tvb, offset);
+ if(tvb_len>snsl)
+ tvb_len=snsl;
+ tvb_rlen=tvb_reported_length_remaining(tvb, offset);
+ if(tvb_rlen>snsl)
+ tvb_rlen=snsl;
+ data_tvb=tvb_new_subset(tvb, offset, tvb_len, tvb_rlen);
+ dissect_scsi_snsinfo (data_tvb, pinfo, tree, 0,
+ tvb_len,
+ &cdata->itlq, itl);
+
+ offset+=snsl;
+ }
+ if((end_offset-offset)>0){
+ proto_tree_add_item(ti, hf_iscsi_async_event_data, tvb, offset, end_offset-offset, ENC_NA);
+ }
+ }
+ offset=end_offset;
} else if(opcode == ISCSI_OPCODE_REJECT) {
- proto_item *tf;
- proto_tree *tt;
- int next_opcode;
- const char *next_opcode_str;
-
- /* Reject */
- proto_tree_add_item(ti, hf_iscsi_Reject_Reason, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- }
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(ti, hf_iscsi_DataSN, tvb, offset + 36, 4, ENC_BIG_ENDIAN);
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
-
- next_opcode = tvb_get_guint8(tvb, offset) & 0x3f;
- next_opcode_str = match_strval(next_opcode, iscsi_opcodes);
-
- tf = proto_tree_add_text(ti, tvb, offset, -1, "Rejected Header");
- tt = proto_item_add_subtree(tf, ett_iscsi_RejectHeader);
-
- dissect_iscsi_pdu(tvb, pinfo, tt, offset, next_opcode, next_opcode_str, 0, iscsi_session, conversation);
+ proto_item *tf;
+ proto_tree *tt;
+ int next_opcode;
+ const char *next_opcode_str;
+
+ /* Reject */
+ proto_tree_add_item(ti, hf_iscsi_Reject_Reason, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(ti, hf_iscsi_DataSN, tvb, offset + 36, 4, ENC_BIG_ENDIAN);
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
+
+ next_opcode = tvb_get_guint8(tvb, offset) & 0x3f;
+ next_opcode_str = match_strval(next_opcode, iscsi_opcodes);
+
+ tf = proto_tree_add_text(ti, tvb, offset, -1, "Rejected Header");
+ tt = proto_item_add_subtree(tf, ett_iscsi_RejectHeader);
+
+ dissect_iscsi_pdu(tvb, pinfo, tt, offset, next_opcode, next_opcode_str, 0, iscsi_session, conversation);
} else if(opcode == ISCSI_OPCODE_VENDOR_SPECIFIC_I0 ||
- opcode == ISCSI_OPCODE_VENDOR_SPECIFIC_I1 ||
- opcode == ISCSI_OPCODE_VENDOR_SPECIFIC_I2 ||
- opcode == ISCSI_OPCODE_VENDOR_SPECIFIC_T0 ||
- opcode == ISCSI_OPCODE_VENDOR_SPECIFIC_T1 ||
- opcode == ISCSI_OPCODE_VENDOR_SPECIFIC_T2) {
- /* Vendor specific opcodes */
- if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
- proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
- }
- proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
- offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
- offset = handleDataSegment(ti, tvb, offset, data_segment_len, end_offset, hf_iscsi_vendor_specific_data);
+ opcode == ISCSI_OPCODE_VENDOR_SPECIFIC_I1 ||
+ opcode == ISCSI_OPCODE_VENDOR_SPECIFIC_I2 ||
+ opcode == ISCSI_OPCODE_VENDOR_SPECIFIC_T0 ||
+ opcode == ISCSI_OPCODE_VENDOR_SPECIFIC_T1 ||
+ opcode == ISCSI_OPCODE_VENDOR_SPECIFIC_T2) {
+ /* Vendor specific opcodes */
+ if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
+ proto_tree_add_item(ti, hf_iscsi_TotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_uint(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5));
+ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
+ offset = handleDataSegment(ti, tvb, offset, data_segment_len, end_offset, hf_iscsi_vendor_specific_data);
}
@@ -1542,10 +1542,10 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
proto_tree_add_uint(ti, hf_iscsi_response_frame, tvb, 0, 0, cdata->itlq.last_exchange_frame);
} else {
if (cdata->itlq.first_exchange_frame){
- nstime_t delta_time;
- proto_tree_add_uint(ti, hf_iscsi_request_frame, tvb, 0, 0, cdata->itlq.first_exchange_frame);
- nstime_delta(&delta_time, &pinfo->fd->abs_ts, &cdata->itlq.fc_time);
- proto_tree_add_time(ti, hf_iscsi_time, tvb, 0, 0, &delta_time);
+ nstime_t delta_time;
+ proto_tree_add_uint(ti, hf_iscsi_request_frame, tvb, 0, 0, cdata->itlq.first_exchange_frame);
+ nstime_delta(&delta_time, &pinfo->fd->abs_ts, &cdata->itlq.fc_time);
+ proto_tree_add_time(ti, hf_iscsi_time, tvb, 0, 0, &delta_time);
}
}
if (cdata->data_out_frame)
@@ -1574,89 +1574,87 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
proto_item_set_len(ti, offset - original_offset);
if((opcode & ((iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08)?
- ~(X_BIT | I_BIT) :
- ~I_BIT)) == ISCSI_OPCODE_SCSI_COMMAND) {
- tvbuff_t *cdb_tvb, *data_tvb;
- int tvb_len, tvb_rlen;
- guint8 scsi_opcode;
+ ~(X_BIT | I_BIT) :
+ ~I_BIT)) == ISCSI_OPCODE_SCSI_COMMAND) {
+ tvbuff_t *cdb_tvb, *data_tvb;
+ int tvb_len, tvb_rlen;
/* SCSI Command */
- tvb_len=tvb_length_remaining(tvb, cdb_offset);
- tvb_rlen=tvb_reported_length_remaining(tvb, cdb_offset);
- scsi_opcode=tvb_get_guint8(tvb, cdb_offset);
- if(ahs_cdb_length && ahs_cdb_length<1024){
- guint8 *cdb_buf;
-
- /* We have a variable length CDB where bytes >16 is transported
- * in the AHS.
- */
- cdb_buf=g_malloc(16+ahs_cdb_length);
- /* the 16 first bytes of the cdb */
- tvb_memcpy(tvb, cdb_buf, cdb_offset, 16);
- /* the remainder of the cdb from the ahs */
- tvb_memcpy(tvb, cdb_buf+16, ahs_cdb_offset, ahs_cdb_length);
-
- cdb_tvb = tvb_new_child_real_data(tvb, cdb_buf,
- ahs_cdb_length+16,
- ahs_cdb_length+16);
- tvb_set_free_cb(cdb_tvb, g_free);
-
- add_new_data_source(pinfo, cdb_tvb, "CDB+AHS");
- } else {
- if(tvb_len>16){
- tvb_len=16;
- }
- if(tvb_rlen>16){
- tvb_rlen=16;
- }
- cdb_tvb=tvb_new_subset(tvb, cdb_offset, tvb_len, tvb_rlen);
- }
+ tvb_len=tvb_length_remaining(tvb, cdb_offset);
+ tvb_rlen=tvb_reported_length_remaining(tvb, cdb_offset);
+ if(ahs_cdb_length && ahs_cdb_length<1024){
+ guint8 *cdb_buf;
+
+ /* We have a variable length CDB where bytes >16 is transported
+ * in the AHS.
+ */
+ cdb_buf=g_malloc(16+ahs_cdb_length);
+ /* the 16 first bytes of the cdb */
+ tvb_memcpy(tvb, cdb_buf, cdb_offset, 16);
+ /* the remainder of the cdb from the ahs */
+ tvb_memcpy(tvb, cdb_buf+16, ahs_cdb_offset, ahs_cdb_length);
+
+ cdb_tvb = tvb_new_child_real_data(tvb, cdb_buf,
+ ahs_cdb_length+16,
+ ahs_cdb_length+16);
+ tvb_set_free_cb(cdb_tvb, g_free);
+
+ add_new_data_source(pinfo, cdb_tvb, "CDB+AHS");
+ } else {
+ if(tvb_len>16){
+ tvb_len=16;
+ }
+ if(tvb_rlen>16){
+ tvb_rlen=16;
+ }
+ cdb_tvb=tvb_new_subset(tvb, cdb_offset, tvb_len, tvb_rlen);
+ }
dissect_scsi_cdb(cdb_tvb, pinfo, tree, SCSI_DEV_UNKNOWN, &cdata->itlq, itl);
- /* we dont want the immediata below to overwrite our CDB info */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_set_fence(pinfo->cinfo, COL_INFO);
- }
- /* where there any ImmediateData ? */
- if(immediate_data_length){
+ /* we dont want the immediata below to overwrite our CDB info */
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_set_fence(pinfo->cinfo, COL_INFO);
+ }
+ /* where there any ImmediateData ? */
+ if(immediate_data_length){
/* Immediate Data TVB */
- tvb_len=tvb_length_remaining(tvb, immediate_data_offset);
- if(tvb_len>(int)immediate_data_length)
- tvb_len=immediate_data_length;
- tvb_rlen=tvb_reported_length_remaining(tvb, immediate_data_offset);
- if(tvb_rlen>(int)immediate_data_length)
- tvb_rlen=immediate_data_length;
- data_tvb=tvb_new_subset(tvb, immediate_data_offset, tvb_len, tvb_rlen);
+ tvb_len=tvb_length_remaining(tvb, immediate_data_offset);
+ if(tvb_len>(int)immediate_data_length)
+ tvb_len=immediate_data_length;
+ tvb_rlen=tvb_reported_length_remaining(tvb, immediate_data_offset);
+ if(tvb_rlen>(int)immediate_data_length)
+ tvb_rlen=immediate_data_length;
+ data_tvb=tvb_new_subset(tvb, immediate_data_offset, tvb_len, tvb_rlen);
dissect_scsi_payload (data_tvb, pinfo, tree,
- TRUE,
- &cdata->itlq, itl,
- 0);
- }
+ TRUE,
+ &cdata->itlq, itl,
+ 0);
+ }
}
else if (opcode == ISCSI_OPCODE_SCSI_RESPONSE) {
if (scsi_status == 0x2) {
/* A SCSI response with Check Condition contains sense data */
/* offset is setup correctly by the iscsi code for response above */
- if((end_offset - offset) >= 2) {
- int senseLen = tvb_get_ntohs(tvb, offset);
- if(ti != NULL)
- proto_tree_add_item(ti, hf_iscsi_SenseLength, tvb, offset, 2, ENC_BIG_ENDIAN);
- offset += 2;
- if(senseLen > 0){
- tvbuff_t *data_tvb;
- int tvb_len, tvb_rlen;
-
- tvb_len=tvb_length_remaining(tvb, offset);
- if(tvb_len>senseLen)
- tvb_len=senseLen;
- tvb_rlen=tvb_reported_length_remaining(tvb, offset);
- if(tvb_rlen>senseLen)
- tvb_rlen=senseLen;
- data_tvb=tvb_new_subset(tvb, offset, tvb_len, tvb_rlen);
- dissect_scsi_snsinfo (data_tvb, pinfo, tree, 0,
- tvb_len,
- &cdata->itlq, itl);
- }
- }
+ if((end_offset - offset) >= 2) {
+ int senseLen = tvb_get_ntohs(tvb, offset);
+ if(ti != NULL)
+ proto_tree_add_item(ti, hf_iscsi_SenseLength, tvb, offset, 2, ENC_BIG_ENDIAN);
+ offset += 2;
+ if(senseLen > 0){
+ tvbuff_t *data_tvb;
+ int tvb_len, tvb_rlen;
+
+ tvb_len=tvb_length_remaining(tvb, offset);
+ if(tvb_len>senseLen)
+ tvb_len=senseLen;
+ tvb_rlen=tvb_reported_length_remaining(tvb, offset);
+ if(tvb_rlen>senseLen)
+ tvb_rlen=senseLen;
+ data_tvb=tvb_new_subset(tvb, offset, tvb_len, tvb_rlen);
+ dissect_scsi_snsinfo (data_tvb, pinfo, tree, 0,
+ tvb_len,
+ &cdata->itlq, itl);
+ }
+ }
}
else {
dissect_scsi_rsp(tvb, pinfo, tree, &cdata->itlq, itl, scsi_status);
@@ -1664,21 +1662,21 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
}
else if ((opcode == ISCSI_OPCODE_SCSI_DATA_IN) ||
(opcode == ISCSI_OPCODE_SCSI_DATA_OUT)) {
- tvbuff_t *data_tvb;
- int tvb_len, tvb_rlen;
+ tvbuff_t *data_tvb;
+ int tvb_len, tvb_rlen;
/* offset is setup correctly by the iscsi code for response above */
- tvb_len=tvb_length_remaining(tvb, offset);
- if(tvb_len>(int)data_segment_len)
- tvb_len=data_segment_len;
- tvb_rlen=tvb_reported_length_remaining(tvb, offset);
- if(tvb_rlen>(int)data_segment_len)
- tvb_rlen=data_segment_len;
- data_tvb=tvb_new_subset(tvb, offset, tvb_len, tvb_rlen);
+ tvb_len=tvb_length_remaining(tvb, offset);
+ if(tvb_len>(int)data_segment_len)
+ tvb_len=data_segment_len;
+ tvb_rlen=tvb_reported_length_remaining(tvb, offset);
+ if(tvb_rlen>(int)data_segment_len)
+ tvb_rlen=data_segment_len;
+ data_tvb=tvb_new_subset(tvb, offset, tvb_len, tvb_rlen);
dissect_scsi_payload (data_tvb, pinfo, tree,
- (opcode==ISCSI_OPCODE_SCSI_DATA_OUT),
- &cdata->itlq, itl,
- data_offset);
+ (opcode==ISCSI_OPCODE_SCSI_DATA_OUT),
+ &cdata->itlq, itl,
+ data_offset);
}
if(S_bit){
@@ -1698,8 +1696,8 @@ dissect_iscsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean chec
guint8 opcode, tmpbyte;
if (available_bytes < 48) {
- /* heuristic already rejected the packet if size < 48,
- assume it's an iscsi packet with a segmented header */
+ /* heuristic already rejected the packet if size < 48,
+ assume it's an iscsi packet with a segmented header */
pinfo->desegment_offset = offset;
pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT;
return TRUE;
@@ -1719,624 +1717,624 @@ dissect_iscsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean chec
*/
switch(opcode){
case ISCSI_OPCODE_NOP_IN:
- /* top two bits of byte 0 must be 0 */
- if(tvb_get_guint8(tvb, offset+0)&0xc0){
- return FALSE;
- }
- /* byte 1 must be 0x80 */
- if(tvb_get_guint8(tvb, offset+1)!=0x80){
- return FALSE;
- }
- /* bytes 2 and 3 must be 0 */
- if(tvb_get_guint8(tvb, offset+2)||tvb_get_guint8(tvb, offset+3)){
- return FALSE;
- }
- break;
+ /* top two bits of byte 0 must be 0 */
+ if(tvb_get_guint8(tvb, offset+0)&0xc0){
+ return FALSE;
+ }
+ /* byte 1 must be 0x80 */
+ if(tvb_get_guint8(tvb, offset+1)!=0x80){
+ return FALSE;
+ }
+ /* bytes 2 and 3 must be 0 */
+ if(tvb_get_guint8(tvb, offset+2)||tvb_get_guint8(tvb, offset+3)){
+ return FALSE;
+ }
+ break;
case ISCSI_OPCODE_NOP_OUT:
- /* top bit of byte 0 must be 0 */
- if(tvb_get_guint8(tvb, offset+0)&0x80){
- return FALSE;
- }
- /* byte 1 must be 0x80 */
- if(tvb_get_guint8(tvb, offset+1)!=0x80){
- return FALSE;
- }
- /* bytes 2 and 3 must be 0 */
- if(tvb_get_guint8(tvb, offset+2)||tvb_get_guint8(tvb, offset+3)){
- return FALSE;
- }
- /* assume ITT and TTT must always be non NULL (ok they can be NULL
- * from time to time but it usually means we are in the middle
- * of a zeroed datablock).
- */
- if(!tvb_get_letohl(tvb,offset+16) || !tvb_get_letohl(tvb,offset+20)){
- return FALSE;
- }
- /* all reserved bytes between 32 - 47 must be null */
- if(tvb_get_letohl(tvb,offset+32)
- || tvb_get_letohl(tvb,offset+36)
- || tvb_get_letohl(tvb,offset+40)
- || tvb_get_letohl(tvb,offset+44)){
- return FALSE;
- }
- break;
+ /* top bit of byte 0 must be 0 */
+ if(tvb_get_guint8(tvb, offset+0)&0x80){
+ return FALSE;
+ }
+ /* byte 1 must be 0x80 */
+ if(tvb_get_guint8(tvb, offset+1)!=0x80){
+ return FALSE;
+ }
+ /* bytes 2 and 3 must be 0 */
+ if(tvb_get_guint8(tvb, offset+2)||tvb_get_guint8(tvb, offset+3)){
+ return FALSE;
+ }
+ /* assume ITT and TTT must always be non NULL (ok they can be NULL
+ * from time to time but it usually means we are in the middle
+ * of a zeroed datablock).
+ */
+ if(!tvb_get_letohl(tvb,offset+16) || !tvb_get_letohl(tvb,offset+20)){
+ return FALSE;
+ }
+ /* all reserved bytes between 32 - 47 must be null */
+ if(tvb_get_letohl(tvb,offset+32)
+ || tvb_get_letohl(tvb,offset+36)
+ || tvb_get_letohl(tvb,offset+40)
+ || tvb_get_letohl(tvb,offset+44)){
+ return FALSE;
+ }
+ break;
case ISCSI_OPCODE_LOGIN_COMMAND:
- /* top two bits in byte 0 must be 0x40 */
- if((tvb_get_guint8(tvb, offset+0)&0xc0)!=0x40){
-
- return FALSE;
- }
- /* both the T and C bits can not be set
- * and the two reserved bits in byte 1 must be 0
- */
- tmpbyte=tvb_get_guint8(tvb, offset+1);
- switch(tmpbyte&0xf0){
- case 0x80:
- case 0x40:
- case 0x00:
- break;
- default:
- return FALSE;
- }
- /* CSG and NSG must not be 2 */
- if(((tmpbyte & 0x03) == 0x02)
- || ((tmpbyte & 0x0c) == 0x08)) {
- return FALSE;
- }
- /* if T bit is set NSG must not be 0 */
- if(tmpbyte&0x80){
- if(!(tmpbyte&0x03)){
- return FALSE;
- }
- }
- /* should we test that datasegmentlen is non zero? */
- break;
+ /* top two bits in byte 0 must be 0x40 */
+ if((tvb_get_guint8(tvb, offset+0)&0xc0)!=0x40){
+
+ return FALSE;
+ }
+ /* both the T and C bits can not be set
+ * and the two reserved bits in byte 1 must be 0
+ */
+ tmpbyte=tvb_get_guint8(tvb, offset+1);
+ switch(tmpbyte&0xf0){
+ case 0x80:
+ case 0x40:
+ case 0x00:
+ break;
+ default:
+ return FALSE;
+ }
+ /* CSG and NSG must not be 2 */
+ if(((tmpbyte & 0x03) == 0x02)
+ || ((tmpbyte & 0x0c) == 0x08)) {
+ return FALSE;
+ }
+ /* if T bit is set NSG must not be 0 */
+ if(tmpbyte&0x80){
+ if(!(tmpbyte&0x03)){
+ return FALSE;
+ }
+ }
+ /* should we test that datasegmentlen is non zero? */
+ break;
case ISCSI_OPCODE_LOGIN_RESPONSE:
- /* top two bits in byte 0 must be 0 */
- if(tvb_get_guint8(tvb, offset+0)&0xc0){
-
- return FALSE;
- }
- /* both the T and C bits can not be set
- * and the two reserved bits in byte 1 must be 0
- */
- tmpbyte=tvb_get_guint8(tvb, offset+1);
- switch(tmpbyte&0xf0){
- case 0x80:
- case 0x40:
- case 0x00:
- break;
- default:
- return FALSE;
- }
- /* CSG and NSG must not be 2 */
- if(((tmpbyte & 0x03) == 0x02)
- || ((tmpbyte & 0x0c) == 0x08)) {
- return FALSE;
- }
- /* if T bit is set NSG must not be 0 */
- if(tmpbyte&0x80){
- if(!(tmpbyte&0x03)){
- return FALSE;
- }
- }
- /* the 32bit words at offsets 20, 40, 44 must be zero */
- if(tvb_get_letohl(tvb,offset+20)
- || tvb_get_letohl(tvb,offset+40)
- || tvb_get_letohl(tvb,offset+44)){
- return FALSE;
- }
- /* the two bytes at offset 38 must be zero */
- if(tvb_get_letohs(tvb,offset+38)){
- return FALSE;
- }
- /* should we test that datasegmentlen is non zero unless we just
- * entered full featured phase?
- */
- break;
+ /* top two bits in byte 0 must be 0 */
+ if(tvb_get_guint8(tvb, offset+0)&0xc0){
+
+ return FALSE;
+ }
+ /* both the T and C bits can not be set
+ * and the two reserved bits in byte 1 must be 0
+ */
+ tmpbyte=tvb_get_guint8(tvb, offset+1);
+ switch(tmpbyte&0xf0){
+ case 0x80:
+ case 0x40:
+ case 0x00:
+ break;
+ default:
+ return FALSE;
+ }
+ /* CSG and NSG must not be 2 */
+ if(((tmpbyte & 0x03) == 0x02)
+ || ((tmpbyte & 0x0c) == 0x08)) {
+ return FALSE;
+ }
+ /* if T bit is set NSG must not be 0 */
+ if(tmpbyte&0x80){
+ if(!(tmpbyte&0x03)){
+ return FALSE;
+ }
+ }
+ /* the 32bit words at offsets 20, 40, 44 must be zero */
+ if(tvb_get_letohl(tvb,offset+20)
+ || tvb_get_letohl(tvb,offset+40)
+ || tvb_get_letohl(tvb,offset+44)){
+ return FALSE;
+ }
+ /* the two bytes at offset 38 must be zero */
+ if(tvb_get_letohs(tvb,offset+38)){
+ return FALSE;
+ }
+ /* should we test that datasegmentlen is non zero unless we just
+ * entered full featured phase?
+ */
+ break;
case ISCSI_OPCODE_TASK_MANAGEMENT_FUNCTION:
- /* top bit in byte 0 must be 0 */
- if(tvb_get_guint8(tvb, offset+0)&0x80){
- return FALSE;
- }
- /* top bit in byte 1 must be set */
- tmpbyte=tvb_get_guint8(tvb, offset+1);
- if(!(tmpbyte&0x80)){
- return FALSE;
- }
- /* Function must be known */
- if(!match_strval(tmpbyte&0x7f, iscsi_task_management_functions)){
- return FALSE;
- }
- /* bytes 2,3 must be null */
- if(tvb_get_letohs(tvb,offset+2)){
- return FALSE;
- }
- /* ahs and dsl must be null */
- if(tvb_get_letohl(tvb,offset+4)){
- return FALSE;
- }
- break;
+ /* top bit in byte 0 must be 0 */
+ if(tvb_get_guint8(tvb, offset+0)&0x80){
+ return FALSE;
+ }
+ /* top bit in byte 1 must be set */
+ tmpbyte=tvb_get_guint8(tvb, offset+1);
+ if(!(tmpbyte&0x80)){
+ return FALSE;
+ }
+ /* Function must be known */
+ if(!match_strval(tmpbyte&0x7f, iscsi_task_management_functions)){
+ return FALSE;
+ }
+ /* bytes 2,3 must be null */
+ if(tvb_get_letohs(tvb,offset+2)){
+ return FALSE;
+ }
+ /* ahs and dsl must be null */
+ if(tvb_get_letohl(tvb,offset+4)){
+ return FALSE;
+ }
+ break;
case ISCSI_OPCODE_TASK_MANAGEMENT_FUNCTION_RESPONSE:
- /* top two bits in byte 0 must be 0 */
- if(tvb_get_guint8(tvb, offset+0)&0xc0){
- return FALSE;
- }
- /* byte 1 must be 0x80 */
- if(tvb_get_guint8(tvb, offset+1)!=0x80){
- return FALSE;
- }
- /* response must be 0-6 or 255 */
- tmpbyte=tvb_get_guint8(tvb,offset+2);
- if(tmpbyte>6 && tmpbyte<255){
- return FALSE;
- }
- /* byte 3 must be 0 */
- if(tvb_get_guint8(tvb,offset+3)){
- return FALSE;
- }
- /* ahs and dsl as well as the 32bit words at offsets 8, 12, 20, 36
- * 40, 44 must all be 0
- */
- if(tvb_get_letohl(tvb,offset+4)
- || tvb_get_letohl(tvb,offset+8)
- || tvb_get_letohl(tvb,offset+12)
- || tvb_get_letohl(tvb,offset+20)
- || tvb_get_letohl(tvb,offset+36)
- || tvb_get_letohl(tvb,offset+40)
- || tvb_get_letohl(tvb,offset+44)){
- return FALSE;
- }
- break;
+ /* top two bits in byte 0 must be 0 */
+ if(tvb_get_guint8(tvb, offset+0)&0xc0){
+ return FALSE;
+ }
+ /* byte 1 must be 0x80 */
+ if(tvb_get_guint8(tvb, offset+1)!=0x80){
+ return FALSE;
+ }
+ /* response must be 0-6 or 255 */
+ tmpbyte=tvb_get_guint8(tvb,offset+2);
+ if(tmpbyte>6 && tmpbyte<255){
+ return FALSE;
+ }
+ /* byte 3 must be 0 */
+ if(tvb_get_guint8(tvb,offset+3)){
+ return FALSE;
+ }
+ /* ahs and dsl as well as the 32bit words at offsets 8, 12, 20, 36
+ * 40, 44 must all be 0
+ */
+ if(tvb_get_letohl(tvb,offset+4)
+ || tvb_get_letohl(tvb,offset+8)
+ || tvb_get_letohl(tvb,offset+12)
+ || tvb_get_letohl(tvb,offset+20)
+ || tvb_get_letohl(tvb,offset+36)
+ || tvb_get_letohl(tvb,offset+40)
+ || tvb_get_letohl(tvb,offset+44)){
+ return FALSE;
+ }
+ break;
case ISCSI_OPCODE_LOGOUT_COMMAND:
- /* top bit in byte 0 must be 0 */
- if(tvb_get_guint8(tvb, offset+0)&0x80){
- return FALSE;
- }
- /* top bit in byte 1 must be set */
- tmpbyte=tvb_get_guint8(tvb, offset+1);
- if(!(tmpbyte&0x80)){
- return FALSE;
- }
- /* Reason code must be known */
- if(!match_strval(tmpbyte&0x7f, iscsi_logout_reasons)){
- return FALSE;
- }
- /* bytes 2,3 must be null */
- if(tvb_get_letohs(tvb,offset+2)){
- return FALSE;
- }
- /* ahs and dsl as well as the 32bit words at offsets 8, 12, 32, 36
- * 40, 44 must all be 0
- */
- if(tvb_get_letohl(tvb,offset+4)
- || tvb_get_letohl(tvb,offset+8)
- || tvb_get_letohl(tvb,offset+12)
- || tvb_get_letohl(tvb,offset+32)
- || tvb_get_letohl(tvb,offset+36)
- || tvb_get_letohl(tvb,offset+40)
- || tvb_get_letohl(tvb,offset+44)){
- return FALSE;
- }
- break;
+ /* top bit in byte 0 must be 0 */
+ if(tvb_get_guint8(tvb, offset+0)&0x80){
+ return FALSE;
+ }
+ /* top bit in byte 1 must be set */
+ tmpbyte=tvb_get_guint8(tvb, offset+1);
+ if(!(tmpbyte&0x80)){
+ return FALSE;
+ }
+ /* Reason code must be known */
+ if(!match_strval(tmpbyte&0x7f, iscsi_logout_reasons)){
+ return FALSE;
+ }
+ /* bytes 2,3 must be null */
+ if(tvb_get_letohs(tvb,offset+2)){
+ return FALSE;
+ }
+ /* ahs and dsl as well as the 32bit words at offsets 8, 12, 32, 36
+ * 40, 44 must all be 0
+ */
+ if(tvb_get_letohl(tvb,offset+4)
+ || tvb_get_letohl(tvb,offset+8)
+ || tvb_get_letohl(tvb,offset+12)
+ || tvb_get_letohl(tvb,offset+32)
+ || tvb_get_letohl(tvb,offset+36)
+ || tvb_get_letohl(tvb,offset+40)
+ || tvb_get_letohl(tvb,offset+44)){
+ return FALSE;
+ }
+ break;
case ISCSI_OPCODE_SNACK_REQUEST:
- /* top two bits in byte 0 must be 0 */
- if(tvb_get_guint8(tvb, offset+0)&0xc0){
- return FALSE;
- }
- /* top 4 bits in byte 1 must be 0x80 */
- tmpbyte=tvb_get_guint8(tvb, offset+1);
- if((tmpbyte&0xf0)!=0x80){
- return FALSE;
- }
- /* type must be known */
- if(!match_strval(tmpbyte&0x0f, iscsi_snack_types)){
- return FALSE;
- }
- /* for status/snack and datack itt must be 0xffffffff
- * for rdata/snack ttt must not be 0 or 0xffffffff
- */
- switch(tmpbyte&0x0f){
- case 1:
- case 2:
- if(tvb_get_letohl(tvb,offset+16)!=0xffffffff){
- return FALSE;
- }
- break;
- case 3:
- if(tvb_get_letohl(tvb,offset+20)==0xffffffff){
- return FALSE;
- }
- if(tvb_get_letohl(tvb,offset+20)==0){
- return FALSE;
- }
- break;
- }
- /* bytes 2,3 must be null */
- if(tvb_get_letohs(tvb,offset+2)){
- return FALSE;
- }
- /* the 32bit words at offsets 24, 32, 36
- * must all be 0
- */
- if(tvb_get_letohl(tvb,offset+24)
- || tvb_get_letohl(tvb,offset+32)
- || tvb_get_letohl(tvb,offset+36)){
- return FALSE;
- }
-
- break;
+ /* top two bits in byte 0 must be 0 */
+ if(tvb_get_guint8(tvb, offset+0)&0xc0){
+ return FALSE;
+ }
+ /* top 4 bits in byte 1 must be 0x80 */
+ tmpbyte=tvb_get_guint8(tvb, offset+1);
+ if((tmpbyte&0xf0)!=0x80){
+ return FALSE;
+ }
+ /* type must be known */
+ if(!match_strval(tmpbyte&0x0f, iscsi_snack_types)){
+ return FALSE;
+ }
+ /* for status/snack and datack itt must be 0xffffffff
+ * for rdata/snack ttt must not be 0 or 0xffffffff
+ */
+ switch(tmpbyte&0x0f){
+ case 1:
+ case 2:
+ if(tvb_get_letohl(tvb,offset+16)!=0xffffffff){
+ return FALSE;
+ }
+ break;
+ case 3:
+ if(tvb_get_letohl(tvb,offset+20)==0xffffffff){
+ return FALSE;
+ }
+ if(tvb_get_letohl(tvb,offset+20)==0){
+ return FALSE;
+ }
+ break;
+ }
+ /* bytes 2,3 must be null */
+ if(tvb_get_letohs(tvb,offset+2)){
+ return FALSE;
+ }
+ /* the 32bit words at offsets 24, 32, 36
+ * must all be 0
+ */
+ if(tvb_get_letohl(tvb,offset+24)
+ || tvb_get_letohl(tvb,offset+32)
+ || tvb_get_letohl(tvb,offset+36)){
+ return FALSE;
+ }
+
+ break;
case ISCSI_OPCODE_R2T:
- /* top two bits in byte 0 must be 0 */
- if(tvb_get_guint8(tvb, offset+0)&0xc0){
- return FALSE;
- }
- /* byte 1 must be 0x80 */
- if(tvb_get_guint8(tvb, offset+1)!=0x80){
- return FALSE;
- }
- /* bytes 2,3 must be null */
- if(tvb_get_letohs(tvb,offset+2)){
- return FALSE;
- }
- /* ahs and dsl must be null */
- if(tvb_get_letohl(tvb,offset+4)){
- return FALSE;
- }
- /* desired data transfer length must not be null */
- if(!tvb_get_letohl(tvb,offset+44)){
- return FALSE;
- }
- break;
+ /* top two bits in byte 0 must be 0 */
+ if(tvb_get_guint8(tvb, offset+0)&0xc0){
+ return FALSE;
+ }
+ /* byte 1 must be 0x80 */
+ if(tvb_get_guint8(tvb, offset+1)!=0x80){
+ return FALSE;
+ }
+ /* bytes 2,3 must be null */
+ if(tvb_get_letohs(tvb,offset+2)){
+ return FALSE;
+ }
+ /* ahs and dsl must be null */
+ if(tvb_get_letohl(tvb,offset+4)){
+ return FALSE;
+ }
+ /* desired data transfer length must not be null */
+ if(!tvb_get_letohl(tvb,offset+44)){
+ return FALSE;
+ }
+ break;
case ISCSI_OPCODE_REJECT:
- /* top two bits in byte 0 must be 0 */
- if(tvb_get_guint8(tvb, offset+0)&0xc0){
- return FALSE;
- }
- /* byte 1 must be 0x80 */
- if(tvb_get_guint8(tvb, offset+1)!=0x80){
- return FALSE;
- }
- /* reason must be known */
- if(!match_strval(tvb_get_guint8(tvb,offset+2), iscsi_reject_reasons)){
- return FALSE;
- }
- /* byte 3 must be 0 */
- if(tvb_get_guint8(tvb, offset+3)){
- return FALSE;
- }
- /* the 32bit words at offsets 8, 12, 20, 40, 44
- * must all be 0
- */
- if(tvb_get_letohl(tvb,offset+8)
- || tvb_get_letohl(tvb,offset+12)
- || tvb_get_letohl(tvb,offset+20)
- || tvb_get_letohl(tvb,offset+40)
- || tvb_get_letohl(tvb,offset+44)){
- return FALSE;
- }
- /* the 32bit word at 16 must be 0xffffffff */
- if(tvb_get_letohl(tvb,offset+16)!=0xffffffff){
- return FALSE;
- }
- break;
+ /* top two bits in byte 0 must be 0 */
+ if(tvb_get_guint8(tvb, offset+0)&0xc0){
+ return FALSE;
+ }
+ /* byte 1 must be 0x80 */
+ if(tvb_get_guint8(tvb, offset+1)!=0x80){
+ return FALSE;
+ }
+ /* reason must be known */
+ if(!match_strval(tvb_get_guint8(tvb,offset+2), iscsi_reject_reasons)){
+ return FALSE;
+ }
+ /* byte 3 must be 0 */
+ if(tvb_get_guint8(tvb, offset+3)){
+ return FALSE;
+ }
+ /* the 32bit words at offsets 8, 12, 20, 40, 44
+ * must all be 0
+ */
+ if(tvb_get_letohl(tvb,offset+8)
+ || tvb_get_letohl(tvb,offset+12)
+ || tvb_get_letohl(tvb,offset+20)
+ || tvb_get_letohl(tvb,offset+40)
+ || tvb_get_letohl(tvb,offset+44)){
+ return FALSE;
+ }
+ /* the 32bit word at 16 must be 0xffffffff */
+ if(tvb_get_letohl(tvb,offset+16)!=0xffffffff){
+ return FALSE;
+ }
+ break;
case ISCSI_OPCODE_TEXT_COMMAND:
- /* top bit in byte 0 must be 0 */
- if(tvb_get_guint8(tvb, offset+0)&0x80){
- return FALSE;
- }
- /* one of the F and C bits must be set but not both
- * low 6 bits in byte 1 must be 0
- */
- switch(tvb_get_guint8(tvb,offset+1)){
- case 0x80:
- case 0x40:
- break;
- default:
- return FALSE;
- }
- /* bytes 2,3 must be null */
- if(tvb_get_letohs(tvb,offset+2)){
- return FALSE;
- }
- /* the 32bit words at offsets 32, 36, 40, 44
- * must all be 0
- */
- if(tvb_get_letohl(tvb,offset+32)
- || tvb_get_letohl(tvb,offset+36)
- || tvb_get_letohl(tvb,offset+40)
- || tvb_get_letohl(tvb,offset+44)){
- return FALSE;
- }
- break;
+ /* top bit in byte 0 must be 0 */
+ if(tvb_get_guint8(tvb, offset+0)&0x80){
+ return FALSE;
+ }
+ /* one of the F and C bits must be set but not both
+ * low 6 bits in byte 1 must be 0
+ */
+ switch(tvb_get_guint8(tvb,offset+1)){
+ case 0x80:
+ case 0x40:
+ break;
+ default:
+ return FALSE;
+ }
+ /* bytes 2,3 must be null */
+ if(tvb_get_letohs(tvb,offset+2)){
+ return FALSE;
+ }
+ /* the 32bit words at offsets 32, 36, 40, 44
+ * must all be 0
+ */
+ if(tvb_get_letohl(tvb,offset+32)
+ || tvb_get_letohl(tvb,offset+36)
+ || tvb_get_letohl(tvb,offset+40)
+ || tvb_get_letohl(tvb,offset+44)){
+ return FALSE;
+ }
+ break;
case ISCSI_OPCODE_TEXT_RESPONSE:
- /* top two bits in byte 0 must be 0 */
- if(tvb_get_guint8(tvb, offset+0)&0xc0){
- return FALSE;
- }
- /* one of the F and C bits must be set but not both
- * low 6 bits in byte 1 must be 0
- */
- switch(tvb_get_guint8(tvb,offset+1)){
- case 0x80:
- case 0x40:
- break;
- default:
- return FALSE;
- }
- /* bytes 2,3 must be null */
- if(tvb_get_letohs(tvb,offset+2)){
- return FALSE;
- }
- /* the 32bit words at offsets 36, 40, 44
- * must all be 0
- */
- if(tvb_get_letohl(tvb,offset+36)
- || tvb_get_letohl(tvb,offset+40)
- || tvb_get_letohl(tvb,offset+44)){
- return FALSE;
- }
- break;
+ /* top two bits in byte 0 must be 0 */
+ if(tvb_get_guint8(tvb, offset+0)&0xc0){
+ return FALSE;
+ }
+ /* one of the F and C bits must be set but not both
+ * low 6 bits in byte 1 must be 0
+ */
+ switch(tvb_get_guint8(tvb,offset+1)){
+ case 0x80:
+ case 0x40:
+ break;
+ default:
+ return FALSE;
+ }
+ /* bytes 2,3 must be null */
+ if(tvb_get_letohs(tvb,offset+2)){
+ return FALSE;
+ }
+ /* the 32bit words at offsets 36, 40, 44
+ * must all be 0
+ */
+ if(tvb_get_letohl(tvb,offset+36)
+ || tvb_get_letohl(tvb,offset+40)
+ || tvb_get_letohl(tvb,offset+44)){
+ return FALSE;
+ }
+ break;
case ISCSI_OPCODE_SCSI_COMMAND:
- /* top bit in byte 0 must be 0 */
- if(tvb_get_guint8(tvb, offset+0)&0x80){
- return FALSE;
- }
- /* reserved bits in byte 1 must be 0 */
- if(tvb_get_guint8(tvb, offset+1)&0x18){
- return FALSE;
- }
- /* bytes 2,3 must be null */
- if(tvb_get_letohs(tvb,offset+2)){
- return FALSE;
- }
- /* last 6 bytes of LUN are always 0 */
- if(tvb_get_ntohs(tvb, offset+10) || tvb_get_ntohl(tvb, offset+12)){
- return FALSE;
- }
- /* expected data transfer length is never >16MByte ? */
- if(tvb_get_guint8(tvb,offset+20)){
- return FALSE;
- }
- break;
+ /* top bit in byte 0 must be 0 */
+ if(tvb_get_guint8(tvb, offset+0)&0x80){
+ return FALSE;
+ }
+ /* reserved bits in byte 1 must be 0 */
+ if(tvb_get_guint8(tvb, offset+1)&0x18){
+ return FALSE;
+ }
+ /* bytes 2,3 must be null */
+ if(tvb_get_letohs(tvb,offset+2)){
+ return FALSE;
+ }
+ /* last 6 bytes of LUN are always 0 */
+ if(tvb_get_ntohs(tvb, offset+10) || tvb_get_ntohl(tvb, offset+12)){
+ return FALSE;
+ }
+ /* expected data transfer length is never >16MByte ? */
+ if(tvb_get_guint8(tvb,offset+20)){
+ return FALSE;
+ }
+ break;
case ISCSI_OPCODE_SCSI_RESPONSE:
- /* top two bits in byte 0 must be 0 */
- if(tvb_get_guint8(tvb, offset+0)&0xc0){
- return FALSE;
- }
- /* top bit in byte 1 must be 1 */
- tmpbyte=tvb_get_guint8(tvb,offset+1);
- if(!(tmpbyte&0x80)){
- return FALSE;
- }
- /* the reserved bits in byte 1 must be 0 */
- if(tmpbyte&0x61){
- return FALSE;
- }
- /* status must be known */
- if(!match_strval(tvb_get_guint8(tvb,offset+3), scsi_status_val)){
- return FALSE;
- }
- /* the 32bit words at offsets 8, 12
- * must all be 0
- */
- if(tvb_get_letohl(tvb,offset+8)
- || tvb_get_letohl(tvb,offset+12)){
- return FALSE;
- }
- break;
+ /* top two bits in byte 0 must be 0 */
+ if(tvb_get_guint8(tvb, offset+0)&0xc0){
+ return FALSE;
+ }
+ /* top bit in byte 1 must be 1 */
+ tmpbyte=tvb_get_guint8(tvb,offset+1);
+ if(!(tmpbyte&0x80)){
+ return FALSE;
+ }
+ /* the reserved bits in byte 1 must be 0 */
+ if(tmpbyte&0x61){
+ return FALSE;
+ }
+ /* status must be known */
+ if(!match_strval(tvb_get_guint8(tvb,offset+3), scsi_status_val)){
+ return FALSE;
+ }
+ /* the 32bit words at offsets 8, 12
+ * must all be 0
+ */
+ if(tvb_get_letohl(tvb,offset+8)
+ || tvb_get_letohl(tvb,offset+12)){
+ return FALSE;
+ }
+ break;
case ISCSI_OPCODE_ASYNC_MESSAGE:
- /* top two bits in byte 0 must be 0 */
- if(tvb_get_guint8(tvb, offset+0)&0xc0){
- return FALSE;
- }
- /* byte 1 must be 0x80 */
- if(tvb_get_guint8(tvb, offset+1)!=0x80){
- return FALSE;
- }
- /* bytes 2,3 must be null */
- if(tvb_get_letohs(tvb,offset+2)){
- return FALSE;
- }
- /* the 32bit words at offsets 20, 44
- * must all be 0
- */
- if(tvb_get_letohl(tvb,offset+20)
- || tvb_get_letohl(tvb,offset+44)){
- return FALSE;
- }
- /* the 32bit word at 16 must be 0xffffffff */
- if(tvb_get_letohl(tvb,offset+16)!=0xffffffff){
- return FALSE;
- }
- break;
+ /* top two bits in byte 0 must be 0 */
+ if(tvb_get_guint8(tvb, offset+0)&0xc0){
+ return FALSE;
+ }
+ /* byte 1 must be 0x80 */
+ if(tvb_get_guint8(tvb, offset+1)!=0x80){
+ return FALSE;
+ }
+ /* bytes 2,3 must be null */
+ if(tvb_get_letohs(tvb,offset+2)){
+ return FALSE;
+ }
+ /* the 32bit words at offsets 20, 44
+ * must all be 0
+ */
+ if(tvb_get_letohl(tvb,offset+20)
+ || tvb_get_letohl(tvb,offset+44)){
+ return FALSE;
+ }
+ /* the 32bit word at 16 must be 0xffffffff */
+ if(tvb_get_letohl(tvb,offset+16)!=0xffffffff){
+ return FALSE;
+ }
+ break;
case ISCSI_OPCODE_LOGOUT_RESPONSE:
- /* top two bits in byte 0 must be 0 */
- if(tvb_get_guint8(tvb, offset+0)&0xc0){
- return FALSE;
- }
- /* byte 1 must be 0x80 */
- if(tvb_get_guint8(tvb, offset+1)!=0x80){
- return FALSE;
- }
- /* response must be known */
- if(!match_strval(tvb_get_guint8(tvb,offset+2), iscsi_logout_response)){
- return FALSE;
- }
- /* byte 3 must be 0 */
- if(tvb_get_guint8(tvb,offset+3)){
- return FALSE;
- }
- /* ahs and dsl as well as the 32bit words at offsets 8, 12, 20, 36
- * 44 must all be 0
- */
- if(tvb_get_letohl(tvb,offset+4)
- || tvb_get_letohl(tvb,offset+8)
- || tvb_get_letohl(tvb,offset+12)
- || tvb_get_letohl(tvb,offset+20)
- || tvb_get_letohl(tvb,offset+36)
- || tvb_get_letohl(tvb,offset+44)){
- return FALSE;
- }
- break;
+ /* top two bits in byte 0 must be 0 */
+ if(tvb_get_guint8(tvb, offset+0)&0xc0){
+ return FALSE;
+ }
+ /* byte 1 must be 0x80 */
+ if(tvb_get_guint8(tvb, offset+1)!=0x80){
+ return FALSE;
+ }
+ /* response must be known */
+ if(!match_strval(tvb_get_guint8(tvb,offset+2), iscsi_logout_response)){
+ return FALSE;
+ }
+ /* byte 3 must be 0 */
+ if(tvb_get_guint8(tvb,offset+3)){
+ return FALSE;
+ }
+ /* ahs and dsl as well as the 32bit words at offsets 8, 12, 20, 36
+ * 44 must all be 0
+ */
+ if(tvb_get_letohl(tvb,offset+4)
+ || tvb_get_letohl(tvb,offset+8)
+ || tvb_get_letohl(tvb,offset+12)
+ || tvb_get_letohl(tvb,offset+20)
+ || tvb_get_letohl(tvb,offset+36)
+ || tvb_get_letohl(tvb,offset+44)){
+ return FALSE;
+ }
+ break;
case ISCSI_OPCODE_SCSI_DATA_OUT:
- /* top two bits in byte 0 must be 0 */
- if(tvb_get_guint8(tvb, offset+0)&0xc0){
- return FALSE;
- }
- /* low 7 bits in byte 1 must be 0 */
- if(tvb_get_guint8(tvb,offset+1)&0x7f){
- return FALSE;
- }
- /* bytes 2,3 must be null */
- if(tvb_get_letohs(tvb,offset+2)){
- return FALSE;
- }
- /* the 32bit words at offsets 24, 32, 44
- * must all be 0
- */
- if(tvb_get_letohl(tvb,offset+24)
- || tvb_get_letohl(tvb,offset+32)
- || tvb_get_letohl(tvb,offset+44)){
- return FALSE;
- }
- break;
+ /* top two bits in byte 0 must be 0 */
+ if(tvb_get_guint8(tvb, offset+0)&0xc0){
+ return FALSE;
+ }
+ /* low 7 bits in byte 1 must be 0 */
+ if(tvb_get_guint8(tvb,offset+1)&0x7f){
+ return FALSE;
+ }
+ /* bytes 2,3 must be null */
+ if(tvb_get_letohs(tvb,offset+2)){
+ return FALSE;
+ }
+ /* the 32bit words at offsets 24, 32, 44
+ * must all be 0
+ */
+ if(tvb_get_letohl(tvb,offset+24)
+ || tvb_get_letohl(tvb,offset+32)
+ || tvb_get_letohl(tvb,offset+44)){
+ return FALSE;
+ }
+ break;
case ISCSI_OPCODE_SCSI_DATA_IN:
- /* top two bits in byte 0 must be 0 */
- if(tvb_get_guint8(tvb, offset+0)&0xc0){
- return FALSE;
- }
- /* reserved bits in byte 1 must be 0 */
- if(tvb_get_guint8(tvb,offset+1)&0x38){
- return FALSE;
- }
- /* byte 2 must be reserved */
- if(tvb_get_guint8(tvb,offset+2)){
- return FALSE;
- }
- break;
+ /* top two bits in byte 0 must be 0 */
+ if(tvb_get_guint8(tvb, offset+0)&0xc0){
+ return FALSE;
+ }
+ /* reserved bits in byte 1 must be 0 */
+ if(tvb_get_guint8(tvb,offset+1)&0x38){
+ return FALSE;
+ }
+ /* byte 2 must be reserved */
+ if(tvb_get_guint8(tvb,offset+2)){
+ return FALSE;
+ }
+ break;
case ISCSI_OPCODE_VENDOR_SPECIFIC_I0:
case ISCSI_OPCODE_VENDOR_SPECIFIC_I1:
case ISCSI_OPCODE_VENDOR_SPECIFIC_I2:
case ISCSI_OPCODE_VENDOR_SPECIFIC_T0:
case ISCSI_OPCODE_VENDOR_SPECIFIC_T1:
case ISCSI_OPCODE_VENDOR_SPECIFIC_T2:
- break;
+ break;
default:
- return FALSE;
+ return FALSE;
}
/* process multiple iSCSI PDUs per packet */
while(available_bytes >= 48 || (iscsi_desegment && available_bytes >= 8)) {
- const char *opcode_str = NULL;
- guint32 data_segment_len;
- guint32 pduLen = 48;
- guint8 secondPduByte = tvb_get_guint8(tvb, offset + 1);
- int badPdu = FALSE;
- guint8 ahsLen=0;
-
- /* mask out any extra bits in the opcode byte */
- opcode = tvb_get_guint8(tvb, offset + 0);
- opcode &= OPCODE_MASK;
-
- opcode_str = match_strval(opcode, iscsi_opcodes);
- if(opcode == ISCSI_OPCODE_TASK_MANAGEMENT_FUNCTION ||
- opcode == ISCSI_OPCODE_TASK_MANAGEMENT_FUNCTION_RESPONSE ||
- opcode == ISCSI_OPCODE_R2T ||
- opcode == ISCSI_OPCODE_LOGOUT_COMMAND ||
- opcode == ISCSI_OPCODE_LOGOUT_RESPONSE ||
- opcode == ISCSI_OPCODE_SNACK_REQUEST)
- data_segment_len = 0;
- else
- data_segment_len = tvb_get_ntohl(tvb, offset + 4) & 0x00ffffff;
-
- if(opcode_str == NULL) {
- badPdu = TRUE;
- }
-
-
- if(!badPdu && check_port) {
- badPdu = TRUE;
- if ((opcode & TARGET_OPCODE_BIT) && value_is_in_range(global_iscsi_port_range, pinfo->srcport)) {
- badPdu = FALSE;
- }
- if (!(opcode & TARGET_OPCODE_BIT) && value_is_in_range(global_iscsi_port_range, pinfo->destport)) {
- badPdu = FALSE;
- }
- if ((opcode & TARGET_OPCODE_BIT) && pinfo->srcport == iscsi_system_port) {
- badPdu = FALSE;
- }
- if (!(opcode & TARGET_OPCODE_BIT) && pinfo->destport == iscsi_system_port) {
- badPdu = FALSE;
- }
- }
-
- if(!badPdu && enable_bogosity_filter) {
- /* try and distinguish between data and real headers */
- if(data_segment_len > bogus_pdu_data_length_threshold) {
- badPdu = TRUE;
- }
- else if(demand_good_f_bit &&
- !(secondPduByte & 0x80) &&
- (opcode == ISCSI_OPCODE_NOP_OUT ||
- opcode == ISCSI_OPCODE_NOP_IN ||
- opcode == ISCSI_OPCODE_LOGOUT_COMMAND ||
- opcode == ISCSI_OPCODE_LOGOUT_RESPONSE ||
- opcode == ISCSI_OPCODE_SCSI_RESPONSE ||
- opcode == ISCSI_OPCODE_TASK_MANAGEMENT_FUNCTION_RESPONSE ||
- opcode == ISCSI_OPCODE_R2T ||
- opcode == ISCSI_OPCODE_ASYNC_MESSAGE ||
- opcode == ISCSI_OPCODE_SNACK_REQUEST ||
- opcode == ISCSI_OPCODE_REJECT)) {
- badPdu = TRUE;
- } else if(opcode==ISCSI_OPCODE_NOP_OUT) {
- /* TransferTag for NOP-Out should either be -1 or
- the tag value we want for a response.
- Assume 0 means we are just inside a big all zero
- datablock.
- */
- if(tvb_get_ntohl(tvb, offset+20)==0){
- badPdu = TRUE;
- }
- }
- }
-
- if(badPdu) {
- return iSCSIPdusDissected > 0;
- }
-
- if(opcode == ISCSI_OPCODE_LOGIN_COMMAND ||
- opcode == ISCSI_OPCODE_LOGIN_RESPONSE) {
- if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08) {
- if((secondPduByte & CSG_MASK) < ISCSI_CSG_OPERATIONAL_NEGOTIATION) {
- /* digests are not yet turned on */
- digestsActive = 0;
- }
- } else {
- digestsActive = 0;
- }
- }
-
- if(opcode == ISCSI_OPCODE_SCSI_COMMAND) {
- /* ahsLen */
- ahsLen = tvb_get_guint8(tvb, offset + 4);
- pduLen += ahsLen * 4;
- }
-
- pduLen += data_segment_len;
- if((pduLen & 3) != 0)
- pduLen += 4 - (pduLen & 3);
-
-
- if(digestsActive && data_segment_len > 0 && enableDataDigests) {
- if(dataDigestIsCRC32)
- pduLen += 4;
- else
- pduLen += dataDigestSize;
- }
-
- /* make sure we have a conversation for this session */
+ const char *opcode_str = NULL;
+ guint32 data_segment_len;
+ guint32 pduLen = 48;
+ guint8 secondPduByte = tvb_get_guint8(tvb, offset + 1);
+ int badPdu = FALSE;
+ guint8 ahsLen=0;
+
+ /* mask out any extra bits in the opcode byte */
+ opcode = tvb_get_guint8(tvb, offset + 0);
+ opcode &= OPCODE_MASK;
+
+ opcode_str = match_strval(opcode, iscsi_opcodes);
+ if(opcode == ISCSI_OPCODE_TASK_MANAGEMENT_FUNCTION ||
+ opcode == ISCSI_OPCODE_TASK_MANAGEMENT_FUNCTION_RESPONSE ||
+ opcode == ISCSI_OPCODE_R2T ||
+ opcode == ISCSI_OPCODE_LOGOUT_COMMAND ||
+ opcode == ISCSI_OPCODE_LOGOUT_RESPONSE ||
+ opcode == ISCSI_OPCODE_SNACK_REQUEST)
+ data_segment_len = 0;
+ else
+ data_segment_len = tvb_get_ntohl(tvb, offset + 4) & 0x00ffffff;
+
+ if(opcode_str == NULL) {
+ badPdu = TRUE;
+ }
+
+
+ if(!badPdu && check_port) {
+ badPdu = TRUE;
+ if ((opcode & TARGET_OPCODE_BIT) && value_is_in_range(global_iscsi_port_range, pinfo->srcport)) {
+ badPdu = FALSE;
+ }
+ if (!(opcode & TARGET_OPCODE_BIT) && value_is_in_range(global_iscsi_port_range, pinfo->destport)) {
+ badPdu = FALSE;
+ }
+ if ((opcode & TARGET_OPCODE_BIT) && pinfo->srcport == iscsi_system_port) {
+ badPdu = FALSE;
+ }
+ if (!(opcode & TARGET_OPCODE_BIT) && pinfo->destport == iscsi_system_port) {
+ badPdu = FALSE;
+ }
+ }
+
+ if(!badPdu && enable_bogosity_filter) {
+ /* try and distinguish between data and real headers */
+ if(data_segment_len > bogus_pdu_data_length_threshold) {
+ badPdu = TRUE;
+ }
+ else if(demand_good_f_bit &&
+ !(secondPduByte & 0x80) &&
+ (opcode == ISCSI_OPCODE_NOP_OUT ||
+ opcode == ISCSI_OPCODE_NOP_IN ||
+ opcode == ISCSI_OPCODE_LOGOUT_COMMAND ||
+ opcode == ISCSI_OPCODE_LOGOUT_RESPONSE ||
+ opcode == ISCSI_OPCODE_SCSI_RESPONSE ||
+ opcode == ISCSI_OPCODE_TASK_MANAGEMENT_FUNCTION_RESPONSE ||
+ opcode == ISCSI_OPCODE_R2T ||
+ opcode == ISCSI_OPCODE_ASYNC_MESSAGE ||
+ opcode == ISCSI_OPCODE_SNACK_REQUEST ||
+ opcode == ISCSI_OPCODE_REJECT)) {
+ badPdu = TRUE;
+ } else if(opcode==ISCSI_OPCODE_NOP_OUT) {
+ /* TransferTag for NOP-Out should either be -1 or
+ the tag value we want for a response.
+ Assume 0 means we are just inside a big all zero
+ datablock.
+ */
+ if(tvb_get_ntohl(tvb, offset+20)==0){
+ badPdu = TRUE;
+ }
+ }
+ }
+
+ if(badPdu) {
+ return iSCSIPdusDissected > 0;
+ }
+
+ if(opcode == ISCSI_OPCODE_LOGIN_COMMAND ||
+ opcode == ISCSI_OPCODE_LOGIN_RESPONSE) {
+ if(iscsi_protocol_version == ISCSI_PROTOCOL_DRAFT08) {
+ if((secondPduByte & CSG_MASK) < ISCSI_CSG_OPERATIONAL_NEGOTIATION) {
+ /* digests are not yet turned on */
+ digestsActive = 0;
+ }
+ } else {
+ digestsActive = 0;
+ }
+ }
+
+ if(opcode == ISCSI_OPCODE_SCSI_COMMAND) {
+ /* ahsLen */
+ ahsLen = tvb_get_guint8(tvb, offset + 4);
+ pduLen += ahsLen * 4;
+ }
+
+ pduLen += data_segment_len;
+ if((pduLen & 3) != 0)
+ pduLen += 4 - (pduLen & 3);
+
+
+ if(digestsActive && data_segment_len > 0 && enableDataDigests) {
+ if(dataDigestIsCRC32)
+ pduLen += 4;
+ else
+ pduLen += dataDigestSize;
+ }
+
+ /* make sure we have a conversation for this session */
conversation = find_or_create_conversation(pinfo);
iscsi_session=conversation_get_proto_data(conversation, proto_iscsi);
@@ -2355,88 +2353,88 @@ dissect_iscsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean chec
conversation_set_dissector(conversation, iscsi_handle);
}
/* try to autodetect if header digest is used or not */
- if(digestsActive && (available_bytes>=(guint32) (48+4+ahsLen*4)) && (iscsi_session->header_digest==ISCSI_HEADER_DIGEST_AUTO) ){
+ if(digestsActive && (available_bytes>=(guint32) (48+4+ahsLen*4)) && (iscsi_session->header_digest==ISCSI_HEADER_DIGEST_AUTO) ){
guint32 crc;
- /* we have enough data to test if HeaderDigest is enabled */
+ /* we have enough data to test if HeaderDigest is enabled */
crc= ~crc32c_calculate(tvb_get_ptr(tvb, offset, 48+ahsLen*4), 48+ahsLen*4, CRC32C_PRELOAD);
if(crc==tvb_get_ntohl(tvb,48+ahsLen*4)){
iscsi_session->header_digest=ISCSI_HEADER_DIGEST_CRC32;
} else {
iscsi_session->header_digest=ISCSI_HEADER_DIGEST_NONE;
}
- }
-
-
- /* Add header digest length to pdulen */
- if(digestsActive){
- switch(iscsi_session->header_digest){
- case ISCSI_HEADER_DIGEST_CRC32:
- pduLen += 4;
- break;
- case ISCSI_HEADER_DIGEST_NONE:
- break;
- case ISCSI_HEADER_DIGEST_AUTO:
- /* oops we didnt know what digest is used yet */
- /* here we should use some default */
- break;
- default:
- DISSECTOR_ASSERT_NOT_REACHED();
- }
- }
-
- /*
- * Desegmentation check.
- */
- if(iscsi_desegment && pinfo->can_desegment) {
- if(pduLen > available_bytes) {
- /*
- * This frame doesn't have all of the data for
- * this message, but we can do reassembly on it.
- *
- * Tell the TCP dissector where the data for this
- * message starts in the data it handed us, and
- * how many more bytes we need, and return.
- */
- pinfo->desegment_offset = offset;
- pinfo->desegment_len = pduLen - available_bytes;
- return TRUE;
- }
- }
-
- /* This is to help TCP keep track of PDU boundaries
- and allows it to find PDUs that are not aligned to
- the start of a TCP segments.
- Since it also allows TCP to know what is in the middle
- of a large PDU, it reduces the probability of a segment
- in the middle of a large PDU transfer being misdissected as
- a PDU.
- */
- if(!pinfo->fd->flags.visited){
- if(pduLen>(guint32)tvb_reported_length_remaining(tvb, offset)){
- pinfo->want_pdu_tracking=2;
- pinfo->bytes_until_next_pdu=pduLen-tvb_reported_length_remaining(tvb, offset);
- }
- }
-
- if(check_col(pinfo->cinfo, COL_INFO)) {
- if(iSCSIPdusDissected == 0)
- col_set_str(pinfo->cinfo, COL_INFO, "");
- else
- col_append_str(pinfo->cinfo, COL_INFO, ", ");
- }
-
- dissect_iscsi_pdu(tvb, pinfo, tree, offset, opcode, opcode_str, data_segment_len, iscsi_session, conversation);
- if(pduLen > available_bytes)
- pduLen = available_bytes;
- offset += pduLen;
- available_bytes -= pduLen;
- ++iSCSIPdusDissected;
+ }
+
+
+ /* Add header digest length to pdulen */
+ if(digestsActive){
+ switch(iscsi_session->header_digest){
+ case ISCSI_HEADER_DIGEST_CRC32:
+ pduLen += 4;
+ break;
+ case ISCSI_HEADER_DIGEST_NONE:
+ break;
+ case ISCSI_HEADER_DIGEST_AUTO:
+ /* oops we didnt know what digest is used yet */
+ /* here we should use some default */
+ break;
+ default:
+ DISSECTOR_ASSERT_NOT_REACHED();
+ }
+ }
+
+ /*
+ * Desegmentation check.
+ */
+ if(iscsi_desegment && pinfo->can_desegment) {
+ if(pduLen > available_bytes) {
+ /*
+ * This frame doesn't have all of the data for
+ * this message, but we can do reassembly on it.
+ *
+ * Tell the TCP dissector where the data for this
+ * message starts in the data it handed us, and
+ * how many more bytes we need, and return.
+ */
+ pinfo->desegment_offset = offset;
+ pinfo->desegment_len = pduLen - available_bytes;
+ return TRUE;
+ }
+ }
+
+ /* This is to help TCP keep track of PDU boundaries
+ and allows it to find PDUs that are not aligned to
+ the start of a TCP segments.
+ Since it also allows TCP to know what is in the middle
+ of a large PDU, it reduces the probability of a segment
+ in the middle of a large PDU transfer being misdissected as
+ a PDU.
+ */
+ if(!pinfo->fd->flags.visited){
+ if(pduLen>(guint32)tvb_reported_length_remaining(tvb, offset)){
+ pinfo->want_pdu_tracking=2;
+ pinfo->bytes_until_next_pdu=pduLen-tvb_reported_length_remaining(tvb, offset);
+ }
+ }
+
+ if(check_col(pinfo->cinfo, COL_INFO)) {
+ if(iSCSIPdusDissected == 0)
+ col_set_str(pinfo->cinfo, COL_INFO, "");
+ else
+ col_append_str(pinfo->cinfo, COL_INFO, ", ");
+ }
+
+ dissect_iscsi_pdu(tvb, pinfo, tree, offset, opcode, opcode_str, data_segment_len, iscsi_session, conversation);
+ if(pduLen > available_bytes)
+ pduLen = available_bytes;
+ offset += pduLen;
+ available_bytes -= pduLen;
+ ++iSCSIPdusDissected;
}
return iSCSIPdusDissected > 0;
}
-/* This is called for those sessions where we have explicitely said
+/* This is called for those sessions where we have explicitly said
this to be iSCSI using "Decode As..."
In this case we will not check the port number for sanity and just
do as the user said.
@@ -2459,8 +2457,8 @@ dissect_iscsi_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
/* quick check to see if the packet is long enough to contain the
* minimum amount of information we need */
if (available_bytes < 48 ){
- /* no, so give up */
- return FALSE;
+ /* no, so give up */
+ return FALSE;
}
return dissect_iscsi(tvb, pinfo, tree, TRUE);
@@ -2481,526 +2479,526 @@ proto_register_iscsi(void)
/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf[] = {
- { &hf_iscsi_request_frame,
- { "Request in", "iscsi.request_frame",
- FT_FRAMENUM, BASE_NONE, NULL, 0,
- "The request to this transaction is in this frame", HFILL }},
-
- { &hf_iscsi_time,
- { "Time from request", "iscsi.time",
- FT_RELATIVE_TIME, BASE_NONE, NULL, 0,
- "Time between the Command and the Response", HFILL }},
-
- { &hf_iscsi_data_in_frame,
- { "Data In in", "iscsi.data_in_frame",
- FT_FRAMENUM, BASE_NONE, NULL, 0,
- "The Data In for this transaction is in this frame", HFILL }},
-
- { &hf_iscsi_data_out_frame,
- { "Data Out in", "iscsi.data_out_frame",
- FT_FRAMENUM, BASE_NONE, NULL, 0,
- "The Data Out for this transaction is in this frame", HFILL }},
-
- { &hf_iscsi_response_frame,
- { "Response in", "iscsi.response_frame",
- FT_FRAMENUM, BASE_NONE, NULL, 0,
- "The response to this transaction is in this frame", HFILL }},
- { &hf_iscsi_AHS_length,
- { "AHS Length", "iscsi.ahs.length",
- FT_UINT16, BASE_DEC, NULL, 0,
- "Length of Additional header segment", HFILL }
- },
- { &hf_iscsi_AHS_read_data_length,
- { "Bidirectional Read Data Length", "iscsi.ahs.bidir.length",
- FT_UINT32, BASE_DEC, NULL, 0,
- NULL, HFILL }
- },
- { &hf_iscsi_AHS_type,
- { "AHS Type", "iscsi.ahs.type",
- FT_UINT8, BASE_DEC, VALS(ahs_type_vals), 0,
- "Type of Additional header segment", HFILL }
- },
- { &hf_iscsi_AHS_extended_cdb,
- { "AHS Extended CDB", "iscsi.ahs.extended_cdb",
- FT_BYTES, BASE_NONE, NULL, 0,
- NULL, HFILL }
- },
- { &hf_iscsi_AHS_blob,
- { "Unknown AHS blob", "iscsi.ahs.unknown_blob",
- FT_BYTES, BASE_NONE, NULL, 0,
- NULL, HFILL }
- },
- { &hf_iscsi_Padding,
- { "Padding", "iscsi.padding",
- FT_BYTES, BASE_NONE, NULL, 0,
- "Padding to 4 byte boundary", HFILL }
- },
- { &hf_iscsi_ping_data,
- { "PingData", "iscsi.pingdata",
- FT_BYTES, BASE_NONE, NULL, 0,
- "Ping Data", HFILL }
- },
- { &hf_iscsi_immediate_data,
- { "ImmediateData", "iscsi.immediatedata",
- FT_BYTES, BASE_NONE, NULL, 0,
- "Immediate Data", HFILL }
- },
- { &hf_iscsi_async_event_data,
- { "AsyncEventData", "iscsi.asynceventdata",
- FT_BYTES, BASE_NONE, NULL, 0,
- "Async Event Data", HFILL }
- },
- { &hf_iscsi_vendor_specific_data,
- { "VendorSpecificData", "iscsi.vendorspecificdata",
- FT_BYTES, BASE_NONE, NULL, 0,
- "Vendor Specific Data", HFILL }
- },
- { &hf_iscsi_HeaderDigest32,
- { "HeaderDigest", "iscsi.headerdigest32",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Header Digest", HFILL }
- },
- { &hf_iscsi_DataDigest,
- { "DataDigest", "iscsi.datadigest",
- FT_BYTES, BASE_NONE, NULL, 0,
- "Data Digest", HFILL }
- },
- { &hf_iscsi_DataDigest32,
- { "DataDigest", "iscsi.datadigest32",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Data Digest", HFILL }
- },
- { &hf_iscsi_Opcode,
- { "Opcode", "iscsi.opcode",
- FT_UINT8, BASE_HEX, VALS(iscsi_opcodes), 0,
- NULL, HFILL }
- },
+ { &hf_iscsi_request_frame,
+ { "Request in", "iscsi.request_frame",
+ FT_FRAMENUM, BASE_NONE, NULL, 0,
+ "The request to this transaction is in this frame", HFILL }},
+
+ { &hf_iscsi_time,
+ { "Time from request", "iscsi.time",
+ FT_RELATIVE_TIME, BASE_NONE, NULL, 0,
+ "Time between the Command and the Response", HFILL }},
+
+ { &hf_iscsi_data_in_frame,
+ { "Data In in", "iscsi.data_in_frame",
+ FT_FRAMENUM, BASE_NONE, NULL, 0,
+ "The Data In for this transaction is in this frame", HFILL }},
+
+ { &hf_iscsi_data_out_frame,
+ { "Data Out in", "iscsi.data_out_frame",
+ FT_FRAMENUM, BASE_NONE, NULL, 0,
+ "The Data Out for this transaction is in this frame", HFILL }},
+
+ { &hf_iscsi_response_frame,
+ { "Response in", "iscsi.response_frame",
+ FT_FRAMENUM, BASE_NONE, NULL, 0,
+ "The response to this transaction is in this frame", HFILL }},
+ { &hf_iscsi_AHS_length,
+ { "AHS Length", "iscsi.ahs.length",
+ FT_UINT16, BASE_DEC, NULL, 0,
+ "Length of Additional header segment", HFILL }
+ },
+ { &hf_iscsi_AHS_read_data_length,
+ { "Bidirectional Read Data Length", "iscsi.ahs.bidir.length",
+ FT_UINT32, BASE_DEC, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_iscsi_AHS_type,
+ { "AHS Type", "iscsi.ahs.type",
+ FT_UINT8, BASE_DEC, VALS(ahs_type_vals), 0,
+ "Type of Additional header segment", HFILL }
+ },
+ { &hf_iscsi_AHS_extended_cdb,
+ { "AHS Extended CDB", "iscsi.ahs.extended_cdb",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_iscsi_AHS_blob,
+ { "Unknown AHS blob", "iscsi.ahs.unknown_blob",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_iscsi_Padding,
+ { "Padding", "iscsi.padding",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ "Padding to 4 byte boundary", HFILL }
+ },
+ { &hf_iscsi_ping_data,
+ { "PingData", "iscsi.pingdata",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ "Ping Data", HFILL }
+ },
+ { &hf_iscsi_immediate_data,
+ { "ImmediateData", "iscsi.immediatedata",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ "Immediate Data", HFILL }
+ },
+ { &hf_iscsi_async_event_data,
+ { "AsyncEventData", "iscsi.asynceventdata",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ "Async Event Data", HFILL }
+ },
+ { &hf_iscsi_vendor_specific_data,
+ { "VendorSpecificData", "iscsi.vendorspecificdata",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ "Vendor Specific Data", HFILL }
+ },
+ { &hf_iscsi_HeaderDigest32,
+ { "HeaderDigest", "iscsi.headerdigest32",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Header Digest", HFILL }
+ },
+ { &hf_iscsi_DataDigest,
+ { "DataDigest", "iscsi.datadigest",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ "Data Digest", HFILL }
+ },
+ { &hf_iscsi_DataDigest32,
+ { "DataDigest", "iscsi.datadigest32",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Data Digest", HFILL }
+ },
+ { &hf_iscsi_Opcode,
+ { "Opcode", "iscsi.opcode",
+ FT_UINT8, BASE_HEX, VALS(iscsi_opcodes), 0,
+ NULL, HFILL }
+ },
/* #ifdef DRAFT08 */
- { &hf_iscsi_X,
- { "X", "iscsi.X",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_X), 0x80,
- "Command Retry", HFILL }
- },
+ { &hf_iscsi_X,
+ { "X", "iscsi.X",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_X), 0x80,
+ "Command Retry", HFILL }
+ },
/* #endif */
- { &hf_iscsi_I,
- { "I", "iscsi.I",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_I), 0x40,
- "Immediate delivery", HFILL }
- },
- { &hf_iscsi_Flags,
- { "Flags", "iscsi.flags",
- FT_UINT8, BASE_HEX, NULL, 0,
- "Opcode specific flags", HFILL }
- },
- { &hf_iscsi_SCSICommand_F,
- { "F", "iscsi.scsicommand.F",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_F), 0x80,
- "PDU completes command", HFILL }
- },
- { &hf_iscsi_SCSICommand_R,
- { "R", "iscsi.scsicommand.R",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_R), 0x40,
- "Command reads from SCSI target", HFILL }
- },
- { &hf_iscsi_SCSICommand_W,
- { "W", "iscsi.scsicommand.W",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_W), 0x20,
- "Command writes to SCSI target", HFILL }
- },
- { &hf_iscsi_SCSICommand_Attr,
- { "Attr", "iscsi.scsicommand.attr",
- FT_UINT8, BASE_HEX, VALS(iscsi_scsicommand_taskattrs), 0x07,
- "SCSI task attributes", HFILL }
- },
- { &hf_iscsi_SCSICommand_CRN,
- { "CRN", "iscsi.scsicommand.crn",
- FT_UINT8, BASE_HEX, NULL, 0,
- "SCSI command reference number", HFILL }
- },
- { &hf_iscsi_DataSegmentLength,
- { "DataSegmentLength", "iscsi.datasegmentlength",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Data segment length (bytes)", HFILL }
- },
- { &hf_iscsi_TotalAHSLength,
- { "TotalAHSLength", "iscsi.totalahslength",
- FT_UINT8, BASE_HEX, NULL, 0,
- "Total additional header segment length (4 byte words)", HFILL }
- },
- { &hf_iscsi_LUN,
- { "LUN", "iscsi.lun",
- FT_BYTES, BASE_NONE, NULL, 0,
- "Logical Unit Number", HFILL }
- },
- { &hf_iscsi_InitiatorTaskTag,
- { "InitiatorTaskTag", "iscsi.initiatortasktag",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Initiator's task tag", HFILL }
- },
- { &hf_iscsi_ExpectedDataTransferLength,
- { "ExpectedDataTransferLength", "iscsi.scsicommand.expecteddatatransferlength",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Expected length of data transfer", HFILL }
- },
- { &hf_iscsi_CmdSN,
- { "CmdSN", "iscsi.cmdsn",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Sequence number for this command", HFILL }
- },
- { &hf_iscsi_ExpStatSN,
- { "ExpStatSN", "iscsi.expstatsn",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Next expected status sequence number", HFILL }
- },
- { &hf_iscsi_SCSIResponse_ResidualCount,
- { "ResidualCount", "iscsi.scsiresponse.residualcount",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Residual count", HFILL }
- },
- { &hf_iscsi_StatSN,
- { "StatSN", "iscsi.statsn",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Status sequence number", HFILL }
- },
- { &hf_iscsi_ExpCmdSN,
- { "ExpCmdSN", "iscsi.expcmdsn",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Next expected command sequence number", HFILL }
- },
- { &hf_iscsi_MaxCmdSN,
- { "MaxCmdSN", "iscsi.maxcmdsn",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Maximum acceptable command sequence number", HFILL }
- },
- { &hf_iscsi_SCSIResponse_o,
- { "o", "iscsi.scsiresponse.o",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_o), 0x10,
- "Bi-directional read residual overflow", HFILL }
- },
- { &hf_iscsi_SCSIResponse_u,
- { "u", "iscsi.scsiresponse.u",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_u), 0x08,
- "Bi-directional read residual underflow", HFILL }
- },
- { &hf_iscsi_SCSIResponse_O,
- { "O", "iscsi.scsiresponse.O",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_O), 0x04,
- "Residual overflow", HFILL }
- },
- { &hf_iscsi_SCSIResponse_U,
- { "U", "iscsi.scsiresponse.U",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_U), 0x02,
- "Residual underflow", HFILL }
- },
- { &hf_iscsi_SCSIResponse_Status,
- { "Status", "iscsi.scsiresponse.status",
- FT_UINT8, BASE_HEX, VALS(scsi_status_val), 0,
- "SCSI command status value", HFILL }
- },
- { &hf_iscsi_SCSIResponse_Response,
- { "Response", "iscsi.scsiresponse.response",
- FT_UINT8, BASE_HEX, VALS(iscsi_scsi_responses), 0,
- "SCSI command response value", HFILL }
- },
- { &hf_iscsi_SCSIResponse_BidiReadResidualCount,
- { "BidiReadResidualCount", "iscsi.scsiresponse.bidireadresidualcount",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Bi-directional read residual count", HFILL }
- },
- { &hf_iscsi_SenseLength,
- { "SenseLength", "iscsi.scsiresponse.senselength",
- FT_UINT16, BASE_HEX, NULL, 0,
- "Sense data length", HFILL }
- },
- { &hf_iscsi_SCSIData_F,
- { "F", "iscsi.scsidata.F",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_F), ISCSI_SCSI_DATA_FLAG_F,
- "Final PDU", HFILL }
- },
- { &hf_iscsi_SCSIData_A,
- { "A", "iscsi.scsidata.A",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_A), ISCSI_SCSI_DATA_FLAG_A,
- "Acknowledge Requested", HFILL }
- },
- { &hf_iscsi_SCSIData_S,
- { "S", "iscsi.scsidata.S",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_S), ISCSI_SCSI_DATA_FLAG_S,
- "PDU Contains SCSI command status", HFILL }
- },
- { &hf_iscsi_SCSIData_U,
- { "U", "iscsi.scsidata.U",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_U), ISCSI_SCSI_DATA_FLAG_U,
- "Residual underflow", HFILL }
- },
- { &hf_iscsi_SCSIData_O,
- { "O", "iscsi.scsidata.O",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_O), ISCSI_SCSI_DATA_FLAG_O,
- "Residual overflow", HFILL }
- },
- { &hf_iscsi_TargetTransferTag,
- { "TargetTransferTag", "iscsi.targettransfertag",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Target transfer tag", HFILL }
- },
- { &hf_iscsi_BufferOffset,
- { "BufferOffset", "iscsi.bufferOffset",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Buffer offset", HFILL }
- },
- { &hf_iscsi_SCSIData_ResidualCount,
- { "ResidualCount", "iscsi.scsidata.readresidualcount",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Residual count", HFILL }
- },
- { &hf_iscsi_DataSN,
- { "DataSN", "iscsi.datasn",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Data sequence number", HFILL }
- },
- { &hf_iscsi_VersionMax,
- { "VersionMax", "iscsi.versionmax",
- FT_UINT8, BASE_HEX, NULL, 0,
- "Maximum supported protocol version", HFILL }
- },
- { &hf_iscsi_VersionMin,
- { "VersionMin", "iscsi.versionmin",
- FT_UINT8, BASE_HEX, NULL, 0,
- "Minimum supported protocol version", HFILL }
- },
- { &hf_iscsi_VersionActive,
- { "VersionActive", "iscsi.versionactive",
- FT_UINT8, BASE_HEX, NULL, 0,
- "Negotiated protocol version", HFILL }
- },
- { &hf_iscsi_CID,
- { "CID", "iscsi.cid",
- FT_UINT16, BASE_HEX, NULL, 0,
- "Connection identifier", HFILL }
- },
+ { &hf_iscsi_I,
+ { "I", "iscsi.I",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_I), 0x40,
+ "Immediate delivery", HFILL }
+ },
+ { &hf_iscsi_Flags,
+ { "Flags", "iscsi.flags",
+ FT_UINT8, BASE_HEX, NULL, 0,
+ "Opcode specific flags", HFILL }
+ },
+ { &hf_iscsi_SCSICommand_F,
+ { "F", "iscsi.scsicommand.F",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_F), 0x80,
+ "PDU completes command", HFILL }
+ },
+ { &hf_iscsi_SCSICommand_R,
+ { "R", "iscsi.scsicommand.R",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_R), 0x40,
+ "Command reads from SCSI target", HFILL }
+ },
+ { &hf_iscsi_SCSICommand_W,
+ { "W", "iscsi.scsicommand.W",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_W), 0x20,
+ "Command writes to SCSI target", HFILL }
+ },
+ { &hf_iscsi_SCSICommand_Attr,
+ { "Attr", "iscsi.scsicommand.attr",
+ FT_UINT8, BASE_HEX, VALS(iscsi_scsicommand_taskattrs), 0x07,
+ "SCSI task attributes", HFILL }
+ },
+ { &hf_iscsi_SCSICommand_CRN,
+ { "CRN", "iscsi.scsicommand.crn",
+ FT_UINT8, BASE_HEX, NULL, 0,
+ "SCSI command reference number", HFILL }
+ },
+ { &hf_iscsi_DataSegmentLength,
+ { "DataSegmentLength", "iscsi.datasegmentlength",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Data segment length (bytes)", HFILL }
+ },
+ { &hf_iscsi_TotalAHSLength,
+ { "TotalAHSLength", "iscsi.totalahslength",
+ FT_UINT8, BASE_HEX, NULL, 0,
+ "Total additional header segment length (4 byte words)", HFILL }
+ },
+ { &hf_iscsi_LUN,
+ { "LUN", "iscsi.lun",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ "Logical Unit Number", HFILL }
+ },
+ { &hf_iscsi_InitiatorTaskTag,
+ { "InitiatorTaskTag", "iscsi.initiatortasktag",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Initiator's task tag", HFILL }
+ },
+ { &hf_iscsi_ExpectedDataTransferLength,
+ { "ExpectedDataTransferLength", "iscsi.scsicommand.expecteddatatransferlength",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Expected length of data transfer", HFILL }
+ },
+ { &hf_iscsi_CmdSN,
+ { "CmdSN", "iscsi.cmdsn",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Sequence number for this command", HFILL }
+ },
+ { &hf_iscsi_ExpStatSN,
+ { "ExpStatSN", "iscsi.expstatsn",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Next expected status sequence number", HFILL }
+ },
+ { &hf_iscsi_SCSIResponse_ResidualCount,
+ { "ResidualCount", "iscsi.scsiresponse.residualcount",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Residual count", HFILL }
+ },
+ { &hf_iscsi_StatSN,
+ { "StatSN", "iscsi.statsn",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Status sequence number", HFILL }
+ },
+ { &hf_iscsi_ExpCmdSN,
+ { "ExpCmdSN", "iscsi.expcmdsn",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Next expected command sequence number", HFILL }
+ },
+ { &hf_iscsi_MaxCmdSN,
+ { "MaxCmdSN", "iscsi.maxcmdsn",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Maximum acceptable command sequence number", HFILL }
+ },
+ { &hf_iscsi_SCSIResponse_o,
+ { "o", "iscsi.scsiresponse.o",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_o), 0x10,
+ "Bi-directional read residual overflow", HFILL }
+ },
+ { &hf_iscsi_SCSIResponse_u,
+ { "u", "iscsi.scsiresponse.u",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_u), 0x08,
+ "Bi-directional read residual underflow", HFILL }
+ },
+ { &hf_iscsi_SCSIResponse_O,
+ { "O", "iscsi.scsiresponse.O",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_O), 0x04,
+ "Residual overflow", HFILL }
+ },
+ { &hf_iscsi_SCSIResponse_U,
+ { "U", "iscsi.scsiresponse.U",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_U), 0x02,
+ "Residual underflow", HFILL }
+ },
+ { &hf_iscsi_SCSIResponse_Status,
+ { "Status", "iscsi.scsiresponse.status",
+ FT_UINT8, BASE_HEX, VALS(scsi_status_val), 0,
+ "SCSI command status value", HFILL }
+ },
+ { &hf_iscsi_SCSIResponse_Response,
+ { "Response", "iscsi.scsiresponse.response",
+ FT_UINT8, BASE_HEX, VALS(iscsi_scsi_responses), 0,
+ "SCSI command response value", HFILL }
+ },
+ { &hf_iscsi_SCSIResponse_BidiReadResidualCount,
+ { "BidiReadResidualCount", "iscsi.scsiresponse.bidireadresidualcount",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Bi-directional read residual count", HFILL }
+ },
+ { &hf_iscsi_SenseLength,
+ { "SenseLength", "iscsi.scsiresponse.senselength",
+ FT_UINT16, BASE_HEX, NULL, 0,
+ "Sense data length", HFILL }
+ },
+ { &hf_iscsi_SCSIData_F,
+ { "F", "iscsi.scsidata.F",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_F), ISCSI_SCSI_DATA_FLAG_F,
+ "Final PDU", HFILL }
+ },
+ { &hf_iscsi_SCSIData_A,
+ { "A", "iscsi.scsidata.A",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_A), ISCSI_SCSI_DATA_FLAG_A,
+ "Acknowledge Requested", HFILL }
+ },
+ { &hf_iscsi_SCSIData_S,
+ { "S", "iscsi.scsidata.S",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_S), ISCSI_SCSI_DATA_FLAG_S,
+ "PDU Contains SCSI command status", HFILL }
+ },
+ { &hf_iscsi_SCSIData_U,
+ { "U", "iscsi.scsidata.U",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_U), ISCSI_SCSI_DATA_FLAG_U,
+ "Residual underflow", HFILL }
+ },
+ { &hf_iscsi_SCSIData_O,
+ { "O", "iscsi.scsidata.O",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_O), ISCSI_SCSI_DATA_FLAG_O,
+ "Residual overflow", HFILL }
+ },
+ { &hf_iscsi_TargetTransferTag,
+ { "TargetTransferTag", "iscsi.targettransfertag",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Target transfer tag", HFILL }
+ },
+ { &hf_iscsi_BufferOffset,
+ { "BufferOffset", "iscsi.bufferOffset",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Buffer offset", HFILL }
+ },
+ { &hf_iscsi_SCSIData_ResidualCount,
+ { "ResidualCount", "iscsi.scsidata.readresidualcount",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Residual count", HFILL }
+ },
+ { &hf_iscsi_DataSN,
+ { "DataSN", "iscsi.datasn",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Data sequence number", HFILL }
+ },
+ { &hf_iscsi_VersionMax,
+ { "VersionMax", "iscsi.versionmax",
+ FT_UINT8, BASE_HEX, NULL, 0,
+ "Maximum supported protocol version", HFILL }
+ },
+ { &hf_iscsi_VersionMin,
+ { "VersionMin", "iscsi.versionmin",
+ FT_UINT8, BASE_HEX, NULL, 0,
+ "Minimum supported protocol version", HFILL }
+ },
+ { &hf_iscsi_VersionActive,
+ { "VersionActive", "iscsi.versionactive",
+ FT_UINT8, BASE_HEX, NULL, 0,
+ "Negotiated protocol version", HFILL }
+ },
+ { &hf_iscsi_CID,
+ { "CID", "iscsi.cid",
+ FT_UINT16, BASE_HEX, NULL, 0,
+ "Connection identifier", HFILL }
+ },
/* #ifdef DRAFT08 */
- { &hf_iscsi_ISID8,
- { "ISID", "iscsi.isid",
- FT_UINT16, BASE_HEX, NULL, 0,
- "Initiator part of session identifier", HFILL }
- },
+ { &hf_iscsi_ISID8,
+ { "ISID", "iscsi.isid",
+ FT_UINT16, BASE_HEX, NULL, 0,
+ "Initiator part of session identifier", HFILL }
+ },
/* #else */
- { &hf_iscsi_ISID,
- { "ISID", "iscsi.isid",
- FT_BYTES, BASE_NONE, NULL, 0,
- "Initiator part of session identifier", HFILL }
- },
+ { &hf_iscsi_ISID,
+ { "ISID", "iscsi.isid",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ "Initiator part of session identifier", HFILL }
+ },
/* #ifdef DRAFT09 */
- { &hf_iscsi_ISID_Type,
- { "ISID_Type", "iscsi.isid.type",
- FT_UINT8, BASE_HEX, VALS(iscsi_isid_type), 0,
- "Initiator part of session identifier - type", HFILL }
- },
- { &hf_iscsi_ISID_NamingAuthority,
- { "ISID_NamingAuthority", "iscsi.isid.namingauthority",
- FT_UINT24, BASE_HEX, NULL, 0,
- "Initiator part of session identifier - naming authority", HFILL }
- },
- { &hf_iscsi_ISID_Qualifier,
- { "ISID_Qualifier", "iscsi.isid.qualifier",
- FT_UINT8, BASE_HEX, NULL, 0,
- "Initiator part of session identifier - qualifier", HFILL }
- },
+ { &hf_iscsi_ISID_Type,
+ { "ISID_Type", "iscsi.isid.type",
+ FT_UINT8, BASE_HEX, VALS(iscsi_isid_type), 0,
+ "Initiator part of session identifier - type", HFILL }
+ },
+ { &hf_iscsi_ISID_NamingAuthority,
+ { "ISID_NamingAuthority", "iscsi.isid.namingauthority",
+ FT_UINT24, BASE_HEX, NULL, 0,
+ "Initiator part of session identifier - naming authority", HFILL }
+ },
+ { &hf_iscsi_ISID_Qualifier,
+ { "ISID_Qualifier", "iscsi.isid.qualifier",
+ FT_UINT8, BASE_HEX, NULL, 0,
+ "Initiator part of session identifier - qualifier", HFILL }
+ },
/* #else */
- { &hf_iscsi_ISID_t,
- { "ISID_t", "iscsi.isid.t",
- FT_UINT8, BASE_HEX, VALS(iscsi_isid_type), 0xc0,
- "Initiator part of session identifier - t", HFILL }
- },
- { &hf_iscsi_ISID_a,
- { "ISID_a", "iscsi.isid.a",
- FT_UINT8, BASE_HEX, NULL, 0x3f,
- "Initiator part of session identifier - a", HFILL }
- },
- { &hf_iscsi_ISID_b,
- { "ISID_b", "iscsi.isid.b",
- FT_UINT16, BASE_HEX, NULL, 0,
- "Initiator part of session identifier - b", HFILL }
- },
- { &hf_iscsi_ISID_c,
- { "ISID_c", "iscsi.isid.c",
- FT_UINT8, BASE_HEX, NULL, 0,
- "Initiator part of session identifier - c", HFILL }
- },
- { &hf_iscsi_ISID_d,
- { "ISID_d", "iscsi.isid.d",
- FT_UINT16, BASE_HEX, NULL, 0,
- "Initiator part of session identifier - d", HFILL }
- },
+ { &hf_iscsi_ISID_t,
+ { "ISID_t", "iscsi.isid.t",
+ FT_UINT8, BASE_HEX, VALS(iscsi_isid_type), 0xc0,
+ "Initiator part of session identifier - t", HFILL }
+ },
+ { &hf_iscsi_ISID_a,
+ { "ISID_a", "iscsi.isid.a",
+ FT_UINT8, BASE_HEX, NULL, 0x3f,
+ "Initiator part of session identifier - a", HFILL }
+ },
+ { &hf_iscsi_ISID_b,
+ { "ISID_b", "iscsi.isid.b",
+ FT_UINT16, BASE_HEX, NULL, 0,
+ "Initiator part of session identifier - b", HFILL }
+ },
+ { &hf_iscsi_ISID_c,
+ { "ISID_c", "iscsi.isid.c",
+ FT_UINT8, BASE_HEX, NULL, 0,
+ "Initiator part of session identifier - c", HFILL }
+ },
+ { &hf_iscsi_ISID_d,
+ { "ISID_d", "iscsi.isid.d",
+ FT_UINT16, BASE_HEX, NULL, 0,
+ "Initiator part of session identifier - d", HFILL }
+ },
/* #endif */
/* #endif */
- { &hf_iscsi_TSID,
- { "TSID", "iscsi.tsid",
- FT_UINT16, BASE_HEX, NULL, 0,
- "Target part of session identifier", HFILL }
- },
- { &hf_iscsi_TSIH,
- { "TSIH", "iscsi.tsih",
- FT_UINT16, BASE_HEX, NULL, 0,
- "Target session identifying handle", HFILL }
- },
- { &hf_iscsi_Login_T,
- { "T", "iscsi.login.T",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_T), 0x80,
- "Transit to next login stage", HFILL }
- },
- { &hf_iscsi_Login_C,
- { "C", "iscsi.login.C",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_C), 0x40,
- "Text incomplete", HFILL }
- },
+ { &hf_iscsi_TSID,
+ { "TSID", "iscsi.tsid",
+ FT_UINT16, BASE_HEX, NULL, 0,
+ "Target part of session identifier", HFILL }
+ },
+ { &hf_iscsi_TSIH,
+ { "TSIH", "iscsi.tsih",
+ FT_UINT16, BASE_HEX, NULL, 0,
+ "Target session identifying handle", HFILL }
+ },
+ { &hf_iscsi_Login_T,
+ { "T", "iscsi.login.T",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_T), 0x80,
+ "Transit to next login stage", HFILL }
+ },
+ { &hf_iscsi_Login_C,
+ { "C", "iscsi.login.C",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_C), 0x40,
+ "Text incomplete", HFILL }
+ },
/* #ifdef DRAFT09 */
- { &hf_iscsi_Login_X,
- { "X", "iscsi.login.X",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_login_X), 0x40,
- "Restart Connection", HFILL }
- },
+ { &hf_iscsi_Login_X,
+ { "X", "iscsi.login.X",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_login_X), 0x40,
+ "Restart Connection", HFILL }
+ },
/* #endif */
- { &hf_iscsi_Login_CSG,
- { "CSG", "iscsi.login.csg",
- FT_UINT8, BASE_HEX, VALS(iscsi_login_stage), CSG_MASK,
- "Current stage", HFILL }
- },
- { &hf_iscsi_Login_NSG,
- { "NSG", "iscsi.login.nsg",
- FT_UINT8, BASE_HEX, VALS(iscsi_login_stage), NSG_MASK,
- "Next stage", HFILL }
- },
- { &hf_iscsi_Login_Status,
- { "Status", "iscsi.login.status",
- FT_UINT16, BASE_HEX, VALS(iscsi_login_status), 0,
- "Status class and detail", HFILL }
- },
- { &hf_iscsi_KeyValue,
- { "KeyValue", "iscsi.keyvalue",
- FT_STRING, BASE_NONE, NULL, 0,
- "Key/value pair", HFILL }
- },
- { &hf_iscsi_Text_F,
- { "F", "iscsi.text.F",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_F), 0x80,
- "Final PDU in text sequence", HFILL }
- },
- { &hf_iscsi_Text_C,
- { "C", "iscsi.text.C",
- FT_BOOLEAN, 8, TFS(&iscsi_meaning_C), 0x40,
- "Text incomplete", HFILL }
- },
- { &hf_iscsi_ExpDataSN,
- { "ExpDataSN", "iscsi.expdatasn",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Next expected data sequence number", HFILL }
- },
- { &hf_iscsi_R2TSN,
- { "R2TSN", "iscsi.r2tsn",
- FT_UINT32, BASE_HEX, NULL, 0,
- "R2T PDU Number", HFILL }
- },
- { &hf_iscsi_TaskManagementFunction_Response,
- { "Response", "iscsi.taskmanfun.response",
- FT_UINT8, BASE_HEX, VALS(iscsi_task_management_responses), 0,
- NULL, HFILL }
- },
- { &hf_iscsi_TaskManagementFunction_ReferencedTaskTag,
- { "ReferencedTaskTag", "iscsi.taskmanfun.referencedtasktag",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Referenced task tag", HFILL }
- },
- { &hf_iscsi_RefCmdSN,
- { "RefCmdSN", "iscsi.refcmdsn",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Command sequence number for command to be aborted", HFILL }
- },
- { &hf_iscsi_TaskManagementFunction_Function,
- { "Function", "iscsi.taskmanfun.function",
- FT_UINT8, BASE_HEX, VALS(iscsi_task_management_functions), 0x7F,
- "Requested task function", HFILL }
- },
- { &hf_iscsi_Logout_Reason,
- { "Reason", "iscsi.logout.reason",
- FT_UINT8, BASE_HEX, VALS(iscsi_logout_reasons), 0x7F,
- "Reason for logout", HFILL }
- },
- { &hf_iscsi_Logout_Response,
- { "Response", "iscsi.logout.response",
- FT_UINT8, BASE_HEX, VALS(iscsi_logout_response), 0,
- "Logout response", HFILL }
- },
- { &hf_iscsi_Time2Wait,
- { "Time2Wait", "iscsi.time2wait",
- FT_UINT16, BASE_HEX, NULL, 0,
- NULL, HFILL }
- },
- { &hf_iscsi_Time2Retain,
- { "Time2Retain", "iscsi.time2retain",
- FT_UINT16, BASE_HEX, NULL, 0,
- NULL, HFILL }
- },
- { &hf_iscsi_DesiredDataLength,
- { "DesiredDataLength", "iscsi.desireddatalength",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Desired data length (bytes)", HFILL }
- },
- { &hf_iscsi_AsyncEvent,
- { "AsyncEvent", "iscsi.asyncevent",
- FT_UINT8, BASE_HEX, VALS(iscsi_asyncevents), 0,
- "Async event type", HFILL }
- },
- { &hf_iscsi_EventVendorCode,
- { "EventVendorCode", "iscsi.eventvendorcode",
- FT_UINT8, BASE_HEX, NULL, 0,
- "Event vendor code", HFILL }
- },
- { &hf_iscsi_Parameter1,
- { "Parameter1", "iscsi.parameter1",
- FT_UINT16, BASE_HEX, NULL, 0,
- "Parameter 1", HFILL }
- },
- { &hf_iscsi_Parameter2,
- { "Parameter2", "iscsi.parameter2",
- FT_UINT16, BASE_HEX, NULL, 0,
- "Parameter 2", HFILL }
- },
- { &hf_iscsi_Parameter3,
- { "Parameter3", "iscsi.parameter3",
- FT_UINT16, BASE_HEX, NULL, 0,
- "Parameter 3", HFILL }
- },
- { &hf_iscsi_Reject_Reason,
- { "Reason", "iscsi.reject.reason",
- FT_UINT8, BASE_HEX, VALS(iscsi_reject_reasons), 0,
- "Reason for command rejection", HFILL }
- },
- { &hf_iscsi_snack_type,
- { "S", "iscsi.snack.type",
- FT_UINT8, BASE_DEC, VALS(iscsi_snack_types), 0x0f,
- "Type of SNACK requested", HFILL }
- },
- { &hf_iscsi_BegRun,
- { "BegRun", "iscsi.snack.begrun",
- FT_UINT32, BASE_HEX, NULL, 0,
- "First missed DataSN or StatSN", HFILL }
- },
- { &hf_iscsi_RunLength,
- { "RunLength", "iscsi.snack.runlength",
- FT_UINT32, BASE_HEX, NULL, 0,
- "Number of additional missing status PDUs in this run", HFILL }
- },
+ { &hf_iscsi_Login_CSG,
+ { "CSG", "iscsi.login.csg",
+ FT_UINT8, BASE_HEX, VALS(iscsi_login_stage), CSG_MASK,
+ "Current stage", HFILL }
+ },
+ { &hf_iscsi_Login_NSG,
+ { "NSG", "iscsi.login.nsg",
+ FT_UINT8, BASE_HEX, VALS(iscsi_login_stage), NSG_MASK,
+ "Next stage", HFILL }
+ },
+ { &hf_iscsi_Login_Status,
+ { "Status", "iscsi.login.status",
+ FT_UINT16, BASE_HEX, VALS(iscsi_login_status), 0,
+ "Status class and detail", HFILL }
+ },
+ { &hf_iscsi_KeyValue,
+ { "KeyValue", "iscsi.keyvalue",
+ FT_STRING, BASE_NONE, NULL, 0,
+ "Key/value pair", HFILL }
+ },
+ { &hf_iscsi_Text_F,
+ { "F", "iscsi.text.F",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_F), 0x80,
+ "Final PDU in text sequence", HFILL }
+ },
+ { &hf_iscsi_Text_C,
+ { "C", "iscsi.text.C",
+ FT_BOOLEAN, 8, TFS(&iscsi_meaning_C), 0x40,
+ "Text incomplete", HFILL }
+ },
+ { &hf_iscsi_ExpDataSN,
+ { "ExpDataSN", "iscsi.expdatasn",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Next expected data sequence number", HFILL }
+ },
+ { &hf_iscsi_R2TSN,
+ { "R2TSN", "iscsi.r2tsn",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "R2T PDU Number", HFILL }
+ },
+ { &hf_iscsi_TaskManagementFunction_Response,
+ { "Response", "iscsi.taskmanfun.response",
+ FT_UINT8, BASE_HEX, VALS(iscsi_task_management_responses), 0,
+ NULL, HFILL }
+ },
+ { &hf_iscsi_TaskManagementFunction_ReferencedTaskTag,
+ { "ReferencedTaskTag", "iscsi.taskmanfun.referencedtasktag",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Referenced task tag", HFILL }
+ },
+ { &hf_iscsi_RefCmdSN,
+ { "RefCmdSN", "iscsi.refcmdsn",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Command sequence number for command to be aborted", HFILL }
+ },
+ { &hf_iscsi_TaskManagementFunction_Function,
+ { "Function", "iscsi.taskmanfun.function",
+ FT_UINT8, BASE_HEX, VALS(iscsi_task_management_functions), 0x7F,
+ "Requested task function", HFILL }
+ },
+ { &hf_iscsi_Logout_Reason,
+ { "Reason", "iscsi.logout.reason",
+ FT_UINT8, BASE_HEX, VALS(iscsi_logout_reasons), 0x7F,
+ "Reason for logout", HFILL }
+ },
+ { &hf_iscsi_Logout_Response,
+ { "Response", "iscsi.logout.response",
+ FT_UINT8, BASE_HEX, VALS(iscsi_logout_response), 0,
+ "Logout response", HFILL }
+ },
+ { &hf_iscsi_Time2Wait,
+ { "Time2Wait", "iscsi.time2wait",
+ FT_UINT16, BASE_HEX, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_iscsi_Time2Retain,
+ { "Time2Retain", "iscsi.time2retain",
+ FT_UINT16, BASE_HEX, NULL, 0,
+ NULL, HFILL }
+ },
+ { &hf_iscsi_DesiredDataLength,
+ { "DesiredDataLength", "iscsi.desireddatalength",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Desired data length (bytes)", HFILL }
+ },
+ { &hf_iscsi_AsyncEvent,
+ { "AsyncEvent", "iscsi.asyncevent",
+ FT_UINT8, BASE_HEX, VALS(iscsi_asyncevents), 0,
+ "Async event type", HFILL }
+ },
+ { &hf_iscsi_EventVendorCode,
+ { "EventVendorCode", "iscsi.eventvendorcode",
+ FT_UINT8, BASE_HEX, NULL, 0,
+ "Event vendor code", HFILL }
+ },
+ { &hf_iscsi_Parameter1,
+ { "Parameter1", "iscsi.parameter1",
+ FT_UINT16, BASE_HEX, NULL, 0,
+ "Parameter 1", HFILL }
+ },
+ { &hf_iscsi_Parameter2,
+ { "Parameter2", "iscsi.parameter2",
+ FT_UINT16, BASE_HEX, NULL, 0,
+ "Parameter 2", HFILL }
+ },
+ { &hf_iscsi_Parameter3,
+ { "Parameter3", "iscsi.parameter3",
+ FT_UINT16, BASE_HEX, NULL, 0,
+ "Parameter 3", HFILL }
+ },
+ { &hf_iscsi_Reject_Reason,
+ { "Reason", "iscsi.reject.reason",
+ FT_UINT8, BASE_HEX, VALS(iscsi_reject_reasons), 0,
+ "Reason for command rejection", HFILL }
+ },
+ { &hf_iscsi_snack_type,
+ { "S", "iscsi.snack.type",
+ FT_UINT8, BASE_DEC, VALS(iscsi_snack_types), 0x0f,
+ "Type of SNACK requested", HFILL }
+ },
+ { &hf_iscsi_BegRun,
+ { "BegRun", "iscsi.snack.begrun",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "First missed DataSN or StatSN", HFILL }
+ },
+ { &hf_iscsi_RunLength,
+ { "RunLength", "iscsi.snack.runlength",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ "Number of additional missing status PDUs in this run", HFILL }
+ },
};
/* Setup protocol subtree array */
static gint *ett[] = {
- &ett_iscsi,
- &ett_iscsi_KeyValues,
- &ett_iscsi_CDB,
- &ett_iscsi_Flags,
- &ett_iscsi_RejectHeader,
+ &ett_iscsi,
+ &ett_iscsi_KeyValues,
+ &ett_iscsi_CDB,
+ &ett_iscsi_Flags,
+ &ett_iscsi_RejectHeader,
/* #ifndef DRAFT08 */
- &ett_iscsi_ISID,
+ &ett_iscsi_ISID,
/* #endif */
};
@@ -3015,85 +3013,85 @@ proto_register_iscsi(void)
iscsi_module = prefs_register_protocol(proto_iscsi, NULL);
prefs_register_enum_preference(iscsi_module,
- "protocol_version",
- "Protocol version",
- "The iSCSI protocol version",
- &iscsi_protocol_version,
- iscsi_protocol_versions,
- FALSE);
+ "protocol_version",
+ "Protocol version",
+ "The iSCSI protocol version",
+ &iscsi_protocol_version,
+ iscsi_protocol_versions,
+ FALSE);
prefs_register_bool_preference(iscsi_module,
- "desegment_iscsi_messages",
- "Reassemble iSCSI messages\nspanning multiple TCP segments",
- "Whether the iSCSI dissector should reassemble messages spanning multiple TCP segments."
- " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
- &iscsi_desegment);
+ "desegment_iscsi_messages",
+ "Reassemble iSCSI messages\nspanning multiple TCP segments",
+ "Whether the iSCSI dissector should reassemble messages spanning multiple TCP segments."
+ " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
+ &iscsi_desegment);
prefs_register_bool_preference(iscsi_module,
- "bogus_pdu_filter",
- "Enable bogus pdu filter",
- "When enabled, packets that appear bogus are ignored",
- &enable_bogosity_filter);
+ "bogus_pdu_filter",
+ "Enable bogus pdu filter",
+ "When enabled, packets that appear bogus are ignored",
+ &enable_bogosity_filter);
prefs_register_bool_preference(iscsi_module,
- "demand_good_f_bit",
- "Ignore packets with bad F bit",
- "Ignore packets that haven't set the F bit when they should have",
- &demand_good_f_bit);
+ "demand_good_f_bit",
+ "Ignore packets with bad F bit",
+ "Ignore packets that haven't set the F bit when they should have",
+ &demand_good_f_bit);
prefs_register_uint_preference(iscsi_module,
- "bogus_pdu_max_data_len",
- "Bogus pdu max data length threshold",
- "Treat packets whose data segment length is greater than this value as bogus",
- 10,
- &bogus_pdu_data_length_threshold);
+ "bogus_pdu_max_data_len",
+ "Bogus pdu max data length threshold",
+ "Treat packets whose data segment length is greater than this value as bogus",
+ 10,
+ &bogus_pdu_data_length_threshold);
range_convert_str(&global_iscsi_port_range, TCP_PORT_ISCSI_RANGE, MAX_TCP_PORT);
prefs_register_range_preference(iscsi_module,
- "target_ports",
- "Target Ports Range",
- "Range of iSCSI target ports"
- "(default " TCP_PORT_ISCSI_RANGE ")",
- &global_iscsi_port_range, MAX_TCP_PORT);
+ "target_ports",
+ "Target Ports Range",
+ "Range of iSCSI target ports"
+ "(default " TCP_PORT_ISCSI_RANGE ")",
+ &global_iscsi_port_range, MAX_TCP_PORT);
prefs_register_uint_preference(iscsi_module,
- "target_system_port",
- "Target system port",
- "System port number of iSCSI target",
- 10,
- &iscsi_system_port);
+ "target_system_port",
+ "Target system port",
+ "System port number of iSCSI target",
+ 10,
+ &iscsi_system_port);
prefs_register_bool_preference(iscsi_module,
- "enable_data_digests",
- "Enable data digests",
- "When enabled, pdus are assumed to contain a data digest",
- &enableDataDigests);
+ "enable_data_digests",
+ "Enable data digests",
+ "When enabled, pdus are assumed to contain a data digest",
+ &enableDataDigests);
prefs_register_bool_preference(iscsi_module,
- "data_digest_is_crc32c",
- "Data digest is CRC32C",
- "When enabled, data digests are assumed to be CRC32C",
- &dataDigestIsCRC32);
+ "data_digest_is_crc32c",
+ "Data digest is CRC32C",
+ "When enabled, data digests are assumed to be CRC32C",
+ &dataDigestIsCRC32);
prefs_register_uint_preference(iscsi_module,
- "data_digest_size",
- "Data digest size",
- "The size of a data digest (bytes)",
- 10,
- &dataDigestSize);
+ "data_digest_size",
+ "Data digest size",
+ "The size of a data digest (bytes)",
+ 10,
+ &dataDigestSize);
/* Preference supported in older versions.
Register them as obsolete. */
prefs_register_obsolete_preference(iscsi_module,
- "version_03_compatible");
+ "version_03_compatible");
prefs_register_obsolete_preference(iscsi_module,
- "bogus_pdu_max_digest_padding");
+ "bogus_pdu_max_digest_padding");
prefs_register_obsolete_preference(iscsi_module,
- "header_digest_is_crc32c");
+ "header_digest_is_crc32c");
prefs_register_obsolete_preference(iscsi_module,
- "header_digest_size");
+ "header_digest_size");
prefs_register_obsolete_preference(iscsi_module,
- "enable_header_digests");
+ "enable_header_digests");
}
diff --git a/epan/dissectors/packet-vxlan.c b/epan/dissectors/packet-vxlan.c
index 23775fb7ba..849da3a0ee 100644
--- a/epan/dissectors/packet-vxlan.c
+++ b/epan/dissectors/packet-vxlan.c
@@ -60,18 +60,18 @@ static dissector_handle_t eth_handle;
static void
dissect_vxlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- proto_tree *vxlan_tree, *flg_tree;
- proto_item *ti, *flg_item;
- tvbuff_t *next_tvb;
- int offset = 0;
+ proto_tree *vxlan_tree, *flg_tree;
+ proto_item *ti, *flg_item;
+ tvbuff_t *next_tvb;
+ int offset = 0;
- /* Make entry in Protocol column on summary display */
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "VxLAN");
+ /* Make entry in Protocol column on summary display */
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "VxLAN");
- col_clear(pinfo->cinfo, COL_INFO);
+ col_clear(pinfo->cinfo, COL_INFO);
- ti = proto_tree_add_item(tree, proto_vxlan, tvb, offset, -1, ENC_NA);
- vxlan_tree = proto_item_add_subtree(ti, ett_vxlan);
+ ti = proto_tree_add_item(tree, proto_vxlan, tvb, offset, -1, ENC_NA);
+ vxlan_tree = proto_item_add_subtree(ti, ett_vxlan);
/*
0 1 2 3
@@ -83,36 +83,36 @@ dissect_vxlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
| VXLAN Network Identifier (VNI) | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- /* Flags (8 bits) where the I flag MUST be set to 1 for a valid
+ /* Flags (8 bits) where the I flag MUST be set to 1 for a valid
* VXLAN Network ID (VNI). The remaining 7 bits (designated "R") are
* reserved fields and MUST be set to zero.
- */
- flg_item = proto_tree_add_item(vxlan_tree, hf_vxlan_flags, tvb, offset, 1, ENC_BIG_ENDIAN);
- flg_tree = proto_item_add_subtree(ti, ett_vxlan_flgs);
+ */
+ flg_item = proto_tree_add_item(vxlan_tree, hf_vxlan_flags, tvb, offset, 1, ENC_BIG_ENDIAN);
+ flg_tree = proto_item_add_subtree(flg_item, ett_vxlan_flgs);
- proto_tree_add_item(flg_tree, hf_vxlan_flag_b7, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(flg_tree, hf_vxlan_flag_b6, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(flg_tree, hf_vxlan_flag_b5, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(flg_tree, hf_vxlan_flag_b4, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flg_tree, hf_vxlan_flag_b7, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flg_tree, hf_vxlan_flag_b6, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flg_tree, hf_vxlan_flag_b5, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flg_tree, hf_vxlan_flag_b4, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(flg_tree, hf_vxlan_flag_i, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(flg_tree, hf_vxlan_flag_b2, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(flg_tree, hf_vxlan_flag_b1, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(flg_tree, hf_vxlan_flag_b0, tvb, offset, 1, ENC_BIG_ENDIAN);
- offset++;
+ proto_tree_add_item(flg_tree, hf_vxlan_flag_i, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flg_tree, hf_vxlan_flag_b2, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flg_tree, hf_vxlan_flag_b1, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(flg_tree, hf_vxlan_flag_b0, tvb, offset, 1, ENC_BIG_ENDIAN);
+ offset++;
- proto_tree_add_item(vxlan_tree, hf_vxlan_reserved_24, tvb, offset, 3, ENC_BIG_ENDIAN);
- offset+=3;
+ proto_tree_add_item(vxlan_tree, hf_vxlan_reserved_24, tvb, offset, 3, ENC_BIG_ENDIAN);
+ offset+=3;
- proto_tree_add_item(vxlan_tree, hf_vxlan_vni, tvb, offset, 3, ENC_BIG_ENDIAN);
- offset+=3;
+ proto_tree_add_item(vxlan_tree, hf_vxlan_vni, tvb, offset, 3, ENC_BIG_ENDIAN);
+ offset+=3;
-
- proto_tree_add_item(vxlan_tree, hf_vxlan_reserved_8, tvb, offset, 1, ENC_BIG_ENDIAN);
- offset++;
- next_tvb = tvb_new_subset_remaining(tvb, offset);
- call_dissector(eth_handle, next_tvb, pinfo, tree);
+ proto_tree_add_item(vxlan_tree, hf_vxlan_reserved_8, tvb, offset, 1, ENC_BIG_ENDIAN);
+ offset++;
+
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
+ call_dissector(eth_handle, next_tvb, pinfo, tree);
}
@@ -121,94 +121,94 @@ dissect_vxlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
void
proto_register_vxlan(void)
{
- static hf_register_info hf[] = {
- { &hf_vxlan_flags,
- { "Flags", "vxlan.flags",
- FT_UINT8, BASE_HEX, NULL, 0x00,
- NULL, HFILL
- },
- },
- { &hf_vxlan_flag_b7,
- { "Reserved(R)", "vxlan.flag_b7",
+ static hf_register_info hf[] = {
+ { &hf_vxlan_flags,
+ { "Flags", "vxlan.flags",
+ FT_UINT8, BASE_HEX, NULL, 0x00,
+ NULL, HFILL
+ },
+ },
+ { &hf_vxlan_flag_b7,
+ { "Reserved(R)", "vxlan.flag_b7",
FT_BOOLEAN, 8, NULL, 0x80,
- NULL, HFILL,
- },
- },
- { &hf_vxlan_flag_b6,
- { "Reserved(R)", "vxlan.flag_b6",
+ NULL, HFILL,
+ },
+ },
+ { &hf_vxlan_flag_b6,
+ { "Reserved(R)", "vxlan.flag_b6",
FT_BOOLEAN, 8, NULL, 0x40,
- NULL, HFILL,
- },
- },
- { &hf_vxlan_flag_b5,
- { "Reserved(R)", "vxlan.flag_b5",
+ NULL, HFILL,
+ },
+ },
+ { &hf_vxlan_flag_b5,
+ { "Reserved(R)", "vxlan.flag_b5",
FT_BOOLEAN, 8, NULL, 0x20,
- NULL, HFILL,
- },
- },
- { &hf_vxlan_flag_b4,
- { "Reserved(R)", "vxlan.flag_b4",
+ NULL, HFILL,
+ },
+ },
+ { &hf_vxlan_flag_b4,
+ { "Reserved(R)", "vxlan.flag_b4",
FT_BOOLEAN, 8, NULL, 0x10,
- NULL, HFILL,
- },
- },
- { &hf_vxlan_flag_i,
- { "VXLAN Network ID(VNI)", "vxlan.flag_i",
+ NULL, HFILL,
+ },
+ },
+ { &hf_vxlan_flag_i,
+ { "VXLAN Network ID(VNI)", "vxlan.flag_i",
FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
- NULL, HFILL,
- },
- },
- { &hf_vxlan_flag_b2,
- { "Reserved(R)", "vxlan.flag_b2",
+ NULL, HFILL,
+ },
+ },
+ { &hf_vxlan_flag_b2,
+ { "Reserved(R)", "vxlan.flag_b2",
FT_BOOLEAN, 8, NULL, 0x10,
- NULL, HFILL,
- },
- },
- { &hf_vxlan_flag_b1,
- { "Reserved(R)", "vxlan.flag_b1",
+ NULL, HFILL,
+ },
+ },
+ { &hf_vxlan_flag_b1,
+ { "Reserved(R)", "vxlan.flag_b1",
FT_BOOLEAN, 8, NULL, 0x10,
- NULL, HFILL,
- },
- },
- { &hf_vxlan_flag_b0,
- { "Reserved(R)", "vxlan.flag_b0",
+ NULL, HFILL,
+ },
+ },
+ { &hf_vxlan_flag_b0,
+ { "Reserved(R)", "vxlan.flag_b0",
FT_BOOLEAN, 8, NULL, 0x10,
- NULL, HFILL,
- },
- },
- { &hf_vxlan_reserved_24,
- { "Reserved", "vxlan.reserved24",
- FT_UINT24, BASE_HEX, NULL, 0x00,
- NULL, HFILL
- },
- },
- { &hf_vxlan_vni,
- { "VXLAN Network Identifier (VNI)", "vxlan.vni",
- FT_UINT24, BASE_DEC, NULL, 0x00,
- NULL, HFILL
- },
- },
- { &hf_vxlan_reserved_8,
- { "Reserved", "vxlan.reserved8",
- FT_UINT8, BASE_DEC, NULL, 0x00,
- NULL, HFILL
- },
- },
- };
-
- /* Setup protocol subtree array */
- static gint *ett[] = {
- &ett_vxlan,
- &ett_vxlan_flgs,
- };
-
- /* Register the protocol name and description */
- proto_vxlan = proto_register_protocol("Virtual eXtensible Local Area Network",
- "VXLAN", "vxlan");
-
- /* Required function calls to register the header fields and subtrees used */
- proto_register_field_array(proto_vxlan, hf, array_length(hf));
- proto_register_subtree_array(ett, array_length(ett));
+ NULL, HFILL,
+ },
+ },
+ { &hf_vxlan_reserved_24,
+ { "Reserved", "vxlan.reserved24",
+ FT_UINT24, BASE_HEX, NULL, 0x00,
+ NULL, HFILL
+ },
+ },
+ { &hf_vxlan_vni,
+ { "VXLAN Network Identifier (VNI)", "vxlan.vni",
+ FT_UINT24, BASE_DEC, NULL, 0x00,
+ NULL, HFILL
+ },
+ },
+ { &hf_vxlan_reserved_8,
+ { "Reserved", "vxlan.reserved8",
+ FT_UINT8, BASE_DEC, NULL, 0x00,
+ NULL, HFILL
+ },
+ },
+ };
+
+ /* Setup protocol subtree array */
+ static gint *ett[] = {
+ &ett_vxlan,
+ &ett_vxlan_flgs,
+ };
+
+ /* Register the protocol name and description */
+ proto_vxlan = proto_register_protocol("Virtual eXtensible Local Area Network",
+ "VXLAN", "vxlan");
+
+ /* Required function calls to register the header fields and subtrees used */
+ proto_register_field_array(proto_vxlan, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}
@@ -218,7 +218,7 @@ proto_reg_handoff_vxlan(void)
{
dissector_handle_t vxlan_handle;
- eth_handle = find_dissector("eth");
+ eth_handle = find_dissector("eth");
vxlan_handle = create_dissector_handle(dissect_vxlan, proto_vxlan);
dissector_add_handle("udp.port", vxlan_handle); /* For 'Decode As' */