---
name: "iscsi_iface_get"
section: "3"
platform: "linux"
package: "open-iscsi"
version: "2.1.13-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/iscsi_iface_get"
---

# iscsi\_iface\_get(3)

Retrieve specified iSCSI interface.

## NAME

iscsi\_iface\_get - Retrieve specified iSCSI interface.

## SYNOPSIS

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

## ARGUMENTS

- ctx

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

- iface\_name

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

- 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

Retrieves specified iSCSI interfaces by reading configuration from "/etc/iscsi/iface/\<iface\_name\>". 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

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**.
