<commit_before>/*
 * Copyright (C) 2011-2014 Red Hat, Inc.
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 *
 * Author: tasleson
 */

#ifndef LIBSTORAGEMGMTERROR_H
#define LIBSTORAGEMGMTERROR_H

#include "libstoragemgmt_common.h"

#ifdef  __cplusplus
extern "C" {
#endif

/** @file libstoragemgmt_error.h */

/**< \enum  lsm_error_level Severity of the error. */
typedef enum  {
    LSM_ERR_LEVEL_NONE = 0,
    LSM_ERR_LEVEL_WARNING = 1,
    LSM_ERR_LEVEL_ERROR = 2
} lsm_error_level;

/**< \enum lsm_error_domain Where the error took place */
typedef enum  {
    LSM_ERR_DOMAIN_FRAME_WORK = 0,      /**< Frame work */
    LSM_ERR_DOMAIN_PLUG_IN = 1          /**< Plug-in */
} lsm_error_domain;

/**< \enum lsm_error_number Possible enumerated return codes from library */
typedef enum {
    LSM_ERR_OK = 0,                     /**< OK */
    LSM_ERR_LIB_BUG = 1,                /**< Library BUG */
    LSM_ERR_PLUGIN_BUG = 2,             /**< Plugin BUG */
    LSM_ERR_STORAGE_SDK_BUG = 3,        /**< Storage SDK BUG */
    LSM_ERR_JOB_STARTED = 7,            /**< Operation has started */
    LSM_ERR_INDEX_BOUNDS = 10,          /**< Out of bounds on string index */
    LSM_ERR_TIMEOUT = 11,               /**< Plug-in is un-responsive */
    LSM_ERR_DAEMON_NOT_RUNNING = 12,    /**< Daemon is not running */

    LSM_ERR_EXISTS_ACCESS_GROUP = 50,   /**< Access group exists */
    LSM_ERR_EXISTS_FS = 51,             /**< FS exists */
    LSM_ERR_EXISTS_INITIATOR = 52,      /**< Initiator exists */
    LSM_ERR_EXISTS_NAME = 53,           /**< Named item already exists */
    LSM_ERR_FS_NOT_EXPORTED = 54,       /**< FS not nfs exported */
    LSM_ERR_INITIATOR_NOT_IN_ACCESS_GROUP = 55, /**< Initiator not in access group */
    LSM_ERR_EXISTS_POOL = 56,           /**< Pool exists */
    LSM_ERR_EXISTS_VOLUME = 57,         /**< Volume exists */

    LSM_ERR_INVALID_ACCESS_GROUP = 100, /**< Invalid access group */
    LSM_ERR_INVALID_ARGUMENT = 101,     /**< Precondition checks failed */
    LSM_ERR_INVALID_CONN = 102,         /**< Connection structure is invalid */
    LSM_ERR_INVALID_ERR = 103,          /**< Invalid error structure */
    LSM_ERR_INVALID_FS = 104,           /**< invalid fs */
    LSM_ERR_INVALID_INIT = 105,         /**< Invalid initiator structure */
    LSM_ERR_INVALID_JOB = 106,          /**< Invalid job number */
    LSM_ERR_INVALID_NAME = 107,         /**< Name specified is invalid */
    LSM_ERR_INVALID_NFS = 108,          /**< invalid nfs export record */
    LSM_ERR_INVALID_PLUGIN = 109,       /**< Invalid plugin structure */
    LSM_ERR_INVALID_POOL = 110,         /**< Invalid pool pointer */
    LSM_ERR_INVALID_SL = 111,           /**< Invalid string list */
    LSM_ERR_INVALID_SS = 112,           /**< Invalid snapshot */
    LSM_ERR_INVALID_URI = 113,          /**< Invalid uri */
    LSM_ERR_INVALID_VAL = 114,          /**< Invalid value */
    LSM_ERR_INVALID_VOL = 115,          /**< Invalid volume pointer */
    LSM_ERR_INVALID_CAPABILITY = 116,   /**< Invalid capability pointer */
    LSM_ERR_INVALID_SYSTEM = 117,       /**< Invalid system pointer */
    LSM_ERR_INVALID_IQN = 118,          /**< Invalid IQN */
    LSM_ERR_INVALID_DISK = 119,         /**< Invalid disk */
    LSM_ERR_INVALID_HASH = 120,         /**< Invalid optional data */
    LSM_ERR_INVALID_BLOCK_RANGE = 121,  /**< Invalud block range */

    LSM_ERR_IS_MAPPED = 125,            /**< Mapping already exists */

    LSM_ERR_NO_CONNECT = 150,           /**< Unable to connect to host */
    LSM_ERR_NO_MAPPING = 151,           /**< There is no access for initiator and volume */
    LSM_ERR_NO_MEMORY = 152,            /**< Memory allocation failure */
    LSM_ERR_NO_SUPPORT = 153,           /**< Feature not supported */

    LSM_ERR_NOT_FOUND_ACCESS_GROUP = 200,   /**< Specified access group not found */
    LSM_ERR_NOT_FOUND_FS = 201,         /**< Specified FS not found */
    LSM_ERR_NOT_FOUND_JOB = 202,        /**< Specified JOB not found */
    LSM_ERR_NOT_FOUND_POOL = 203,       /**< Specified POOL not found */
    LSM_ERR_NOT_FOUND_SS = 204,         /**< Specified snap shot not found */
    LSM_ERR_NOT_FOUND_VOLUME = 205,     /**< Specified volume not found */
    LSM_ERR_NOT_FOUND_NFS_EXPORT = 206, /**< NFS export not found */
    LSM_ERR_NOT_FOUND_INITIATOR = 207,  /**< Initiator not found */
    LSM_ERR_NOT_FOUND_SYSTEM = 208,     /**< System not found */
    LSM_ERR_NOT_FOUND_DISK = 209,       /**< Disk not found */

    LSM_ERR_NOT_IMPLEMENTED = 225,      /**< Feature not implemented */
    LSM_ERR_NOT_LICENSED = 226,         /**< Need license for feature */<commit_msg>C API: Rename LSM_ERR_INVALID_IQN to LSM_ERR_INVALID_INIT<commit_after>/*
 * Copyright (C) 2011-2014 Red Hat, Inc.
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 *
 * Author: tasleson
 */

#ifndef LIBSTORAGEMGMTERROR_H
#define LIBSTORAGEMGMTERROR_H

#include "libstoragemgmt_common.h"

#ifdef  __cplusplus
extern "C" {
#endif

/** @file libstoragemgmt_error.h */

/**< \enum  lsm_error_level Severity of the error. */
typedef enum  {
    LSM_ERR_LEVEL_NONE = 0,
    LSM_ERR_LEVEL_WARNING = 1,
    LSM_ERR_LEVEL_ERROR = 2
} lsm_error_level;

/**< \enum lsm_error_domain Where the error took place */
typedef enum  {
    LSM_ERR_DOMAIN_FRAME_WORK = 0,      /**< Frame work */
    LSM_ERR_DOMAIN_PLUG_IN = 1          /**< Plug-in */
} lsm_error_domain;

/**< \enum lsm_error_number Possible enumerated return codes from library */
typedef enum {
    LSM_ERR_OK = 0,                     /**< OK */
    LSM_ERR_LIB_BUG = 1,                /**< Library BUG */
    LSM_ERR_PLUGIN_BUG = 2,             /**< Plugin BUG */
    LSM_ERR_STORAGE_SDK_BUG = 3,        /**< Storage SDK BUG */
    LSM_ERR_JOB_STARTED = 7,            /**< Operation has started */
    LSM_ERR_INDEX_BOUNDS = 10,          /**< Out of bounds on string index */
    LSM_ERR_TIMEOUT = 11,               /**< Plug-in is un-responsive */
    LSM_ERR_DAEMON_NOT_RUNNING = 12,    /**< Daemon is not running */

    LSM_ERR_EXISTS_ACCESS_GROUP = 50,   /**< Access group exists */
    LSM_ERR_EXISTS_FS = 51,             /**< FS exists */
    LSM_ERR_EXISTS_INITIATOR = 52,      /**< Initiator exists */
    LSM_ERR_EXISTS_NAME = 53,           /**< Named item already exists */
    LSM_ERR_FS_NOT_EXPORTED = 54,       /**< FS not nfs exported */
    LSM_ERR_INITIATOR_NOT_IN_ACCESS_GROUP = 55, /**< Initiator not in access group */
    LSM_ERR_EXISTS_POOL = 56,           /**< Pool exists */
    LSM_ERR_EXISTS_VOLUME = 57,         /**< Volume exists */

    LSM_ERR_INVALID_ACCESS_GROUP = 100, /**< Invalid access group */
    LSM_ERR_INVALID_ARGUMENT = 101,     /**< Precondition checks failed */
    LSM_ERR_INVALID_CONN = 102,         /**< Connection structure is invalid */
    LSM_ERR_INVALID_ERR = 103,          /**< Invalid error structure */
    LSM_ERR_INVALID_FS = 104,           /**< invalid fs */
    LSM_ERR_INVALID_JOB = 106,          /**< Invalid job number */
    LSM_ERR_INVALID_NAME = 107,         /**< Name specified is invalid */
    LSM_ERR_INVALID_NFS = 108,          /**< invalid nfs export record */
    LSM_ERR_INVALID_PLUGIN = 109,       /**< Invalid plugin structure */
    LSM_ERR_INVALID_POOL = 110,         /**< Invalid pool pointer */
    LSM_ERR_INVALID_SL = 111,           /**< Invalid string list */
    LSM_ERR_INVALID_SS = 112,           /**< Invalid snapshot */
    LSM_ERR_INVALID_URI = 113,          /**< Invalid uri */
    LSM_ERR_INVALID_VAL = 114,          /**< Invalid value */
    LSM_ERR_INVALID_VOL = 115,          /**< Invalid volume pointer */
    LSM_ERR_INVALID_CAPABILITY = 116,   /**< Invalid capability pointer */
    LSM_ERR_INVALID_SYSTEM = 117,       /**< Invalid system pointer */
    LSM_ERR_INVALID_INIT = 118,         /**< Invalid Initiator ID */
    LSM_ERR_INVALID_DISK = 119,         /**< Invalid disk */
    LSM_ERR_INVALID_HASH = 120,         /**< Invalid optional data */
    LSM_ERR_INVALID_BLOCK_RANGE = 121,  /**< Invalud block range */

    LSM_ERR_IS_MAPPED = 125,            /**< Mapping already exists */

    LSM_ERR_NO_CONNECT = 150,           /**< Unable to connect to host */
    LSM_ERR_NO_MAPPING = 151,           /**< There is no access for initiator and volume */
    LSM_ERR_NO_MEMORY = 152,            /**< Memory allocation failure */
    LSM_ERR_NO_SUPPORT = 153,           /**< Feature not supported */

    LSM_ERR_NOT_FOUND_ACCESS_GROUP = 200,   /**< Specified access group not found */
    LSM_ERR_NOT_FOUND_FS = 201,         /**< Specified FS not found */
    LSM_ERR_NOT_FOUND_JOB = 202,        /**< Specified JOB not found */
    LSM_ERR_NOT_FOUND_POOL = 203,       /**< Specified POOL not found */
    LSM_ERR_NOT_FOUND_SS = 204,         /**< Specified snap shot not found */
    LSM_ERR_NOT_FOUND_VOLUME = 205,     /**< Specified volume not found */
    LSM_ERR_NOT_FOUND_NFS_EXPORT = 206, /**< NFS export not found */
    LSM_ERR_NOT_FOUND_INITIATOR = 207,  /**< Initiator not found */
    LSM_ERR_NOT_FOUND_SYSTEM = 208,     /**< System not found */
    LSM_ERR_NOT_FOUND_DISK = 209,       /**< Disk not found */

    LSM_ERR_NOT_IMPLEMENTED = 225,      /**< Feature not implemented */
    LSM_ERR_NOT_LICENSED = 226,         /**< Need license for feature */
{'fraction_non_alphanumeric': 0.10463251250117936, 'fraction_numerical': 0.03179545240116992, 'mean_word_length': 2.512259774685222, 'pattern_counts': {'":': 0, '<': 122, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5392048', 'n_tokens_mistral': 3789, 'n_tokens_neox': 3385, 'n_words': 933}