aboutsummaryrefslogtreecommitdiffstats
path: root/packet-iscsi.c
AgeCommit message (Collapse)AuthorFilesLines
2004-07-18Move dissectors to epan/dissectors directory.gram1-2511/+0
Also move ncp222.py, x11-fields, process-x11-fields.pl, make-reg-dotc, and make-reg-dotc.py. Adjust #include lines in files that include packet-*.h files. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11410 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-18Set the svn:eol-style property on all text files to "native", so thatguy1-1/+1
they have LF at the end of the line on UN*X and CR/LF on Windows; hopefully this means that if a CR/LF version is checked in on Windows, the CRs will be stripped so that they show up only when checked out on Windows, not on UN*X. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11400 f5534014-38df-0310-8fa8-9805f1628bb7
2004-05-24Have two strings in an enum_val_t - one that's a short string that isguy1-7/+7
convenient to put into a command line (no capital letters, no spaces to require quotes), and one that's a detailed description for use in the UI. Allow either of them in the preferences file or "-o" option; use the detailed description in the UI, and also use it when writing the preferences out, so that the preference will be readable by older versions of Ethereal (assuming the preference existed in that version). Update "README.developer" to give more detail about an enum_val_t (and to put the _t in), and to give a more detailed description of the "radio_buttons" argument to "prefs_register_enum_preference()". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10982 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-18update iscsi so that we can also measure the time between request and ↵sahlberg1-49/+80
response for those transactions where we have phase collaps (no explicit response PDU, status embedded inside the last DataIn PDU) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10092 f5534014-38df-0310-8fa8-9805f1628bb7
2003-11-16Export "protocol_t" as an opaque type.guy1-4/+1
Make "proto_is_protocol_enabled()" and "proto_get_protocol_short_name()" take a "protocol_t *" as an argument, so they don't have to look up the "protocol_t" - this will probably speed them up considerably, and they're called on almost every dissector handoff. Get rid of a number of "proto_is_protocol_enabled()" calls that aren't necessary (dissectors called through handles, including those called through dissector tables, or called as heuristic dissectors, aren't even called if their protocol isn't enabled). Change some direct dissector calls to go through handles. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8979 f5534014-38df-0310-8fa8-9805f1628bb7
2003-09-09For iSCSIsahlberg1-3/+10
During the Login phase, if the T bit is not set, then the iniator/targets are not ready to transition to the next stage. Thus the NSG bits are undefined. Change the dissector to only dissect the NSG bits iff the T bit is set in the Login pdu. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8433 f5534014-38df-0310-8fa8-9805f1628bb7
2003-06-21Rewritten the Command/DataIn/DataOut/Response matching in iSCSIsahlberg1-140/+275
so that it is reliable. Put FT_FRAMENUMs for request-in, datain-in, data-out-in, response-in and time-from-request in the tree pane and make all the responses have "iscsi.time" which is the time from the command. By later passing this data down to the scsi dissectors we should be able to create taps and generate scsi service response time statistics. ... the iscsi dissector should be cleaned up and use switch()case and subroutines instead of one gigantic if()else if() ... git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7910 f5534014-38df-0310-8fa8-9805f1628bb7
2003-06-15update iSCSI so that DecodeAs... can be used to specify a TCP session being ↵sahlberg1-5/+31
iSCSI git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7889 f5534014-38df-0310-8fa8-9805f1628bb7
2003-06-15Let iSCSI/TCP keep track of where PDU bundaries are in the TCP stream.sahlberg1-1/+25
This will reduce the chance of false-positives in detecting iscsi headers inside a large data transfer. the dissector needs to become a bit more stateful first. NOP-Out commands will have a TransferTag of either -1 or a valid value if a response is requested. Assume opcode==NOP-Out (0) and TransferTag==0 is a non-iscsi header. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7887 f5534014-38df-0310-8fa8-9805f1628bb7
2003-01-28Panic if a preference starts with the name of the module to which itguy1-2/+2
belongs, as that's redundant. Fix a bunch of cases where that was done, and map the old name to the new name. Instead of marking "mtp3.mtp3_standard" as obsolete, map it to "mtp3.standard". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7030 f5534014-38df-0310-8fa8-9805f1628bb7
2002-12-02Don't cast away constness, and fix variable and structure memberguy1-7/+7
qualifiers as necessary to ensure that we don't have to. "strcmp()", "strcasecmp()", and "memcmp()" don't return booleans; don't test their results as if they did. Use "guint8", not "guchar", for a pointer to (one or more) 8-bit bytes. Update Michael Tuexen's e-mail address. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6726 f5534014-38df-0310-8fa8-9805f1628bb7
2002-11-14From Andrew Esh: typo fix in iSCSI dissector.guy1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6631 f5534014-38df-0310-8fa8-9805f1628bb7
2002-09-26From Mark Burton: iSCSI updatessahlberg1-9/+40
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6340 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-29From Mark Burton: fix the byte order in the CRC calculation.guy1-2/+12
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6130 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-28Removed trailing whitespaces from .h and .c files using thejmayer1-52/+52
winapi_cleanup tool written by Patrik Stridvall for the wine project. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6117 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-20Have "dissect_scsi_cdb()" take an argument that's a SCSI device type,guy1-2/+2
for the benefit of dissectors such as the NDMP dissector that can at least supply a reasonable guess for the device type; more than one type of device can be opened on the same host over NDMP, so the scheme currently used by the SCSI dissector to remember device types in INQUIRY replies won't work. Have the iSCSI dissector supply SCSI_DEV_UNKNOWN, and have the NDMP dissector supply SCSI_DEV_SMC for NDMP_SCSI_EXECUTE_CDB (under the assumption that it's operating on a media changer) and supply SCSI_DEV_SSC for NDMP_TAPE_EXECUTE_CDB (under the assumption that it's operating on a tape device). Fix memory leaks in the SCSI dissector. Fix the dissectors for the SSC READ(6) and WRITE(6) CDBs to dissect the transfer length as a 24-bit quantity. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6035 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hjmayer1-9/+1
equivalents for the toplevel directory. The removal of winsock2.h will hopefully not cause any problems under MSVC++, as those files using struct timeval still include wtap.h, which still includes winsock2.h. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5932 f5534014-38df-0310-8fa8-9805f1628bb7
2002-07-17From Joerg Mayer:guy1-5/+1
dftest.c: Remove #if-0-ed includes packet-ieee80211.c, packet-wtls.c, packet-afp.c, packet-wsp.c, packet-wtp.c, ethereal_gen.py: Remove redundant include varargs (already in snprintf.h, and required only for snprintf.h) Remove unused include of snprintf.h from files not using "snprintf()". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5889 f5534014-38df-0310-8fa8-9805f1628bb7
2002-06-24From Mark Burton: add Draft 13 support, making that draft the default.guy1-5/+21
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5755 f5534014-38df-0310-8fa8-9805f1628bb7
2002-05-16Fix from Mark Burton.guy1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5490 f5534014-38df-0310-8fa8-9805f1628bb7
2002-05-15iSCSI draft 12 support, from Mark Burton.guy1-6/+43
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5476 f5534014-38df-0310-8fa8-9805f1628bb7
2002-05-14From Mark Burton: make the iSCSI protocol level a settable preferenceguy1-218/+270
rather than something chosen at compile time, and get rid of an unused-but-#ifdeffed-out variable. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5469 f5534014-38df-0310-8fa8-9805f1628bb7
2002-04-29Removal (or, at least, #ifdeffing out) of unused variables andguy1-2/+3
functions, from David Frascone. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5288 f5534014-38df-0310-8fa8-9805f1628bb7
2002-04-04From Mark Burton: add an ett_iscsi ett_ value for the top-level treeguy1-4/+7
item. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5100 f5534014-38df-0310-8fa8-9805f1628bb7
2002-04-04Compile fix from Mark Burton.guy1-4/+4
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5097 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-20Update to draft 11, from Mark Burton.guy1-27/+202
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4995 f5534014-38df-0310-8fa8-9805f1628bb7
2002-02-13Have the private data for the SCSI dissection routines be a pointer to aguy1-7/+15
structure containing a 32-bit conversation ID (which uniquely identifies conversations between a SCSI initiator and target) and a 32-bit task ID (which uniquely identifies a task within that conversation). Have the NDMP dissector create conversations when it sees an "execute CDB" request, and use the conversation index as the conversation ID and the sequence number for requests and reply sequence for replies as the task ID. Have it use "dissect_scsi_payload()" to dissect the payload of "execute CDB" requests and replies. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4726 f5534014-38df-0310-8fa8-9805f1628bb7
2002-02-02Updates from Mark Burton.guy1-19/+38
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4675 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-31Minor updates, from Mark Burton:guy1-27/+28
More draft 09 compatibility changes. Default port number now 3260. Now prints extra info to COL_INFO for SCSI command and login responses. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4641 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-21From Mark Burton:guy1-23/+143
- Upgrade to version draft-09 of the iSCSI protocol (compatibility to draft-08 can be selected at compile time) - Bug fix so that now the the 16 bit length that prefixes sense data is taken into account. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4591 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-21Include files from the "epan" directory and subdirectories thereof withguy1-3/+3
"epan/..." pathnames, so as to avoid collisions with header files in any of the directories in which we look (e.g., "proto.h", as some other package has its own "proto.h" file which it installs in the top-level include directory). Don't add "-I" flags to search "epan", as that's no longer necessary (and we want includes of "epan" headers to fail if the "epan/" is left out, so that we don't re-introduce includes lacking "epan/"). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4586 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-20Allow a length of -1 to be specified when adding FT_NONE and FT_PROTOCOLguy1-2/+2
items to the protocol tree; it's interpreted as "the rest of the data in the tvbuff". This can be used if 1) the item covers the entire packet or the remaining payload in the packet or 2) the item's length won't be known until it's dissected, and will be then set with "proto_item_set_len()" - if an exception is thrown in the dissection, it means the item ran *past* the end of the tvbuff, so saying it runs to the end of the tvbuff is reasonable. Convert a number of "proto_tree_add_XXX()" calls using "tvb_length_remaining()", values derived from the result of "tvb_length()", or 0 (in the case of items whose length is unknown) to use -1 instead (using 0 means that if an exception is thrown, selecting the item highlights nothing; using -1 means it highlights all the data for that item that's available). In some places where "tvb_length()" or "tvb_length_remaining()" was used to determine how large a packet is, use "tvb_reported_length()" or "tvb_reported_length_remaining()", instead - the first two calls indicate how much captured data was in the packet, the latter two calls indicate how large the packet actually was (and the fact that using the latter could cause BoundsError exceptions to be thrown is a feature - if such an exception is thrown, the frame really *was* short, and it should be tagged as such). Replace some "proto_tree_add_XXX()" calls with equivalent "proto_tree_add_item()" calls. Fix some indentation. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4578 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-16From Mark Burton: reinstate data segment digest handling, and stop theguy1-1/+13
SCSI dissector from treating data digests as payload. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4552 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-10SCSI dissector, and changes to make the iSCSI dissector use it, fromguy1-169/+193
Dinesh Dutt. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4508 f5534014-38df-0310-8fa8-9805f1628bb7
2001-12-10Move the pointer to the "column_info" structure in the "frame_data"guy1-12/+12
structure to the "packet_info" structure; only stuff that's permanently stored with each frame should be in the "frame_data" structure, and the "column_info" structure is not guaranteed to hold the column values for that frame at all times - it was only in the "frame_data" structure so that it could be passed to dissectors, and, as all dissectors are now passed a pointer to a "packet_info" structure, it could just as well be put in the "packet_info" structure. That saves memory, by shrinking the "frame_data" structure (there's one of those per frame), and also lets us clean up the code a bit. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4370 f5534014-38df-0310-8fa8-9805f1628bb7
2001-11-04Allow a dissector to register preferences that it no longer supports asguy1-1/+8
obsolete; we silently ignore attempts to set those in a preferences file, so that we don't spam the user with error messages caused by them having saved preferences in an earlier release that contained those preferences. Make the Diameter and iSCSI dissectors register obsolete preferences. Crash if some code tries to register a preferences module with a name that contains something other than lower-case ASCII letters, numbers, or underscores, or that has already been registered, or if some code tries to register a preference with a name that contains something other than lower-case ASCII letters, numbers, underscores, or periods, or that has already been registered, so that we don't put code like that in a release and have to shovel code into "prefs.c" to fix it up later. (The problem with multiple modules or preferences with the same name should be obvious; the problem with names with blanks, or upper-case letters, or punctuation, is that they're a pain to type on the command line.) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4148 f5534014-38df-0310-8fa8-9805f1628bb7
2001-11-04Updates from Mark Burton.guy1-92/+122
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4147 f5534014-38df-0310-8fa8-9805f1628bb7
2001-10-23When putting protocols into the list of protocols, do a case-insensitiveguy1-2/+2
sort. Give iSCSI the short name "iSCSI" rather than "ISCSI". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4067 f5534014-38df-0310-8fa8-9805f1628bb7
2001-10-21Give the "iscsi_desegment" and "iscsi_port" the right types, matchingguy1-3/+3
the declarations of the functions to which a pointer to them is passed; this also fixes it so it compiles with MSVC++, as there's no "uint" type declared by MSVC++ by default. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4054 f5534014-38df-0310-8fa8-9805f1628bb7
2001-10-21Updates from Mark Burton:guy1-214/+349
The enclosed code contains the following improvements: 1 - Compatible with 08 version of the protocol 2 - Handles both header and data digests 3 - Supports desegmentation 4 - Dissects multiple PDUs per packet 5 - Stronger heuristics to avoid dissecting non-iSCSI packets 6 - General rationalisation and de-crufting! The old code that attempted to automatically detect the presence of a header digest has been removed. You now have to specify in the iSCSI preferences whether digests are enabled and if they are, whether they are CRC32 or not. If not CRC32, you also need to specify the size of the digests (in bytes). Another new option specifies the iSCSI port number. This is used in the heuristics to filter out packets with silly port numbers, set to 0 to disable the port filter. One problem that I haven't been able to track down is that if desegmentation is enabled and you turn digests on or off ethereal throws a SEGV. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4051 f5534014-38df-0310-8fa8-9805f1628bb7
2001-10-20FT_UINTn values must always have a base, even if they're bitfields - theguy1-2/+2
width of the item containing the bitfield is "n", so you don't have to specify it explicitly, as you have to do with FT_BOOLEAN bitfields. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4047 f5534014-38df-0310-8fa8-9805f1628bb7
2001-10-19From Mark Burton: update to the -08 draft.guy1-850/+514
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4043 f5534014-38df-0310-8fa8-9805f1628bb7
2001-07-22Update from Mark Burton.guy1-182/+218
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3771 f5534014-38df-0310-8fa8-9805f1628bb7
2001-07-16Get the length of a null-terminated string with "tvb_strnlen()", not byguy1-5/+6
getting a pointer to the first byte of the string with "tvb_get_ptr()" and then assuming you can safely do a "strlen()" with that pointer (it's not guaranteed that you can, as the terminating null byte might not be in the tvbuff). Add the resulting string with "proto_tree_add_item()". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3728 f5534014-38df-0310-8fa8-9805f1628bb7
2001-07-16Convert a bunch of "proto_tree_add_bytes(tree, hf, tvb, offset, length,guy1-134/+134
tvb_get_ptr(tvb, offset, length))" calls to "proto_tree_add_item()" calls. Do the same, in "packet-iscsi.c" and "packet-mrdisc.c", for "proto_tree_add_uint()" and "proto_tree_add_boolean()" calls. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3726 f5534014-38df-0310-8fa8-9805f1628bb7
2001-06-28Updates from Mark Burton.guy1-40/+234
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3618 f5534014-38df-0310-8fa8-9805f1628bb7
2001-06-18From Joerg Mayer: explicitly fill in all members of aguy1-88/+88
"header_field_info" structure, including the ones that are later set by the routines to register fields. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3561 f5534014-38df-0310-8fa8-9805f1628bb7
2001-06-04Updates from Mark Burton.guy1-26/+56
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3508 f5534014-38df-0310-8fa8-9805f1628bb7
2001-06-02On Windows, "min" apparently gets defined or declared in such a fashionguy1-6/+6
that declaring our own static function "min()" doesn't work; rename it "iscsi_min()" to get rid of the problem. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3504 f5534014-38df-0310-8fa8-9805f1628bb7
2001-05-31Updates from Mark Burton.guy1-76/+172
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3492 f5534014-38df-0310-8fa8-9805f1628bb7