Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

libiscsi(3) [netbsd man page]

LIBISCSI(3)						   BSD Library Functions Manual 					       LIBISCSI(3)

NAME
libiscsi -- iSCSI network storage protocol implementation LIBRARY
iSCSI protocol library (libiscsi, -liscsi) SYNOPSIS
#include <iscsi.h> int iscsi_target_set_defaults(iscsi_target_t *target); int iscsi_target_start(iscsi_target_t *target); int iscsi_target_listen(iscsi_target_t *target); int iscsi_target_shutdown(iscsi_target_t *target); void iscsi_target_write_pidfile(const char *filename); int iscsi_target_setvar(iscsi_target_t *target, const char *name, const char *value); char * iscsi_target_getvar(iscsi_target_t *target, const char *name); int iscsi_initiator_set_defaults(iscsi_initiator_t *initiator); int iscsi_initiator_start(iscsi_initiator_t *initiator); int iscsi_initiator_discover(iscsi_initiator_t *initiator, char *x, uint64_t a, int b); int iscsi_initiator_shutdown(iscsi_initiator_t *initiator); int iscsi_initiator_setvar(iscsi_initiator_t *initiator, const char *name, const char *value); char * iscsi_initiator_getvar(iscsi_initiator_t *initiator, const char *name); DESCRIPTION
libiscsi is a library interface to the iSCSI target and initiator. This conforms to IETF RFC 3720. The corresponding command line utilities for libiscsi are iscsi-initiator(8) and iscsi-target(8). In normal operation, a process acting as a target (i.e. presenting storage to the network) will call iscsi_target_set_defaults() and will then set various values using the iscsi_target_setvar() function. The value of a variable can be retrieved at any time using the iscsi_target_getvar() function. When all of the variables have been set, the iscsi_target_start() function is called, and the block storage will be served up by the process. A useful illustration of the use of these functions can be found in the source code to the iscsi-target(8) utility. The libiscsi library also provides an implementation of the client end of the iSCSI subsystem, which is known as the initiator. The process acting as an initiator will first call the iscsi_initiator_set_defaults() function, to set default values for the initiator variables. Once all the values have been set to the user preferences using the iscsi_initiator_setvar() function, then the iscsi_initiator_start() function is called. The libiscsi library can be used to perform iSCSI device discovery by calling the iscsi_initiator_discovery() function. This will return a list of all the iSCSI targets which are serving up block storage according to the variables which have already been set. SEE ALSO
iscsi-initiator(8), iscsi-target(8) HISTORY
The libiscsi library first appeared in NetBSD 4.0. This programmatic interface to the iSCSI subsystem first appeared in NetBSD 6.0. AUTHORS
Alistair Crooks <agc@NetBSD.org>. BSD
February 19, 2011 BSD

Check Out this Related Man Page

TARGETS(5)						      BSD File Formats Manual							TARGETS(5)

NAME
targets -- configuration file for iSCSI targets SYNOPSIS
targets DESCRIPTION
The targets file describes the iSCSI storage which is presented to iSCSI initiators by the iscsi-target(8) service. A description of the iSCSI protocol can be found in Internet Small Computer Systems Interface RFC 3720. Each line in the file (other than comment lines that begin with a '#') specifies an extent, a device (made up of extents or other devices), or a target to present to the initiator. Each definition, an extent, a device, and a target, is specified on a single whitespace delimited line. The extent definition specifies a piece of storage that will be used as storage, and presented to initiators. It is the basic definition for an iSCSI target. Each target must contain at least one extent definition. The first field in the definition is the extent name, which must begin with the word ``extent'' and be followed by a number. The next field is the file or NetBSD device which will be used as persistent storage. The next field is the offset (in bytes) of the start of the extent. This field is usually 0. The fourth field in the definition is the size of the extent. The basic unit is bytes, and the shorthand KB, MB, GB, and TB can be used for kilobytes (1024 bytes), megabytes (1024 kilobytes), gigabytes (1024 megabytes), and terabytes (1024 gigabytes) respectively. It is possible to use the word ``size'' to use the full size of the pre-existing regular file given in the extent name. The device definition specifies a LUN or device, and is made up of extents and other devices. It is possible to create hierarchies of devices using the device definition. The first field in the definition is the device name, which must begin with the word ``device'' and be followed by a number. The next field is the type of resilience that is to be provided by the device. For simple devices, RAID0 suffices. Greater resilience can be gained by using the RAID1 resilience field. Following the resilience field is a list of extents or other devices. Large devices can be created by using multiple RAID0 extents, in which case each extent will be concatenated. Resilient devices can be cre- ated by using multiple RAID1 devices or extents, in which case data will be written to each of the devices or extents in turn. If RAID1 resilience is used, all the extents or sub-devices must be the same size. Please note that RAID1 recovery is not yet supported by the iscsi-target(8) utility. An extent or sub-device may only be used once. The target definition specifies an iSCSI target, which is presented to the iSCSI initiator. Multiple targets can be specified. The first field in the definition is the target name, which must begin with either of the words ``target'' or ``lun'' and be followed by a number. Optionally, if a target is followed by an ``='' sign and some text, the text is taken to be that of the iSCSI Qualified Name of the target. This IQN is used by the initiator to connect to the appropriate target. The next field is a selector for whether the storage should be pre- sented as writable, or merely as read-only storage. The field of ``rw'' denotes read-write storage, whilst ``ro'' denotes read-only storage. The next field is the device or extent name that will be used as persistent storage for this target. The fourth field is a slash-notation netmask which will be used, during the discovery phase, to control the network addresses to which targets will be presented. The magic val- ues ``any'' and ``all'' will expand to be the same as ``0/0''. If an attempt is made to discover a target which is not allowed by the net- mask, a warning will be issued using syslog(3) to make administrators aware of this attempt. The administrator can still use tcp wrapper functionality, as found in hosts_access(5) and hosts.deny(5) to allow or deny discovery attempts from initiators as well as using the inbuilt netmask functionality. FILES
/etc/iscsi/targets the list of exported storage targets SEE ALSO
syslog(3), hosts.deny(5), hosts_access(5), iscsi-target(8) HISTORY
The targets file first appeared in NetBSD 4.0. BSD
December 18, 2007 BSD
Man Page