Commit Graph

66 Commits

Author SHA1 Message Date
Ronnie Sahlberg a9f636b41d imake fcp responses that do carry a scsi response code
call the scsi response dissector as well
(so that eventually we can do things like SRT for SCSI)


it doesnt work yet since fcp is using some incredibly broken logic to
track state between frames.

the cdata stuff can just not ever work exscept for single scan tethereal dissection.
is there noone at all looking at these protocols wioth ethereal?
has noone noticed it is completely broken yet?


sigh,    soon   i think i will be able to add the originally estimated trivial to implement   SCSI SRT



svn path=/trunk/; revision=17811
2006-04-05 08:51:45 +00:00
Ronnie Sahlberg 6fd403ee95 make reportluns use the new macros to catch and flag alloclen truncation
svn path=/trunk/; revision=17810
2006-04-05 07:25:57 +00:00
Ronnie Sahlberg ab9b2e6836 dislay a flags field as "Flags" instead of "SCCS Flags"
svn path=/trunk/; revision=17801
2006-04-03 20:39:55 +00:00
Ronnie Sahlberg 54d8591809 use col_set_fence() after we have populated the info column with the SCSI details so that if there are other pdus followinf this scsi pdu in the packet they will not overwrite it
svn path=/trunk/; revision=17800
2006-04-03 20:29:53 +00:00
Ronnie Sahlberg 5ee1c8d1e4 add dissection of the inq sync flag
sort the entries in scsi_verdesc_val   so it is easier to add missing entries


svn path=/trunk/; revision=17799
2006-04-03 20:12:24 +00:00
Ronnie Sahlberg f886744b64 further prettification of the inq dissector.
further refactorinf of  the scsi  alloc_len macros



svn path=/trunk/; revision=17795
2006-04-03 08:20:54 +00:00
Ronnie Sahlberg 700a7f527a dissect byte 7 of the inq response
svn path=/trunk/; revision=17794
2006-04-03 03:19:52 +00:00
Ronnie Sahlberg 0f1f0c8d8a add dissection of byte 6 of inq response
(except fopr 3 bits that only exist for pscsi)


svn path=/trunk/; revision=17791
2006-04-03 02:40:07 +00:00
Ronnie Sahlberg d5585760e7 add dissection of the flags in byte 5 of the inquiry response
svn path=/trunk/; revision=17788
2006-04-03 01:44:56 +00:00
Ronnie Sahlberg ae66a76a1a prettify dissection of the aca flags byte in the inq response data.
add dissection of two additional bits and the respdataformat bitvield

add booleans for the filter fields

make all the fields filterable



svn path=/trunk/; revision=17787
2006-04-03 00:55:21 +00:00
Ronnie Sahlberg 695b605cbb change TRY_SCSI_SHORT_TRANSFER to use the allocation length specified in the CDB
instead of the allocation length from the data pdu   since sometimes the datapdu will be completely empty and thus we cant extract it from the data pdu.
(unclear if this is really allowed by scsi   but anyway)
this should make the scsi transfer length checking more correct.


update mmc  getconfiguration   and spc  inquiry  to use these macros
and flag these packets that are short due to a too small alloc_len
as truncated due to scsi  and not being short/malformed packets.


at the same time,  get rid of a few horrible   offset+x   in the inquiry dissector and replace with proper offset incrementation instead.





svn path=/trunk/; revision=17784
2006-04-02 22:50:46 +00:00
Anders Broman 89de25406b From Ming Zhang:
fix a minor error in mode_select, packet-scsi.c

svn path=/trunk/; revision=17780
2006-03-31 05:11:57 +00:00
Jaap Keuter 9734da71a8 From Ming Zhang: the track # in read toc command dissector should be 1 instead of 4.
svn path=/trunk/; revision=17753
2006-03-28 21:03:01 +00:00
Jaap Keuter 719b8effbe From Ming Zhang: fix for several wrong use of ntohs in packet-scsi.c
svn path=/trunk/; revision=17725
2006-03-25 07:57:11 +00:00
Guy Harris 0d66eda9ba Fix some format strings to display all fields in some mode sense page
bytes.

Constify some variables to squelch compiler warnings.

svn path=/trunk/; revision=17672
2006-03-19 20:23:17 +00:00
Anders Broman d2ae4f4c7a From Ming Zhang:
added 3 MCC mode pages decode support.

MRW page
Write param page
capacity page

also fixed several wrong tvb_get_ntohs usage introduced in previous patch.

svn path=/trunk/; revision=17654
2006-03-17 06:26:14 +00:00
Ronnie Sahlberg 877d757062 put the opcode as a generated field inside data pdus for scsi
svn path=/trunk/; revision=17619
2006-03-14 04:56:40 +00:00
Ronnie Sahlberg dd99a25837 prettifu getconfiguration response
svn path=/trunk/; revision=17618
2006-03-14 01:18:43 +00:00
Ronnie Sahlberg 0398f48341 set current_proto to SCSI so that the exception handler will show the correct protocol
fix length in getconfiguration()  so that we provide the proper one (+4)
to avoid marking valid packets as malformed.



svn path=/trunk/; revision=17616
2006-03-13 22:35:14 +00:00
Ulf Lamping 3048f90e45 remove a compiler warning
svn path=/trunk/; revision=17613
2006-03-13 22:19:36 +00:00
Ronnie Sahlberg edcaaee164 SCSI is fairly unique among the ethereal protocols in that it is sometimes normal for a PDU we receive back froma device to be truncated.
(report luns with allocation length 8 for example)

Therefore it is a bit wrong to mark these packets as [malformed packets]
Since they are truncated by scsi   and this is NOTY an error condition.


Add a new exception type  :  ScsiBoundsError
If this exception is caught by packet-frame, then print an appropriate message
instead of [malformed packet]

For SCSI, add helper macros TRY_SCSI_SHORT_PACKET   and END_...


If the packet was not short in the normal sense (snaplen < packetlen) then intercept the exception for BoundsError and rethrow it as ScsiBoundsError instead.





svn path=/trunk/; revision=17611
2006-03-13 10:29:00 +00:00
Anders Broman 11c3d3d90d From Ming Zhang
added another command preventallowmediaremoval besides those 3.

> enhanced packet-scsi.c a bit to decode 3 more scsi commands
> 
> getperformance
> setcdspeed
> readdiscstructure.



svn path=/trunk/; revision=17610
2006-03-13 06:23:59 +00:00
Gerald Combs 172556500d Remove MIN and MAX defines, which GLib provides.
svn path=/trunk/; revision=17551
2006-03-09 16:00:33 +00:00
Ronnie Sahlberg 7fc017a5c4 rewrite of some hairy code
fixes (hopefully) coverity bug 137


svn path=/trunk/; revision=17492
2006-03-07 10:25:42 +00:00
Anders Broman 0c8b1090f4 From Ming Zhang:
Update on dissector packet-scsi

* modepage processing for MMC
* support cmd Get Event Status Notification
* support cmd start stop unit for mmc

svn path=/trunk/; revision=17484
2006-03-06 20:06:05 +00:00
Anders Broman a8b8b3d9ff From Ming Zhang:
Updated dissector packet-scsi to

* decode the device configuration mode page;
* decode the request sense response;
* fix a wrong lens print in several writeX(). this happens when one packet contains several iscsi pdu. one write data pdu will be explained as request with LEN extracted (but it is not a cdb so it was wrong).
* split the dissect_scsi_snsinfo() into 2 parts so the sense data decode part can be a subroutine shared by requestsense() and maybe more places.


svn path=/trunk/; revision=17460
2006-03-04 10:10:48 +00:00
Ronnie Sahlberg 5600e98269 From Ming Zhang
Add dissection of some additional SCSI SSC commands :

space6
erase6
locate10
space16
locate16


svn path=/trunk/; revision=17447
2006-03-02 21:17:18 +00:00
Anders Broman 9fac8a5601 From David Wysochanski fix a typo.
svn path=/trunk/; revision=16380
2005-11-02 20:28:58 +00:00
Anders Broman 402b0480f7 From Dinesh G Dutt
Support some new messages and fix a couple of bugs.

packet-fc.h - Added a #define for a Cisco MDS-specific frame called OHMS (online health mgmt srv) packet-fc.c - Support for OHMS frame, fixed an incorrect "malformed frame" error caused on ACK1 frames (they
                   don't contain anything but (encap hdr + FC hdr + encap trailer), fixed incorrect detection of
                   last-data-frame

packet-fcct.h - Support for new service type, "Fabric Controller", used in conjunction with FC-SW3 ESS message,
                     exported the service name value string definitions and  
packet-fcct.c - Support for recognizing "Fabric Controller" service type and "vendor-specific" service

packet-fcswils.h - Support for ESS & MRRA messages, defined as part of FC-SW3 packet-fcswils.c - Support for ESS & MRRA messages, defined as part of FC-SW3

packet-scsi.c - Support for Verify and Write&Verify SBC commands.

svn path=/trunk/; revision=15799
2005-09-14 18:40:16 +00:00
Ronnie Sahlberg f86e30f39b add missing value_string termination
svn path=/trunk/; revision=15585
2005-08-28 03:05:53 +00:00
Ronnie Sahlberg f8d286b7e3 add dissection of two more SSC commands
add 4 commands from SMC to the SSC tables.
the fallback for missing commands/i.e. commands defined outside the SSC
only handles SPC   I.e.  If a command for SSC is missing in the SSC tables, assume it might be imported from SPC instead.

This fallback only works with opcodes imported from SPC.


svn path=/trunk/; revision=15345
2005-08-14 00:10:41 +00:00
Guy Harris 0fb64bd9cb Get rid of unused variables.
Use "tvb_format_text()" and friends to format strings for display.

Don't throw an exception on errors if we can keep dissecting.

Use "PROTO_ITEM_SET_GENERATED()" to mark items as generated.

If an item covers real data, it's not generated.

Dissect WRITE FILEMARKS (6) (we already had a dissector, but it wasn't
being used).

svn path=/trunk/; revision=15341
2005-08-13 22:05:01 +00:00
Ronnie Sahlberg f6e45c9d5f remove some unused variables from scsi
change two gmemchunks in smtp to se_alloc() and remove one now redundant init routine.


svn path=/trunk/; revision=15308
2005-08-12 10:03:17 +00:00
Ronnie Sahlberg d3b675c2d6 add missing include to scsi
change two gmemchunks to se_alloc() for msproxy

svn path=/trunk/; revision=15307
2005-08-12 09:56:28 +00:00
Ronnie Sahlberg 0a06795b00 oops forgot to delete a variable
svn path=/trunk/; revision=15304
2005-08-12 09:31:07 +00:00
Ronnie Sahlberg ec7942851e get rid of some unnessecary GMemChunks.
These GMemChunks are used here because :
1, GMemChunks are cheap to allocate and cheap to free
2, We always unconditionally free the entire chunk When and only when we load a new capture.

==>
se_alloc() does exactly the same thing but with significantly less code

==>
se_alloc() is a much better fit to out allocation requirements and useage than GMemChunks



svn path=/trunk/; revision=15303
2005-08-12 09:30:24 +00:00
Ronnie Sahlberg 216cc15b46 fix several bugs where we might dereference a null pointer
svn path=/trunk/; revision=15289
2005-08-11 08:15:52 +00:00
Gerald Combs 06cc81aa5f When we receive junk data, mark it as a malformed packet instead of
a dissector bug.  This keeps buildbot from opening unnecessary bugs
during fuzz testing.

When we create a new scsi_task_data_t struct make sure all of its
members are initialized.

svn path=/trunk/; revision=15278
2005-08-10 16:05:50 +00:00
Jörg Mayer 69dcb66cd9 More char -> const char warning fixes
svn path=/trunk/; revision=15218
2005-08-05 00:23:22 +00:00
Guy Harris 5c78208855 Widen a variable, as a guint16 value is assigned to it; the upper 8 bits
might be irrelevant in this case, but we might as well not throw them
out.

Clean up some code that sets "cdata->flags".

svn path=/trunk/; revision=15149
2005-07-30 02:09:59 +00:00
Guy Harris ab797734dd Get rid of the private "my_match_strval()" routine in many dissectors;
add a "match_strval_idx()" routine that does the same thing, and have
"match_strval()" call it.

Make those routines, and "val_to_str()", return a "const" pointer. 
Update dissectors as necessary to squelch compiler warnings produced by
that.

Use "val_to_str()" rather than using "match_strval()" and then, if the
result is null, substituting a specific string.  Clean up some other
"match_strval()"/"val_to_str()" usages.

Add a null pointer check in the NDPS dissector's "attribute_value()"
routine, as it's not clear that "global_attribute_name" won't be null at
that point.

Make some global variables in the AFS4INT dissector local.

Make some routines not used outside the module they're in static.

Make some tables "static const".

Clean up white space.

Fix Gerald's address in some files.

svn path=/trunk/; revision=14786
2005-06-26 19:56:52 +00:00
Ronnie Sahlberg 2edd8a7a00 add MMC READ DISC INFORMATION cdb
svn path=/trunk/; revision=14486
2005-05-30 12:09:39 +00:00
Ronnie Sahlberg 3b4e688073 add MMC READ TRACK INFORMATION cdb
svn path=/trunk/; revision=14485
2005-05-30 11:16:08 +00:00
Ronnie Sahlberg acaf8730be add MMC RESERVE TRACK cdb
svn path=/trunk/; revision=14476
2005-05-29 08:45:09 +00:00
Ronnie Sahlberg bbf29dd862 MMC SET STREAMING command
svn path=/trunk/; revision=14475
2005-05-29 08:29:55 +00:00
Ronnie Sahlberg aa7157462c remove offset and len from the signature of dissect_scsi_payload()
svn path=/trunk/; revision=14473
2005-05-29 03:18:53 +00:00
Ronnie Sahlberg e66ff913ff make all callers of dissect_scsi_cdb() first create a new subset tvb
change the signature for dissect_scsi_cdb since we no longer need to pass offset over.



svn path=/trunk/; revision=14472
2005-05-29 02:55:12 +00:00
Ronnie Sahlberg 6eb6d5f9af minor prettification
in the decode pane for the SCSI protocol,
put the name of the CDB on the protocol line


svn path=/trunk/; revision=14470
2005-05-29 01:54:22 +00:00
Ronnie Sahlberg 3007142732 add MMC READ BUFFER CAPACITY command
svn path=/trunk/; revision=14467
2005-05-28 13:29:45 +00:00
Ronnie Sahlberg 5d7e4750d2 add the SynchronizeCache command for MMC
svn path=/trunk/; revision=14466
2005-05-28 13:01:14 +00:00