aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-scsi.h
AgeCommit message (Collapse)AuthorFilesLines
2018-04-20Handle subset tvbuffs where the length goes past the end of the parent.Guy Harris1-26/+18
Add a "contained length" to tvbuffs. For non-subset tvbuffs, that's the same as the reported length. For a subset tvbuff, that's the amount of the reported data that was actually present in the "contained data" of the parent tvbuff. This is unaffected by the *captured* length of any tvbuff; that differs from the contained length only if the capture was cut short by a snapshot length. If a reference is within the reported data, but not within the contained data, a ContainedBoundsError exception is thrown. This exception represents a protocol error, rather than a reference past the captured data in the packet; we treat it as such. Change-Id: Ide87f81238eaeb89b3093f54a87bf7f715485af5 Reviewed-on: https://code.wireshark.org/review/27039 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-20More indentation cleanups.Guy Harris1-1/+1
Change-Id: I7f87d4a636a539dfa8bd04cc5a91675d92ba4097 Reviewed-on: https://code.wireshark.org/review/27038 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-20Clean up indentation.Guy Harris1-4/+4
Change-Id: I0a05245b5cd19a0ea9929a4e29f82bfe5e526793 Reviewed-on: https://code.wireshark.org/review/27037 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-12dissectors: use SPDX identifiers.Dario Lombardo1-13/+1
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a Reviewed-on: https://code.wireshark.org/review/25756 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-24Add Service Response Time dialog for SCSI.Michael Mann1-0/+11
SCSI requires parameter data to be passed into the tap. Provide a new dialog that can handle SCSI commands. Bug: 14144 Change-Id: I4561f251ec38753a28befee33b8b994b04b92230 Reviewed-on: https://code.wireshark.org/review/24955 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-05-02scsi: fix conflicting entry in its value_stringAlexis La Goutte1-1/+0
Field 'SPC-2 Opcode' (scsi.spc.opcode) has a conflicting entry in its value_string: 132 is at indices 26 (Receive Copy) and 27 (Receive Copy Results)) Change-Id: I5916bab1bb493226003e86b5a6b693fd4a727499 Reviewed-on: https://code.wireshark.org/review/21458 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-10Rename tvb_new_subset() to tvb_new_subset_length_caplen().Guy Harris1-1/+1
This emphasizes that there is no such thing as *the* routine to construct a subset tvbuff; you need to choose one of tvb_new_subset_remaining() (if you want a new tvbuff that contains everything past a certain point in an existing tvbuff), tvb_new_subset_length() (if you want a subset that contains everything past a certain point, for some number of bytes, in an existing tvbuff), and tvb_new_subset_length_caplen() (for all other cases). Many of the calls to tvb_new_subset_length_caplen() should really be calling one of the other routines; that's the next step. (This also makes it easier to find the calls that need fixing.) Change-Id: Ieb3d676d8cda535451c119487d7cd3b559221f2b Reviewed-on: https://code.wireshark.org/review/19597 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-26Fix variable that needs to survive a longjmp().Guy Harris1-1/+1
Pointed out by a warning in a compilation for ARM. Change-Id: Iab2748adbdc88c9e6749da1c3835896683a1a091 Reviewed-on: https://code.wireshark.org/review/8648 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-16Fix spelling: cant-->can't, wont-->won't, etcBill Meier1-2/+2
Change-Id: I4497f1b8b6eab0e576d9dd31b732965f9a6679c6 Reviewed-on: https://code.wireshark.org/review/4124 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-06-17Add support for WRITE_LONG16 & REPORT_REFERRALS to scsi dissectorAnish Bhatt1-1/+3
Picking up leftover work on https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8843 Change-Id: Ie3df55ae3309cf68f64b2aa184fb2904d1200cb5 Signed-off-by: Anish Bhatt <anish@chelsio.com> Reviewed-on: https://code.wireshark.org/review/2239 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-17Fix "might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]" warning ↵Bill Meier1-14/+31
from gcc 4.9 Rework code related to TRY_SCSI_CDB_ALLOC_LEN macro to simplify and clarify same. Rename some vars to catch any incorrect usage. Change-Id: Ibf9465c5ce7670aa1147e0c311c37e582ece427a Reviewed-on: https://code.wireshark.org/review/1177 Reviewed-by: Bill Meier <wmeier@newsguy.com> Tested-by: Bill Meier <wmeier@newsguy.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2013-12-23From Yaniv Kaul via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9551Alexis La Goutte1-0/+3
Dissect SCSI XCOPY and RECEIVE COPY Parameters commands From me : Fix encoding-args Fix trailing whitespace svn path=/trunk/; revision=54381
2013-12-12Create/use a number of extended value-strings;Bill Meier1-4/+0
Remove or comment out dups from several value-string arrays; Sort a number of value-string arrays; Reformat many hf[] entries; Remove some unneeded initializers; Add editor-modelines; Use consistent indentation; Reformat whitespace. svn path=/trunk/; revision=53968
2013-11-10Add missing includes in order to remove exceptions.h from proto.h (next commit).Jakub Zawadzki1-0/+2
svn path=/trunk/; revision=53230
2013-10-13whitespace fixes; mostly: remove trailing blanksBill Meier1-5/+5
svn path=/trunk/; revision=52591
2013-05-18SCSI: Add dissection of REPORT SUPPORTED OPCODESRonnie Sahlberg1-1/+6
svn path=/trunk/; revision=49408
2013-03-01Export libwireshark symbols using WS_DLL_PUBLIC defineBalint Reczey1-1/+2
Also remove old WS_VAR_IMPORT define and related Makefile magic everywhere in the project. svn path=/trunk/; revision=47992
2013-02-27Move show_exception() and show_reported_bounds_error() toGuy Harris1-3/+0
epan/show_exception.c, as it's used outside epan/dissectors/packet-frame.c. Update their callers to include <epan/show_exception.h> to get their declaration. Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if there's more stuff in the packet to dissect after the dissector call that threw the exception, doesn't mean you shouldn't go ahead and dissect that stuff. Use it in all those cases, including ones where BoundsError was inappropriately being caught (you want those passed up to the top level, so that the packet is reported as having been cut short in the capture process). Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that correspond to running past the end of the data for a tvbuff; use it rather than explicitly catching those exceptions individually, and rather than just catching all exceptions (the only place that DissectorError should be caught, for example, is at the top level, so dissector bugs show up in the protocol tree). Don't catch and then immediately rethrow exceptions without doing anything else; just let the exceptions go up to the final catcher. Use show_exception() to report non-fatal errors, rather than doing it yourself. If a dissector is called from Lua, catch all non-fatal errors and use show_exception() to report them rather than catching only ReportedBoundsError and adding a proto_malformed item. Don't catch exceptions when constructing a trailer tvbuff in packet-ieee8023.c - just construct it after the payload has been dissected, and let whatever exceptions that throws be handled at the top level. Avoid some TRY/CATCH/ENDTRY cases by using checks such as tvb_bytes_exist() before even looking in the tvbuff. svn path=/trunk/; revision=47924
2012-07-27SCSI/ISCSI: Add decode of LUNs with address mode/bus and lunRonnie Sahlberg1-0/+2
Dont implement the complex "extended logical unit addressing format" just yet. That one is hairy so wait until we actually see it in the wild first. Add decoding of LUNs using single level lun structure and flat addressing space modes svn path=/trunk/; revision=44058
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-05-29SCSI SBC: Add dissection of GET_LBA_STATUS commandRonnie Sahlberg1-0/+1
svn path=/trunk/; revision=42897
2010-12-06Improve dissection of bit-oriented fields. Patch from Richard Sharpe viaChris Maynard1-0/+2
bug #5466 with some minor whitespace modifications from me and a fix of an invalid offset introduced with the patch. Fuzz testing still needs to be done. I can't seem to get the fuzz tester to work with the capture files attached to the bug report. svn path=/trunk/; revision=35137
2010-10-29Use value_string_ext to access several "relatively large" value-strings.Bill Meier1-4/+5
svn path=/trunk/; revision=34689
2010-07-21From Zachary Mark:Jaap Keuter1-2/+2
It appears that SCSI_SPC_ACCESS_CONTROL_IN is incorrectly set to opcode 0x85 where the actual opcode is 0x86. 0x85 is the opcode for the 16-byte version of the ATA PASSTHROUGH command of the SAT standards family. svn path=/trunk/; revision=33611
2008-11-22From Peter (bug 2942):Stig Bjørlykke1-1/+1
Allow optimalization with -ftracer. svn path=/trunk/; revision=26822
2007-04-13another attempt to let windows buildbot becoming greenSebastien Tandel1-4/+4
fix rev21398 (gcc warning fix) svn path=/trunk/; revision=21412
2007-04-13use of volatile for every functions and not only the ones using the ExceptionSebastien Tandel1-2/+2
mechanisms. (fix rev21398) Windows buildbot sould be green again as formal parameters are the same as the ones in the declaration now. svn path=/trunk/; revision=21409
2007-04-13Change the prototypes of dissect_spc_inquiry() and dissect_spc_reportluns()Jeff Morriss1-2/+2
as per the change in rev 21398 to get Windows builds working again. svn path=/trunk/; revision=21403
2007-02-11remove the revision number from the spc symbolsRonnie Sahlberg1-49/+51
change all spc2 and spc3 to spc svn path=/trunk/; revision=20779
2006-11-27break the SCSI SBC commandset out into its own dissectorRonnie Sahlberg1-6/+0
svn path=/trunk/; revision=20000
2006-11-23break the SCSI SMC commandset out into its own dissectorRonnie Sahlberg1-17/+5
svn path=/trunk/; revision=19964
2006-11-22fix Win32 build: scsi_ssc2_vals -> scsi_ssc_valsUlf Lamping1-1/+0
svn path=/trunk/; revision=19958
2006-11-22break the SCSI SSC commandset out into its own dissectorRonnie Sahlberg1-1/+31
svn path=/trunk/; revision=19957
2006-10-30start splitting the monolitic scsi dissector up into commandset dissectorsRonnie Sahlberg1-0/+92
split the MMC commandset out of the main scsi dissector svn path=/trunk/; revision=19738
2006-10-13pass the relative data offset of data in/out pdu's to the scsi data in/out ↵Ronnie Sahlberg1-1/+2
dissector (dissect_scsi_payload) so that we can later add reassembly of data pdu's and also (if reassembly is disabled) only dissect the initial (offset==0) data pdu. dissect_scsi_payload() does not yet use this parameter. now that we have both data offset and expected data length/bidir expected data length and also the read/write flags availabe we have what we need to reassemble data in/out pdus (modulo overflow/underflow but those are so rare we can worry about them later). ndmp: ndmp conceptually always has a data in and a data out phase and never fragment the data into smaller pdu's os that dissector always report offset as 0. svn path=/trunk/; revision=19511
2006-10-12wireshark does not yet consume enough memory for me to be happyRonnie Sahlberg1-0/+1
pass conversation form the transports up to the scsi layer add tracking of conversation specific info to scsi osd add tracking of conversation+lun specific info to scsi osd for scsi osd add tracking of PARTITIONS and display in which frame they were created/removed svn path=/trunk/; revision=19505
2006-10-11add a task_flags bitmap and two lengths (data and bidirectional data)Ronnie Sahlberg1-0/+22
so that the two scsi transports FCP and ISCSI can provide the expected data transfer lengths to SCSI to allow SCSI reassembly. NDMP does not really need these hints since for NDMP (and also iscsi-lite) there is conceptually always both data in and data out phases and there is never any fragmentation. svn path=/trunk/; revision=19493
2006-10-11move the ITL and the ITLQ structure to packet-scsi.h where it belongsRonnie Sahlberg1-0/+46
svn path=/trunk/; revision=19492
2006-09-29add initial scsi osd dissector but only dissect sdbs that are impoerted ↵Ronnie Sahlberg1-0/+22
from SPC various changes to the existing scsi dissector to start allowing different commandsets to be implemented in their own dissector files to prevent the scsi dissector to become as huge as the parlay dissector svn path=/trunk/; revision=19360
2006-09-29move the defines for SPC command opcode values to the headerfileRonnie Sahlberg1-0/+33
svn path=/trunk/; revision=19359
2006-06-20Change ETH_VAR_IMPORT to WS_VAR_IMPORT. Try to fix a duplicate variableGerald Combs1-3/+3
definition in the Catapult DCT2000 code. svn path=/trunk/; revision=18524
2006-05-21change a whole bunch of ethereal into wiresharkRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18196
2006-04-25rename some value_Strings from ..._val to ..._valsRonnie Sahlberg1-3/+3
svn path=/trunk/; revision=17991
2006-04-25fix win32 build:Ulf Lamping1-3/+3
scsi_mmc_val DATA scsi_sbc2_val DATA scsi_ssc2_val DATA BTW: these values should be renamed to ..._vals as in every other dissector I know! svn path=/trunk/; revision=17989
2006-04-24SCSI Service Response Time StaisticsRonnie Sahlberg1-0/+4
svn path=/trunk/; revision=17984
2006-04-24change the signature for dissect_scsi_snsinfo() to take itlq and itl structuresRonnie Sahlberg1-1/+1
update the comment in packet-scsi.c to reflect that it is the transport now that is responsible to track itl and itlq data make scsi tapable svn path=/trunk/; revision=17974
2006-04-22the scsi transports (fc/fcp and iscsi) now track both itl and itlqRonnie Sahlberg1-11/+0
structures for scsi. we no longer need the scsi_task_id structure passed by pinfo->private_data so get rid of it. we no longer need the (broken by design) scsi_task_data hash table since this has been replaced byt hte itl and itlq structures and tracking svn path=/trunk/; revision=17952
2006-04-21remover the lun parameter from dissect_scsi_cdb/payload since this is now ↵Ronnie Sahlberg1-2/+2
part of the exchange data in itlq remove the two fields opcode and devtype from the scsi_task_data structure since these are also part of the itlq and itl structures svn path=/trunk/; revision=17949
2006-04-21updates to get the fc and scsi dissectorsRonnie Sahlberg1-3/+3
and get rid of some breakage in the design let the scsi transport keep track of itl (initiator, target, lun) matching and let it pass a itl structure to scsi that is persistent across packets. let scsi use this itl structure to track device type for a specific itl instead of the (must have been) broken hashtable. update both iscsi and fc to track the itl structure for scsi and schange the scsi signature to accept itl as a parameter. more to come. svn path=/trunk/; revision=17942