aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-scsi.c
AgeCommit message (Collapse)AuthorFilesLines
2017-05-17Create temporary variables for some proto_tree_add_<datatype> calculations.Michael Mann1-10/+13
checkAPIs.pl doesn't like tvb_get_* parameters because it thinks proto_tree_add_item should be used. This is just to pacify the check. Change-Id: If40728bcdf5558c351999057321ffba5d802c7c7 Reviewed-on: https://code.wireshark.org/review/21694 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-29Register reassembly tablesMichael Mann1-15/+2
Register all reassembly tables with a central unit, allowing the central unit to have the callback that initializes and destroys the reassembly tables, rather than have dissectors do it individually. Change-Id: Ic92619c06fb5ba6f1c3012f613cae14982e101d4 Reviewed-on: https://code.wireshark.org/review/19834 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-10Rename tvb_new_subset() to tvb_new_subset_length_caplen().Guy Harris1-5/+5
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>
2016-12-13Adjust proto_tree_add_uint_format_value calls to use unit stringMichael Mann1-1/+3
Several calls to proto_tree_add_uint_format_value could be better served using BASE_UNIT_STRING with a "unit string" in hf_ field. There also a few cases where proto_tree_add_uint_format_value could just be proto_tree_add_uint. Added a few more "common" unit string values to unit_strings.[ch] Change-Id: Iaedff82c515269c9c31ab9100dff19f5563c932d Reviewed-on: https://code.wireshark.org/review/19242 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-08-24SCSI: Mode Sense 10: Wrong block descriptor lengthAlexis La Goutte1-3/+3
Issue reported by Sharon Samuel Enoch Bug:12780 Change-Id: I94ad5355cdfa4d8cd3915c9e261931ff56dc765b Reviewed-on: https://code.wireshark.org/review/17272 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-06*_stdup_printf -> strdup for "single string only" formatting.Michael Mann1-1/+1
Done for performance improvements. This could probably be done in checkAPIs.pl, but this was just a quick manual check with grepping. Change-Id: I91ff102cb528bb00fa2f65489de53890e7e46f2d Reviewed-on: https://code.wireshark.org/review/15751 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2016-03-20Create call_data_dissector() to call data dissector.Michael Mann1-14/+5
This saves many dissectors the need to find the data dissector and store a handle to it. There were also some that were finding it, but not using it. For others this was the only reason for their handoff function, so it could be eliminated. Change-Id: I5d3f951ee1daa3d30c060d21bd12bbc881a8027b Reviewed-on: https://code.wireshark.org/review/14530 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-11SCSI: Fix conflict for hf fieldsAlexis La Goutte1-2/+2
'scsi.blockdescs.no_of_blocks' exists multiple times with NOT compatible types: FT_UINT32 and FT_UINT64 'scsi.naa.vendor_specific' exists multiple times with NOT compatible types: FT_BYTES and FT_UINT32 Change-Id: Iaa512c02b99f0a103bb5015e92d900dae2932843 Reviewed-on: https://code.wireshark.org/review/14418 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-24Add the packet number to the packet_info structure, and use it.Guy Harris1-1/+1
That removes most of the uses of the frame number field in the frame_data structure. Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22 Reviewed-on: https://code.wireshark.org/review/13509 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-23Add more fields to packet_info structure and use them.Guy Harris1-1/+1
Add fields for the absolute time stamp (and another field for a presence flag for the absolute time stamp) and the packet encapsulation for the packet. This lets us remove the field for the packet encapsulation in the frame_data structure; do so. Change-Id: Ifb910a9a192414e2a53086f3f7b97f39ed36aa39 Reviewed-on: https://code.wireshark.org/review/13499 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-22SCSI: Fix mixed up SCSI senddiag PF valuesStefan Pöschel1-1/+1
Change-Id: I5e4b3ff0579789d81bf4eaad3dc2669472d22dd7 Reviewed-on: https://code.wireshark.org/review/12024 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-09-14SCSI: Fix typo on modelinesAlexis La Goutte1-1/+1
Change-Id: Id3613adbb69a4d02e752504a93bf13aa233ad00c Reviewed-on: https://code.wireshark.org/review/10530 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-09-12SCSI: Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-1/+1
Change-Id: I2e3acabfc8415c1230aad01f8112d46c2cf2b57f Reviewed-on: https://code.wireshark.org/review/10499 Reviewed-by: ronnie sahlberg <ronniesahlberg@gmail.com>
2015-09-12Add casts to reassure the compiler that we know what we're doing.Guy Harris1-6/+6
I.e., the calculations (thanks to the masking etc.) will result in values that fit into a guint, so there's no loss of data in converting to a guint. Change-Id: I3dacce93ab87c625a45d22090b27774b9a63ba21 Reviewed-on: https://code.wireshark.org/review/10496 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-09-11SCSI: Fix decode of DeviceIdentification VPD page it was completely bogusRonnie Sahlberg1-25/+96
Change-Id: I0046525fdd574471533d3674343222fe88de1a06 Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Reviewed-on: https://code.wireshark.org/review/10484 Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
2015-09-11SCSI: Update block limits VPD decode to SBC-4Ronnie Sahlberg1-1/+22
SBC-4 Adds three new fields to the block limits VPD page related to the new opcode WITE_ATOMIC_16 that we need to decode: Max atomic transfer length Atomic Alignment Atomic Transfer Length Granularity Change-Id: Ia75793972535f3c8f524eaba037b3297743d1853 Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Reviewed-on: https://code.wireshark.org/review/10481 Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
2015-07-03Call reassembly_table_destroy for some dissectorsPeter Wu1-0/+7
This patch adds reassembly_table_destroy calls as cleanup function for dissectors which have a simple init routine that just calls reassembly_table_init (comments are ignored). The changes were automatically generated using https://git.lekensteyn.nl/peter/wireshark-notes/diff/one-off/cleanup-rewrite.py?id=4cc0aec05dc67a51926a045e1955b7a956757b5e (with the if and assignment parsers disabled). The only difference from the autogenerated output is that the XXX comments from the init routines in smb-pipe and tds dissectors are kept. Change-Id: I64aedf7189877247282b30b0e0f83757be6199e7 Reviewed-on: https://code.wireshark.org/review/9222 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-25Bugfix parsing filters out of SRT tables with parameters.Michael Mann1-1/+1
Change-Id: I5f9315b144333be789f8555f4128371994d4245b Reviewed-on: https://code.wireshark.org/review/9141 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-21Further refactor SRT stats.Michael Mann1-0/+108
Create "common" SRT tap data collection intended for all GUIs. Refactor/merge functionality of existing dissectors that have SRT support (AFP, DCERPC, Diameter, FC, GTP, LDAP, NCP, RPC, SCIS, SMB, and SMB2) for both TShark and GTK. SMB and DCERPC "tap packet filtering" were different between TShark and GTK, so I went with GTK filter logic. CAMEL "tap packet filtering" was different between TShark and GTK, so GTK filtering logic was pushed to the dissector and the TShark tap was left alone. Change-Id: I7d6eaad0673fe628ef337f9165d7ed94f4a5e1cc Reviewed-on: https://code.wireshark.org/review/8894 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Gerald Combs <gerald@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-06SCSI: There are identical sub-expressions ↵Alexis La Goutte1-1/+1
'tvb_reported_length_remaining(tvb, offset)' to the left and to the right of the '!=' operator found by PVS Studio (V501) Change-Id: Iaf7ea99e983d3b42dedf2620250dec0f3d68f937 Reviewed-on: https://code.wireshark.org/review/8790 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-05-30SCSI: Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-2/+0
Change-Id: Ie71203081f807401d3eee5601a1885e9a311f81e Reviewed-on: https://code.wireshark.org/review/8698 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-29Update scsi lun id dissector, add support to handle all 4 addressingAnish Bhatt1-27/+142
methods Bug 11078 Change-Id: I7a9ff07d83b4bb5f5512c04d71aa7f1d3baa0edd Reviewed-on: https://code.wireshark.org/review/8181 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-26Replace deprecated tvb_length* apisAnish Bhatt1-25/+25
Change-Id: Ia23a6cbc61dfaf65002ce63160e87877963a3cca Reviewed-on: https://code.wireshark.org/review/8643 Reviewed-by: Anders Broman <a.broman58@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-12-28Create FT_FCWWN field type.Michael Mann1-3/+3
Also, convert the "string" hf_ entries that used tvb_fcwwn_to_str as a string to use proto_tree_add_item with FT_FCWWN type. Change-Id: I4ca77870499fd8239584a70874998b5d194a7167 Reviewed-on: https://code.wireshark.org/review/6036 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-25Deleting unnecessary #includes from dissectors.Martin Mathieson1-2/+0
Fifth batch (packet-rtp.c -> end). Will look at cleaning up and committing script afterwards. Change-Id: I8ed61dc941d98d3f7259a9d1f74e214eb7b4bfa2 Reviewed-on: https://code.wireshark.org/review/6052 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-2/+0
Specifically: - Set packet.h to be the first wireshark #include after config.h and "system" #includes. packet.h added as an #include in some cases when missing. - Remove some #includes included (directly/indirectly) in packet.h. E.g., glib.h. (Done only for those files including packet.h). - As needed, move "system" #includes to be after config.h and before wireshark #includes. - Rework various #include file specifications for consistency. - Misc. Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95 Reviewed-on: https://code.wireshark.org/review/5923 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-13Use ENC_BIG_ENDIAN when fetching FT_U?INT8 fields ...Bill Meier1-98/+98
(for some dissectors which fetch all other integral fields using ENC_BIG_ENDIAN). Change-Id: Ic18e3172aad76af12b12d6732c88497be22aed56 Reviewed-on: https://code.wireshark.org/review/5748 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-11-25SCSI: type and scope fields are ignored in some SCSI persistent reserve ↵Yaniv Kaul1-11/+27
service actions Bug: 10727 Change-Id: Id34f57b2a0b89867eec1b0a13db2eba037835804 Reviewed-on: https://code.wireshark.org/review/5493 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-11-20Eliminate proto_tree_add_text from some dissectors.Michael Mann1-16/+28
Change-Id: Ib160211198ca02f7eacf29d04568628c11f208a5 Reviewed-on: https://code.wireshark.org/review/5407 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-09-19Do encoding-arg changes (all benign)Bill Meier1-11/+11
For: - FT_BYTES: Always use just ENC_NA - integral/floating (other than FT_[U]INT8): Do ENC_NA --> ENC_BIG_ENDIAN Also: - FT_UINT... --> FT_UINT8 in a few cases (to match proto_tree_add_item...) - Change one case of incorrect '||' to '|' Change-Id: I427e0e61618ff8faf55691c8a695930f67d455b0 Reviewed-on: https://code.wireshark.org/review/4184 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-16Fix spelling: cant-->can't, wont-->won't, etcBill Meier1-5/+5
Change-Id: I4497f1b8b6eab0e576d9dd31b732965f9a6679c6 Reviewed-on: https://code.wireshark.org/review/4124 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-08SCSI: fix dissection of ElementAddress... mode page for SMC devicesRonnie Sahlberg1-12/+9
Change-Id: If16ad422ab851f538af309fbf7d567bd2a13cace Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Reviewed-on: https://code.wireshark.org/review/4029
2014-07-09convert to proto_tree_add_subtree[_format]Michael Mann1-48/+29
Change-Id: I8d66b1bc7dbdfee3d4bf6fd3b3c21c6323b66f44 Reviewed-on: https://code.wireshark.org/review/2946 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-25/+25
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 246fe2ca4c67d8c98caa84e2f57694f6322e2f96. Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f Reviewed-on: https://code.wireshark.org/review/2430 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-18Fixup: tvb_* -> tvb_capturedDario Lombardo1-25/+25
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-17Fix "might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]" warning ↵Bill Meier1-107/+101
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-11packet-scsi.c minor changes - add WWN dissection and fix a typoYaniv Kaul1-4/+7
Change-Id: I0ef84e088988f1a40863ab54b722faace8bacc31 Reviewed-on: https://code.wireshark.org/review/592 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.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-26Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-9/+9
svn path=/trunk/; revision=54457
2013-12-26Fix -Wunused-const-variable found by ClangAlexis La Goutte1-0/+2
svn path=/trunk/; revision=54456
2013-12-26From Yaniv Kaul via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9595Alexis La Goutte1-8/+10
Small changes (mainly textual) to packet-scsi.c The attached patch fixes small issues in SCSI dissection: 1. Extends the meaning of some fields (for example, the mysterious 'LBPME' becomes 'LBPME (logical block provisioning management enabled) / TPE' 2. Adds another ASC value which is important to me - 'Thin Provisioning Soft Threshold Reached' . Added comment where to get all of them (at http://www.t10.org/lists/asc-alph.txt or http://www.t10.org/lists/asc-num.txt) 3. Fixes a small typo: scsi.extcopy.dest_lba is 'Destination LBA', not 'Source LBA' (silly copy-paste mistake). svn path=/trunk/; revision=54455
2013-12-23Reove _U_ from some function parameters ...Bill Meier1-4/+4
svn path=/trunk/; revision=54386
2013-12-23Change types to try to avoid warnings.Martin Mathieson1-2/+4
svn path=/trunk/; revision=54385
2013-12-23From Yaniv Kaul via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9551Alexis La Goutte1-6/+460
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-67/+68
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-12-11- Make local functions static.Anders Broman1-1/+4
- Forward declaration of register functions. svn path=/trunk/; revision=53942
2013-10-23#if 0 numerous "unused const variables" (mostly value-string-arrays);Bill Meier1-0/+2
Also; fix a few "set but not used" warnings. svn path=/trunk/; revision=52780
2013-10-13whitespace fixes; mostly: remove trailing blanksBill Meier1-1/+1
svn path=/trunk/; revision=52591
2013-09-14emem -> wmemJörg Mayer1-6/+6
svn path=/trunk/; revision=52038