Home | History | Annotate | Download | only in iscsitgtd
      1 /*
      2  * CDDL HEADER START
      3  *
      4  * The contents of this file are subject to the terms of the
      5  * Common Development and Distribution License (the "License").
      6  * You may not use this file except in compliance with the License.
      7  *
      8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9  * or http://www.opensolaris.org/os/licensing.
     10  * See the License for the specific language governing permissions
     11  * and limitations under the License.
     12  *
     13  * When distributing Covered Code, include this CDDL HEADER in each
     14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15  * If applicable, add the following below this CDDL HEADER, with the
     16  * fields enclosed by brackets "[]" replaced with your own identifying
     17  * information: Portions Copyright [yyyy] [name of copyright owner]
     18  *
     19  * CDDL HEADER END
     20  */
     21 
     22 /*
     23  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
     24  * Use is subject to license terms.
     25  */
     26 
     27 #ifndef _TARGET_ERRCODE_H
     28 #define	_TARGET_ERRCODE_H
     29 
     30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
     31 
     32 /*
     33  * Block comment which describes the contents of this file.
     34  */
     35 
     36 #ifdef __cplusplus
     37 extern "C" {
     38 #endif
     39 
     40 typedef enum {
     41 	ERR_SUCCESS = 1000,
     42 	ERR_NULL_XML_MESSAGE,
     43 	ERR_SYNTAX_EMPTY,
     44 	ERR_SYNTAX_MISSING_ALL,
     45 	ERR_SYNTAX_MISSING_BACKING_STORE,
     46 	ERR_SYNTAX_MISSING_INAME,
     47 	ERR_SYNTAX_MISSING_IPADDR,
     48 	ERR_SYNTAX_MISSING_NAME,
     49 	ERR_SYNTAX_MISSING_OBJECT,
     50 	ERR_SYNTAX_MISSING_OPERAND,
     51 	ERR_SYNTAX_MISSING_SIZE,
     52 	ERR_SYNTAX_MISSING_TYPE,
     53 	ERR_SYNTAX_EMPTY_ACL,
     54 	ERR_SYNTAX_EMPTY_ALIAS,
     55 	ERR_SYNTAX_EMPTY_CHAPNAME,
     56 	ERR_SYNTAX_EMPTY_CHAPSECRET,
     57 	ERR_SYNTAX_EMPTY_IPADDR,
     58 	ERR_SYNTAX_EMPTY_MAXRECV,
     59 	ERR_SYNTAX_EMPTY_TPGT,
     60 	ERR_SYNTAX_INVALID_NAME,
     61 	ERR_INVALID_COMMAND,
     62 	ERR_INVALID_OBJECT,
     63 	ERR_INVALID_IP,
     64 	ERR_INVALID_BASEDIR,
     65 	ERR_INVALID_TPGT,
     66 	ERR_INVALID_MAXRECV,
     67 	ERR_INVALID_RADSRV,
     68 	ERR_INVALID_SIZE,
     69 	ERR_INIT_EXISTS,
     70 	ERR_NAME_TOO_LONG,
     71 	ERR_LUN_EXISTS,
     72 	ERR_TPGT_EXISTS,
     73 	ERR_ACL_NOT_FOUND,
     74 	ERR_INIT_NOT_FOUND,
     75 	ERR_TARG_NOT_FOUND,
     76 	ERR_LUN_NOT_FOUND,
     77 	ERR_LUN_INVALID_RANGE,
     78 	ERR_TPGT_NOT_FOUND,
     79 	ERR_ACCESS_RAW_DEVICE_FAILED,
     80 	ERR_CREATE_METADATA_FAILED,
     81 	ERR_CREATE_SYMLINK_FAILED,
     82 	ERR_CREATE_NAME_TOO_LONG,
     83 	ERR_DISK_BACKING_MUST_BE_REGULAR_FILE,
     84 	ERR_DISK_BACKING_NOT_VALID_RAW,
     85 	ERR_DISK_BACKING_SIZE_OR_FILE,
     86 	ERR_STAT_BACKING_FAILED,
     87 	ERR_RAW_PART_NOT_CAP,
     88 	ERR_CREATE_TARGET_DIR_FAILED,
     89 	ERR_ENCODE_GUID_FAILED,
     90 	ERR_INIT_XML_READER_FAILED,
     91 	ERR_INVALID_XML_REQUEST,
     92 	ERR_OPEN_PARAM_FILE_FAILED,
     93 	ERR_UPDATE_MAINCFG_FAILED,
     94 	ERR_UPDATE_TARGCFG_FAILED,
     95 	ERR_VALID_TARG_EXIST,
     96 	ERR_TARGCFG_MISSING_INAME,
     97 	ERR_NO_MATCH,
     98 	ERR_NO_MEM,
     99 	ERR_LUN_ZERO_NOT_LAST,
    100 	ERR_LUN_ZERO_NOT_FIRST,
    101 	ERR_SIZE_MOD_BLOCK,
    102 	ERR_CANT_SHRINK_LU,
    103 	ERR_RESIZE_WRONG_TYPE,
    104 	ERR_RESIZE_WRONG_DTYPE,
    105 	ERR_LUN_NOT_GROWN,
    106 	ERR_FILE_TOO_BIG,
    107 	ERR_FAILED_TO_CREATE_LU,
    108 	ERR_TAPE_NOT_SUPPORTED_IN_32BIT,
    109 	ERR_INTERNAL_ERROR,
    110 	ERR_BAD_CREDS,
    111 	ERR_NO_PERMISSION,
    112 	ERR_INVALID_ISNS_SRV,
    113 	ERR_ISNS_ERROR,
    114 	ERR_TPGT_NO_IPADDR,
    115 	ERR_TPGT_IN_USE,
    116 	ERR_ZFS_ISCSISHARE_OFF
    117 } err_code_t;
    118 
    119 char *
    120 errcode_to_str(err_code_t err_code);
    121 
    122 #ifdef __cplusplus
    123 }
    124 #endif
    125 
    126 #endif /* _TARGET_ERRCODE_H */
    127