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

ipmi_err.h File Reference

#include <errno.h>

Go to the source code of this file.

Defines

#define IPMI_OS_ERR_TOP   0x00000000
#define IPMI_IPMI_ERR_TOP   0x01000000
#define IPMI_RMCPP_ERR_TOP   0x02000000
#define IPMI_SOL_ERR_TOP   0x03000000
#define IPMI_IS_OS_ERR(E)   (((E) & 0xffffff00) == IPMI_OS_ERR_TOP)
#define IPMI_GET_OS_ERR(E)   ((E) & 0xff)
#define IPMI_OS_ERR_VAL(v)   ((v) | IPMI_OS_ERR_TOP)
#define IPMI_IS_IPMI_ERR(E)   (((E) & 0xffffff00) == IPMI_IPMI_ERR_TOP)
#define IPMI_GET_IPMI_ERR(E)   ((E) & 0xff)
#define IPMI_IPMI_ERR_VAL(v)   ((v) | IPMI_IPMI_ERR_TOP)
#define IPMI_IS_RMCPP_ERR(E)   (((E) & 0xffffff00) == IPMI_RMCPP_ERR_TOP)
#define IPMI_GET_RMCPP_ERR(E)   ((E) & 0xff)
#define IPMI_RMCPP_ERR_VAL(v)   ((v) | IPMI_RMCPP_ERR_TOP)
#define IPMI_IS_SOL_ERR(E)   (((E) & 0xffffff00) == IPMI_SOL_ERR_TOP)
#define IPMI_GET_SOL_ERR(E)   ((E) & 0xff)
#define IPMI_SOL_ERR_VAL(v)   ((v) | IPMI_SOL_ERR_TOP)
#define IPMI_NODE_BUSY_CC   0xC0
#define IPMI_INVALID_CMD_CC   0xC1
#define IPMI_COMMAND_INVALID_FOR_LUN_CC   0xC2
#define IPMI_TIMEOUT_CC   0xC3
#define IPMI_OUT_OF_SPACE_CC   0xC4
#define IPMI_INVALID_RESERVATION_CC   0xC5
#define IPMI_REQUEST_DATA_TRUNCATED_CC   0xC6
#define IPMI_REQUEST_DATA_LENGTH_INVALID_CC   0xC7
#define IPMI_REQUESTED_DATA_LENGTH_EXCEEDED_CC   0xC8
#define IPMI_PARAMETER_OUT_OF_RANGE_CC   0xC9
#define IPMI_CANNOT_RETURN_REQ_LENGTH_CC   0xCA
#define IPMI_NOT_PRESENT_CC   0xCB
#define IPMI_INVALID_DATA_FIELD_CC   0xCC
#define IPMI_COMMAND_ILLEGAL_FOR_SENSOR_CC   0xCD
#define IPMI_COULD_NOT_PROVIDE_RESPONSE_CC   0xCE
#define IPMI_CANNOT_EXEC_DUPLICATE_REQUEST_CC   0xCF
#define IPMI_REPOSITORY_IN_UPDATE_MODE_CC   0xD0
#define IPMI_DEVICE_IN_FIRMWARE_UPDATE_CC   0xD1
#define IPMI_BMC_INIT_IN_PROGRESS_CC   0xD2
#define IPMI_DESTINATION_UNAVAILABLE_CC   0xD3
#define IPMI_INSUFFICIENT_PRIVILEGE_CC   0xD4
#define IPMI_NOT_SUPPORTED_IN_PRESENT_STATE_CC   0xD5
#define IPMI_UNKNOWN_ERR_CC   0xff
#define IPMI_RMCPP_INSUFFICIENT_RESOURCES_FOR_SESSION   0x01
#define IPMI_RMCPP_INVALID_SESSION_ID   0x02
#define IPMI_RMCPP_INVALID_PAYLOAD_TYPE   0x03
#define IPMI_RMCPP_INVALID_AUTHENTICATION_ALGORITHM   0x04
#define IPMI_RMCPP_INVALID_INTEGRITY_ALGORITHM   0x05
#define IPMI_RMCPP_NO_MATCHING_AUTHENTICATION_PAYLOAD   0x06
#define IPMI_RMCPP_NO_MATCHING_INTEGRITY_PAYLOAD   0x07
#define IPMI_RMCPP_INACTIVE_SESSION_ID   0x08
#define IPMI_RMCPP_INVALID_ROLE   0x09
#define IPMI_RMCPP_UNAUTHORIZED_ROLE_OR_PRIVILEGE   0x0a
#define IPMI_RMCPP_INSUFFICIENT_RESOURCES_FOR_ROLE   0x0b
#define IPMI_RMCPP_INVALID_NAME_LENGTH   0x0c
#define IPMI_RMCPP_UNAUTHORIZED_NAME   0x0d
#define IPMI_RMCPP_UNAUTHORIZED_GUID   0x0e
#define IPMI_RMCPP_INVALID_INTEGRITY_CHECK_VALUE   0x0f
#define IPMI_RMCPP_INVALID_CONFIDENTIALITY_ALGORITHM   0x10
#define IPMI_RMCPP_NO_CIPHER_SUITE_MATCHES   0x11
#define IPMI_RMCPP_ILLEGAL_PARAMETER   0x12
#define IPMI_SOL_CHARACTER_TRANSFER_UNAVAILABLE   0x01
 The request was NACKed because Char Trans was Unavail The managed system deactivated SoL SoL is not available due to managed system configuration. The connection has been forcibly disconnected. The operation has been attempted, but no confirmation is possible. The packet containing the request was flushed before transmission.
#define IPMI_SOL_DEACTIVATED   0x02
#define IPMI_SOL_NOT_AVAILABLE   0x03
#define IPMI_SOL_DISCONNECTED   0x04
#define IPMI_SOL_UNCONFIRMABLE_OPERATION   0x05
#define IPMI_SOL_FLUSHED   0x06

Functions

char * ipmi_get_cc_string (unsigned int cc, char *buffer, unsigned int buf_len)
int ipmi_get_cc_string_len (unsigned int cc)
char * ipmi_get_error_string (unsigned int err, char *buffer, unsigned int buf_len)
int ipmi_get_error_string_len (unsigned int err)


Define Documentation

#define IPMI_BMC_INIT_IN_PROGRESS_CC   0xD2
 

Definition at line 121 of file ipmi_err.h.

#define IPMI_CANNOT_EXEC_DUPLICATE_REQUEST_CC   0xCF
 

Definition at line 118 of file ipmi_err.h.

#define IPMI_CANNOT_RETURN_REQ_LENGTH_CC   0xCA
 

Definition at line 113 of file ipmi_err.h.

Referenced by fru_data_handler(), and handle_sdr_data().

#define IPMI_COMMAND_ILLEGAL_FOR_SENSOR_CC   0xCD
 

Definition at line 116 of file ipmi_err.h.

#define IPMI_COMMAND_INVALID_FOR_LUN_CC   0xC2
 

Definition at line 105 of file ipmi_err.h.

#define IPMI_COULD_NOT_PROVIDE_RESPONSE_CC   0xCE
 

Definition at line 117 of file ipmi_err.h.

#define IPMI_DESTINATION_UNAVAILABLE_CC   0xD3
 

Definition at line 122 of file ipmi_err.h.

Referenced by handle_picmg_cmd_fru_control(), handle_picmg_cmd_get_fru_led_properties(), handle_picmg_cmd_get_fru_led_state(), handle_picmg_cmd_get_led_color_capabilities(), handle_picmg_cmd_set_fru_activation(), handle_picmg_cmd_set_fru_led_state(), and handle_picmg_get_address_info().

#define IPMI_DEVICE_IN_FIRMWARE_UPDATE_CC   0xD1
 

Definition at line 120 of file ipmi_err.h.

#define IPMI_GET_IPMI_ERR  )     ((E) & 0xff)
 

Definition at line 76 of file ipmi_err.h.

Referenced by ipmi_get_error_string(), ipmi_get_error_string_len(), leave_err(), and report_error().

#define IPMI_GET_OS_ERR  )     ((E) & 0xff)
 

Definition at line 73 of file ipmi_err.h.

Referenced by ipmi_get_error_string(), ipmi_get_error_string_len(), leave_err(), and report_error().

#define IPMI_GET_RMCPP_ERR  )     ((E) & 0xff)
 

Definition at line 79 of file ipmi_err.h.

Referenced by ipmi_get_error_string(), and ipmi_get_error_string_len().

#define IPMI_GET_SOL_ERR  )     ((E) & 0xff)
 

Definition at line 82 of file ipmi_err.h.

Referenced by ipmi_get_error_string(), ipmi_get_error_string_len(), and transmit_complete().

#define IPMI_INSUFFICIENT_PRIVILEGE_CC   0xD4
 

Definition at line 123 of file ipmi_err.h.

Referenced by handle_close_session(), and handle_normal_session().

#define IPMI_INVALID_CMD_CC   0xC1
 

Definition at line 104 of file ipmi_err.h.

Referenced by handle_get_authcode(), handle_get_sensor_event_enable(), handle_get_sensor_hysteresis(), handle_get_sensor_thresholds(), handle_get_system_guid(), handle_invalid_cmd(), handle_normal_session(), handle_reservation(), handle_set_sensor_event_enable(), handle_set_sensor_hysteresis(), and handle_set_sensor_thresholds().

#define IPMI_INVALID_DATA_FIELD_CC   0xCC
 

Definition at line 115 of file ipmi_err.h.

Referenced by handle_clear_sdr_repository(), handle_clear_sel(), handle_get_channel_access(), handle_get_channel_auth_capabilities(), handle_get_channel_info(), handle_get_fru_inventory_area_info(), handle_get_sel_entry(), handle_get_sensor_event_enable(), handle_get_sensor_hysteresis(), handle_get_sensor_reading(), handle_get_sensor_thresholds(), handle_get_sensor_type(), handle_get_session_challenge(), handle_get_session_info(), handle_get_user_access(), handle_get_user_name(), handle_ipmi_get_lan_config_parms(), handle_ipmi_get_pef_config_parms(), handle_ipmi_set_lan_config_parms(), handle_ipmi_set_pef_config_parms(), handle_partial_add_sdr(), handle_picmg_cmd_fru_control(), handle_picmg_cmd_get_fru_led_state(), handle_picmg_cmd_get_led_color_capabilities(), handle_picmg_cmd_set_fru_activation(), handle_picmg_cmd_set_fru_led_state(), handle_picmg_get_address_info(), handle_read_fru_data(), handle_set_channel_access(), handle_set_sensor_event_enable(), handle_set_sensor_hysteresis(), handle_set_sensor_thresholds(), handle_set_user_access(), handle_set_user_name(), handle_set_user_password(), handle_temp_session(), handle_write_fru_data(), and ipmi_emu_handle_msg().

#define IPMI_INVALID_RESERVATION_CC   0xC5
 

Definition at line 108 of file ipmi_err.h.

Referenced by handle_clear_sdr_repository(), handle_clear_sel(), handle_delete_sdr(), handle_delete_sel_entry(), handle_get_device_sdr(), handle_get_sdr(), handle_get_sel_entry(), handle_partial_add_sdr(), handle_reservation_check(), handle_sdr_data(), handle_sdr_write(), handle_sdr_write_done(), handle_sel_clear(), handle_sel_data(), and handle_sel_delete().

#define IPMI_IPMI_ERR_TOP   0x01000000
 

Definition at line 69 of file ipmi_err.h.

#define IPMI_IPMI_ERR_VAL  )     ((v) | IPMI_IPMI_ERR_TOP)
 

Definition at line 77 of file ipmi_err.h.

Referenced by _ipmi_mc_get_device_id_data_from_rsp(), activate_handler(), alarm_get_cb(), alarm_set_cb(), amc_temp_cool_get_done(), atca_ipmb_handler(), board_power_config_get_done(), challenge_done(), chan_info_rsp_handler(), chassis_power_get_cb(), chassis_power_set_cb(), chassis_reset_set_cb(), check_for_msg_err(), check_identifier_get_rv(), check_lanparm_response_param(), check_pef_response_param(), check_rakp_rsp(), check_solparm_response_param(), clearlanparmlock_rsp_handler(), clearpeflock_rsp_handler(), fru_data_handler(), fru_inventory_area_handler(), fru_write_handler(), gba(), gcp(), get_sel_time(), gga(), ghp(), gnas(), gnc(), got_chan_access(), got_chan_info(), got_event_log_enable(), got_user1(), got_user2(), gpc(), gpn(), gvi(), gvp(), gvt(), handle_activate_payload_response(), handle_deactivate_payload_response(), handle_del_sel_clear(), handle_dev_id(), handle_get_channel_payload_support_response(), handle_get_payload_activation_status_response(), handle_get_sol_enabled_response(), handle_reservation(), handle_reservation_check(), handle_save_reservation(), handle_sdr_clear(), handle_sdr_data(), handle_sdr_info(), handle_sdr_write(), handle_sdr_write_done(), handle_sel_check(), handle_sel_data(), handle_sel_delete(), handle_sel_info(), handle_session_info_response(), handle_set_sol_enabled_response(), handle_set_volatile_bitrate_response(), hs_led_get_cb(), hs_led_set_cb(), i2c_sens_reading_cb(), ipmb_handler(), ipmb_handler_amc(), lock_done(), mc_reset_done(), mxp_chassis_id_get_cb(), mxp_control_get_done(), mxp_control_set_done(), mxp_fan_reading_cb(), mxp_sensor_get_done(), mxp_voltage_reading_cb(), oem_control_get_done(), oem_control_set_done(), oem_discrete_sensor_get_done(), power_get_cb(), power_set_cb(), relay_get_done(), sel_add_event_done(), sel_reserved_for_delete(), sensor_done_check_rsp(), session_activated(), session_privilege_set(), set_chan_access(), set_done(), set_event_log_enable(), set_event_log_enable_2(), set_event_rcvr_done(), set_sel_time(), set_user2(), set_user3(), set_user4(), set_user5(), and sys_led_get_cb().

#define IPMI_IS_IPMI_ERR  )     (((E) & 0xffffff00) == IPMI_IPMI_ERR_TOP)
 

Definition at line 75 of file ipmi_err.h.

Referenced by ipmi_get_error_string(), and ipmi_get_error_string_len().

#define IPMI_IS_OS_ERR  )     (((E) & 0xffffff00) == IPMI_OS_ERR_TOP)
 

Definition at line 72 of file ipmi_err.h.

Referenced by ipmi_get_error_string(), ipmi_get_error_string_len(), leave_err(), and report_error().

#define IPMI_IS_RMCPP_ERR  )     (((E) & 0xffffff00) == IPMI_RMCPP_ERR_TOP)
 

Definition at line 78 of file ipmi_err.h.

Referenced by ipmi_get_error_string(), and ipmi_get_error_string_len().

#define IPMI_IS_SOL_ERR  )     (((E) & 0xffffff00) == IPMI_SOL_ERR_TOP)
 

Definition at line 81 of file ipmi_err.h.

Referenced by ipmi_get_error_string(), ipmi_get_error_string_len(), and transmit_complete().

#define IPMI_NODE_BUSY_CC   0xC0
 

Definition at line 103 of file ipmi_err.h.

#define IPMI_NOT_PRESENT_CC   0xCB
 

Definition at line 114 of file ipmi_err.h.

Referenced by handle_delete_sdr(), handle_delete_sel_entry(), handle_get_channel_info(), handle_get_device_sdr(), handle_get_sdr(), handle_get_sel_entry(), handle_sdr_data(), handle_sel_check(), and handle_sel_delete().

#define IPMI_NOT_SUPPORTED_IN_PRESENT_STATE_CC   0xD5
 

Definition at line 124 of file ipmi_err.h.

Referenced by handle_add_sdr(), handle_no_session(), handle_normal_session(), and handle_partial_add_sdr().

#define IPMI_OS_ERR_TOP   0x00000000
 

Definition at line 68 of file ipmi_err.h.

#define IPMI_OS_ERR_VAL  )     ((v) | IPMI_OS_ERR_TOP)
 

Definition at line 74 of file ipmi_err.h.

#define IPMI_OUT_OF_SPACE_CC   0xC4
 

Definition at line 107 of file ipmi_err.h.

Referenced by handle_add_sdr(), and handle_add_sel_entry().

#define IPMI_PARAMETER_OUT_OF_RANGE_CC   0xC9
 

Definition at line 112 of file ipmi_err.h.

Referenced by handle_get_device_sdr(), handle_get_sdr(), handle_ipmi_get_pef_config_parms(), handle_ipmi_set_pef_config_parms(), handle_read_fru_data(), and handle_write_fru_data().

#define IPMI_REPOSITORY_IN_UPDATE_MODE_CC   0xD0
 

Definition at line 119 of file ipmi_err.h.

#define IPMI_REQUEST_DATA_LENGTH_INVALID_CC   0xC7
 

Definition at line 110 of file ipmi_err.h.

Referenced by check_msg_length(), fru_data_handler(), handle_activate_session_cmd(), handle_close_session(), handle_get_channel_access(), handle_get_channel_auth_capabilities(), handle_get_channel_info(), handle_get_session_challenge(), handle_get_session_info(), handle_get_user_access(), handle_get_user_name(), handle_ipmi_get_lan_config_parms(), handle_ipmi_get_pef_config_parms(), handle_ipmi_set_lan_config_parms(), handle_ipmi_set_pef_config_parms(), handle_set_channel_access(), handle_set_session_privilege(), handle_set_user_access(), handle_set_user_name(), handle_set_user_password(), and ipmi_emu_handle_msg().

#define IPMI_REQUEST_DATA_TRUNCATED_CC   0xC6
 

Definition at line 109 of file ipmi_err.h.

Referenced by handle_msg_ipmi_dev().

#define IPMI_REQUESTED_DATA_LENGTH_EXCEEDED_CC   0xC8
 

Definition at line 111 of file ipmi_err.h.

Referenced by fru_data_handler(), handle_get_device_sdr(), handle_get_sdr(), handle_read_fru_data(), handle_smi_msg(), and handle_write_fru_data().

#define IPMI_RMCPP_ERR_TOP   0x02000000
 

Definition at line 70 of file ipmi_err.h.

#define IPMI_RMCPP_ERR_VAL  )     ((v) | IPMI_RMCPP_ERR_TOP)
 

Definition at line 80 of file ipmi_err.h.

Referenced by check_rakp_rsp(), handle_get_channel_payload_support_response(), and handle_get_payload_activation_status_response().

#define IPMI_RMCPP_ILLEGAL_PARAMETER   0x12
 

Definition at line 145 of file ipmi_err.h.

Referenced by handle_open_session_payload(), handle_rakp1_payload(), and handle_rakp2().

#define IPMI_RMCPP_INACTIVE_SESSION_ID   0x08
 

Definition at line 135 of file ipmi_err.h.

#define IPMI_RMCPP_INSUFFICIENT_RESOURCES_FOR_ROLE   0x0b
 

Definition at line 138 of file ipmi_err.h.

#define IPMI_RMCPP_INSUFFICIENT_RESOURCES_FOR_SESSION   0x01
 

Definition at line 128 of file ipmi_err.h.

Referenced by handle_open_session_payload(), handle_rakp1_payload(), and handle_rakp2().

#define IPMI_RMCPP_INVALID_AUTHENTICATION_ALGORITHM   0x04
 

Definition at line 131 of file ipmi_err.h.

Referenced by handle_open_session_payload().

#define IPMI_RMCPP_INVALID_CONFIDENTIALITY_ALGORITHM   0x10
 

Definition at line 143 of file ipmi_err.h.

Referenced by handle_open_session_payload().

#define IPMI_RMCPP_INVALID_INTEGRITY_ALGORITHM   0x05
 

Definition at line 132 of file ipmi_err.h.

Referenced by handle_open_session_payload().

#define IPMI_RMCPP_INVALID_INTEGRITY_CHECK_VALUE   0x0f
 

Definition at line 142 of file ipmi_err.h.

Referenced by handle_rakp2().

#define IPMI_RMCPP_INVALID_NAME_LENGTH   0x0c
 

Definition at line 139 of file ipmi_err.h.

#define IPMI_RMCPP_INVALID_PAYLOAD_TYPE   0x03
 

Definition at line 130 of file ipmi_err.h.

Referenced by handle_get_channel_payload_support_response(), and handle_get_payload_activation_status_response().

#define IPMI_RMCPP_INVALID_ROLE   0x09
 

Definition at line 136 of file ipmi_err.h.

#define IPMI_RMCPP_INVALID_SESSION_ID   0x02
 

Definition at line 129 of file ipmi_err.h.

Referenced by handle_open_session_payload(), and handle_rakp2().

#define IPMI_RMCPP_NO_CIPHER_SUITE_MATCHES   0x11
 

Definition at line 144 of file ipmi_err.h.

Referenced by handle_open_session_payload().

#define IPMI_RMCPP_NO_MATCHING_AUTHENTICATION_PAYLOAD   0x06
 

Definition at line 133 of file ipmi_err.h.

#define IPMI_RMCPP_NO_MATCHING_INTEGRITY_PAYLOAD   0x07
 

Definition at line 134 of file ipmi_err.h.

#define IPMI_RMCPP_UNAUTHORIZED_GUID   0x0e
 

Definition at line 141 of file ipmi_err.h.

#define IPMI_RMCPP_UNAUTHORIZED_NAME   0x0d
 

Definition at line 140 of file ipmi_err.h.

#define IPMI_RMCPP_UNAUTHORIZED_ROLE_OR_PRIVILEGE   0x0a
 

Definition at line 137 of file ipmi_err.h.

#define IPMI_SOL_CHARACTER_TRANSFER_UNAVAILABLE   0x01
 

The request was NACKed because Char Trans was Unavail The managed system deactivated SoL SoL is not available due to managed system configuration. The connection has been forcibly disconnected. The operation has been attempted, but no confirmation is possible. The packet containing the request was flushed before transmission.

Serial-over-LAN error codes

Definition at line 150 of file ipmi_err.h.

Referenced by process_packet().

#define IPMI_SOL_DEACTIVATED   0x02
 

Referenced by process_packet().

#define IPMI_SOL_DISCONNECTED   0x04
 

Referenced by handle_deactivate_payload_response(), ipmi_sol_force_close(), and sol_ACK_timer_expired().

#define IPMI_SOL_ERR_TOP   0x03000000
 

Definition at line 71 of file ipmi_err.h.

#define IPMI_SOL_ERR_VAL  )     ((v) | IPMI_SOL_ERR_TOP)
 

Definition at line 83 of file ipmi_err.h.

Referenced by handle_activate_payload_response(), handle_deactivate_payload_response(), handle_get_channel_payload_support_response(), handle_get_payload_activation_status_response(), handle_get_sol_enabled_response(), handle_session_info_response(), handle_set_sol_enabled_response(), handle_set_volatile_bitrate_response(), ipmi_sol_flush(), ipmi_sol_force_close(), process_packet(), sol_ACK_timer_expired(), and transmitter_prod_nolock().

#define IPMI_SOL_FLUSHED   0x06
 

Referenced by ipmi_sol_flush().

#define IPMI_SOL_NOT_AVAILABLE   0x03
 

Referenced by handle_activate_payload_response(), handle_get_channel_payload_support_response(), handle_get_payload_activation_status_response(), handle_get_sol_enabled_response(), handle_session_info_response(), handle_set_sol_enabled_response(), and handle_set_volatile_bitrate_response().

#define IPMI_SOL_UNCONFIRMABLE_OPERATION   0x05
 

Referenced by transmit_complete(), and transmitter_prod_nolock().

#define IPMI_TIMEOUT_CC   0xC3
 

Definition at line 106 of file ipmi_err.h.

Referenced by devid_bc_rsp_handler(), fru_data_handler(), handle_msg_ipmi_dev(), handle_msg_ipmi_sock(), and rsp_timeout_handler().

#define IPMI_UNKNOWN_ERR_CC   0xff
 

Definition at line 125 of file ipmi_err.h.

Referenced by check_command_queue(), cleanup_domain(), fru_data_handler(), handle_add_sel_entry(), handle_get_session_challenge(), handle_normal_session(), handle_partial_add_sdr(), handle_sdr_data(), handle_smi_msg(), handle_temp_session(), lan_cleanup(), reroute_cmds(), and rsp_timeout_handler().


Function Documentation

char* ipmi_get_cc_string unsigned int  cc,
char *  buffer,
unsigned int  buf_len
 

Definition at line 1185 of file strings.c.

References ipmi_ccodes.

Referenced by ipmi_get_error_string(), ipmi_handle_recv(), and ipmi_handle_recv_async().

01188 {
01189     char *cc_fs;
01190 
01191     if ( cc == 0x00 )
01192         cc_fs = ipmi_ccodes[0];
01193     else if ( (cc > 0xbf) && (cc < 0xd6) )
01194         cc_fs = ipmi_ccodes[cc - 0xc0 + 1];
01195     else if ( cc == 0xff )
01196         cc_fs = ipmi_ccodes[23];
01197     else
01198         cc_fs = "Unknown:%02x";
01199 
01200     snprintf(buffer, buf_len, cc_fs, cc);
01201 
01202     return buffer;
01203 }

int ipmi_get_cc_string_len unsigned int  cc  ) 
 

Definition at line 1206 of file strings.c.

References ipmi_ccodes.

Referenced by ipmi_get_error_string_len().

01207 {
01208     char *cc_fs;
01209     char dummy[1];
01210 
01211     if ( cc == 0x00 )
01212         cc_fs = ipmi_ccodes[0];
01213     else if ( (cc > 0xbf) && (cc < 0xd6) )
01214         cc_fs = ipmi_ccodes[cc - 0xc0 + 1];
01215     else if ( cc == 0xff )
01216         cc_fs = ipmi_ccodes[23];
01217     else
01218         cc_fs = "Unknown:%02x";
01219 
01220     return snprintf(dummy, 1, cc_fs, cc);
01221 }

char* ipmi_get_error_string unsigned int  err,
char *  buffer,
unsigned int  buf_len
 

Definition at line 1259 of file strings.c.

References ipmi_get_cc_string(), IPMI_GET_IPMI_ERR, IPMI_GET_OS_ERR, IPMI_GET_RMCPP_ERR, IPMI_GET_SOL_ERR, IPMI_IS_IPMI_ERR, IPMI_IS_OS_ERR, IPMI_IS_RMCPP_ERR, IPMI_IS_SOL_ERR, rmcpp_error_codes, and sol_error_codes.

Referenced by cmd_done(), conn_changed(), connection_state(), domain_con_change(), sol_ACK_timer_expired(), sol_do_flush(), sol_send(), sol_send_break(), transmit_complete(), transmit_outstanding_packet(), and transmitter_prod_nolock().

01262 {
01263     int  len;
01264     char *err_type;
01265 
01266     if (err == 0) {
01267         strncpy(buffer, "Success (No error)", buf_len);
01268         return buffer;
01269     }
01270 
01271     if (IPMI_IS_OS_ERR(err)) {
01272         snprintf(buffer+4, buf_len-4, "%s", strerror(IPMI_GET_OS_ERR(err)));
01273         err_type = "OS: ";
01274     } else if (IPMI_IS_IPMI_ERR(err)) {
01275         ipmi_get_cc_string(IPMI_GET_IPMI_ERR(err), buffer+6, buf_len-6);
01276         err_type = "IPMI: ";
01277     } else if (IPMI_IS_RMCPP_ERR(err)) {
01278         int rmcpp_err = IPMI_GET_RMCPP_ERR(err);
01279         if ((rmcpp_err <= 0) && (rmcpp_err > 0x12))
01280             rmcpp_err = 0x13;
01281         snprintf(buffer+7, buf_len-7, "%s (0x%02x)",
01282                  rmcpp_error_codes[rmcpp_err - 1],
01283                  IPMI_GET_RMCPP_ERR(err));
01284         err_type = "RMCP+: ";
01285     } else if (IPMI_IS_SOL_ERR(err)) {
01286         int sol_err = IPMI_GET_SOL_ERR(err);
01287         if ((sol_err < 1) || (sol_err > 7))
01288             sol_err = 7;
01289         strncpy(buffer+5, sol_error_codes[sol_err - 1], buf_len-5);
01290         err_type = "SoL: ";
01291     } else {
01292         strncpy(buffer+9, "Unknown", buf_len-9);
01293         err_type = "Unknown: ";
01294     }
01295 
01296     len = strlen(err_type);
01297     if (len > buf_len-1) {
01298         len = buf_len-1;
01299         buffer[buf_len-1] = '\0';
01300     }
01301     memcpy(buffer, err_type, len);
01302 
01303     return buffer;
01304 }

int ipmi_get_error_string_len unsigned int  err  ) 
 

Definition at line 1306 of file strings.c.

References ipmi_get_cc_string_len(), IPMI_GET_IPMI_ERR, IPMI_GET_OS_ERR, IPMI_GET_RMCPP_ERR, IPMI_GET_SOL_ERR, IPMI_IS_IPMI_ERR, IPMI_IS_OS_ERR, IPMI_IS_RMCPP_ERR, IPMI_IS_SOL_ERR, rmcpp_error_codes, and sol_error_codes.

01307 {
01308     if (err == 0)
01309         return(strlen("Success (No error)"));
01310 
01311     if (IPMI_IS_OS_ERR(err))
01312         return strlen(strerror(IPMI_GET_OS_ERR(err))) + 5;
01313     else if (IPMI_IS_IPMI_ERR(err)) {
01314         return ipmi_get_cc_string_len(IPMI_GET_IPMI_ERR(err)) + 7;
01315     } else if (IPMI_IS_RMCPP_ERR(err)) {
01316         int rmcpp_err = IPMI_GET_RMCPP_ERR(err);
01317         if ((rmcpp_err <= 0) && (rmcpp_err > 0x12))
01318             rmcpp_err = 0x13;
01319         return strlen(rmcpp_error_codes[rmcpp_err - 1]) + 15;
01320     } else if (IPMI_IS_SOL_ERR(err)) {
01321         int sol_err = IPMI_GET_SOL_ERR(err);
01322         if ((sol_err < 1) || (sol_err > 7))
01323             sol_err = 7;
01324         return strlen(sol_error_codes[sol_err - 1]) + 6;
01325     } else {
01326         return strlen("Unknown") + 10;
01327     }
01328 }


© sourcejam.com 2005-2008