aboutsummaryrefslogtreecommitdiff
path: root/lib/libiscsiutil
Commit message (Collapse)AuthorAgeFilesLines
* libiscsiutil: preserve errno across warning logsKyle Evans2026-04-281-1/+3
| | | | | | | | | Various calls in the implementation can clobber errno; preserve it for the caller since none of these will bubble up pass/fail to simplify some future error handling in ctld. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D56539
* libiscsiutil: Record dependency on libmdDag-Erling Smørgrav2026-02-281-1/+1
| | | | | | | | | MFC after: 3 days Fixes: 6378393308bc ("Add an internal libiscsiutil library.") Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D55596
* Remove redundant PACKAGE for INTERNALLIB librariesLexi Winter2025-08-231-1/+0
| | | | | | | | | These libraries don't install anything, so they shouldn't have a PACKAGE setting. This avoids surprising behaviour in future if e.g. manpages are added to an internal library. Reported by: des Differential Revision: https://reviews.freebsd.org/D51901
* libiscsiutil: Fix header to work with C++John Baldwin2025-04-021-0/+4
| | | | | | Reviewed by: asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D49137
* libiscsiutil: Add log_warnc() and log_errc() functionsJohn Baldwin2025-01-302-0/+26
| | | | | | | | | These are similar to warnc() and errc() in that they take an explicit error code instead of using the value of the errno global. Reviewed by: mav, asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48648
* iscsi: Move valid_iscsi_name to libiscsiutilJohn Baldwin2025-01-242-0/+74
| | | | | | | | While here, use isxdigit(3) instead of a home-rolled version. Reviewed by: mav, asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48593
* lib: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* dirdeps: Update Makefile.depend* files with empty contentsStephen J. Kiernan2023-10-291-0/+14
| | | | | Some Makefile.depend* files were committed with no contents or empty DIRDEPS list, but they should have DIRDEPS with some contents.
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-128-8/+8
| | | | | | | | | 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
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-0/+0
|
* libiscsiutil: Fix a typo in a source code commentGordon Bergling2023-01-111-1/+1
| | | | | | - s/sesion/session/ MFC after: 3 days
* iscsi: per-session timeouts and rapid teardown of session on reconnectRichard Scheffenegger2022-02-251-0/+2
| | | | | | | | | | Add per-Session configurable ping (SCSI NOP) and login timeouts. Remove the torn down, old iSCSI session quickly, when performing a reconnect. Reviewed By: trasz Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D34198
* iscsi: Handle large Text responses.John Baldwin2021-12-293-1/+342
| | | | | | | | | | | | | | | | | | | | | | | | 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
* libiscsiutil: Change keys_load/save to operate on data buffers.John Baldwin2021-12-222-12/+26
| | | | | | | | | | | | 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
* libiscsiutil: Use open_memstream to build the outgoing block of keys.John Baldwin2021-12-221-23/+15
| | | | | | Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D33546
* libiscsiutil: Fix a memory leak with negotiation keys.John Baldwin2021-12-222-15/+17
| | | | | | | | | | | | | | | | | | | | When keys are loaded from a received PDU, a copy of the received keys block is saved in the keys struct and the name and value pointers point into that saved block. Freeing the keys frees this block. However, when keys are added to a keys struct to build a set of keys later sent in a PDU, the keys data block pointer is not used and individual key names and values hold allocated strings. When the keys structure was freed, all of these individual key name and value strings were leaked. Instead, allocate copies of strings for names and values when parsing a set of keys from a received PDU and free all of the individual key name and value strings when deleting a set of keys. Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D33545
* Add an internal libiscsiutil library.John Baldwin2021-12-228-0/+1295
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