|
Packit Service |
646995 |
/*
|
|
Packit Service |
646995 |
* Copyright (C) 2017 Red Hat, Inc.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* This program is free software: you can redistribute it and/or modify
|
|
Packit Service |
646995 |
* it under the terms of the GNU General Public License as published by
|
|
Packit Service |
646995 |
* the Free Software Foundation, either version 3 of the License, or
|
|
Packit Service |
646995 |
* (at your option) any later version.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* This program is distributed in the hope that it will be useful,
|
|
Packit Service |
646995 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
646995 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
646995 |
* GNU General Public License for more details.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* You should have received a copy of the GNU General Public License
|
|
Packit Service |
646995 |
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Author: Gris Ge <fge@redhat.com>
|
|
Packit Service |
646995 |
*/
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
#ifndef _LIB_OPEN_ISCSI_USR_IFACE_H_
|
|
Packit Service |
646995 |
#define _LIB_OPEN_ISCSI_USR_IFACE_H_
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
#include <stdint.h>
|
|
Packit Service |
646995 |
#include <stdbool.h>
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
#include "libopeniscsiusr_common.h"
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
/**
|
|
Packit Service |
646995 |
* iscsi_iface_ipaddress_get() - Retrieve IP address of specified
|
|
Packit Service |
646995 |
* iSCSI interface
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Retrieve the IP address of specified iSCSI interface.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* @iface:
|
|
Packit Service |
646995 |
* Pointer of 'struct iscsi_iface'.
|
|
Packit Service |
646995 |
* If this pointer is NULL, your program will be terminated by assert.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Return:
|
|
Packit Service |
646995 |
* const char *.
|
|
Packit Service |
646995 |
* No need to free this memory, the resources will get freed by
|
|
Packit Service |
646995 |
* iscsi_session_free() or iscsi_sessions_free().
|
|
Packit Service |
646995 |
*/
|
|
Packit Service |
646995 |
__DLL_EXPORT const char *iscsi_iface_ipaddress_get(struct iscsi_iface *iface);
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
/**
|
|
Packit Service |
646995 |
* iscsi_iface_hwaddress_get() - Retrieve hardware address of specified
|
|
Packit Service |
646995 |
* iSCSI interface
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Retrieve the hardware address of specified iSCSI interface.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* @iface:
|
|
Packit Service |
646995 |
* Pointer of 'struct iscsi_iface'.
|
|
Packit Service |
646995 |
* If this pointer is NULL, your program will be terminated by assert.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Return:
|
|
Packit Service |
646995 |
* const char *.
|
|
Packit Service |
646995 |
* No need to free this memory, the resources will get freed by
|
|
Packit Service |
646995 |
* iscsi_session_free() or iscsi_sessions_free().
|
|
Packit Service |
646995 |
*/
|
|
Packit Service |
646995 |
__DLL_EXPORT const char *iscsi_iface_hwaddress_get(struct iscsi_iface *iface);
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
/**
|
|
Packit Service |
646995 |
* iscsi_iface_netdev_get() - Retrieve network device name of specified
|
|
Packit Service |
646995 |
* iSCSI interface
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Retrieve the network device name of specified iSCSI interface.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* @iface:
|
|
Packit Service |
646995 |
* Pointer of 'struct iscsi_iface'.
|
|
Packit Service |
646995 |
* If this pointer is NULL, your program will be terminated by assert.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Return:
|
|
Packit Service |
646995 |
* const char *.
|
|
Packit Service |
646995 |
* No need to free this memory, the resources will get freed by
|
|
Packit Service |
646995 |
* iscsi_session_free() or iscsi_sessions_free().
|
|
Packit Service |
646995 |
*/
|
|
Packit Service |
646995 |
__DLL_EXPORT const char *iscsi_iface_netdev_get(struct iscsi_iface *iface);
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
/**
|
|
Packit Service |
646995 |
* iscsi_iface_transport_name_get() - Retrieve transport name of specified
|
|
Packit Service |
646995 |
* iSCSI interface
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Retrieve the transport name of specified iSCSI interface.
|
|
Packit Service |
646995 |
* Examples:
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* * "tcp" (Software iSCSI over TCP/IP)
|
|
Packit Service |
646995 |
* * "iser" (Software iSCSI over infinniband
|
|
Packit Service |
646995 |
* * "qla4xxx" (Qlogic QLA4XXX HBAs)
|
|
Packit Service |
646995 |
* * "bnx2i" (Broadcom bnx iSCSI HBAs);
|
|
Packit Service |
646995 |
* * "cxgb3i" (Chelsio cxgb S3 iSCSI HBAs);
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* @iface:
|
|
Packit Service |
646995 |
* Pointer of 'struct iscsi_iface'.
|
|
Packit Service |
646995 |
* If this pointer is NULL, your program will be terminated by assert.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Return:
|
|
Packit Service |
646995 |
* const char *.
|
|
Packit Service |
646995 |
* No need to free this memory, the resources will get freed by
|
|
Packit Service |
646995 |
* iscsi_session_free() or iscsi_sessions_free().
|
|
Packit Service |
646995 |
*/
|
|
Packit Service |
646995 |
__DLL_EXPORT const char *iscsi_iface_transport_name_get
|
|
Packit Service |
646995 |
(struct iscsi_iface *iface);
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
/**
|
|
Packit Service |
646995 |
* iscsi_iface_iname_get() - Retrieve initiator name of specified
|
|
Packit Service |
646995 |
* iSCSI interface
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Retrieve the initiator name of specified iSCSI interface.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* @iface:
|
|
Packit Service |
646995 |
* Pointer of 'struct iscsi_iface'.
|
|
Packit Service |
646995 |
* If this pointer is NULL, your program will be terminated by assert.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Return:
|
|
Packit Service |
646995 |
* const char *.
|
|
Packit Service |
646995 |
* No need to free this memory, the resources will get freed by
|
|
Packit Service |
646995 |
* iscsi_session_free() or iscsi_sessions_free().
|
|
Packit Service |
646995 |
*/
|
|
Packit Service |
646995 |
__DLL_EXPORT const char *iscsi_iface_iname_get(struct iscsi_iface *iface);
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
/**
|
|
Packit Service |
646995 |
* iscsi_iface_port_state_get() - Retrieve network port state of specified
|
|
Packit Service |
646995 |
* iSCSI interface
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Retrieve the network port state of specified iSCSI interface.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* @iface:
|
|
Packit Service |
646995 |
* Pointer of 'struct iscsi_iface'.
|
|
Packit Service |
646995 |
* If this pointer is NULL, your program will be terminated by assert.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Return:
|
|
Packit Service |
646995 |
* const char *. Possible values are :
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* * "LINK_UP"
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* * "LINK_DOWN"
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* * "unknown"
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* No need to free this memory, the resources will get freed by
|
|
Packit Service |
646995 |
* iscsi_session_free() or iscsi_sessions_free().
|
|
Packit Service |
646995 |
*/
|
|
Packit Service |
646995 |
__DLL_EXPORT const char *iscsi_iface_port_state_get(struct iscsi_iface *iface);
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
/**
|
|
Packit Service |
646995 |
* iscsi_iface_port_speed_get() - Retrieve network port speed of specified
|
|
Packit Service |
646995 |
* iSCSI interface
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Retrieve the network port speed of specified iSCSI interface.
|
|
Packit Service |
646995 |
* Returned string format is '[0-9]+ [MGT]bps', example: '10 Mbps' or '10 Gbps'.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* @iface:
|
|
Packit Service |
646995 |
* Pointer of 'struct iscsi_iface'.
|
|
Packit Service |
646995 |
* If this pointer is NULL, your program will be terminated by assert.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Return:
|
|
Packit Service |
646995 |
* const char *. Set to "unknown" if unknown.
|
|
Packit Service |
646995 |
* No need to free this memory, the resources will get freed by
|
|
Packit Service |
646995 |
* iscsi_session_free() or iscsi_sessions_free().
|
|
Packit Service |
646995 |
*/
|
|
Packit Service |
646995 |
__DLL_EXPORT const char *iscsi_iface_port_speed_get(struct iscsi_iface *iface);
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
/**
|
|
Packit Service |
646995 |
* iscsi_iface_port_speed_get() - Retrieve name of specified iSCSI interface
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Retrieve the name of specified iSCSI interface.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* @iface:
|
|
Packit Service |
646995 |
* Pointer of 'struct iscsi_iface'.
|
|
Packit Service |
646995 |
* If this pointer is NULL, your program will be terminated by assert.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Return:
|
|
Packit Service |
646995 |
* const char *.
|
|
Packit Service |
646995 |
* No need to free this memory, the resources will get freed by
|
|
Packit Service |
646995 |
* iscsi_session_free() or iscsi_sessions_free().
|
|
Packit Service |
646995 |
*/
|
|
Packit Service |
646995 |
__DLL_EXPORT const char *iscsi_iface_name_get(struct iscsi_iface *iface);
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
/**
|
|
Packit Service |
646995 |
* iscsi_iface_dump_config() - Dump all configurations of specified iSCSI
|
|
Packit Service |
646995 |
* interface.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Dump all configurations of specified iSCSI interface. Will skip empty
|
|
Packit Service |
646995 |
* configuration so that output string could be saved directly to
|
|
Packit Service |
f80f6b |
* /etc/iscsi/ifaces/<iface_name> file.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* @iface:
|
|
Packit Service |
646995 |
* Pointer of 'struct iscsi_iface'.
|
|
Packit Service |
646995 |
* If this pointer is NULL, your program will be terminated by assert.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Return:
|
|
Packit Service |
646995 |
* const char *.
|
|
Packit Service |
646995 |
* Need to free this memory by free().
|
|
Packit Service |
646995 |
*/
|
|
Packit Service |
646995 |
__DLL_EXPORT const char *iscsi_iface_dump_config(struct iscsi_iface *iface);
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
/**
|
|
Packit Service |
646995 |
* iscsi_iface_dump_config() - Print all configurations of specified iSCSI
|
|
Packit Service |
646995 |
* interface to STDOUT.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Print all configurations of specified iSCSI interface.
|
|
Packit Service |
646995 |
* For empty configuration, it will be shown as "name = <empty>".
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* @iface:
|
|
Packit Service |
646995 |
* Pointer of 'struct iscsi_iface'.
|
|
Packit Service |
646995 |
* If this pointer is NULL, your program will be terminated by assert.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Return:
|
|
Packit Service |
646995 |
* void
|
|
Packit Service |
646995 |
*/
|
|
Packit Service |
646995 |
__DLL_EXPORT void iscsi_iface_print_config(struct iscsi_iface *iface);
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
/**
|
|
Packit Service |
646995 |
* iscsi_is_default_iface() - Whether specified iSCSI interface is default
|
|
Packit Service |
646995 |
* interface.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Check whether specified iSCSI interface is one of the default interfaces.
|
|
Packit Service |
646995 |
* Currently, default interfaces are :
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* * Interface 'default' using 'iscsi_tcp' kernel module.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* * Interface 'iser' is using 'ib_iser' kernel module.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* @iface:
|
|
Packit Service |
646995 |
* Pointer of 'struct iscsi_iface'.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* Return:
|
|
Packit Service |
646995 |
* bool.
|
|
Packit Service |
646995 |
*/
|
|
Packit Service |
646995 |
__DLL_EXPORT bool iscsi_is_default_iface(struct iscsi_iface *iface);
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
#endif /* End of _LIB_OPEN_ISCSI_USR_IFACE_H_ */
|