Main Page | Class List | Directories | File List | Class Members | File Members

ipmi_err.h

Go to the documentation of this file.
00001 /*
00002  * ipmi_err.h
00003  *
00004  * MontaVista IPMI interface, error values.
00005  *
00006  * Author: MontaVista Software, Inc.
00007  *         Corey Minyard <minyard@mvista.com>
00008  *         source@mvista.com
00009  *
00010  * Copyright 2002,2003,2004,2005 MontaVista Software Inc.
00011  *
00012  * This software is available to you under a choice of one of two
00013  * licenses.  You may choose to be licensed under the terms of the GNU
00014  * Lesser General Public License (GPL) Version 2 or the modified BSD
00015  * license below.  The following disclamer applies to both licenses:
00016  *
00017  *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
00018  *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00019  *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00020  *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00021  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00022  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00023  *  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00024  *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
00025  *  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00026  *  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027  *
00028  * GNU Lesser General Public Licence
00029  *
00030  *  This program is free software; you can redistribute it and/or
00031  *  modify it under the terms of the GNU Lesser General Public License
00032  *  as published by the Free Software Foundation; either version 2 of
00033  *  the License, or (at your option) any later version.
00034  *
00035  *  You should have received a copy of the GNU Lesser General Public
00036  *  License along with this program; if not, write to the Free
00037  *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00038  *
00039  * Modified BSD Licence
00040  *
00041  * Redistribution and use in source and binary forms, with or without
00042  * modification, are permitted provided that the following conditions
00043  * are met:
00044  *
00045  *   1. Redistributions of source code must retain the above copyright
00046  *      notice, this list of conditions and the following disclaimer.
00047  *   2. Redistributions in binary form must reproduce the above
00048  *      copyright notice, this list of conditions and the following
00049  *      disclaimer in the documentation and/or other materials provided
00050  *      with the distribution.
00051  *   3. The name of the author may not be used to endorse or promote
00052  *      products derived from this software without specific prior
00053  *      written permission.
00054  */
00055 
00056 #ifndef _IPMI_ERR_H
00057 #define _IPMI_ERR_H
00058 
00059 /*
00060  * Error values
00061  *
00062  * Return errors or reported errors can be due to OS problems or to 
00063  * reported IPMI errors for messages this code handled.  These macros
00064  * differentiate these.  Note that this is NOT for handling the first
00065  * byte of a response (the completion code) on a message you handle, it
00066  * will simply be a byte of information.
00067  */
00068 #define IPMI_OS_ERR_TOP         0x00000000
00069 #define IPMI_IPMI_ERR_TOP       0x01000000
00070 #define IPMI_RMCPP_ERR_TOP      0x02000000
00071 #define IPMI_SOL_ERR_TOP        0x03000000
00072 #define IPMI_IS_OS_ERR(E)       (((E) & 0xffffff00) == IPMI_OS_ERR_TOP)
00073 #define IPMI_GET_OS_ERR(E)      ((E) & 0xff)
00074 #define IPMI_OS_ERR_VAL(v)      ((v) | IPMI_OS_ERR_TOP)
00075 #define IPMI_IS_IPMI_ERR(E)     (((E) & 0xffffff00) == IPMI_IPMI_ERR_TOP)
00076 #define IPMI_GET_IPMI_ERR(E)    ((E) & 0xff)
00077 #define IPMI_IPMI_ERR_VAL(v)    ((v) | IPMI_IPMI_ERR_TOP)
00078 #define IPMI_IS_RMCPP_ERR(E)    (((E) & 0xffffff00) == IPMI_RMCPP_ERR_TOP)
00079 #define IPMI_GET_RMCPP_ERR(E)   ((E) & 0xff)
00080 #define IPMI_RMCPP_ERR_VAL(v)   ((v) | IPMI_RMCPP_ERR_TOP)
00081 #define IPMI_IS_SOL_ERR(E)      (((E) & 0xffffff00) == IPMI_SOL_ERR_TOP)
00082 #define IPMI_GET_SOL_ERR(E)     ((E) & 0xff)
00083 #define IPMI_SOL_ERR_VAL(v)     ((v) | IPMI_SOL_ERR_TOP)
00084 
00085 /* The following local system completion codes are defined to be
00086  * returned by OpenIPMI:
00087  *
00088  * EBADF
00089  * EINVAL
00090  * E2BIG
00091  * ENOMEM
00092  * ENOENT
00093  * ECANCELED
00094  * ENOSYS
00095  * EEXIST
00096  * EAGAIN
00097  * EPERM
00098  */
00099 
00100 /*
00101  * Completion codes for IPMI.
00102  */
00103 #define IPMI_NODE_BUSY_CC                       0xC0
00104 #define IPMI_INVALID_CMD_CC                     0xC1
00105 #define IPMI_COMMAND_INVALID_FOR_LUN_CC         0xC2
00106 #define IPMI_TIMEOUT_CC                         0xC3
00107 #define IPMI_OUT_OF_SPACE_CC                    0xC4
00108 #define IPMI_INVALID_RESERVATION_CC             0xC5
00109 #define IPMI_REQUEST_DATA_TRUNCATED_CC          0xC6
00110 #define IPMI_REQUEST_DATA_LENGTH_INVALID_CC     0xC7
00111 #define IPMI_REQUESTED_DATA_LENGTH_EXCEEDED_CC  0xC8
00112 #define IPMI_PARAMETER_OUT_OF_RANGE_CC          0xC9
00113 #define IPMI_CANNOT_RETURN_REQ_LENGTH_CC        0xCA
00114 #define IPMI_NOT_PRESENT_CC                     0xCB
00115 #define IPMI_INVALID_DATA_FIELD_CC              0xCC
00116 #define IPMI_COMMAND_ILLEGAL_FOR_SENSOR_CC      0xCD
00117 #define IPMI_COULD_NOT_PROVIDE_RESPONSE_CC      0xCE
00118 #define IPMI_CANNOT_EXEC_DUPLICATE_REQUEST_CC   0xCF
00119 #define IPMI_REPOSITORY_IN_UPDATE_MODE_CC       0xD0
00120 #define IPMI_DEVICE_IN_FIRMWARE_UPDATE_CC       0xD1
00121 #define IPMI_BMC_INIT_IN_PROGRESS_CC            0xD2
00122 #define IPMI_DESTINATION_UNAVAILABLE_CC         0xD3
00123 #define IPMI_INSUFFICIENT_PRIVILEGE_CC          0xD4
00124 #define IPMI_NOT_SUPPORTED_IN_PRESENT_STATE_CC  0xD5
00125 #define IPMI_UNKNOWN_ERR_CC                     0xff
00126 
00127 /* Error codes from RMCP+ */
00128 #define IPMI_RMCPP_INSUFFICIENT_RESOURCES_FOR_SESSION   0x01
00129 #define IPMI_RMCPP_INVALID_SESSION_ID                   0x02
00130 #define IPMI_RMCPP_INVALID_PAYLOAD_TYPE                 0x03
00131 #define IPMI_RMCPP_INVALID_AUTHENTICATION_ALGORITHM     0x04
00132 #define IPMI_RMCPP_INVALID_INTEGRITY_ALGORITHM          0x05
00133 #define IPMI_RMCPP_NO_MATCHING_AUTHENTICATION_PAYLOAD   0x06
00134 #define IPMI_RMCPP_NO_MATCHING_INTEGRITY_PAYLOAD        0x07
00135 #define IPMI_RMCPP_INACTIVE_SESSION_ID                  0x08
00136 #define IPMI_RMCPP_INVALID_ROLE                         0x09
00137 #define IPMI_RMCPP_UNAUTHORIZED_ROLE_OR_PRIVILEGE       0x0a
00138 #define IPMI_RMCPP_INSUFFICIENT_RESOURCES_FOR_ROLE      0x0b
00139 #define IPMI_RMCPP_INVALID_NAME_LENGTH                  0x0c
00140 #define IPMI_RMCPP_UNAUTHORIZED_NAME                    0x0d
00141 #define IPMI_RMCPP_UNAUTHORIZED_GUID                    0x0e
00142 #define IPMI_RMCPP_INVALID_INTEGRITY_CHECK_VALUE        0x0f
00143 #define IPMI_RMCPP_INVALID_CONFIDENTIALITY_ALGORITHM    0x10
00144 #define IPMI_RMCPP_NO_CIPHER_SUITE_MATCHES              0x11
00145 #define IPMI_RMCPP_ILLEGAL_PARAMETER                    0x12
00146 
00150 #define IPMI_SOL_CHARACTER_TRANSFER_UNAVAILABLE 0x01 
00151 #define IPMI_SOL_DEACTIVATED                    0x02 
00152 #define IPMI_SOL_NOT_AVAILABLE                  0x03 
00153 #define IPMI_SOL_DISCONNECTED                   0x04 
00154 #define IPMI_SOL_UNCONFIRMABLE_OPERATION        0x05 
00155 #define IPMI_SOL_FLUSHED                        0x06 
00156 
00157 #ifdef __cplusplus
00158 extern "C" {
00159 #endif
00160 
00161 /* Convert a completion code into a string.  You must pass a buffer in
00162    (32 bytes is good) and the buffer length.  The string will be
00163    stored in that buffer and also returned. */
00164 char *ipmi_get_cc_string(unsigned int cc,
00165                          char         *buffer,
00166                          unsigned int buf_len);
00167 int ipmi_get_cc_string_len(unsigned int cc);
00168 
00169 char *ipmi_get_error_string(unsigned int err,
00170                             char *buffer,
00171                             unsigned int buf_len);
00172 int ipmi_get_error_string_len(unsigned int err);
00173 
00174 #ifdef __cplusplus
00175 }
00176 #endif
00177 
00178 #include <errno.h>
00179 
00180 #endif /* _IPMI_ERR_H */

© sourcejam.com 2005-2008