libipmi_sdr.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. /* Get SDR Repository Allocation Info Command */
  20. uint16_t IPMICMD_GetSDRRepositoryAllocInfo( IPMI20_UDS_SESSION_T *pUDSSession,
  21. SDRRepositoryAllocInfo_T *pResGetSDRRepositoryAllocInfo,
  22. int timeout);
  23. /* Reserve SDR Repository Command */
  24. uint16_t IPMICMD_ReserveSDRRepository( IPMI20_UDS_SESSION_T *pUDSSession,
  25. ReserveSDRRepositoryRes_T *pResReserveSDRRepository,
  26. int timeout);
  27. /* Get SDR Command */
  28. uint16_t IPMICMD_GetSDR( IPMI20_UDS_SESSION_T *pUDSSession,
  29. GetSDRReq_T *pReqGetSDR,
  30. GetSDRRes_T *pResGetSDR,
  31. uint32_t *pdwOutBuffLen,
  32. int timeout);
  33. /* Add SDR Command */
  34. uint16_t IPMICMD_AddSDR( IPMI20_UDS_SESSION_T *pUDSSession,
  35. uint8_t *pReqAddSDR,
  36. uint32_t dwInBuffLen,
  37. AddSDRRes_T *pResAddSDR,
  38. int timeout);
  39. /* Partial Add SDR Command */
  40. uint16_t IPMICMD_PartialAddSDR( IPMI20_UDS_SESSION_T *pUDSSession,
  41. PartialAddSDRReq_T *pReqPartialAddSDR,
  42. uint32_t dwInBuffLen,
  43. PartialAddSDRRes_T *pResPartialAddSDR,
  44. int timeout);
  45. /* Delete SDR Command */
  46. uint16_t IPMICMD_DeleteSDR( IPMI20_UDS_SESSION_T *pUDSSession,
  47. DeleteSDRReq_T *pReqDeleteSDR,
  48. DeleteSDRReq_T *pResDeleteSDR,
  49. int timeout);
  50. /* Clear SDR Repository Command */
  51. uint16_t IPMICMD_ClearSDRRepository( IPMI20_UDS_SESSION_T *pUDSSession,
  52. ClearSDRReq_T *pReqClearSDR,
  53. ClearSDRRes_T *pResClearSDR,
  54. int timeout);
  55. /* Get SDR Repository Time Command */
  56. uint16_t IPMICMD_GetSDRRepositoryTime( IPMI20_UDS_SESSION_T *pUDSSession,
  57. GetSDRRepositoryTimeRes_T *pResGetSDRRepositoryTime,
  58. int timeout);
  59. /* Set SDR Repository Time Command */
  60. uint16_t IPMICMD_SetSDRRepositoryTime( IPMI20_UDS_SESSION_T *pUDSSession,
  61. SetSDRRepositoryTimeReq_T *pReqSetSDRRepositoryTime,
  62. uint8_t *pResSetSDRRepositoryTime,
  63. int timeout);
  64. /* Enter SDR Repository Update Mode Command */
  65. uint16_t IPMICMD_EnterSDRUpdateMode( IPMI20_UDS_SESSION_T *pUDSSession,
  66. EnterSDRUpdateModeRes_T *pResEnterSDRUpdateMode,
  67. int timeout);
  68. /* Exit SDR Repository Update Mode Command */
  69. uint16_t IPMICMD_ExitSDRUpdateMode( IPMI20_UDS_SESSION_T *pUDSSession,
  70. ExitSDRUpdateModeRes_T *pResExitSDRUpdateMode,
  71. int timeout);
  72. /* Run Initialization Agent Command */
  73. uint16_t IPMICMD_RunInitAgent( IPMI20_UDS_SESSION_T *pUDSSession,
  74. RunInitAgentReq_T *pReqRunInitAgent,
  75. RunInitAgentRes_T *pResRunInitAgent,
  76. int timeout);
  77. /*---------- LIBIPMI Higher level routines -----------*/
  78. uint16_t LIBIPMI_HL_GetCompleteSDR( IPMI20_UDS_SESSION_T *pUDSSession,
  79. uint16_t record_id,
  80. uint16_t *next_record_id,
  81. uint8_t *sdr_buffer,
  82. size_t buffer_len,
  83. int timeout );
  84. uint16_t LIBIPMI_HL_GetAllSDRs( IPMI20_UDS_SESSION_T *pUDSSession,
  85. uint8_t *sdr_buffer, size_t buffer_len,
  86. int timeout );
  87. uint16_t LIBIPMI_HL_GetSDR( IPMI20_UDS_SESSION_T *pUDSSession,
  88. uint16_t reservation_id,
  89. uint16_t record_id,
  90. GetSDRRes_T *pGetSDRRes,
  91. uint32_t *dwDataLen,
  92. int timeout );
  93. //#define SDR_CACHE_PATH "/var/sdrcache"
  94. #define ERR_SDRCACHE_SUCCESS 0
  95. #define ERR_SDRCACHE_FILEOP 1
  96. #define ERR_SDRCACHE_INVALID_ARGS 2
  97. #define ERR_SDRCACHE_BUFFSIZE 3
  98. uint16_t LIBIPMI_HL_GetAllSDRs_Cached( IPMI20_UDS_SESSION_T *pUDSSession,
  99. uint8_t *sdr_buffer,
  100. uint32_t* sdr_buff_size,
  101. uint32_t* max_sdr_len,
  102. uint32_t * sdr_count,
  103. int timeout );
  104. uint16_t LIBIPMI_HL_GetSpecificSDR( IPMI20_UDS_SESSION_T *pUDSSession,
  105. uint8_t *sdr_buffer,
  106. uint32_t* sdr_buff_size,
  107. int SensorNumber,
  108. int timeout );
  109. #ifdef __cplusplus
  110. }
  111. #endif
  112. #endif