libipmi_errorcodes.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /**
  2. * @file libipmi_errorcodes.h
  3. * @author Rajasekhar (rajasekharj@amiindia.co.in)
  4. * @date 02-Sep-2004
  5. *
  6. * @brief Contains the error codes returned by LIBIPMI API
  7. *
  8. *
  9. */
  10. #ifndef __LIBIPMI_ERROR_CODES_H__
  11. #define __LIBIPMI_ERROR_CODES_H__
  12. /* Error code retrieval macros */
  13. #define MEDIUM_ERROR_FLAG 0
  14. #define IPMI_ERROR_FLAG 1
  15. #define RMCP_RAKP_ERROR_FLAG 2
  16. /**
  17. @def STATUS_CODE(x,y)
  18. @brief forms a 2 byte error code. Here x specifies error type and y specifies
  19. actual error code.
  20. */
  21. #define STATUS_CODE(x,y) ((uint16_t)( (((uint16_t)(x))<<8) | ((uint16_t)(y)) ))
  22. /**
  23. @def IS_MEDIUM_ERROR(x)
  24. @brief checks if error type is MEDIUM_ERROR_FLAG
  25. */
  26. #define IS_MEDIUM_ERROR(x) ( ((x)>>8) == MEDIUM_ERROR_FLAG )
  27. /**
  28. @def IS_IPMI_ERROR(x)
  29. @brief checks if error type is IPMI_ERROR_FLAG
  30. */
  31. #define IS_IPMI_ERROR(x) ( ((x)>>8) == IPMI_ERROR_FLAG )
  32. /**
  33. @def IS_RMCP_RAKP_ERROR(x)
  34. @brief checks if error type is IPMI_ERROR_FLAG
  35. */
  36. #define IS_RMCP_RAKP_ERROR(x) ( ((x)>>8) == RMCP_RAKP_ERROR_FLAG )
  37. /**
  38. @def GET_ERROR_CODE(x)
  39. @brief returns the actual 1 byte error code.
  40. */
  41. #define GET_ERROR_CODE(x) ( ((uint8_t)x & 0xff) )
  42. /**************************/
  43. /* Error Codes */
  44. #define LIBIPMI_E_SUCCESS 0x0000
  45. #define LIBIPMI_STATUS_SUCCESS 0x00
  46. /* Medium related errors */
  47. #define LIBIPMI_MEDIUM_E_CONNECT_FAILURE 0x01
  48. #define LIBIPMI_MEDIUM_E_SEND_DATA_FAILURE 0x02
  49. #define LIBIPMI_MEDIUM_E_RECV_DATA_FAILURE 0x03
  50. #define LIBIPMI_MEDIUM_E_WSA_INIT_FAILURE 0x04
  51. #define LIBIPMI_MEDIUM_E_INVALID_SOCKET 0x05
  52. #define LIBIPMI_MEDIUM_E_TIMED_OUT 0x06
  53. #define LIBIPMI_MEDIUM_E_UNSUPPORTED 0x07
  54. #define LIBIPMI_MEDIUM_E_OS_UNSUPPORTED 0x08
  55. #define LIBIPMI_MEDIUM_E_INVALID_PARAMS 0x09
  56. #define LIBIPMI_MEDIUM_E_INVALID_DATA 0x0A
  57. #define LIBIPMI_MEDIUM_E_TIMED_OUT_ON_SEND 0x0B
  58. #define LIBIPMI_MEDIUM_E_RESOLVED_ADDR_FAILURE 0x0C
  59. /* Session related errors */
  60. #define LIBIPMI_SESSION_E_EXPIRED 0x10
  61. #define LIBIPMI_SESSION_E_RECONNECT_FAILURE 0x11
  62. #define LIBIPMI_SESSION_E_HANDSHAKE_NOT_RECVD 0x12
  63. /* RMCP reated errors*/
  64. #define LIBIPMI_RMCP_E_INVALID_PACKET 0x20
  65. #define LIBIPMI_RMCP_E_INVALID_PONG 0x21
  66. #define LIBIPMI_BMC_E_IPMI2_NOT_SUPPORTED 0x30
  67. /* AES Encryption Errors */
  68. #define LIBIPMI_AES_CBC_E_NO_ENOUGH_MEMORY 0x40
  69. #define LIBIPMI_ENCRYPTION_UNSUPPORTED 0x41
  70. /* Validation Errors */
  71. #define LIBIPMI_E_INVALID_AUTHTYPE 0x50
  72. #define LIBIPMI_E_INVALID_SESSIONID 0x51
  73. #define LIBIPMI_E_PADBYTES_MISMATCH 0x52
  74. #define LIBIPMI_E_AUTHCODE_MISMATCH 0x53
  75. #define LIBIPMI_E_CHKSUM_MISMATCH 0x54
  76. #define LIBIPMI_E_AUTHTYPE_NOT_SUPPORTED 0x55
  77. /* Session Establishment Errors */
  78. #define LIBIPMI_E_INVALID_OPEN_SESSION_RESPONSE 0x60
  79. #define LIBIPMI_E_INVALID_RAKP_MESSAGE_2 0x61
  80. #define LIBIPMI_E_AUTH_ALG_UNSUPPORTED 0x62
  81. #define LIBIPMI_E_INTEGRITY_ALG_UNSUPPORTED 0x63
  82. #define LIBIPMI_E_CONFIDENTIALITY_ALG_UNSUPPORTED 0x64
  83. #define LIBIPMI_E_AUTH_CODE_INVALID 0x65
  84. #define LIBIPMI_E_INVALID_RAKP_MESSAGE_4 0x66
  85. #define LIBIPMI_E_INVALID_HMAC_SIK 0x67
  86. /* Highlevel function errors */
  87. #define LIBIPMI_E_INVALID_USER_ID 0x70
  88. #define LIBIPMI_E_INVALID_USER_NAME 0x71
  89. #define LIBIPMI_E_INVALID_PASSWORD 0x80
  90. #define LIBIPMI_E_INVALID_INDEX 0x72
  91. /* IPMB errors */
  92. #define LIBIPMI_E_NO_ENOUGH_MEMORY 0x80
  93. #define LIBIPMI_E_INVALID_HOST_ADDR 0x81
  94. #define LIBIPMI_E_I2C_WRITE_FAILURE 0x82
  95. #define LIBIPMI_E_I2C_READ_FAILURE 0x83
  96. #define LIBIPMI_E_I2C_BUS_SUSPEND 0x84
  97. #define LIBIPMI_E_SEQ_NUM_MISMATCH 0x85
  98. #define LIBIPMI_E_INSUFFICIENT_BUFFER_SIZE 0x86
  99. #define LIBIPMI_E_IPMB_LOCK_ACCESS_FAILED 0x87
  100. #define LIBIPMI_E_IPMB_COMM_FAILURE 0x88
  101. #define LIBIPMI_E_IPMB_UNKNOWN_ERROR 0x89
  102. #define LIBIPMI_E_IPMB_REQ_BUFF_TOO_BIG 0x8A
  103. #define LIBIPMI_E_IPMB_RES_BUFF_TOO_BIG 0x8B
  104. #define LIBIPMI_E_SEL_CLEARED 0x85
  105. #define LIBIPMI_E_SEL_EMPTY 0x86
  106. #define LIBIPMI_E_SENSOR_INFO_EMPTY 0x87
  107. /* Last RMCP+/RAKP satus code */
  108. #define LAST_RMCP_RAKP_STATUS_CODE (SC_NO_CIPHER_SUITE_MATCH)
  109. /* Error Codes for FRU*/
  110. #define FRU_INVALID_HEADER_VERSION 0x8C
  111. #define FRU_INVALID_AREA 0x8D
  112. #endif