History log of /freebsd-current/usr.sbin/ctld/discovery.c
Revision Date Author Comments
# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# b4068979 29-Dec-2021 John Baldwin <jhb@FreeBSD.org>

iscsi: Handle large Text responses.

Text requests and responses can span multiple PDUs. In that case, the
sender sets the Continue bit in non-final PDUs and the Final bit in
the last PDU. The receiver responds to non-final PDUs with an empty
text PDU.

To support this, add a more abstract API in libiscsi which accepts and
receives key sets rather than PDUs. These routines internally send or
receive one or more PDUs. Use these new functions to replace the
handling of TextRequest and TextResponse PDUs in discovery sessions in
both ctld and iscsid.

Note that there is not currently a use case for large Text requests
and those are still always sent as a single PDU. However, discovery
sessions can return a text response listing targets that spans
multiple PDUs, so the new API supports sending and receiving multi-PDU
responses.

Reported by: Jithesh Arakkan @ Chelsio
Reviewed by: mav
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D33548


# 25700db3 22-Dec-2021 John Baldwin <jhb@FreeBSD.org>

libiscsiutil: Change keys_load/save to operate on data buffers.

This will be used in future changes to support large text requests
spanning multiple PDUs.

Provide wrapper functions keys_load/save_pdu that operate use a PDU's
data buffer.

Reviewed by: mav
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D33547


# 63783933 22-Dec-2021 John Baldwin <jhb@FreeBSD.org>

Add an internal libiscsiutil library.

Move some of the code duplicated between ctld(8) and iscsid(8) into a
libiscsiutil library.

Sharing the low-level PDU code did require having a
'struct connection' base class with a method table to permit separate
initiator vs target behavior (e.g. in handling proxy PDUs).

Reviewed by: mav, emaste
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D33544


# bce7ee9d 28-Oct-2020 Edward Tomasz Napierala <trasz@FreeBSD.org>

Drop "All rights reserved" from all my stuff. This includes
Foundation copyrights, approved by emaste@. It does not include
files which carry other people's copyrights; if you're one
of those people, feel free to make similar change.

Reviewed by: emaste, imp, gbe (manpages)
Differential Revision: https://reviews.freebsd.org/D26980


# 1de7b4b8 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.


# 78a89597 19-May-2016 Edward Tomasz Napierala <trasz@FreeBSD.org>

Fix error message.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation


# a7c4ad39 14-Apr-2015 Xin LI <delphij@FreeBSD.org>

Eliminate unused headers.


# e9b7390b 03-Mar-2015 Alexander Motin <mav@FreeBSD.org>

Fix handling of queued text and logout requests.

While it may have little sense, text and logout requests can be queued.
If they are, they consume cmdsn, so we should increment our conn_cmdsn.

MFC after: 1 week


# 92847ee1 06-Feb-2015 Alexander Motin <mav@FreeBSD.org>

Add support for multiple portal groups per target.

This change allows multiple "portal-group" options to be specified per
target. Each of them may include new optional auth-group name parameter
to override per-target auth parameters for specific portal group.

Kernel side support was added earlier at r278161.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.


# 2124e3b0 17-Dec-2014 Alexander Motin <mav@FreeBSD.org>

Make sequence numbers checks more strict.

While we don't support MCS, hole in received sequence numbers may mean
only PDU loss. While we don't support lost PDU recovery, terminate the
connection to avoid stuck commands.

While there, improve handling of sequence numbers wrap after 2^32 PDUs.

MFC after: 2 weeks


# 05374883 29-Oct-2014 Edward Tomasz Napierala <trasz@FreeBSD.org>

Add discovery-filter. This makes it possible to restrict which targets
are returned during discovery based on initiator portal, name, and CHAP
credentials.

Reviewed by: mav@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation


# 7c8e3a7f 22-Oct-2014 Edward Tomasz Napierala <trasz@FreeBSD.org>

Clean up (refactor) discovery a little; no functional changes.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation


# b7a65e39 21-Aug-2014 Edward Tomasz Napierala <trasz@FreeBSD.org>

Make the iSCSI stack use __FBSDID() properly.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation


# b8c1bd13 17-Jun-2014 Alexander Motin <mav@FreeBSD.org>

On discovery stage add set of TargetAddress keys to reply, reporting to
the client all the portal groups addresses and ports.

Reviewed by: trasz@
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.


# f7ae5bf8 11-Feb-2014 Edward Tomasz Napierala <trasz@FreeBSD.org>

Rename a variable, no functional changes.

Sponsored by: The FreeBSD Foundation


# 017cbe4a 11-Feb-2014 Edward Tomasz Napierala <trasz@FreeBSD.org>

Empty data segment during Login Phase is rather unlikely, but it's
not, by itself, a protocol error. This fixes interoperability with
OpenBSD initiator.

Sponsored by: The FreeBSD Foundation


# 009ea47e 14-Sep-2013 Edward Tomasz Napierala <trasz@FreeBSD.org>

Bring in the new iSCSI target and initiator.

Reviewed by: ken (parts)
Approved by: re (delphij)
Sponsored by: FreeBSD Foundation