51ef550414
Add -f to rm when cleaning up to get rid of error message when running make clean twice
Ronnie Sahlberg
2011-04-16 16:49:10 +10:00
a1715ae21a
Add a simple SCSI test tool. For now focused on SBC but should be enhanced to cover other commandsets too
Ronnie Sahlberg
2011-04-16 16:47:38 +10:00
f4ef49e068
Add missing prototype for the read6 cdb function
Ronnie Sahlberg
2011-04-16 16:27:48 +10:00
3a29351dac
Read out the residual count correctly from the scsi reply
Ronnie Sahlberg
2011-04-16 16:26:04 +10:00
4551b01104
compiler warning about unusued variable
Ronnie Sahlberg
2011-04-16 16:22:59 +10:00
024f7dc94e
In iscsi_scsi_response_cb() dont pick task up from the argument, since this callback can be invoked from places where we dont have/know the task strucutre and it is thus NULL.
Ronnie Sahlberg
2011-04-16 13:51:32 +10:00
49dd0fb8b3
Add definition of INVALID OPERATION CODE asqc
Ronnie Sahlberg
2011-04-16 09:54:48 +10:00
07ad0572f2
Add support for READ6
Ronnie Sahlberg
2011-04-16 08:06:16 +10:00
b6782dd7c8
TCP KEEPALIVE support
Ronnie Sahlberg
2011-04-13 21:35:51 +10:00
120f41f225
TODO: Update TODO to reflect we now do target driven NOPs
Ronnie Sahlberg
2011-04-10 15:36:23 +10:00
ef846b0f30
Target initiated NOP: Initial support to try to respond to target initiated NOPs.
Ronnie Sahlberg
2011-04-10 15:32:47 +10:00
cfe19486ee
Add RESERVATION CONFLICT From Richard Sharpe, add support to handle when a target responds with RESERVATION CONFLICT to a scsi i/o
Ronnie Sahlberg
2011-04-09 11:59:12 +10:00
bceb3d058d
TYPO: fix error strings to "trying TO send ..."
Ronnie Sahlberg
2011-04-06 17:46:59 +10:00
e93ad2f039
Fix a cut-n-paste typo in an error message
Ronnie Sahlberg
2011-04-05 12:24:13 +10:00
1a5f267b1d
WRITE10: Set W bit to 1 only if we write data, i.e. number of blocks are >0
Ronnie Sahlberg
2011-04-04 18:46:43 +10:00
e7300bfb8b
READ10: only set R flag in iscsi if we are reading >0 blocks. If we are reading 0 blocks, the R flag should be clear
Ronnie Sahlberg
2011-04-04 18:33:29 +10:00
5225b5fa66
Add definitions for ASCQ LBA-OUT-OF-RANGE
Ronnie Sahlberg
2011-04-04 17:39:07 +10:00
376f60fc06
Use ioctl(FIONREAD) to determine how many bytes are readable in the socket and make sure we dont try to read mor than that.
Ronnie Sahlberg
2011-04-03 07:22:05 +10:00
4979b7346f
From Richard Sharpe
Ronnie Sahlberg
2011-03-27 19:27:10 +11:00
2c932a1869
README: document we have support patches for kvm/qemu, sg3utils and mtx
Ronnie Sahlberg
2011-03-27 19:06:11 +11:00
e98030123d
KVM/QEMU patch to make iscsi aware
Ronnie Sahlberg
2011-03-27 19:03:14 +11:00
53dda35d38
Add patch to provide iscsi functionality in the MTX package
Ronnie Sahlberg
2011-03-27 18:30:12 +11:00
40d3928c64
oops used the wrong sg3 patch
Ronnie Sahlberg
2011-03-27 18:24:34 +11:00
343d86dca7
get rid of the _async() scsi functions. We dotn need two interfaces that only diuffer in whether they return a pointer or NULL vs an semiidentical interface that returns 0 or <0
Ronnie Sahlberg
2011-03-27 18:17:12 +11:00
cedcc55796
Add SG3 utils patch to the patches subdirectory
Ronnie Sahlberg
2011-03-27 18:00:55 +11:00
f4f6ef5033
change dont automatically free the scsi_task once the callback completes. Freeing the scsi_task structure is the responsibility of the application to either do so during the callback, or later.
Ronnie Sahlberg
2011-03-27 17:53:05 +11:00
4e6e39ee23
Support for REJECT PDUs.
Ronnie Sahlberg
2011-02-27 13:49:49 +11:00
8784a72f0e
ISCSICLIENT update the example to use the _task() function for task management
Ronnie Sahlberg
2011-02-27 10:35:49 +11:00
3561dbbd61
Document the async _task() functions
Ronnie Sahlberg
2011-02-27 10:32:23 +11:00
76208e1eff
Rename the _send() functions to _task() These functions are also async functions for SCSI commands but they return a task structure or NULL.
Ronnie Sahlberg
2011-02-27 10:29:51 +11:00
bdbf6b5d00
Dont free the scsi task from iscsi_scsi_command_async(), leave that for the caller to do if required.
Ronnie Sahlberg
2011-02-25 15:53:56 +11:00
356a6571bb
Login: remember what the TargetAddress returned during login is so we can handle redirect 'errors'.
Ronnie Sahlberg
2011-02-25 15:35:49 +11:00
e9749ee68c
Add ifdefs to protect the header files from being included multiple times
Ronnie Sahlberg
2011-02-25 14:25:45 +11:00
6a2a8b5187
TaskManagement: Add a function for abort task set
Ronnie Sahlberg
2011-02-19 18:18:56 +11:00
b81d21ce8c
TaskManagement: Add a function to abort a scsi_task
Ronnie Sahlberg
2011-02-19 18:04:55 +11:00
fb34c5615a
Update the example with a task management call to abort a task
Ronnie Sahlberg
2011-02-19 18:04:22 +11:00
4315ee9225
Create _send() functions for all scsi commands that return a 'handle' we can use to abort the task later.
Ronnie Sahlberg
2011-02-19 17:30:03 +11:00
09446737aa
TaskMgmt: add a enum for the task management functions
Ronnie Sahlberg
2011-02-15 22:03:41 +11:00
9c7ca31482
TaskMgmt: Add handling of tm responses we receive from the target
Ronnie Sahlberg
2011-02-15 21:58:29 +11:00
3dfdebcba7
TaskMgmt : Add an initial function to create a iscsi tm PDU
Ronnie Sahlberg
2011-02-15 21:53:47 +11:00
332ea04e8d
TaskMgmt: Add a functionto set the Reference cmdsn for tm pdus
Ronnie Sahlberg
2011-02-15 21:44:16 +11:00
95db35e592
TaskMgmt: add a function to set the ritt for tm pdus
Ronnie Sahlberg
2011-02-15 21:42:23 +11:00
2c093d86a6
whitespace changes to the list of pdu types
Ronnie Sahlberg
2011-02-15 21:26:26 +11:00
704288169f
Add task management pdu request and response constants to the list of pdu types
Ronnie Sahlberg
2011-02-15 21:24:24 +11:00
f73e42ec26
TaskManagement: Store the ITT and CMDSN in the scsi_task structure These are required for some of the task management functions
Ronnie Sahlberg
2011-02-15 20:57:03 +11:00
b51807e65a
README update
Ronnie Sahlberg
2011-02-13 08:09:08 +11:00
e3af8903ac
README remove strace from example
Ronnie Sahlberg
2011-02-13 08:06:30 +11:00
52b7ae3152
LD_PRELOAD: add dup2 support so we can use it with dd
Ronnie Sahlberg
2011-02-13 07:36:26 +11:00
0c6025b01b
Using two different structures, with the same first element, and casting between them makes compilers complain about aliasing.
Ronnie Sahlberg
2011-02-09 15:51:45 +11:00
7a454aa010
autogen.sh: we should create libiscsi.pc not ctdb.pc
Ronnie Sahlberg
2011-02-07 21:47:26 +11:00
947a1a7796
MAKEFILE: Add a distclean target
Ronnie Sahlberg
2011-02-07 21:46:57 +11:00
35821830d6
LD_ISCSI.SO LD_PRELOAD hack
Ronnie Sahlberg
2011-02-05 21:21:52 +11:00
eba0a2de81
SYNC READ10 : add a sync version for read10
Ronnie Sahlberg
2011-02-05 20:41:02 +11:00
c29b9a2aae
Add a new "iscsi_queue_length()" which will tell us how many commands are in flight at the moment. Aside from commands, we also consider the "has not yet connected completely" as being an i/o.
Ronnie Sahlberg
2011-02-03 19:08:16 +11:00
d22a2aee3c
When initializing a new session, default to set the "random" ISID randomly.
Ronnie Sahlberg
2011-01-27 11:02:16 +11:00
ca1e152f2c
New example file : iscsi-dd can be used to copy the content of one iscsi lun onto a different iscsi lun of the exact same sixe.
Ronnie Sahlberg
2011-01-23 18:35:58 +11:00
ec08fe7a45
Read10/Write10 parameters
Ronnie Sahlberg
2011-01-23 18:34:16 +11:00
7b5ff1095c
Improve help/usage strings for iscsi-ls and iscsi-inq
Ronnie Sahlberg
2011-01-09 10:36:53 +11:00
b2c4bdcd43
iscsi-ls: Destroy the iscsi_url when exiting.
Ronnie Sahlberg
2011-01-09 09:51:26 +11:00
f3f2031a8c
Fix a compiler warning
Ronnie Sahlberg
2011-01-09 09:48:59 +11:00
b9ad4beb41
Replace rindex() with strrchr()
Ronnie Sahlberg
2011-01-09 09:47:39 +11:00
5e11bb17b1
Replace index() with strchr()
Ronnie Sahlberg
2011-01-09 09:46:42 +11:00
f1996d26a6
Check the return from asprintf() and report an error when it fails.
Ronnie Sahlberg
2011-01-09 09:43:33 +11:00
e312aa2ae0
ISID: Add helper functions to set any type of ISID value for the iscsi context.
Ronnie Sahlberg
2011-01-09 09:26:03 +11:00
b5d5370b8c
TYPO, fix typo in iscsi.h
Ronnie Sahlberg
2011-01-09 09:04:13 +11:00
554670820b
README: Add a blurb about HeaderDigest in libiscsi and what is the default
Ronnie Sahlberg
2011-01-09 08:58:32 +11:00
3b6176ad79
README: add a note about ipv6 support and ipv6 syntax
Ronnie Sahlberg
2011-01-09 08:54:58 +11:00
954e55148a
TODO: expand on what we need to do to handle target-originated iscsi-nop.
Ronnie Sahlberg
2011-01-08 16:19:13 +11:00
acd459ad48
TOTO: ipv6 is done
Ronnie Sahlberg
2011-01-08 16:10:59 +11:00
aa916b7802
IPv6 Support. Add ipv6 support to the socket management. IPv6 addresses are specified in [...] format.
Ronnie Sahlberg
2011-01-08 16:09:14 +11:00
7d702357d1
TODO: we need ipv6 at some stage
Ronnie Sahlberg
2011-01-06 20:03:23 +11:00
c877737b36
Add redirect support to TODO
Ronnie Sahlberg
2011-01-06 12:15:16 +11:00
827cf9af05
iscsi-ls --show-luns: We need to remember the username/password used during the initial discovery login so we can use it again when we do the normal logins to do inquiry/readcapacity for --show-luns
Ronnie Sahlberg
2011-01-03 18:16:40 +11:00
6f36a6ca2b
Change HeaderDigest to default to None,CRC32C instead of None This allows our default setting to work with any target configuration.
Ronnie Sahlberg
2011-01-03 15:54:38 +11:00
9ddce8dc24
Replace bzero() with memset()
Ronnie Sahlberg
2011-01-03 15:35:36 +11:00
77f1440b65
iscsi-ls: Use the helper function to parse the Portal URL and add support for CHAP authentication during the discovery login.
Ronnie Sahlberg
2011-01-03 15:28:44 +11:00
7253a667ae
Add a helper function to parse a Portal URL. A Portal URL is of the form iscsi://[<username>[%<password>]@]<host>[:<port>] and is used by command such as iscsi-ls during the discovery login phase.
Ronnie Sahlberg
2011-01-03 15:22:01 +11:00
51662af5ba
Document the iSCSI URL syntax and how to specify username/password
Ronnie Sahlberg
2011-01-03 15:10:15 +11:00
178f9c8751
Only set CHAP username/password if BOTH have been provided. There is no point in setting the username if there is no password and vice versa.
Ronnie Sahlberg
2011-01-03 15:01:38 +11:00
5928575bac
Allow setting the CHAP username/password via environment variables so that the password will not be showing up in log where the application logs the "filename/iscsi url" or in ps aux output.
Ronnie Sahlberg
2011-01-03 14:58:52 +11:00
87072d5622
Dont use gethostbyname2() at all since it is non-portable, use gethostbyname() instead.
Ronnie Sahlberg
2011-01-03 14:48:43 +11:00
71ec54603d
Solaris install fixes, solaris needs to use ginstall, not install and it does not have ldconfig
Ronnie Sahlberg
2011-01-03 11:15:50 +11:00
adfb7326e3
Solaris needs -lsocket and -lnsl and does not support gethostbyname2()
Ronnie Sahlberg
2011-01-03 10:57:35 +11:00
e7c24af75e
Handle ImmediateData=Yes correctly when sending data to the target.
Ronnie Sahlberg
2011-01-02 19:49:45 +11:00
20eaf85dd4
Handle InitialR2T=Yes correctly when sendign data to a target and wait for a R2T before sending the first block of data.
Ronnie Sahlberg
2011-01-02 19:31:49 +11:00
74fadc9337
Add support for R2T PDUs. Update the "send scsi command" fucntion to honour "FirstBurstLength" so that we only send this many bytes as unsolicited data.
Ronnie Sahlberg
2011-01-02 19:23:30 +11:00
502843d64a
Honour MaxRecvDataSegmentLength from the target and split DATAOUT into chunks of this size.
Ronnie Sahlberg
2011-01-02 18:50:49 +11:00
d240e8b5aa
Use an initiator specific and one target specific value for MaxRecvDataSegmentLength
Ronnie Sahlberg
2011-01-02 18:42:36 +11:00
5e5d6c05c0
Add a function to send DATAOUT PDUs.
Ronnie Sahlberg
2011-01-02 17:57:47 +11:00
9a8fca8bea
Add two new helpers iscsi_pdu_set_[datasn|bufferoffset]() These two helpers can be used to set the corresponding fields in a DATAOUT PDU
Ronnie Sahlberg
2011-01-02 17:54:44 +11:00
9cd03ca559
Add a new helper function iscsi_allocate_pdu_with_itt_flags() This function can allocate a new pdu using a specific itt value and specific flags instead of using the defaults of, next iff, no flags set.
Ronnie Sahlberg
2011-01-02 17:49:12 +11:00
1569624fd2
Add a new helper function _set_itt() that can be used to set the itt of a pdu, instead of having to twiddle the bits and bytes manually.
Ronnie Sahlberg
2011-01-02 17:45:55 +11:00
72f9d8fa82
Add a new pdu flag : NO_CALLBACK This flag is used when we dont want the CANCEL callback to be invoked if the context is destroyed.
Ronnie Sahlberg
2011-01-02 17:38:27 +11:00
490a01053a
Add a flags field to the pdu structure Add a new pdu flag : DELETE_WHEN_SENT. When this pdu has been sent to the wire, the pdu will be deleted and not put on the waitpdu list.
Ronnie Sahlberg
2011-01-02 17:34:36 +11:00
1f1e5111d4
Negotiate ImmediateData during login and store the result in iscsi-> We will use this later to decide when we should send unsolicited imemdiate data to the target. Currently we always send unsolicited immediate data but targets configured to not allow immediate data may refuce this and turn an error.
Ronnie Sahlberg
2011-01-02 12:59:41 +11:00