libipmi_sdr.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. #ifndef __LIBIPMI_SDR_H__
  2. #define __LIBIPMI_SDR_H__
  3. /* LIIPMI core header files */
  4. #include "libipmi_session.h"
  5. #include "libipmi_errorcodes.h"
  6. #include "com_BmcType.h"
  7. /* command specific header files */
  8. #pragma pack(1)
  9. #include "com_IPMI_SDR.h"
  10. #pragma pack()
  11. #include "com_IPMI_SensorEvent.h"
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. /* Get SDR Repository Info Command */
  16. uint16_t IPMICMD_GetSDRRepositoryInfo( IPMI20_UDS_SESSION_T *pUDSSession,
  17. SDRRepositoryInfo_T *pResGetSDRRepositoryInfo,
  18. int timeout);
  19. uint16_t IPMC_GetSDRRepositoryInfo( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t IpmbAddr,
  20. SDRRepositoryInfo_T *pResGetSDRRepositoryInfo,
  21. int timeout);
  22. /* Get SDR Repository Allocation Info Command */
  23. uint16_t IPMICMD_GetSDRRepositoryAllocInfo( IPMI20_UDS_SESSION_T *pUDSSession,
  24. SDRRepositoryAllocInfo_T *pResGetSDRRepositoryAllocInfo,
  25. int timeout);
  26. uint16_t IPMC_GetSDRRepositoryAllocInfo( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t IpmbAddr,
  27. SDRRepositoryAllocInfo_T *pResGetSDRRepositoryAllocInfo,
  28. int timeout);
  29. /* Reserve SDR Repository Command */
  30. uint16_t IPMICMD_ReserveSDRRepository( IPMI20_UDS_SESSION_T *pUDSSession,
  31. ReserveSDRRepositoryRes_T *pResReserveSDRRepository,
  32. int timeout);
  33. /* Get SDR Command */
  34. uint16_t IPMICMD_GetSDR( IPMI20_UDS_SESSION_T *pUDSSession,
  35. GetSDRReq_T *pReqGetSDR,
  36. GetSDRRes_T *pResGetSDR,
  37. uint32_t *pdwOutBuffLen,
  38. int timeout);
  39. /* Add SDR Command */
  40. uint16_t IPMICMD_AddSDR( IPMI20_UDS_SESSION_T *pUDSSession,
  41. uint8_t *pReqAddSDR,
  42. uint32_t dwInBuffLen,
  43. AddSDRRes_T *pResAddSDR,
  44. int timeout);
  45. /* Partial Add SDR Command */
  46. uint16_t IPMICMD_PartialAddSDR( IPMI20_UDS_SESSION_T *pUDSSession,
  47. PartialAddSDRReq_T *pReqPartialAddSDR,
  48. uint32_t dwInBuffLen,
  49. PartialAddSDRRes_T *pResPartialAddSDR,
  50. int timeout);
  51. /* Delete SDR Command */
  52. uint16_t IPMICMD_DeleteSDR( IPMI20_UDS_SESSION_T *pUDSSession,
  53. DeleteSDRReq_T *pReqDeleteSDR,
  54. DeleteSDRReq_T *pResDeleteSDR,
  55. int timeout);
  56. /* Clear SDR Repository Command */
  57. uint16_t IPMICMD_ClearSDRRepository( IPMI20_UDS_SESSION_T *pUDSSession,
  58. ClearSDRReq_T *pReqClearSDR,
  59. ClearSDRRes_T *pResClearSDR,
  60. int timeout);
  61. /* Get SDR Repository Time Command */
  62. uint16_t IPMICMD_GetSDRRepositoryTime( IPMI20_UDS_SESSION_T *pUDSSession,
  63. GetSDRRepositoryTimeRes_T *pResGetSDRRepositoryTime,
  64. int timeout);
  65. /* Set SDR Repository Time Command */
  66. uint16_t IPMICMD_SetSDRRepositoryTime( IPMI20_UDS_SESSION_T *pUDSSession,
  67. SetSDRRepositoryTimeReq_T *pReqSetSDRRepositoryTime,
  68. uint8_t *pResSetSDRRepositoryTime,
  69. int timeout);
  70. /* Enter SDR Repository Update Mode Command */
  71. uint16_t IPMICMD_EnterSDRUpdateMode( IPMI20_UDS_SESSION_T *pUDSSession,
  72. EnterSDRUpdateModeRes_T *pResEnterSDRUpdateMode,
  73. int timeout);
  74. /* Exit SDR Repository Update Mode Command */
  75. uint16_t IPMICMD_ExitSDRUpdateMode( IPMI20_UDS_SESSION_T *pUDSSession,
  76. ExitSDRUpdateModeRes_T *pResExitSDRUpdateMode,
  77. int timeout);
  78. /* Run Initialization Agent Command */
  79. uint16_t IPMICMD_RunInitAgent( IPMI20_UDS_SESSION_T *pUDSSession,
  80. RunInitAgentReq_T *pReqRunInitAgent,
  81. RunInitAgentRes_T *pResRunInitAgent,
  82. int timeout);
  83. /*---------- LIBIPMI Higher level routines -----------*/
  84. uint16_t Storlead_GetCompleteSDR( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t IpmbAddr,
  85. uint16_t record_id,
  86. uint16_t *next_record_id,
  87. uint8_t *sdr_buffer,
  88. size_t buffer_len,
  89. int timeout );
  90. uint16_t Storlead_GetAllSDRs( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t IpmbAddr,
  91. uint8_t *sdr_buffer, size_t buffer_len,
  92. int timeout );
  93. uint16_t LIBIPMI_HL_GetSDR( IPMI20_UDS_SESSION_T *pUDSSession,
  94. uint16_t reservation_id,
  95. uint16_t record_id,
  96. GetSDRRes_T *pGetSDRRes,
  97. uint32_t *dwDataLen,
  98. int timeout );
  99. uint16_t IPMC_GetSDR( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t IpmbAddr,
  100. uint16_t reservation_id,
  101. uint16_t record_id,
  102. GetSDRRes_T *pGetSDRRes,
  103. uint32_t *dwDataLen,
  104. int timeout );
  105. //#define SDR_CACHE_PATH "/var/sdrcache"
  106. #define ERR_SDRCACHE_SUCCESS 0
  107. #define ERR_SDRCACHE_FILEOP 1
  108. #define ERR_SDRCACHE_INVALID_ARGS 2
  109. #define ERR_SDRCACHE_BUFFSIZE 3
  110. uint16_t LIBIPMI_HL_GetAllSDRs_Cached( IPMI20_UDS_SESSION_T *pUDSSession,
  111. uint8_t *sdr_buffer,
  112. uint32_t* sdr_buff_size,
  113. uint32_t* max_sdr_len,
  114. uint32_t * sdr_count,
  115. int timeout );
  116. uint16_t LIBIPMI_HL_GetSpecificSDR( IPMI20_UDS_SESSION_T *pUDSSession,
  117. uint8_t *sdr_buffer,
  118. uint32_t* sdr_buff_size,
  119. int SensorNumber,
  120. int timeout );
  121. #ifdef __cplusplus
  122. }
  123. #endif
  124. #endif