Commit Graph

10 Commits

Author SHA1 Message Date
Ronnie Sahlberg
a3328a85ef Negotiation of MaxBurstLength, FirstBurstLength, MaxRecvDataSegmentLength
Add these settings to the iscsi context structure and initialize them to
sane valued.
When sending login commands to the target, use these values instead
of hardcoded values.
Parse when the target sends a login reply back to us and update these variables
if the target asks us to.

This allows us to detect when our defaults are too big for the target
and adjust the settings we use so we match the target.

Some targets have a very small accepted default for some settings.
During login, we will initially send these keys with our dafult values.
These targets will then respond back by refusing to transition to the next
login phase, and by telling us back what the maximum of these values should be.
In this case we have to try the login again but use the smaller values we got
from the target.
Othervise, if we try again, ignoring the value from the target, and just repeat
using our defaults the target will abort the login with a "initiator error".
2011-01-01 09:51:16 +11:00
Ronnie Sahlberg
46199d2f59 Improve the parsing of iscsi URLs and validate the input.
Generate better error messages when a badly formed URL is given
and an error string that points to the field there is a problem with.
2010-12-31 09:44:14 +11:00
Ronnie Sahlberg
240e250b11 USERNAME / PASSWORD
When failing iscsi-ls due to a missing url, print the url syntax
in the error message before aborting
2010-12-25 12:04:29 +11:00
Ronnie Sahlberg
60718652a4 USERNAME PASSWORD
When generating an error after failing to parse a iscsi url
add username/password to the url syntax that is printed in the error message
2010-12-25 12:00:09 +11:00
Ronnie Sahlberg
40abe849b0 CHAP
Add unidirectional chap support so we can authenticate to the target.

Make the login phase more "intelligent" so we can iterate over login
pdus until we have reached full feature phase

Add a new helper functions to parse a iscsi url and break it down
into elements in a structure

Update iscsi-inq to allow CHAP authentication
2010-12-22 22:23:55 +11:00
Ronnie Sahlberg
cf0ddbd0d9 URL PARSER
Add a function to parse a common iscsi://... URL so we dont have to re
implement the same code in every application
2010-12-22 18:40:46 +11:00
Ronnie Sahlberg
1c024d6bc4 Input processing:
Input processing used to keep all data in one single input buffer, which
makes it hard to handle nested events as well as reading directly from the
socket into the application buffer without an extra copy.

Create a new iscsi_in_pdu structure where we store the header, and any data
for the recevied pdu and store them in a proper input queue.

Change the signature for all processing functions to tahe a iscsi_in_pdu
structure for the received pdu instead of just a pointer to a buffer.
2010-12-11 15:15:51 +11:00
Ronnie Sahlberg
8a6665a092 Licence
Change to LGPL 2.1+ to be compatible with kvm/qemu
2010-12-11 11:47:28 +11:00
Ronnie Sahlberg
709d85c4da Add a COPYING file and updat ehte LGPL boilerplate 2010-12-05 11:11:37 +11:00
Ronnie Sahlberg
098bc5a9a7 Initial import of libiscsi 2010-12-05 08:24:57 +11:00