slist.h: rename SLIST_ to ISCSI_LIST_ to avoid clash on *BSD

Rename the macros for managing the linked lists from SLIST_* to ISCSI_LIST_*
to avoid a clash on *BSD which already have other macros SLIST_*

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
format string cast ptrdiff on 32bit arch (#747262)

Cast ptrdiff (diff between two pointers) to long to fix printfs.
This fixes FTBFS on 32bit architectures.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
examples/ld_iscsi.c: format string int on 32bit

This patch uses appropriate format string specifiers for uint64_t
types taken from inttypes.h, instead of using %lu, because %lu is
wrong at least on 32bit architecture.

Also, cast size_t expressions to unsigned long, again, because on at least
32bit architectures, size_t is int, not long.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
- test_unmap_simple: was assuming that zero buffer was already cleared, which is not guaranteed and resulted in spurious failures
- writesame10_unmap_until_end, writesame16_unmap, writesame16_unmap_until_end were doing an CU_ASSERT *PER-BYTE* in the verification phase,
which was very CPU-intensive. This change uses memcmp on a whole block which finishes much quicker.
- writesame10 and writesame16 were looking at the datalen, when they wanted to be looking at the number of blocks
Merge pull request #112 from jpocas/ws10_ws16_unmap_fix

- writesame10 and writesame16 were looking at the datalen, when they wan...
Merge pull request #111 from jpocas/upstream

- test_unmap_simple: was assuming that zero buffer was already cleared, ...
tests: use alloca when allocating scratch buffer for writesame

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
tests: remove deprecated test tool iscsi-test

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
socket: do not stop sending for immediate PDUs

Signed-off-by: Peter Lieven <pl@kamp.de>
pdu: introduce ISCSI_PDU_CORK_WHEN_SENT

Signed-off-by: Peter Lieven <pl@kamp.de>
logout: cork socket after logout has been sent

Signed-off-by: Peter Lieven <pl@kamp.de>
socket: queue immediate PDUs in front of outqueue

Signed-off-by: Peter Lieven <pl@kamp.de>
logout: allow additional PDU flags to be passed internally

Signed-off-by: Peter Lieven <pl@kamp.de>
pdu: handle async target requests logout events

Signed-off-by: Peter Lieven <pl@kamp.de>
pdu: catch rejected packets while target waits for logout

after a target has send the async target requests logout event it may
reject each request with a waiting for logout reason. Catch these
rejects if an outstanding request and the logout event overlap.

Signed-off-by: Peter Lieven <pl@kamp.de>
pdu: handle async events 2,3,4

Signed-off-by: Peter Lieven <pl@kamp.de>
examples: additional options to iscsi-dd

this adds progress output, 16 byte CDB support, additional checks and user
settable max_in_flight and blocks_per_io.

Signed-off-by: Peter Lieven <pl@kamp.de>
iscsi-command: do not fail commands while reconnect is pending

Signed-off-by: Peter Lieven <pl@kamp.de>
examples: iscsi-dd add option to ignore errors

Signed-off-by: Peter Lieven <pl@kamp.de>