Blame libopeniscsiusr/libopeniscsiusr/libopeniscsiusr_common.h

Packit eace71
/*
Packit eace71
 * Copyright (C) 2017 Red Hat, Inc.
Packit eace71
 *
Packit eace71
 * This program is free software: you can redistribute it and/or modify
Packit eace71
 * it under the terms of the GNU General Public License as published by
Packit eace71
 * the Free Software Foundation, either version 3 of the License, or
Packit eace71
 * (at your option) any later version.
Packit eace71
 *
Packit eace71
 * This program is distributed in the hope that it will be useful,
Packit eace71
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit eace71
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit eace71
 * GNU General Public License for more details.
Packit eace71
 *
Packit eace71
 * You should have received a copy of the GNU General Public License
Packit eace71
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit eace71
 *
Packit eace71
 * Author: Gris Ge <fge@redhat.com>
Packit eace71
 */
Packit eace71
Packit eace71
Packit eace71
#ifndef _LIB_OPEN_ISCSI_USR_COMMON_H_
Packit eace71
#define _LIB_OPEN_ISCSI_USR_COMMON_H_
Packit eace71
Packit eace71
#include <errno.h>
Packit eace71
Packit eace71
/* Below error numbers should align with 'open-iscsi/include/iscsi_err.h' */
Packit eace71
#define LIBISCSI_OK			0
Packit eace71
/* ^ No error */
Packit eace71
Packit eace71
#define LIBISCSI_ERR_BUG		1
Packit eace71
/* ^ Bug of library */
Packit eace71
Packit eace71
#define LIBISCSI_ERR_SESS_NOT_FOUND	2
Packit eace71
/* ^ session could not be found */
Packit eace71
Packit eace71
#define LIBISCSI_ERR_NOMEM		3
Packit eace71
/* ^ Could not allocate resource for operation */
Packit eace71
Packit eace71
#define LIBISCSI_ERR_IDBM		6
Packit eace71
/* ^ Error accessing/managing iSCSI DB */
Packit eace71
Packit eace71
#define LIBISCSI_ERR_INVAL		7
Packit eace71
/* ^ Invalid argument */
Packit eace71
Packit eace71
#define LIBISCSI_ERR_TRANS_NOT_FOUND	12
Packit eace71
/* ^ iSCSI transport module not loaded in kernel or iscsid */
Packit eace71
Packit eace71
#define LIBISCSI_ERR_ACCESS		13
Packit eace71
/* ^ Permission denied */
Packit eace71
Packit eace71
#define LIBISCSI_ERR_SYSFS_LOOKUP	22
Packit eace71
/* ^ Could not lookup object in sysfs */
Packit eace71
Packit eace71
/*
Packit eace71
 * Use the syslog severity level as log priority
Packit eace71
 */
Packit eace71
#define LIBISCSI_LOG_PRIORITY_ERROR	3
Packit eace71
#define LIBISCSI_LOG_PRIORITY_WARNING	4
Packit eace71
#define LIBISCSI_LOG_PRIORITY_INFO	6
Packit eace71
#define LIBISCSI_LOG_PRIORITY_DEBUG	7
Packit eace71
Packit eace71
#define LIBISCSI_LOG_PRIORITY_DEFAULT	LIBISCSI_LOG_PRIORITY_WARNING
Packit eace71
Packit eace71
#define __DLL_EXPORT	__attribute__ ((visibility ("default")))
Packit eace71
/* ^ Mark function or struct as external use.
Packit eace71
 *   Check https://gcc.gnu.org/wiki/Visibility for detail
Packit eace71
 */
Packit eace71
#define __DLL_LOCAL	__attribute__ ((visibility ("hidden")))
Packit eace71
/* ^ Mark function or struct as internal use only.
Packit eace71
 *   Check https://gcc.gnu.org/wiki/Visibility for detail
Packit eace71
 */
Packit eace71
Packit eace71
struct __DLL_EXPORT iscsi_context;
Packit eace71
Packit eace71
struct __DLL_EXPORT iscsi_session;
Packit eace71
Packit eace71
struct __DLL_EXPORT iscsi_iface;
Packit eace71
Packit eace71
struct __DLL_EXPORT iscsi_node;
Packit eace71
Packit eace71
#endif /* End of _LIB_OPEN_ISCSI_USR_COMMON_H_ */