iscsi\_iface\_get(3) API Manual iscsi\_iface\_get(3)

# [NAME](#NAME)

iscsi\_iface\_get - Retrieve specified iSCSI interface.

# [SYNOPSIS](#SYNOPSIS)

**int iscsi\_iface\_get** **(struct iscsi\_context \*ctx,** **const char \*iface\_name,** **struct iscsi\_iface \*\*iface);**

# [ARGUMENTS](#ARGUMENTS)

[ctx](#ctx)

Pointer of 'struct iscsi\_context'. If this pointer is NULL, your program will be terminated by assert.

[iface\_name](#iface_name)

String. Name of iSCSI interface. Also the file name of configuration file "/etc/iscsi/iface/&lt;iface\_name&gt;". If this pointer is NULL or empty string, your program will be terminated by assert.

[iface](#iface)

Output pointer of 'struct iscsi\_iface'. Its memory should be freed by **iscsi\_iface\_free**. If this pointer is NULL, your program will be terminated by assert.

# [DESCRIPTION](#DESCRIPTION)

Retrieves specified iSCSI interfaces by reading configuration from "/etc/iscsi/iface/&lt;iface\_name&gt;". To generate iSCSI interface configuration when new card installed, please use **iscsi\_default\_iface\_setup**. Illegal configuration file will be treated as error LIBISCSI\_ERR\_IDBM. Configuration file not found will be treated as error LIBISCSI\_ERR\_INVAL.

# [RETURN](#RETURN)

int. Valid error codes are:

\* LIBISCSI\_OK

\* LIBISCSI\_ERR\_BUG

\* LIBISCSI\_ERR\_NOMEM

\* LIBISCSI\_ERR\_ACCESS

\* LIBISCSI\_ERR\_SYSFS\_LOOKUP

\* LIBISCSI\_ERR\_IDBM

Error number could be converted to string by **iscsi\_strerror**.

iscsi\_iface\_get October 2026

---

Document: iscsi_iface_get(3) from open-iscsi 2.1.13-r4 (Chainguard OS)
Source: https://github.com/open-iscsi/open-iscsi
