zhangbo hace 5 años
padre
commit
21fd17f2e1
Se han modificado 30 ficheros con 906 adiciones y 1426 borrados
  1. 4 3
      app/common_include/com_IPMIDefs.h
  2. 12 11
      app/goahead-5.1.0/projects/goahead-linux-static.mk
  3. 23 4
      app/goahead-5.1.0/src/goahead.c
  4. 1 1
      app/goahead-5.1.0/src/goahead.h
  5. 22 22
      app/goahead-5.1.0/src/libipmi/inc/libipmi_AppDevice.h
  6. 18 18
      app/goahead-5.1.0/src/libipmi/inc/libipmi_ChassisDevice.h
  7. 4 4
      app/goahead-5.1.0/src/libipmi/inc/libipmi_IPM.h
  8. 18 18
      app/goahead-5.1.0/src/libipmi/inc/libipmi_PEF.h
  9. 22 22
      app/goahead-5.1.0/src/libipmi/inc/libipmi_StorDevice.h
  10. 1 1
      app/goahead-5.1.0/src/libipmi/inc/libipmi_fru.h
  11. 18 18
      app/goahead-5.1.0/src/libipmi/inc/libipmi_sdr.h
  12. 21 21
      app/goahead-5.1.0/src/libipmi/inc/libipmi_sensor.h
  13. 3 83
      app/goahead-5.1.0/src/libipmi/inc/libipmi_session.h
  14. 16 16
      app/goahead-5.1.0/src/libipmi/inc/libipmi_storlead_OEM.h
  15. 18 18
      app/goahead-5.1.0/src/libipmi/inc/libipmi_struct.h
  16. 2 2
      app/goahead-5.1.0/src/libipmi/inc/libsensor.h
  17. 2 2
      app/goahead-5.1.0/src/libipmi/inc/sensor_helpers.h
  18. 30 30
      app/goahead-5.1.0/src/libipmi/src/libipmi_Chassis.c
  19. 8 9
      app/goahead-5.1.0/src/libipmi/src/libipmi_IPM.c
  20. 41 41
      app/goahead-5.1.0/src/libipmi/src/libipmi_PEF.c
  21. 6 6
      app/goahead-5.1.0/src/libipmi/src/libipmi_fru.c
  22. 49 49
      app/goahead-5.1.0/src/libipmi/src/libipmi_sdr.c
  23. 54 54
      app/goahead-5.1.0/src/libipmi/src/libipmi_sensor.c
  24. 141 185
      app/goahead-5.1.0/src/libipmi/src/libipmi_session.c
  25. 314 314
      app/goahead-5.1.0/src/libipmi/src/libipmi_storlead_OEM.c
  26. 7 421
      app/goahead-5.1.0/src/libipmi/src/libipmi_uds_session.c
  27. 7 7
      app/goahead-5.1.0/src/libipmi/src/sensor_helpers.c
  28. 2 0
      app/goahead-5.1.0/src/socket.c
  29. 1 1
      app/goahead-5.1.0/src/utils/mine/ResultUtils.c
  30. 41 45
      app/goahead-5.1.0/src/web_interface/src/dashboard.c

+ 4 - 3
app/common_include/com_IPMIDefs.h

@@ -56,7 +56,7 @@
 #define MAX_SEL_RECORD			(100)
 #define MAX_ID_STR_LEN  		16
 #define MAX_FRU_SDR_STR_SIZE 	40
-#define MAX_SENSOR_INFO_SIZE	(1024*2)
+#define MAX_SENSOR_INFO_SIZE	(1024)
 
 #define AUTH_FILE_PATH		"/etc/goahead/auth.txt"
 
@@ -85,6 +85,8 @@
 #define UDS_PARAM_FAILURE -2
 #define UDS_SOCKET_QUE_LEN  50
 #define MAX_UDS_BUFFER_SIZE 1024
+#define	MAX_REQUEST_SIZE		1024
+#define	MAX_RESPONSE_SIZE		1024
 
 #define WAIT_NONE       0
 #define WAIT_INFINITE   (-1)
@@ -146,8 +148,7 @@
 #define BRIDGING_REQUEST        PARAM_BRIDGE
 
 
-#define	MAX_REQUEST_SIZE		1024
-#define	MAX_RESPONSE_SIZE		1024
+
 
 #define IP4_VERSION     4
 #define IP6_VERSION     6

+ 12 - 11
app/goahead-5.1.0/projects/goahead-linux-static.mk

@@ -38,22 +38,23 @@ ifeq ($(ME_COM_OPENSSL),1)
 endif
 
 #CFLAGS                += -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Wl,-z,relro,-z,now -Wl,--as-needed -Wl,--no-copy-dt-needed-entries -Wl,-z,noexecstatck -Wl,-z,noexecheap -pie -fPIE -w 
+CFLAGS                += -Os -mcpu=cortex-m3 -mthumb
 DFLAGS                +=  $(patsubst %,-D%,$(filter ME_%,$(MAKEFLAGS))) -DME_COM_COMPILER=$(ME_COM_COMPILER) -DME_COM_LIB=$(ME_COM_LIB) -DME_COM_MATRIXSSL=$(ME_COM_MATRIXSSL) -DME_COM_MBEDTLS=$(ME_COM_MBEDTLS) -DME_COM_NANOSSL=$(ME_COM_NANOSSL) -DME_COM_OPENSSL=$(ME_COM_OPENSSL) -DME_COM_OSDEP=$(ME_COM_OSDEP) -DME_COM_SSL=$(ME_COM_SSL) -DME_COM_VXWORKS=$(ME_COM_VXWORKS) 
 IFLAGS                += "-I$(BUILD)/inc"
-LDFLAGS               += 
+LDFLAGS               += -mcpu=cortex-m3 -mthumb -L$(INSTALL_ROOT)/A2F/root/usr/lib
 LIBPATHS              += -L$(BUILD)/bin
 LIBS                  += -lrt -lpthread -lm #-ldl
 
-DEBUG                 ?= debug
-CFLAGS-debug          ?= -g
-DFLAGS-debug          ?= -DME_DEBUG
-LDFLAGS-debug         ?= -g
-DFLAGS-release        ?= 
-CFLAGS-release        ?= -O2
-LDFLAGS-release       ?= 
-CFLAGS                += $(CFLAGS-$(DEBUG))
-DFLAGS                += $(DFLAGS-$(DEBUG))
-LDFLAGS               += $(LDFLAGS-$(DEBUG))
+#DEBUG                 ?= debug
+#CFLAGS-debug          ?= -g
+#DFLAGS-debug          ?= -DME_DEBUG
+#LDFLAGS-debug         ?= -g
+#DFLAGS-release        ?= 
+#CFLAGS-release        ?= -O2
+#LDFLAGS-release       ?= 
+#CFLAGS                += $(CFLAGS-$(DEBUG))
+#DFLAGS                += $(DFLAGS-$(DEBUG))
+#LDFLAGS               += $(LDFLAGS-$(DEBUG))
 
 ME_ROOT_PREFIX        ?= 
 ME_BASE_PREFIX        ?= $(ME_ROOT_PREFIX)/usr/local

+ 23 - 4
app/goahead-5.1.0/src/goahead.c

@@ -57,6 +57,17 @@ MAIN(goahead, int argc, char **argv, char **envp)
     int     argind;
 	logmsg(2, "---> log1\n");
 	error("---> log1\n");
+
+#if defined(ME_UNIX_LIKE)
+    printf("---> ME_UNIX_LIKE\n");
+#endif
+
+#if defined(__linux__)
+    printf("---> __linux__\n");     
+#endif
+
+
+
 #if WINDOWS
     if (windowsInit() < 0) {
         return 0;
@@ -67,10 +78,7 @@ MAIN(goahead, int argc, char **argv, char **envp)
 
 
 /********************* jimbo test code **************************/
-    // Webs wp;
-
-    // getDeviceInfo(&wp);
-    
+ 
 
 /********************* jimbo test end **************************/    
 
@@ -202,6 +210,8 @@ MAIN(goahead, int argc, char **argv, char **envp)
         }
     }
 #endif
+
+
 #if ME_UNIX_LIKE && !MACOSX
     /*
         Service events till terminated
@@ -213,6 +223,13 @@ MAIN(goahead, int argc, char **argv, char **envp)
         }
     }
 #endif
+
+/********************* jimbo test code **************************/
+printf("jimbo test after goahead!\n");
+socket(AF_UNIX, SOCK_STREAM, 0);
+
+/********************* jimbo test end **************************/    
+
 	error( "---> websServiceEvents\n");
     websServiceEvents(&finished);
     logmsg(1, "Instructed to exit");
@@ -220,6 +237,8 @@ MAIN(goahead, int argc, char **argv, char **envp)
 #if WINDOWS
     windowsClose();
 #endif
+
+
     return 0;
 }
 

+ 1 - 1
app/goahead-5.1.0/src/goahead.h

@@ -1993,7 +1993,7 @@ typedef struct Webs {
 #endif
     void            *ssl;               /**< SSL context */
 
-    IPMI20_SESSION_T    ipmi_session;
+//    IPMI20_SESSION_T    ipmi_session;
 } Webs;
 
 #if ME_GOAHEAD_LEGACY

+ 22 - 22
app/goahead-5.1.0/src/libipmi/inc/libipmi_AppDevice.h

@@ -29,66 +29,66 @@ extern "C" {
 #define SERIAL_CHANNEL_MEDIUM_TYPE   0x05
 /*---------- IPMI Command direct routines ----------*/
 /* User Management functions */
-uint16_t IPMICMD_GetUserAccess(IPMI20_SESSION_T* pSession,
+uint16_t IPMICMD_GetUserAccess(IPMI20_UDS_SESSION_T* pUDSSession,
 								 GetUserAccessReq_T* pReqGetUserAccess,
 								 GetUserAccessRes_T* pResGetUserAccess,
 								 int timeout);
 
-uint16_t	IPMICMD_GetUser(IPMI20_SESSION_T *pSession/*in*/, GetUserNameReq_T	*pReqGetUser/*in*/,
+uint16_t	IPMICMD_GetUser(IPMI20_UDS_SESSION_T *pUDSSession/*in*/, GetUserNameReq_T	*pReqGetUser/*in*/,
 							GetUserNameRes_T *pResGetUser/*out*/, int timeout/*in*/);
-uint16_t	IPMICMD_SetUser(IPMI20_SESSION_T *pSession/*in*/, SetUserNameReq_T	*pReqSetUser/*in*/,
+uint16_t	IPMICMD_SetUser(IPMI20_UDS_SESSION_T *pUDSSession/*in*/, SetUserNameReq_T	*pReqSetUser/*in*/,
 							SetUserNameRes_T	*pResSetUser/*out*/, int timeout/*in*/);
-uint16_t	IPMICMD_GetSessionInfo(IPMI20_SESSION_T *pSession/*in*/, GetSesInfoReq_T	*pReqSetUser/*in*/,
+uint16_t	IPMICMD_GetSessionInfo(IPMI20_UDS_SESSION_T *pUDSSession/*in*/, GetSesInfoReq_T	*pReqSetUser/*in*/,
 							GetSesInfoRes_T	*pResSetUser/*out*/, int timeout/*in*/);
-uint16_t IPMICMD_GetUserAccessPayload(IPMI20_SESSION_T* pSession,
+uint16_t IPMICMD_GetUserAccessPayload(IPMI20_UDS_SESSION_T* pUDSSession,
 							 GetUsrPayldAccReq_T* pReqGetUserAccessPayload,
 							 GetUsrPayldAccRes_T* pResGetUserAccessPayload,
 							 int timeout);
-uint16_t IPMICMD_GetWDT(IPMI20_SESSION_T* pSession,
+uint16_t IPMICMD_GetWDT(IPMI20_UDS_SESSION_T* pUDSSession,
 							 GetWDTRes_T* pResGetWDT,
 							 int timeout);
 
-uint16_t IPMICMD_GetChannelInfo(IPMI20_SESSION_T* pSession,
+uint16_t IPMICMD_GetChannelInfo(IPMI20_UDS_SESSION_T* pUDSSession,
 							 GetChInfoReq_T* pReqGetChInfo,
 							 GetChInfoRes_T* pResGetChInfo,
 							 int timeout);
 
-  uint16_t	IPMICMD_GetSystemGUID( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_GetSystemGUID( IPMI20_UDS_SESSION_T *pUDSSession,
                                             GetSysGUIDRes_T *pGetSystemGUID,
                                             int timeout );
-  uint16_t IPMICMD_SendMessage(IPMI20_SESSION_T *pSession,uint8_t *pSendMsgReq,
+  uint16_t IPMICMD_SendMessage(IPMI20_UDS_SESSION_T *pUDSSession,uint8_t *pSendMsgReq,
                                                           uint8_t *pSendMsgRes,uint32_t SendMsgReqLen,int timeout);
 
 /*---------- LIBIPMI Higher level routines -----------*/
 
 /* User Management functions */
-  uint16_t LIBIPMI_HL_SetUser( IPMI20_SESSION_T *pSession/*in*/, char *pszUsername/*in*/,
+  uint16_t LIBIPMI_HL_SetUser( IPMI20_UDS_SESSION_T *pUDSSession/*in*/, char *pszUsername/*in*/,
 										uint8_t byID/*in*/, int timeout/*in*/);
-  uint16_t LIBIPMI_HL_GetUser( IPMI20_SESSION_T *pSession/*in*/, char *pszUsername/*out*/,
+  uint16_t LIBIPMI_HL_GetUser( IPMI20_UDS_SESSION_T *pUDSSession/*in*/, char *pszUsername/*out*/,
 										uint8_t byID/*in*/, int timeout/*in*/);
 
-  uint16_t LIBIPMI_HL_AddUser(IPMI20_SESSION_T *pSession/*in*/,uint8_t UserID/*in*/,
+  uint16_t LIBIPMI_HL_AddUser(IPMI20_UDS_SESSION_T *pUDSSession/*in*/,uint8_t UserID/*in*/,
                                     char* UserName/*in*/,   char* ClearPswd/*in*/,
                                     uint8_t NetworkPriv/*in*/,uint8_t SerialPriv/*in*/,
                                     int timeout);
-uint16_t LIBIPMI_HL_ModUser(IPMI20_SESSION_T *pSession,
+uint16_t LIBIPMI_HL_ModUser(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t UserID,uint8_t IsPwdChange,
 					char* UserName,char* ClearPswd,
 					uint8_t NetworkPriv,uint8_t SerialPriv,uint8_t EnableUser,
 					uint8_t ModifyUserName, uint8_t EnableSOL,
 					int timeout);
-  uint16_t LIBIPMI_HL_DelUser(IPMI20_SESSION_T *pSession/*in*/,uint8_t UserID/*in*/,
+  uint16_t LIBIPMI_HL_DelUser(IPMI20_UDS_SESSION_T *pUDSSession/*in*/,uint8_t UserID/*in*/,
                                     int timeout);
-  uint16_t LIBIPMI_HL_GetMaxNumUsers(IPMI20_SESSION_T* pSession/*in*/,
+  uint16_t LIBIPMI_HL_GetMaxNumUsers(IPMI20_UDS_SESSION_T* pUDSSession/*in*/,
                                     uint8_t *nNumUsers/*in*/, int timeout);
-uint16_t LIBIPMI_HL_GetAllUserInfo(IPMI20_SESSION_T *pSession,
+uint16_t LIBIPMI_HL_GetAllUserInfo(IPMI20_UDS_SESSION_T *pUDSSession,
 							uint8_t* nNumUsers,
 							GetUserNameRes_T* pResGetUserName,
 							GetUserAccessRes_T* pResGetUserAccess_Network,
 							GetUserAccessRes_T* pResGetUserAccess_Serial,
                             GetUsrPayldAccRes_T* pResGetUserAccessPayload_SOL,
 							int timeout);
-uint16_t LIBIPMI_HL_GetOneUserInfo(IPMI20_SESSION_T *pSession,
+uint16_t LIBIPMI_HL_GetOneUserInfo(IPMI20_UDS_SESSION_T *pUDSSession,
                             int UserID,
                             GetUserNameRes_T* pResGetUserName,
 							GetUserAccessRes_T* pResGetUserAccess_Network,
@@ -96,15 +96,15 @@ uint16_t LIBIPMI_HL_GetOneUserInfo(IPMI20_SESSION_T *pSession,
                             GetUsrPayldAccRes_T* pResGetUserAccessPayload_SOL,
 							int timeout);
 
-uint16_t LIBIPMI_HL_GetSessionInfoCurrent( IPMI20_SESSION_T *pSession, GetSesInfoRes_T* SesInfoRes, int timeout );
-uint16_t LIBIPMI_HL_GetChannelAccess(IPMI20_SESSION_T* pSession,uint8_t ChannelMedium,GetChAccessRes_T* pChAccessRes, int timeout);
-uint16_t LIBIPMI_HL_SetChannelAccessPrivilege(IPMI20_SESSION_T* pSession,
+uint16_t LIBIPMI_HL_GetSessionInfoCurrent( IPMI20_UDS_SESSION_T *pUDSSession, GetSesInfoRes_T* SesInfoRes, int timeout );
+uint16_t LIBIPMI_HL_GetChannelAccess(IPMI20_UDS_SESSION_T* pUDSSession,uint8_t ChannelMedium,GetChAccessRes_T* pChAccessRes, int timeout);
+uint16_t LIBIPMI_HL_SetChannelAccessPrivilege(IPMI20_UDS_SESSION_T* pUDSSession,
                                    uint8_t ChannelMedium,uint8_t Privilege,
                                       SetChAccessRes_T* pChAccessRes, int timeout);
 
-  uint16_t LIBIPMI_HL_GetSystemGUID( IPMI20_SESSION_T *pSession, char *pszSystemGUID, int timeout );
+  uint16_t LIBIPMI_HL_GetSystemGUID( IPMI20_UDS_SESSION_T *pUDSSession, char *pszSystemGUID, int timeout );
 
-  uint16_t LIBIPMI_HL_GetUserPrivilege(IPMI20_SESSION_T *pSession, uint8_t UserID, uint32_t *Privilege, int timeout);
+  uint16_t LIBIPMI_HL_GetUserPrivilege(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t UserID, uint32_t *Privilege, int timeout);
 
 #ifdef  __cplusplus
 }

+ 18 - 18
app/goahead-5.1.0/src/libipmi/inc/libipmi_ChassisDevice.h

@@ -36,65 +36,65 @@ extern "C" {
 
 /**
    \breif	Higher level function for PowerOff Host.
-   @param	pSession		[in]Session handle
+   @param	pUDSSession		[in]Session handle
    @param	timeout			[in]timeout value in seconds.
 
    @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
 */
-  uint16_t LIBIPMI_HL_PowerOff( IPMI20_SESSION_T *pSession/*in*/, int timeout/*in*/);
+  uint16_t LIBIPMI_HL_PowerOff( IPMI20_UDS_SESSION_T *pUDSSession/*in*/, int timeout/*in*/);
 
 
 
 /**
    \breif	Higher level function for PowerUP Host
-   @param	pSession		[in]Session handle
+   @param	pUDSSession		[in]Session handle
    @param	timeout			[in]timeout value in seconds.
 
    @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
 */
-  uint16_t LIBIPMI_HL_PowerUp( IPMI20_SESSION_T *pSession/*in*/, int timeout/*in*/);
+  uint16_t LIBIPMI_HL_PowerUp( IPMI20_UDS_SESSION_T *pUDSSession/*in*/, int timeout/*in*/);
 
 
 
 /**
    \breif	Higher level function for PowerCycle host.
-   @param	pSession		[in]Session handle
+   @param	pUDSSession		[in]Session handle
    @param	timeout			[in]timeout value in seconds.
 
    @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
 */
-  uint16_t LIBIPMI_HL_PowerCycle( IPMI20_SESSION_T *pSession, int timeout );
+  uint16_t LIBIPMI_HL_PowerCycle( IPMI20_UDS_SESSION_T *pUDSSession, int timeout );
 
 
 
 /**
    \breif	Higher level function for HardReset
-   @param	pSession		[in]Session handle
+   @param	pUDSSession		[in]Session handle
    @param	timeout			[in]timeout value in seconds.
 
    @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
 */
-  uint16_t LIBIPMI_HL_HardReset( IPMI20_SESSION_T *pSession, int timeout );
+  uint16_t LIBIPMI_HL_HardReset( IPMI20_UDS_SESSION_T *pUDSSession, int timeout );
     
 
 /**
    \breif	Higher level function for DiagInt
-   @param	pSession		[in]Session handle
+   @param	pUDSSession		[in]Session handle
    @param	timeout			[in]timeout value in seconds.
 
    @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
 */
-  uint16_t LIBIPMI_HL_DiagInt( IPMI20_SESSION_T *pSession, int timeout );
+  uint16_t LIBIPMI_HL_DiagInt( IPMI20_UDS_SESSION_T *pUDSSession, int timeout );
     
 
 /**
    \breif	Higher level function for SoftOff
-   @param	pSession		[in]Session handle
+   @param	pUDSSession		[in]Session handle
    @param	timeout			[in]timeout value in seconds.
 
    @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
 */
-  uint16_t LIBIPMI_HL_SoftOff( IPMI20_SESSION_T *pSession, int timeout );
+  uint16_t LIBIPMI_HL_SoftOff( IPMI20_UDS_SESSION_T *pUDSSession, int timeout );
     
 
 
@@ -116,13 +116,13 @@ typedef struct tag_chassis_status_T
 /** 
  * 
  * 
- *  @param	pSession		[in]Session handle
+ *  @param	pUDSSession		[in]Session handle
  *  @param	timeout			[in]timeout value in seconds.
  *  @param      status			[out]status of the host is returned.
  * 
  * @return  Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
  */
-  uint16_t	LIBIPMI_HL_GetChassisStatus( IPMI20_SESSION_T *pSession, int timeout,  chassis_status_T *status);
+  uint16_t	LIBIPMI_HL_GetChassisStatus( IPMI20_UDS_SESSION_T *pUDSSession, int timeout,  chassis_status_T *status);
 
 /*---------------------Chassis Idnetify defines ---------------------*/
 #define CHASSIS_ID_INTERVAL_TURN_OFF		0
@@ -137,17 +137,17 @@ typedef enum tag_FORCE_CHASSIS_ID
 /** 
  * 
  * 
- *  @param	pSession		[in]Session handle
+ *  @param	pUDSSession		[in]Session handle
  *  @param	timeout			[in]timeout value in seconds.
  *  @param      BlinkTimeSecs		[in]BlinkTimeInSecs.0 for Turn off (use #defs above)
  *  @param 	ForceOn			[in] Whether Interval is indefinite (Use enum above)
  * 
  * @return  Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
  */
-  uint16_t LIBIPMI_HL_ChassisIdentify(IPMI20_SESSION_T *pSession, int timeout,uint8_t BlinkTimeSecs,FORCE_CHASSIS_ID ForceOn);
+  uint16_t LIBIPMI_HL_ChassisIdentify(IPMI20_UDS_SESSION_T *pUDSSession, int timeout,uint8_t BlinkTimeSecs,FORCE_CHASSIS_ID ForceOn);
 
-uint16_t	LIBIPMI_HL_GetSystemBootOptions_BootFlags( IPMI20_SESSION_T *pSession, BootFlags_T* pBootFlags,int timeout);
-uint16_t	LIBIPMI_HL_SetSystemBootOptions_BootFlags( IPMI20_SESSION_T *pSession, BootFlags_T* pBootFlags,int timeout);
+uint16_t	LIBIPMI_HL_GetSystemBootOptions_BootFlags( IPMI20_UDS_SESSION_T *pUDSSession, BootFlags_T* pBootFlags,int timeout);
+uint16_t	LIBIPMI_HL_SetSystemBootOptions_BootFlags( IPMI20_UDS_SESSION_T *pUDSSession, BootFlags_T* pBootFlags,int timeout);
 
     
 

+ 4 - 4
app/goahead-5.1.0/src/libipmi/inc/libipmi_IPM.h

@@ -26,21 +26,21 @@ extern "C" {
 
 /*---------- IPMI Command direct routines ----------*/
 /* Device ID */
-extern uint16_t	IPMICMD_GetDeviceID( IPMI20_SESSION_T *pSession/*in*/,
+extern uint16_t	IPMICMD_GetDeviceID( IPMI20_UDS_SESSION_T *pUDSSession/*in*/,
 										GetDevIDRes_T *pGetDeviceID/*out*/,
 										int timeout/*in*/);
 /* Device GUID */
-extern uint16_t	IPMICMD_GetDeviceGUID( IPMI20_SESSION_T *pSession/*in*/, 
+extern uint16_t	IPMICMD_GetDeviceGUID( IPMI20_UDS_SESSION_T *pUDSSession/*in*/, 
                                         GetDevGUIDRes_T *pGetDeviceGUID/*out*/,
                                         int timeout/*in*/ );
 
 /*---------- LIBIPMI Higher level routines -----------*/
 /* Device ID */
-extern uint16_t LIBIPMI_HL_GetDeviceID( IPMI20_SESSION_T *pSession/*in*/,
+extern uint16_t LIBIPMI_HL_GetDeviceID( IPMI20_UDS_SESSION_T *pUDSSession/*in*/,
 											char *pszDeviceID/*out*/, int timeout/*in*/ );
 
 /* Device GUID */
-extern uint16_t LIBIPMI_HL_GetDeviceGUID( IPMI20_SESSION_T *pSession /*in*/, 
+extern uint16_t LIBIPMI_HL_GetDeviceGUID( IPMI20_UDS_SESSION_T *pUDSSession /*in*/, 
                                             char *pszDeviceGUID /*out*/, int timeout /*in*/);
 
 #ifdef  __cplusplus

+ 18 - 18
app/goahead-5.1.0/src/libipmi/inc/libipmi_PEF.h

@@ -25,97 +25,97 @@ extern "C" {
 #endif
 
 /* Get PEF Capabilities Command */
-  uint16_t	IPMICMD_GetPEFCapabilities( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_GetPEFCapabilities( IPMI20_UDS_SESSION_T *pUDSSession,
 							GetPEFCapRes_T *pResGetPEFCap,
 							int timeout);
 
 /* Arm PEF Postpone Timer Command */
-  uint16_t	IPMICMD_ArmPEFTimer( IPMI20_SESSION_T *pSession/*in*/,
+  uint16_t	IPMICMD_ArmPEFTimer( IPMI20_UDS_SESSION_T *pUDSSession/*in*/,
 							uint8_t*	pReqTmrTimeout/*in*/,
 							ArmPEFTmrRes_T *pResArmPEFTmr/*out*/,
 							int timeout/*in*/);
 
 /* Set PEF Configuration Parameters Command */
-  uint16_t	IPMICMD_SetPEFConf( IPMI20_SESSION_T *pSession/*in*/,
+  uint16_t	IPMICMD_SetPEFConf( IPMI20_UDS_SESSION_T *pUDSSession/*in*/,
 							uint8_t *pReqSetPEFConf/*in*/,
 							uint32_t dwReqBufLen,
 							uint8_t *pResSetPEFConf/*out*/,
 							int timeout/*in*/);
 
 /* Get PEF Configuration Parameters Command */
-  uint16_t	IPMICMD_GetPEFConf( IPMI20_SESSION_T *pSession/*in*/,
+  uint16_t	IPMICMD_GetPEFConf( IPMI20_UDS_SESSION_T *pUDSSession/*in*/,
 							GetPEFConfigReq_T *pReqGetPEFConf/*in*/,
 							uint8_t *pResGetPEFConf/*out*/,
 							int timeout/*in*/);
 
 /* Set Last Processed Event ID Command */
-  uint16_t	IPMICMD_SetLastEventID( IPMI20_SESSION_T *pSession/*in*/,
+  uint16_t	IPMICMD_SetLastEventID( IPMI20_UDS_SESSION_T *pUDSSession/*in*/,
 							SetLastEvtIDReq_T *pReqSetLastEvt/*in*/,
 							uint8_t *pResSetLastEvt/*out*/,
 							int timeout/*in*/);
 
 /* Get Last Processed Event ID Command */
-  uint16_t	IPMICMD_GetLastEventID( IPMI20_SESSION_T *pSession/*in*/,
+  uint16_t	IPMICMD_GetLastEventID( IPMI20_UDS_SESSION_T *pUDSSession/*in*/,
 							GetLastEvtIDRes_T *pResGetLastEvt/*out*/,
 							int timeout/*in*/);
 
 /* Alert Immediate Command */
-  uint16_t	IPMICMD_AlertImmediate( IPMI20_SESSION_T *pSession/*in*/,
+  uint16_t	IPMICMD_AlertImmediate( IPMI20_UDS_SESSION_T *pUDSSession/*in*/,
 							AlertImmReq_T *pReqAlertImmediate/*in*/,
 							AlertImmRes_T *pResAlertImmediate/*out*/,
 							int timeout/*in*/);
 
 /* PET Acknowledge Command */
-  uint16_t	IPMICMD_PETAck( IPMI20_SESSION_T *pSession/*in*/,
+  uint16_t	IPMICMD_PETAck( IPMI20_UDS_SESSION_T *pUDSSession/*in*/,
 							PETAckReq_T *pReqPETAck /*out*/,
 							uint8_t *pResPETACK /*out*/,
 							int timeout/*in*/);
 
 /*---------- PEF Higher level routines -----------*/
 /*********** Alert Table **********/
-  uint16_t LIBIPMI_HL_GetNumOfAlertPolicyEntries(IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetNumOfAlertPolicyEntries(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t* pNumOfAlertPolicyEntries,
 					int timeout);
-  uint16_t LIBIPMI_HL_GetAnAlertEntry(IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetAnAlertEntry(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t AlertEntryNumber,
 					AlertPolicyTblEntry_T* pAlertEntry,
 					int timeout);
-  uint16_t LIBIPMI_HL_SetAnAlertEntry(IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_SetAnAlertEntry(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t AlertEntryNumber,
 					AlertPolicyTblEntry_T* pAlertEntry,
 					int timeout);
 
-  uint16_t LIBIPMI_HL_GetAlertTable(IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetAlertTable(IPMI20_UDS_SESSION_T *pUDSSession,
 					AlertPolicyTblEntry_T* pAlertTable,
 					uint8_t* pNumOfAlertEntries,
 					int timeout);
 
-  uint16_t LIBIPMI_HL_SetGraspAlertLevel(IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_SetGraspAlertLevel(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t IndexNum,
 					uint8_t AlertLevel, 
 					uint8_t Channel, 
 					int timeout);
 
 
-  uint16_t LIBIPMI_HL_GetGraspAlertLevel(IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetGraspAlertLevel(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t IndexNum,
 					uint8_t* AlertLevel, 
 					uint8_t* DestIndex,
 					int timeout);
 /*********** PEF Table ********/
-  uint16_t LIBIPMI_HL_GetPEFTable(IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetPEFTable(IPMI20_UDS_SESSION_T *pUDSSession,
 					EvtFilterTblEntry_T* pPEFTable,
 					uint8_t* pNumOfPEFEntries,
 					int timeout);
-  uint16_t LIBIPMI_HL_GetPEFEntry(IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetPEFEntry(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t PEFEntryNumber,
 					EvtFilterTblEntry_T* pPEFEntry,
 					int timeout);
-  uint16_t LIBIPMI_HL_SetPEFEntry(IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_SetPEFEntry(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t PEFEntryNumber,
 					EvtFilterTblEntry_T* pPEFEntry,
 					int timeout);
-  uint16_t LIBIPMI_HL_GetNumOfPEFEntries(IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetNumOfPEFEntries(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t* pNumOfPEFEntries,
 					int timeout);
 

+ 22 - 22
app/goahead-5.1.0/src/libipmi/inc/libipmi_StorDevice.h

@@ -32,51 +32,51 @@ extern "C" {
 /*****************************************************************************
 	System Event Log
 ******************************************************************************/
-  uint16_t IPMICMD_GetSELInfo(IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_GetSELInfo(IPMI20_UDS_SESSION_T *pUDSSession,
 					SELInfo_T *pResGetSELInfo,
 					int timeout);
-  uint16_t IPMICMD_GetSELAllocationInfo(IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_GetSELAllocationInfo(IPMI20_UDS_SESSION_T *pUDSSession,
 					SELAllocInfo_T *pResGetSELAllocInfo,
 					int timeout);
-  uint16_t IPMICMD_ReserveSEL(IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_ReserveSEL(IPMI20_UDS_SESSION_T *pUDSSession,
 					ReserveSELRes_T* pReserveSelRes,
 					int timeout);
-  uint16_t IPMICMD_GetSELEntry(IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_GetSELEntry(IPMI20_UDS_SESSION_T *pUDSSession,
 					GetSELReq_T* pGetSELReqData,
 					uint8_t* pGetSELResData,
 					uint32_t ResDataLen,
 					int timeout);
-  uint16_t IPMICMD_AddSELEntry(IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_AddSELEntry(IPMI20_UDS_SESSION_T *pUDSSession,
 					SELEventRecord_T* pSELReqData,
 					AddSELRes_T* pSELResData,
 					int timeout);
-  uint16_t IPMICMD_DeleteSELEntry(IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_DeleteSELEntry(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint16_t RecordID,
 					int timeout);
 
 /*---------- LIBIPMI Higher level routines -----------*/
-  uint16_t LIBIPMI_HL_GetNumOfSELEntries(IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetNumOfSELEntries(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint16_t* nNumOfSELEntries,
 					int timeout);
-  uint16_t LIBIPMI_HL_GetMaxPossibleSELEntries(IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetMaxPossibleSELEntries(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint16_t* nMaxPossibleSELEntries,
 					int timeout);
-  uint16_t LIBIPMI_HL_GetAllSELEntries(IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetAllSELEntries(IPMI20_UDS_SESSION_T *pUDSSession,
 					SELEventRecord_T *pSELEntriesBuffer,
 					int timeout);
 
-  uint16_t LIBIPMI_HL_GetAllSensorInfo(IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetAllSensorInfo(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t **SDRBuff,
 					int *SDRCount,
 					int *MaxSDRLen,
 					int timeout);
-  uint16_t LIBIPMI_HL_GetSensorName(IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetSensorName(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t SlaveAdd,
 					uint8_t LUNid,
 					uint8_t SensorNum,
 					uint8_t *SensorName,
 					int timeout);
-uint16_t LIBIPMI_HL_GetAllFRUDevice(IPMI20_SESSION_T *pSession,
+uint16_t LIBIPMI_HL_GetAllFRUDevice(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t *pFRUIDs,
 					uint8_t *nFRUs,
 					uint8_t nFRUsName[][16],
@@ -121,45 +121,45 @@ uint8_t libipmi_GetBits(uint8_t orig, uint8_t startbit, uint8_t endbit);
 //Will remove this macro when all projects stop using it
 #define GetBits libipmi_GetBits
 
-  uint16_t IPMICMD_GetFRUInventoryAreaInfo(IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_GetFRUInventoryAreaInfo(IPMI20_UDS_SESSION_T *pUDSSession,
 				FRUInventoryAreaInfoReq_T *pReqFRUInventoryAreaInfo,
 				FRUInventoryAreaInfoRes_T *pResFRUInventoryAreaInfo,
 				int timeout);
 
-  uint16_t IPMICMD_ReadFRUData(IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_ReadFRUData(IPMI20_UDS_SESSION_T *pUDSSession,
 				FRUReadReq_T* pFRUReadReqData,
 				FRUReadRes_T* pFRUReadResData,
 				int timeout);
 
-  uint16_t IPMICMD_WriteFRUData(IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_WriteFRUData(IPMI20_UDS_SESSION_T *pUDSSession,
 				FRUWriteReq_T* pFRUWriteReqData,
 				uint32_t ReqDataLen /* Bytes to be written + sizeof(FRUWriteReq_T) */,
 				FRUWriteRes_T* pFRUWriteResData,
 				int timeout);
 
-  uint16_t LIBIPMI_HL_GetAllFRUDevices(IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetAllFRUDevices(IPMI20_UDS_SESSION_T *pUDSSession,
 				uint8_t *pFRUIDs,
 				uint8_t *pFRUNames,
 				uint8_t *nFRUs,
 				int timeout);
 
-  uint16_t LIBIPMI_HL_GetAllSelEntriesWithSensorNames(IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetAllSelEntriesWithSensorNames(IPMI20_UDS_SESSION_T *pUDSSession,
 	SELEventRecordWithSensorName_T *pSELEntriesBuffer,
 	int timeout);
 
-  uint16_t IPMICMD_ClearSEL(IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_ClearSEL(IPMI20_UDS_SESSION_T *pUDSSession,
 				int timeout);
 
-  uint8_t IPMICMD_GetSELTime(IPMI20_SESSION_T *pSession,
+  uint8_t IPMICMD_GetSELTime(IPMI20_UDS_SESSION_T *pUDSSession,
 				GetSELTimeRes_T *pGetSELTimeRes, int timeout);
 
-  uint8_t IPMICMD_SetSELTime(IPMI20_SESSION_T *pSession,
+  uint8_t IPMICMD_SetSELTime(IPMI20_UDS_SESSION_T *pUDSSession,
 				SetSELTimeReq_T *pSetSELTimeReq, int timeout);
 
-  uint8_t IPMICMD_GetSELTimeUTCOffset(IPMI20_SESSION_T *pSession,
+  uint8_t IPMICMD_GetSELTimeUTCOffset(IPMI20_UDS_SESSION_T *pUDSSession,
 				GetSELTimeUTCOffsetRes_T *pGetSELTimeUTCOffsetRes, int timeout);
 
-  uint8_t IPMICMD_SetSELTimeUTCOffset(IPMI20_SESSION_T *pSession,
+  uint8_t IPMICMD_SetSELTimeUTCOffset(IPMI20_UDS_SESSION_T *pUDSSession,
 				SetSELTimeUTCOffsetReq_T *pSetSELTimeUTCOffsetReq, int timeout);
 
 

+ 1 - 1
app/goahead-5.1.0/src/libipmi/inc/libipmi_fru.h

@@ -82,7 +82,7 @@ typedef struct fru_t
 }FRU_T;
 
 
-  uint16_t LIBIPMI_HL_GetFRUData(IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetFRUData(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t fru_device_id,
 				  	uint32_t* p_fru_size,
 				  	FRUData_T* fru_data,

+ 18 - 18
app/goahead-5.1.0/src/libipmi/inc/libipmi_sdr.h

@@ -21,94 +21,94 @@ extern "C" {
 
 
 /* Get SDR Repository Info Command */
-  uint16_t	IPMICMD_GetSDRRepositoryInfo( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_GetSDRRepositoryInfo( IPMI20_UDS_SESSION_T *pUDSSession,
 										SDRRepositoryInfo_T *pResGetSDRRepositoryInfo,
 										int timeout);
 
 /* Get SDR Repository Allocation Info Command */
-  uint16_t	IPMICMD_GetSDRRepositoryAllocInfo( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_GetSDRRepositoryAllocInfo( IPMI20_UDS_SESSION_T *pUDSSession,
 										SDRRepositoryAllocInfo_T *pResGetSDRRepositoryAllocInfo,
 										int timeout);
 
 /* Reserve SDR Repository Command */
-  uint16_t	IPMICMD_ReserveSDRRepository( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_ReserveSDRRepository( IPMI20_UDS_SESSION_T *pUDSSession,
 										ReserveSDRRepositoryRes_T *pResReserveSDRRepository,
 										int timeout);
 
 /* Get SDR Command */
-  uint16_t	IPMICMD_GetSDR( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_GetSDR( IPMI20_UDS_SESSION_T *pUDSSession,
 									GetSDRReq_T *pReqGetSDR,
 									GetSDRRes_T *pResGetSDR,
 									uint32_t		*pdwOutBuffLen,
 									int timeout);
 
 /* Add SDR Command */
-  uint16_t	IPMICMD_AddSDR( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_AddSDR( IPMI20_UDS_SESSION_T *pUDSSession,
 									uint8_t		*pReqAddSDR,
 									uint32_t		dwInBuffLen,
 									AddSDRRes_T *pResAddSDR,
 									int timeout);
 
 /* Partial Add SDR Command */
-  uint16_t	IPMICMD_PartialAddSDR( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_PartialAddSDR( IPMI20_UDS_SESSION_T *pUDSSession,
 									PartialAddSDRReq_T *pReqPartialAddSDR,
 									uint32_t		dwInBuffLen,
 									PartialAddSDRRes_T *pResPartialAddSDR,
 									int timeout);
 
 /* Delete SDR Command */
-  uint16_t	IPMICMD_DeleteSDR( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_DeleteSDR( IPMI20_UDS_SESSION_T *pUDSSession,
 									DeleteSDRReq_T *pReqDeleteSDR,
 									DeleteSDRReq_T *pResDeleteSDR,
 									int timeout);
 
 /* Clear SDR Repository Command */
-  uint16_t	IPMICMD_ClearSDRRepository( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_ClearSDRRepository( IPMI20_UDS_SESSION_T *pUDSSession,
 									ClearSDRReq_T *pReqClearSDR,
 									ClearSDRRes_T *pResClearSDR,
 									int timeout);
 
 /* Get SDR Repository Time Command */
-  uint16_t	IPMICMD_GetSDRRepositoryTime( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_GetSDRRepositoryTime( IPMI20_UDS_SESSION_T *pUDSSession,
 									GetSDRRepositoryTimeRes_T *pResGetSDRRepositoryTime,
 									int timeout);
 
 /* Set SDR Repository Time Command */
-  uint16_t	IPMICMD_SetSDRRepositoryTime( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_SetSDRRepositoryTime( IPMI20_UDS_SESSION_T *pUDSSession,
 									SetSDRRepositoryTimeReq_T *pReqSetSDRRepositoryTime,
 									uint8_t *pResSetSDRRepositoryTime,
 									int timeout);
 
 /* Enter SDR Repository Update Mode Command */
-  uint16_t	IPMICMD_EnterSDRUpdateMode( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_EnterSDRUpdateMode( IPMI20_UDS_SESSION_T *pUDSSession,
 									EnterSDRUpdateModeRes_T *pResEnterSDRUpdateMode,
 									int timeout);
 
 /* Exit SDR Repository Update Mode Command */
-  uint16_t	IPMICMD_ExitSDRUpdateMode( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_ExitSDRUpdateMode( IPMI20_UDS_SESSION_T *pUDSSession,
 									ExitSDRUpdateModeRes_T *pResExitSDRUpdateMode,
 									int timeout);
 
 /* Run Initialization Agent Command */
-  uint16_t	IPMICMD_RunInitAgent( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_RunInitAgent( IPMI20_UDS_SESSION_T *pUDSSession,
 									RunInitAgentReq_T *pReqRunInitAgent,
 									RunInitAgentRes_T *pResRunInitAgent,
 									int timeout);
 
 /*---------- LIBIPMI Higher level routines -----------*/
-  uint16_t LIBIPMI_HL_GetCompleteSDR( IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetCompleteSDR( IPMI20_UDS_SESSION_T *pUDSSession,
                                               uint16_t record_id,
                                               uint16_t *next_record_id,
                                               uint8_t *sdr_buffer,
                                               size_t buffer_len,
                                               int timeout );
 
-  uint16_t LIBIPMI_HL_GetAllSDRs( IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetAllSDRs( IPMI20_UDS_SESSION_T *pUDSSession,
                                           uint8_t *sdr_buffer, size_t buffer_len,
                                           int timeout );
 
 
-  uint16_t LIBIPMI_HL_GetSDR( IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetSDR( IPMI20_UDS_SESSION_T *pUDSSession,
                                             uint16_t reservation_id,
                                             uint16_t record_id,
                                             GetSDRRes_T *pGetSDRRes,
@@ -122,14 +122,14 @@ extern "C" {
 #define ERR_SDRCACHE_BUFFSIZE		3
 
 
-  uint16_t LIBIPMI_HL_GetAllSDRs_Cached( IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetAllSDRs_Cached( IPMI20_UDS_SESSION_T *pUDSSession,
                                           uint8_t *sdr_buffer, 
 										  uint32_t* sdr_buff_size,
 										  uint32_t* max_sdr_len,
 										  uint32_t * sdr_count,
                                           int timeout );
 
-  uint16_t LIBIPMI_HL_GetSpecificSDR( IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetSpecificSDR( IPMI20_UDS_SESSION_T *pUDSSession,
 										uint8_t *sdr_buffer, 
 										uint32_t* sdr_buff_size,
 										int SensorNumber,

+ 21 - 21
app/goahead-5.1.0/src/libipmi/inc/libipmi_sensor.h

@@ -18,94 +18,94 @@ extern "C" {
 #endif
 
 /* 35.2 Get Device SDR Info Command */
-  uint16_t IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_GetSDRInfo( IPMI20_UDS_SESSION_T *pUDSSession,
                                        uint8_t *pReqGetSDRInfo,
                                        GetSDRInfoRes_T *pResGetSDRInfo,
                                        int timeout);
     
 /* 35.3 Get Device SDR Command */
-  uint16_t IPMICMD_GetDevSDR( IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_GetDevSDR( IPMI20_UDS_SESSION_T *pUDSSession,
                                       GetDevSDRReq_T *pReqDevSDR,
                                       GetDevSDRRes_T *pResDevSDR,
                                       uint32_t *pOutBuffLen,
                                       int timeout);
 
 /* 35.4 Reserve Device SDR Repository Command */
-  uint16_t IPMICMD_ReserveDevSDR( IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_ReserveDevSDR( IPMI20_UDS_SESSION_T *pUDSSession,
                                           ReserveDevSDRRes_T *pResReserveDevSDR,
                                           int timeout);
 
 /* 35.5 Get Sensor Reading Factors Command */
-  uint16_t IPMICMD_GetSensorReadingFactor( IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_GetSensorReadingFactor( IPMI20_UDS_SESSION_T *pUDSSession,
                                                    GetSensorReadingFactorReq_T *pReqGetSensorReadingFactor,
                                                    GetSensorReadingFactorRes_T *pResGetSensorReadingFactor,
                                                    int timeout);
 
 /* 35.6 Set Sensor Hysteresis Command */
-  uint16_t IPMICMD_SetSensorHysterisis( IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_SetSensorHysterisis( IPMI20_UDS_SESSION_T *pUDSSession,
                                                 SetSensorHysterisisReq_T *pReqSetSensorHysterisis,
                                                 SetSensorHysterisisRes_T *pResSetSensorHysterisis,
                                                 int timeout);
 /* 35.7 Get Sensor Hysteresis Command */
-  uint16_t IPMICMD_GetSensorHysterisis( IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_GetSensorHysterisis( IPMI20_UDS_SESSION_T *pUDSSession,
                                                 GetSensorHysterisisReq_T *pReqGetSensorHysterisis,
                                                 GetSensorHysterisisRes_T *pResGetSensorHysterisis,
                                                 int timeout);
 
 /* 35.8 Set Sensor Thresholds Command */
-  uint16_t IPMICMD_SetSensorThreshold( IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_SetSensorThreshold( IPMI20_UDS_SESSION_T *pUDSSession,
                                                SetSensorThresholdReq_T *pReqSetSensorThreshold,
                                                SetSensorThresholdRes_T *pResSetSensorThreshold,
                                                int timeout);
 
 /* 35.9 Get Sensor Thresholds Command */
-  uint16_t IPMICMD_GetSensorThreshold( IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_GetSensorThreshold( IPMI20_UDS_SESSION_T *pUDSSession,
                                                GetSensorThresholdReq_T *pReqGetSensorThreshold,
                                                GetSensorThresholdRes_T *pResGetSensorThreshold,
                                                int timeout);
 
 /* 35.10 Set Sensor Event Enable Command */
-  uint16_t IPMICMD_SetSensorEventEnable( IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_SetSensorEventEnable( IPMI20_UDS_SESSION_T *pUDSSession,
                                                  SetSensorEventEnableReq_T *pReqSetSensorEventEnable,
                                                  SetSensorEventEnableRes_T *pResSetSensorEventEnable,
                                                  int timeout);
 
 /* 35.11 Get Sensor Event Enable Command */
-  uint16_t IPMICMD_GetSensorEventEnable( IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_GetSensorEventEnable( IPMI20_UDS_SESSION_T *pUDSSession,
                                                  GetSensorEventEnableReq_T *pReqGetSensorEventEnable,
                                                  GetSensorEventEnableRes_T *pResGetSensorEventEnable,
                                                  int timeout);
 
 /* 35.12 ReArm Sensor Events Command */
-  uint16_t	IPMICMD_ReArmSensorEvents( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_ReArmSensorEvents( IPMI20_UDS_SESSION_T *pUDSSession,
                                                  ReArmSensorReq_T *pReArmSensorReq,
                                                  ReArmSensorRes_T *pReArmSensorRes,
                                                  int timeout);
 
 /* 35.13 Get Sensor Event Status Command */
-  uint16_t	IPMICMD_GetSensorEventStatus( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_GetSensorEventStatus( IPMI20_UDS_SESSION_T *pUDSSession,
                                                  GetSensorEventStatusReq_T *pReqGetSensorEventStatus,
                                                  GetSensorEventStatusRes_T *pResGetSensorEventStatus,
                                                  int timeout);
 
 /* 35.14 Get Sensor Reading Command */
-  uint16_t IPMICMD_GetSensorReading( IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_GetSensorReading( IPMI20_UDS_SESSION_T *pUDSSession,
                                              GetSensorReadingReq_T *pReqGetSensorReading,
                                              GetSensorReadingRes_T *pResGetSensorReading,
                                              int timeout);
 
 /* 35.15 Set Sensor Type Command */
-  uint16_t IPMICMD_SetSensorType( IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_SetSensorType( IPMI20_UDS_SESSION_T *pUDSSession,
                                           SetSensorTypeReq_T *pReqSetSensorType,
                                           SetSensorTypeRes_T *pResSetSensorType,
                                           int timeout);
 
 /* 35.16 Get Sensor Type Command */
-  uint16_t IPMICMD_GetSensorType( IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_GetSensorType( IPMI20_UDS_SESSION_T *pUDSSession,
                                           GetSensorTypeReq_T *pReqGetSensorType,
                                           GetSensorTypeRes_T *pResGetSensorType,
                                           int timeout);
-  uint16_t IPMICMD_SetSensorReading( IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_SetSensorReading( IPMI20_UDS_SESSION_T *pUDSSession,
                                            SetSensorReadingReq_T *pReqSetSensorReading,
                                            SetSensorReadingRes_T *pResSetSensorReading,
                                            int timeout);
@@ -156,23 +156,23 @@ struct sensor_info
 
 /*------------------------- HL sensor functions -----------------------------*/
   uint16_t
-LIBIPMI_HL_ReadSensorFromSDR( IPMI20_SESSION_T *pSession, uint8_t *sdr_buffer,
+LIBIPMI_HL_ReadSensorFromSDR( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t *sdr_buffer,
                               uint8_t *raw_reading, float *reading,
                               uint8_t *discrete, int timeout );
 
   uint16_t
-LIBIPMI_HL_LoadSensorSDRs( IPMI20_SESSION_T *pSession, uint8_t **sdr_buffer, int *count, int timeout );
+LIBIPMI_HL_LoadSensorSDRs( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t **sdr_buffer, int *count, int timeout );
 
   uint16_t
-LIBIPMI_HL_GetSensorCount( IPMI20_SESSION_T *pSession, int *sdr_count, int timeout );
+LIBIPMI_HL_GetSensorCount( IPMI20_UDS_SESSION_T *pUDSSession, int *sdr_count, int timeout );
 
   uint16_t
-LIBIPMI_HL_GetAllSensorReadings( IPMI20_SESSION_T *pSession,
+LIBIPMI_HL_GetAllSensorReadings( IPMI20_UDS_SESSION_T *pUDSSession,
                                  struct sensor_data *sensor_list, uint32_t nNumSensor,int timeout );
 
 
   uint16_t 
-LIBIPMI_HL_GetSensorHistoryReadingData( IPMI20_SESSION_T *pSession,            
+LIBIPMI_HL_GetSensorHistoryReadingData( IPMI20_UDS_SESSION_T *pUDSSession,            
                                                  SensorhistoryData_T *pHistoryData, uint8_t nNumSensor, int timeout);
 
 

+ 3 - 83
app/goahead-5.1.0/src/libipmi/inc/libipmi_session.h

@@ -14,73 +14,12 @@
 #include <stdio.h>
 #include "libipmi_struct.h"
 #include "libipmi_errorcodes.h"
-//#include "libipmiifc.h"
-//#include "libipmi_version.h"
-
-
-
-//#include "IPMI_RMCP.h"
-//#include "IPMI_App.h"
-//#include "IPMI_AppDevice.h"
-//#include "IPMI_RMCP+.h"
-//#include "IPMI_AMI.h"
-//#include "AES.h"
-//#include "hmac.h"
-//#include "sha1.h"
-//#include <time.h>
-//
-//typedef struct
-//{
-//    uint32_t      Param;                    /* Parameter */
-//    uint8_t       Channel;                  /* Originator's channel number */
-//    uint8_t       SrcQ [64];     /* Originator Queue */
-//    uint8_t       Cmd;                      /* Command that needs to be processed*/
-//    uint8_t       NetFnLUN;                 /* Net function and LUN of command   */
-//    uint8_t       Privilege;                /* Current privilege level */
-//    uint32_t      SessionID;                /* Session ID if any */
-//    time_t      ReqTime;                  /* Request Timestamp */
-//    uint16_t       ResTimeOut;              /* response timeout in secs */
-//    uint16_t      SessionType;               /* Session Type */
-//    uint8_t       IPAddr [16];    /* IPv6 Address */
-//    uint16_t      UDPPort;                  /* UDP Port Number  */
-//    uint16_t      Socket;                   /* socket handle    */
-//    uint32_t      Size;                     /* Size of the data */
-//    uint8_t       Data [1024 * 60];  /* Data */
-//} PACKED MsgPkt_T;
-//
-//typedef union
-//{
-//    IPMIMsgHdr_T        IPMIMsgHdr;
-//    IPMIUDSMsg_T        UDSMsgHdr;
-//}PACKED ResMsgHdr_T;
-//#include "BridgeMsgAPI.h"
-
-/* Undefine PACK so that it can be redefined in other header files */
 
 
 #ifdef  __cplusplus
 extern "C" {
 #endif
 
-// extern uint16_t Create_IPMI20_UDS_Session(IPMI20_SESSION_T *pSession, char *pszSocketPath,
-// 				char *pszUserName, char *pszPassword, uint8_t *byPrivLevel,
-// 				char *pUserName, uint8_t *ipaddr, int timeout, uint8_t ChannelNum);
-
-
-/**
-This function is used to get the UserID for given Username and Password.
-It compares all IPMI username with the IN argument Username.
-If it matches, then it checks for the password.
-If password also matches, it will return SUCCESS and corresponding User ID.
-Since duplicate username is supported in IPMI specification,
-It will executes unless it gets SUCCESS or reaches MAX_USERS_COUNT.
-Username and Password are IN arguments, UserID is OUT argument.
-**/
-extern int LIBIPMI_GetUserIDForUserName(IPMI20_SESSION_T *pSession, 
-							char *UserName, char *Password, 
-							uint8_t *UserID,int timeout);
-
-
 /**
 \breif	Create UDS session to comunitation with BMC
  @param	pSession			[in]Session Info handle
@@ -88,7 +27,7 @@ extern int LIBIPMI_GetUserIDForUserName(IPMI20_SESSION_T *pSession,
 
  @retval Returns LIBIPMI_E_SUCCESS on success and error codes on failure
 */
-uint16_t LIBIPMI_CreateSession(IPMI20_SESSION_T *pSession, int timeout);
+uint16_t LIBIPMI_CreateSession(IPMI20_UDS_SESSION_T *pUDSSession, int timeout);
 
 /**
 \breif	Sends RAW IPMI Command to the BMC
@@ -105,7 +44,7 @@ uint16_t LIBIPMI_CreateSession(IPMI20_SESSION_T *pSession, int timeout);
 
  @retval Returns LIBIPMI_E_SUCCESS on success and error codes on failure
 */
-extern uint16_t LIBIPMI_Send_RAW_IPMI2_0_Command(IPMI20_SESSION_T *pSession,
+uint16_t LIBIPMI_Send_RAW_IPMI2_0_Command(IPMI20_UDS_SESSION_T *pUDSSession,
 									uint8_t byNetFnLUN, uint8_t byCommand,
 									uint8_t *pszReqData, uint32_t dwReqDataLen,
 									uint8_t *pszResData, uint32_t *pdwResDataLen,
@@ -118,26 +57,7 @@ extern uint16_t LIBIPMI_Send_RAW_IPMI2_0_Command(IPMI20_SESSION_T *pSession,
 
  @retval Returns LIBIPMI_E_SUCCESS on success and error codes on failure
 */
-extern uint16_t LIBIPMI_CloseSession( IPMI20_SESSION_T *pSession );
-
-/**
-\breif	returns status whether the session is started or not
- @param	pSession			[in]Session Info handle
- 
- @retval 1 if session is started and 0 if not
-*/
-extern uint8_t	IsSessionStarted(IPMI20_SESSION_T *pSession);
-
-/**
-\brief  Sets the Cmd Retry Count and Interval
- @param pSession                        [in]Session Info handle
- @retval Returns LIBIPMI_E_SUCCESS on success and error codes on failure
- @note This function is not implemented 
-*/
-
-extern uint16_t LIBIPMI_SetRetryCfg( IPMI20_SESSION_T *pSession, 
-										int nCmdRetryCount, 
-										int nCmdRetryInterval);
+extern uint16_t LIBIPMI_CloseSession( IPMI20_UDS_SESSION_T *pUDSSession );
 
 #ifdef  __cplusplus
 }

+ 16 - 16
app/goahead-5.1.0/src/libipmi/inc/libipmi_storlead_OEM.h

@@ -104,22 +104,22 @@ typedef struct{
 } SensorHistoryCapability_T;
 
 extern OemWebFlags_T g_OemWebFlags;
-//uint16_t LIBIPMI_HL_GetIPMCSensorInfo(IPMI20_SESSION_T *pSession, SenInfo_T *pSensorInfo,uint32_t *nNumSensor,int timeout);
-
-uint16_t LIBIPMI_HL_FanCtrol( IPMI20_SESSION_T *pSession, uint8_t fanIndex, uint8_t fanMode, uint8_t fanLevel, int timeout);
-int LIBIPMI_HL_GetFanStatus( IPMI20_SESSION_T *pSession, uint8_t fanIndex, OemFanStatus_T *pFanStatus, int timeout);
-uint16_t LIBIPMI_HL_GetSysInfo( IPMI20_SESSION_T *pSession, SysInfo_T *pSysInfo, int timeout);
-uint16_t LIBIPMI_HL_GetSensorHistory( IPMI20_SESSION_T *pSession, sensor_history_st *pSensorHistory_st, int card_index, int sensor_number, int IPMB_ADDR);
-uint16_t LIBIPMI_HL_GetAllCards(IPMI20_SESSION_T *pSession, CardStatus_T*	pResBladeSts, int timeout);
-int	 LIBIPMI_HL_GetChassisInfo(IPMI20_SESSION_T *pSession, OemChassisInfo_T* pBladeInfo, int timeout);
-int 	 LIBIPMI_HL_GetBladeStatus(IPMI20_SESSION_T *pSession, OemBladeStatus_T* pBladeStatus, int timeout);
-int LIBIPMI_HL_GetIPMCCapability(IPMI20_SESSION_T *pSession, uint8_t bladeIndex, OemIPMCCapability_T* pIPMCCapability, int timeout);
-int LIBIPMI_HL_SetBladeManageFn(IPMI20_SESSION_T *pSession, uint8_t enable, int timeout);
-int LIBIPMI_HL_GetManageWebName(IPMI20_SESSION_T *pSession, char* webName, int timeout);
-int LIBIPMI_HL_GetFanInfo(IPMI20_SESSION_T *pSession, OemFanInfo_T* pFanInfo, int timeout);
-int LIBIPMI_HL_GetSensorHistoryCapability(IPMI20_SESSION_T *pSession, uint8_t sensorNum, SensorHistoryCapability_T* pSensorHistoryCapability, int timeout);
-//int LIBIPMI_HL_GetSensorHistoryEn(IPMI20_SESSION_T *pSession, uint8_t* SensorHistoryEnable, int timeout);
-int LIBIPMI_HL_SetSensorHistoryEn(IPMI20_SESSION_T *pSession, uint8_t sensorNum, uint8_t SensorHistoryEnable, int timeout);
+//uint16_t LIBIPMI_HL_GetIPMCSensorInfo(IPMI20_UDS_SESSION_T *pUDSSession, SenInfo_T *pSensorInfo,uint32_t *nNumSensor,int timeout);
+
+//uint16_t LIBIPMI_HL_FanCtrol( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t fanIndex, uint8_t fanMode, uint8_t fanLevel, int timeout);
+//int LIBIPMI_HL_GetFanStatus( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t fanIndex, OemFanStatus_T *pFanStatus, int timeout);
+uint16_t LIBIPMI_HL_GetSysInfo( IPMI20_UDS_SESSION_T *pUDSSession, SysInfo_T *pSysInfo, int timeout);
+//uint16_t LIBIPMI_HL_GetSensorHistory( IPMI20_UDS_SESSION_T *pUDSSession, sensor_history_st *pSensorHistory_st, int card_index, int sensor_number, int IPMB_ADDR);
+//uint16_t LIBIPMI_HL_GetAllCards(IPMI20_UDS_SESSION_T *pUDSSession, CardStatus_T*	pResBladeSts, int timeout);
+//int	 LIBIPMI_HL_GetChassisInfo(IPMI20_UDS_SESSION_T *pUDSSession, OemChassisInfo_T* pBladeInfo, int timeout);
+//int 	 LIBIPMI_HL_GetBladeStatus(IPMI20_UDS_SESSION_T *pUDSSession, OemBladeStatus_T* pBladeStatus, int timeout);
+//int LIBIPMI_HL_GetIPMCCapability(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t bladeIndex, OemIPMCCapability_T* pIPMCCapability, int timeout);
+//int LIBIPMI_HL_SetBladeManageFn(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t enable, int timeout);
+//int LIBIPMI_HL_GetManageWebName(IPMI20_UDS_SESSION_T *pUDSSession, char* webName, int timeout);
+//int LIBIPMI_HL_GetFanInfo(IPMI20_UDS_SESSION_T *pUDSSession, OemFanInfo_T* pFanInfo, int timeout);
+//int LIBIPMI_HL_GetSensorHistoryCapability(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t sensorNum, SensorHistoryCapability_T* pSensorHistoryCapability, int timeout);
+//int LIBIPMI_HL_GetSensorHistoryEn(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t* SensorHistoryEnable, int timeout);
+//int LIBIPMI_HL_SetSensorHistoryEn(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t sensorNum, uint8_t SensorHistoryEnable, int timeout);
 
 #endif /* __LIBIPMI_STORLEAD_OEM_H__ */
 

+ 18 - 18
app/goahead-5.1.0/src/libipmi/inc/libipmi_struct.h

@@ -44,27 +44,27 @@ typedef struct IPMI20_UDS_SESSION_T_tag {
 }PACK IPMI20_UDS_SESSION_T;
 
 
-/**
- @def IPMI20_SESSION_T
- @brief holds info for maintaining a session
-*/
-typedef struct IPMI20_SESSION_T_tag {
-/* Medium type (Network, Serial, KCS, IPMB, USB) */
-	uint8_t	byMediumType;
-#define	UDS_MEDIUM	          0x07
+// /**
+//  @def IPMI20_SESSION_T
+//  @brief holds info for maintaining a session
+// */
+// typedef struct IPMI20_SESSION_T_tag {
+// /* Medium type (Network, Serial, KCS, IPMB, USB) */
+// 	uint8_t	byMediumType;
+// #define	UDS_MEDIUM	          0x07
 
-/* tells whether session has started or not. */
-	uint8_t	bySessionStarted;
-#define SESSION_NOT_STARTED 0x00
-#define SESSION_STARTED	0x01
+// /* tells whether session has started or not. */
+// 	uint8_t	bySessionStarted;
+// #define SESSION_NOT_STARTED 0x00
+// #define SESSION_STARTED	0x01
 
-/* if this value is > 0, session reestablishment will be tried for byMaxRetries times. */
-	uint8_t	byMaxRetries;
-/* LAN Eth Index for hold Eth number if multi NIc supported */
-	uint8_t         EthIndex;
-	IPMI20_UDS_SESSION_T		*hUDSSession;
+// /* if this value is > 0, session reestablishment will be tried for byMaxRetries times. */
+// 	uint8_t	byMaxRetries;
+// /* LAN Eth Index for hold Eth number if multi NIc supported */
+// 	uint8_t         EthIndex;
+// 	IPMI20_UDS_SESSION_T		*hUDSSession;
 
-} PACK IPMI20_SESSION_T;
+// } PACK IPMI20_SESSION_T;
 
 typedef enum
 {

+ 2 - 2
app/goahead-5.1.0/src/libipmi/inc/libsensor.h

@@ -52,8 +52,8 @@ struct sensor_data
 
 #pragma pack()
 
-int getsensorcount( IPMI20_SESSION_T *pSession );
-int getallsensorreadings( struct sensor_data *sensors, IPMI20_SESSION_T *pSession );
+int getsensorcount( IPMI20_UDS_SESSION_T *pUDSSession );
+int getallsensorreadings( struct sensor_data *sensors, IPMI20_UDS_SESSION_T *pUDSSession );
 
 
 #endif

+ 2 - 2
app/goahead-5.1.0/src/libipmi/inc/sensor_helpers.h

@@ -27,10 +27,10 @@
 #include "com_IPMI_SDRRecord.h"
 
 int ipmi_convert_reading( uint8_t *sdr_buffer, uint8_t raw_reading, float *converted_reading );
-int read_sensor_sdrs( IPMI20_SESSION_T *pSession, struct sensor_info **sensor_list,
+int read_sensor_sdrs( IPMI20_UDS_SESSION_T *pUDSSession, struct sensor_info **sensor_list,
 					  int timeout );
 int get_sdr_sensor_state( uint8_t sensor_reading, uint8_t *sdr_buffer, uint16_t *current_state );
-int GetSensorState(IPMI20_SESSION_T *pSession, uint8_t sensor_reading, uint8_t *sdr_buffer, uint16_t *current_state, int timeout  );
+int GetSensorState(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t sensor_reading, uint8_t *sdr_buffer, uint16_t *current_state, int timeout  );
 int ipmi_conv_reading(uint8_t SDRType, uint8_t raw_reading, float *converted_reading ,uint8_t Min,uint8_t Max,uint8_t Units1,uint8_t Lin,uint8_t Mval,uint8_t Bval,uint8_t M_Tol,uint8_t B_Acc,uint8_t R_B_Ex);
 int SensorState( uint8_t sensor_reading, uint16_t *current_state,uint8_t SDRType,uint8_t Lin,uint8_t Units1,uint8_t EvtType,uint8_t AssertEvt1,uint8_t AssertEvt2,uint8_t DeassertEvt1,uint8_t DeassertEvt2);
 unsigned char sdr_convert_sensor_value_to_raw(FullSensorRec_T	*sdr_record, double val);

+ 30 - 30
app/goahead-5.1.0/src/libipmi/src/libipmi_Chassis.c

@@ -35,7 +35,7 @@
 
    @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
 */
-uint16_t	IPMICMD_ChassisControl( IPMI20_SESSION_T *pSession, int timeout, char cmd)
+uint16_t	IPMICMD_ChassisControl( IPMI20_UDS_SESSION_T *pUDSSession, int timeout, char cmd)
 {
 
     uint32_t		dwResLen;
@@ -47,7 +47,7 @@ uint16_t	IPMICMD_ChassisControl( IPMI20_SESSION_T *pSession, int timeout, char c
     dwResLen = sizeof ( ChassisControlRes_T);
 
 
-    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 					    NETFNLUN_IPMI_CHASSIS, CMD_CHASSIS_CONTROL,
 					    (uint8_t *)&ChassisReq,sizeof(ChassisControlReq_T),
 					    (uint8_t*)&ChassisRes, &dwResLen,
@@ -56,7 +56,7 @@ uint16_t	IPMICMD_ChassisControl( IPMI20_SESSION_T *pSession, int timeout, char c
 }
 
 
-uint16_t IPMICMD_GetSystemBootOptions(IPMI20_SESSION_T *pSession, GetBootOptionsReq_T* pReqGetBootOptions,
+uint16_t IPMICMD_GetSystemBootOptions(IPMI20_UDS_SESSION_T *pUDSSession, GetBootOptionsReq_T* pReqGetBootOptions,
 							 GetBootOptionsRes_T* pResGetBootOptions,int reslen,int timeout)
 {
 	uint16_t wRet;
@@ -64,7 +64,7 @@ uint16_t IPMICMD_GetSystemBootOptions(IPMI20_SESSION_T *pSession, GetBootOptions
 
 	dwResLen = reslen;
 	
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_CHASSIS, CMD_GET_SYSTEM_BOOT_OPTIONS,
 											(uint8_t*)pReqGetBootOptions, sizeof(GetBootOptionsReq_T),
 											(uint8_t *)pResGetBootOptions, &dwResLen,
@@ -74,7 +74,7 @@ uint16_t IPMICMD_GetSystemBootOptions(IPMI20_SESSION_T *pSession, GetBootOptions
 }
 
 
-uint16_t IPMICMD_SetSystemBootOptions(IPMI20_SESSION_T *pSession, SetBootOptionsReq_T* pReqSetBootOptions,
+uint16_t IPMICMD_SetSystemBootOptions(IPMI20_UDS_SESSION_T *pUDSSession, SetBootOptionsReq_T* pReqSetBootOptions,
 							 SetBootOptionsRes_T* pResSetBootOptions,int reqlen,int timeout)
 {
 	uint16_t wRet;
@@ -89,7 +89,7 @@ uint16_t IPMICMD_SetSystemBootOptions(IPMI20_SESSION_T *pSession, SetBootOptions
 	local_ReqSetBootOptions.BootParam.SetInProgress = 1;
 	dwResLen = sizeof(SetBootOptionsRes_T);
 	//first do a set in progress
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_CHASSIS, CMD_SET_SYSTEM_BOOT_OPTIONS,
 											(uint8_t*)&local_ReqSetBootOptions, 2,
 											(uint8_t *)&local_ResSetBootOptions, &dwResLen,
@@ -103,7 +103,7 @@ uint16_t IPMICMD_SetSystemBootOptions(IPMI20_SESSION_T *pSession, SetBootOptions
 
 
 	dwResLen = sizeof(SetBootOptionsRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_CHASSIS, CMD_SET_SYSTEM_BOOT_OPTIONS,
 											(uint8_t*)pReqSetBootOptions, reqlen,
 											(uint8_t *)pResSetBootOptions, &dwResLen,
@@ -119,7 +119,7 @@ uint16_t IPMICMD_SetSystemBootOptions(IPMI20_SESSION_T *pSession, SetBootOptions
 	local_ReqSetBootOptions.BootParam.SetInProgress = 0;
 	dwResLen = sizeof(SetBootOptionsRes_T);
 	//first do a set in progress
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 										NETFNLUN_IPMI_CHASSIS, CMD_SET_SYSTEM_BOOT_OPTIONS,
 										(uint8_t*)&local_ReqSetBootOptions, 2,
 										(uint8_t *)&local_ResSetBootOptions, &dwResLen,
@@ -137,7 +137,7 @@ uint16_t IPMICMD_SetSystemBootOptions(IPMI20_SESSION_T *pSession, SetBootOptions
 
 
 
-uint16_t IPMICMD_ChassisIdentify(IPMI20_SESSION_T *pSession,int timeout,ChassisIdentifyReq_T* ChassisIdReq)
+uint16_t IPMICMD_ChassisIdentify(IPMI20_UDS_SESSION_T *pUDSSession,int timeout,ChassisIdentifyReq_T* ChassisIdReq)
 {
 	 uint32_t		dwResLen;
     	 uint16_t		wRet;
@@ -145,7 +145,7 @@ uint16_t IPMICMD_ChassisIdentify(IPMI20_SESSION_T *pSession,int timeout,ChassisI
 	 
 	 dwResLen = sizeof (ChassisIdentifyRes_T);
 	 
-	 wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	 wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 					    NETFNLUN_IPMI_CHASSIS, CMD_CHASSIS_IDENTIFY,
 					    (uint8_t *)ChassisIdReq,sizeof(ChassisIdentifyReq_T),
 					    (uint8_t*)&ChassisIdRes, &dwResLen,
@@ -155,11 +155,11 @@ uint16_t IPMICMD_ChassisIdentify(IPMI20_SESSION_T *pSession,int timeout,ChassisI
 }
 
 
-uint16_t LIBIPMI_HL_PowerOff( IPMI20_SESSION_T *pSession, int timeout )
+uint16_t LIBIPMI_HL_PowerOff( IPMI20_UDS_SESSION_T *pUDSSession, int timeout )
 {
     uint16_t	wRet;
 
-    wRet = IPMICMD_ChassisControl( pSession, timeout, CHASSIS_POWEROFF);
+    wRet = IPMICMD_ChassisControl( pUDSSession, timeout, CHASSIS_POWEROFF);
 
     if (wRet == LIBIPMI_E_SUCCESS){
 	TDBG("Succefully executed powerOFF  command.\n");
@@ -169,11 +169,11 @@ uint16_t LIBIPMI_HL_PowerOff( IPMI20_SESSION_T *pSession, int timeout )
     return wRet;
 }
 
-uint16_t LIBIPMI_HL_PowerUp( IPMI20_SESSION_T *pSession, int timeout )
+uint16_t LIBIPMI_HL_PowerUp( IPMI20_UDS_SESSION_T *pUDSSession, int timeout )
 {
     uint16_t	wRet;
 
-    wRet = IPMICMD_ChassisControl( pSession, timeout, CHASSIS_POWERUP);
+    wRet = IPMICMD_ChassisControl( pUDSSession, timeout, CHASSIS_POWERUP);
 
     if (wRet == LIBIPMI_E_SUCCESS){
 	TDBG("Succefully executed powerUP the command.\n");
@@ -183,11 +183,11 @@ uint16_t LIBIPMI_HL_PowerUp( IPMI20_SESSION_T *pSession, int timeout )
     return wRet;
 }
 
-uint16_t LIBIPMI_HL_PowerCycle( IPMI20_SESSION_T *pSession, int timeout )
+uint16_t LIBIPMI_HL_PowerCycle( IPMI20_UDS_SESSION_T *pUDSSession, int timeout )
 {
     uint16_t	wRet;
 
-    wRet = IPMICMD_ChassisControl( pSession, timeout, CHASSIS_POWERCYCLE);
+    wRet = IPMICMD_ChassisControl( pUDSSession, timeout, CHASSIS_POWERCYCLE);
 
     if (wRet == LIBIPMI_E_SUCCESS){
 	TDBG("Succefully executed powerCycle the command.\n");
@@ -197,11 +197,11 @@ uint16_t LIBIPMI_HL_PowerCycle( IPMI20_SESSION_T *pSession, int timeout )
     return wRet;
 }
 
-uint16_t LIBIPMI_HL_HardReset( IPMI20_SESSION_T *pSession, int timeout )
+uint16_t LIBIPMI_HL_HardReset( IPMI20_UDS_SESSION_T *pUDSSession, int timeout )
 {	//TODO: jimbo control rst1~10 pin
     uint16_t	wRet;
 
-    wRet = IPMICMD_ChassisControl( pSession, timeout, CHASSIS_HARDRESET);
+    wRet = IPMICMD_ChassisControl( pUDSSession, timeout, CHASSIS_HARDRESET);
 
     if (wRet == LIBIPMI_E_SUCCESS){
 	TDBG("Succefully executed HardReset the command.\n");
@@ -211,11 +211,11 @@ uint16_t LIBIPMI_HL_HardReset( IPMI20_SESSION_T *pSession, int timeout )
     return wRet;
 }
 
-uint16_t LIBIPMI_HL_DiagInt( IPMI20_SESSION_T *pSession, int timeout )
+uint16_t LIBIPMI_HL_DiagInt( IPMI20_UDS_SESSION_T *pUDSSession, int timeout )
 {
     uint16_t	wRet;
 
-    wRet = IPMICMD_ChassisControl( pSession, timeout, CHASSIS_DIAGINT);
+    wRet = IPMICMD_ChassisControl( pUDSSession, timeout, CHASSIS_DIAGINT);
 
     if (wRet == LIBIPMI_E_SUCCESS){
 	TDBG("Succefully executed DiagInt command.\n");
@@ -225,11 +225,11 @@ uint16_t LIBIPMI_HL_DiagInt( IPMI20_SESSION_T *pSession, int timeout )
     return wRet;
 }
 
-uint16_t LIBIPMI_HL_SoftOff( IPMI20_SESSION_T *pSession, int timeout )
+uint16_t LIBIPMI_HL_SoftOff( IPMI20_UDS_SESSION_T *pUDSSession, int timeout )
 {
     uint16_t	wRet;
 
-    wRet = IPMICMD_ChassisControl( pSession, timeout, CHASSIS_SOFTOFF);
+    wRet = IPMICMD_ChassisControl( pUDSSession, timeout, CHASSIS_SOFTOFF);
 
     if (wRet == LIBIPMI_E_SUCCESS){
 	TDBG("Succefully executed SoftOff command.\n");
@@ -239,7 +239,7 @@ uint16_t LIBIPMI_HL_SoftOff( IPMI20_SESSION_T *pSession, int timeout )
     return wRet;
 }
 
-uint16_t	LIBIPMI_HL_GetChassisStatus( IPMI20_SESSION_T *pSession, int timeout, chassis_status_T *status)
+uint16_t	LIBIPMI_HL_GetChassisStatus( IPMI20_UDS_SESSION_T *pUDSSession, int timeout, chassis_status_T *status)
 {
 
     uint32_t		dwResLen;
@@ -250,7 +250,7 @@ uint16_t	LIBIPMI_HL_GetChassisStatus( IPMI20_SESSION_T *pSession, int timeout, c
 
     dwResLen = sizeof(GetChassisStatusRes_T);
     
-    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 					    NETFNLUN_IPMI_CHASSIS, CMD_GET_CHASSIS_STATUS,
 					    (uint8_t *)&ChassisStatusReq, 0 ,
 					    (uint8_t*)&ChassisStatusRes, &dwResLen,
@@ -297,7 +297,7 @@ uint16_t	LIBIPMI_HL_GetChassisStatus( IPMI20_SESSION_T *pSession, int timeout, c
 //	      Set to Interval in secs for chassis identify to be on for that much time.
 // 	      for indefinite interval set ForceOn to 1.
 // ForceOn - overrides BlinkTime settings if set to 1.Set to 0 if controlling by interval
-uint16_t LIBIPMI_HL_ChassisIdentify(IPMI20_SESSION_T *pSession, int timeout,uint8_t BlinkTimeSecs,FORCE_CHASSIS_ID ForceOn)
+uint16_t LIBIPMI_HL_ChassisIdentify(IPMI20_UDS_SESSION_T *pUDSSession, int timeout,uint8_t BlinkTimeSecs,FORCE_CHASSIS_ID ForceOn)
 {
 	uint16_t wRet;
 	
@@ -310,7 +310,7 @@ uint16_t LIBIPMI_HL_ChassisIdentify(IPMI20_SESSION_T *pSession, int timeout,uint
 	
 	TDBG("id interval and  force in libipmi are %d %d \n",ChassisIdReq.IdentifyInterval,ChassisIdReq.ForceIdentify);
 	
-	wRet = IPMICMD_ChassisIdentify(pSession,timeout,&ChassisIdReq);
+	wRet = IPMICMD_ChassisIdentify(pUDSSession,timeout,&ChassisIdReq);
 	
 	if(wRet == LIBIPMI_E_SUCCESS)
 	{
@@ -325,7 +325,7 @@ uint16_t LIBIPMI_HL_ChassisIdentify(IPMI20_SESSION_T *pSession, int timeout,uint
 }
 
 
-uint16_t	LIBIPMI_HL_GetSystemBootOptions_BootFlags( IPMI20_SESSION_T *pSession, BootFlags_T* pBootFlags,int timeout)
+uint16_t	LIBIPMI_HL_GetSystemBootOptions_BootFlags( IPMI20_UDS_SESSION_T *pUDSSession, BootFlags_T* pBootFlags,int timeout)
 {
 	uint16_t wRet;
 	GetBootOptionsReq_T ReqGetBootOptions;
@@ -342,7 +342,7 @@ uint16_t	LIBIPMI_HL_GetSystemBootOptions_BootFlags( IPMI20_SESSION_T *pSession,
 	reslen = 3 + sizeof(BootFlags_T);
 
 
-	wRet = IPMICMD_GetSystemBootOptions(pSession,&ReqGetBootOptions,&ResGetBootOptions,reslen,timeout);
+	wRet = IPMICMD_GetSystemBootOptions(pUDSSession,&ReqGetBootOptions,&ResGetBootOptions,reslen,timeout);
 
 	if(wRet != 0)
 	{
@@ -363,7 +363,7 @@ uint16_t	LIBIPMI_HL_GetSystemBootOptions_BootFlags( IPMI20_SESSION_T *pSession,
 }
 
 
-uint16_t	LIBIPMI_HL_SetSystemBootOptions_BootFlags( IPMI20_SESSION_T *pSession, BootFlags_T* pBootFlags,int timeout)
+uint16_t	LIBIPMI_HL_SetSystemBootOptions_BootFlags( IPMI20_UDS_SESSION_T *pUDSSession, BootFlags_T* pBootFlags,int timeout)
 {
 	uint16_t wRet;
 	SetBootOptionsReq_T ReqSetBootOptions;
@@ -384,7 +384,7 @@ uint16_t	LIBIPMI_HL_SetSystemBootOptions_BootFlags( IPMI20_SESSION_T *pSession,
 
 
 
-	wRet = IPMICMD_SetSystemBootOptions(pSession,&ReqSetBootOptions,&ResSetBootOptions,reqlen,timeout);
+	wRet = IPMICMD_SetSystemBootOptions(pUDSSession,&ReqSetBootOptions,&ResSetBootOptions,reqlen,timeout);
 
 	if(wRet != 0)
 	{

+ 8 - 9
app/goahead-5.1.0/src/libipmi/src/libipmi_IPM.c

@@ -34,14 +34,14 @@
 
  @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
 */
-uint16_t	IPMICMD_GetDeviceID( IPMI20_SESSION_T *pSession, GetDevIDRes_T	*pGetDeviceID, int timeout )
+uint16_t	IPMICMD_GetDeviceID( IPMI20_UDS_SESSION_T *pUDSSession, GetDevIDRes_T	*pGetDeviceID, int timeout )
 {
 	uint8_t		Req [20];
 	uint32_t		dwResLen;
 	uint16_t		wRet;
 
 	//dwResLen = sizeof(GetDevIDRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession, 
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession, 
 											DEFAULT_NET_FN_LUN, CMD_GET_DEV_ID,
 											Req, 0,
 											(uint8_t*)pGetDeviceID, &dwResLen,
@@ -57,19 +57,18 @@ uint16_t	IPMICMD_GetDeviceID( IPMI20_SESSION_T *pSession, GetDevIDRes_T	*pGetDev
 
  @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
 */
-uint16_t	IPMICMD_GetDeviceGUID( IPMI20_SESSION_T *pSession, GetDevGUIDRes_T *pGetDeviceGUID, int timeout )
+uint16_t	IPMICMD_GetDeviceGUID( IPMI20_UDS_SESSION_T *pUDSSession, GetDevGUIDRes_T *pGetDeviceGUID, int timeout )
 {
 	uint8_t		Req [20];
 	uint32_t		dwResLen;
 	uint16_t		wRet;
 
 	dwResLen = sizeof(GetDevGUIDRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession, 
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession, 
 											DEFAULT_NET_FN_LUN, CMD_GET_DEV_GUID,
 											Req, 0,
 											(uint8_t*)pGetDeviceGUID, &dwResLen,
 											timeout);
-	printf("---> log22 pSession = %#x\n",(int)pSession);
 	return wRet;
 }
 
@@ -83,7 +82,7 @@ uint16_t	IPMICMD_GetDeviceGUID( IPMI20_SESSION_T *pSession, GetDevGUIDRes_T *pGe
 
  @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
 */
-uint16_t LIBIPMI_HL_GetDeviceID( IPMI20_SESSION_T *pSession, char *pszDeviceID, int timeout )
+uint16_t LIBIPMI_HL_GetDeviceID( IPMI20_UDS_SESSION_T *pUDSSession, char *pszDeviceID, int timeout )
 {
 	uint8_t	i;
 	uint16_t	wRet = LIBIPMI_E_SUCCESS;
@@ -92,7 +91,7 @@ uint16_t LIBIPMI_HL_GetDeviceID( IPMI20_SESSION_T *pSession, char *pszDeviceID,
 
 	pszDeviceID[0] = (char)0;
 	
-	wRet = IPMICMD_GetDeviceID( pSession, &DeviceID, timeout);
+	wRet = IPMICMD_GetDeviceID( pUDSSession, &DeviceID, timeout);
 
 	if (wRet == LIBIPMI_E_SUCCESS)
 	{
@@ -117,7 +116,7 @@ uint16_t LIBIPMI_HL_GetDeviceID( IPMI20_SESSION_T *pSession, char *pszDeviceID,
 
  @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
 */
-uint16_t LIBIPMI_HL_GetDeviceGUID( IPMI20_SESSION_T *pSession, char *pszDeviceGUID, int timeout )
+uint16_t LIBIPMI_HL_GetDeviceGUID( IPMI20_UDS_SESSION_T *pUDSSession, char *pszDeviceGUID, int timeout )
 {
 	uint8_t	i;
 	uint16_t	wRet;
@@ -126,7 +125,7 @@ uint16_t LIBIPMI_HL_GetDeviceGUID( IPMI20_SESSION_T *pSession, char *pszDeviceGU
 
 	pszDeviceGUID[0] = (char)0;
 	
-	wRet = IPMICMD_GetDeviceGUID( pSession, &DeviceGUID, timeout);
+	wRet = IPMICMD_GetDeviceGUID( pUDSSession, &DeviceGUID, timeout);
 
 	if (wRet == LIBIPMI_E_SUCCESS)
 	{

+ 41 - 41
app/goahead-5.1.0/src/libipmi/src/libipmi_PEF.c

@@ -28,7 +28,7 @@
 #endif
 
 /* Get PEF Capabilities Command */
-uint16_t	IPMICMD_GetPEFCapabilities( IPMI20_SESSION_T *pSession,
+uint16_t	IPMICMD_GetPEFCapabilities( IPMI20_UDS_SESSION_T *pUDSSession,
 					GetPEFCapRes_T *pResGetPEFCap,
 					int timeout)
 {
@@ -38,7 +38,7 @@ uint16_t	IPMICMD_GetPEFCapabilities( IPMI20_SESSION_T *pSession,
 
 
 	dwResLen = sizeof(GetPEFCapRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 						NETFNLUN_IPMI_SENSOR, CMD_GET_PEF_CAPABILITIES,
 						(uint8_t*)Req, 0,
 						(uint8_t *)pResGetPEFCap, &dwResLen,
@@ -48,7 +48,7 @@ uint16_t	IPMICMD_GetPEFCapabilities( IPMI20_SESSION_T *pSession,
 }
 
 /* Arm PEF Postpone Timer Command */
-uint16_t	IPMICMD_ArmPEFTimer( IPMI20_SESSION_T *pSession/*in*/,
+uint16_t	IPMICMD_ArmPEFTimer( IPMI20_UDS_SESSION_T *pUDSSession/*in*/,
 					uint8_t*	pReqTmrTimeout/*in*/,
 					ArmPEFTmrRes_T *pResArmPEFTmr/*out*/,
 					int timeout/*in*/)
@@ -58,7 +58,7 @@ uint16_t	IPMICMD_ArmPEFTimer( IPMI20_SESSION_T *pSession/*in*/,
 
 
 	dwResLen = sizeof(ArmPEFTmrRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 						NETFNLUN_IPMI_SENSOR, CMD_ARM_PEF_POSTPONE_TIMER,
 						pReqTmrTimeout, sizeof(uint8_t),
 						(uint8_t *)pResArmPEFTmr, &dwResLen,
@@ -68,7 +68,7 @@ uint16_t	IPMICMD_ArmPEFTimer( IPMI20_SESSION_T *pSession/*in*/,
 }
 
 /* Set PEF Configuration Parameters Command */
-uint16_t	IPMICMD_SetPEFConf( IPMI20_SESSION_T *pSession/*in*/,
+uint16_t	IPMICMD_SetPEFConf( IPMI20_UDS_SESSION_T *pUDSSession/*in*/,
 					uint8_t *pReqSetPEFConf/*in*/,
 					uint32_t dwReqBufLen,
 					uint8_t *pResSetPEFConf/*out*/,
@@ -79,7 +79,7 @@ uint16_t	IPMICMD_SetPEFConf( IPMI20_SESSION_T *pSession/*in*/,
 
 
 	dwResLen = sizeof(uint8_t);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 						NETFNLUN_IPMI_SENSOR, CMD_SET_PEF_CONFIG_PARAMS,
 						pReqSetPEFConf, dwReqBufLen,
 						(uint8_t *)pResSetPEFConf, &dwResLen,
@@ -89,7 +89,7 @@ uint16_t	IPMICMD_SetPEFConf( IPMI20_SESSION_T *pSession/*in*/,
 }
 
 /* Get PEF Configuration Parameters Command */
-uint16_t	IPMICMD_GetPEFConf( IPMI20_SESSION_T *pSession/*in*/,
+uint16_t	IPMICMD_GetPEFConf( IPMI20_UDS_SESSION_T *pUDSSession/*in*/,
 					GetPEFConfigReq_T *pReqGetPEFConf/*in*/,
 					uint8_t *pResGetPEFConf/*out*/,
 					int timeout/*in*/)
@@ -99,7 +99,7 @@ uint16_t	IPMICMD_GetPEFConf( IPMI20_SESSION_T *pSession/*in*/,
 
 
 	dwResLen = MAX_RESPONSE_SIZE;
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 						NETFNLUN_IPMI_SENSOR, CMD_GET_PEF_CONFIG_PARAMS,
 						(uint8_t*)pReqGetPEFConf, sizeof(GetPEFConfigReq_T),
 						pResGetPEFConf, &dwResLen,
@@ -109,7 +109,7 @@ uint16_t	IPMICMD_GetPEFConf( IPMI20_SESSION_T *pSession/*in*/,
 }
 
 /* Set Last Processed Event ID Command */
-uint16_t	IPMICMD_SetLastEventID( IPMI20_SESSION_T *pSession/*in*/,
+uint16_t	IPMICMD_SetLastEventID( IPMI20_UDS_SESSION_T *pUDSSession/*in*/,
 					SetLastEvtIDReq_T *pReqSetLastEvt/*in*/,
 					uint8_t *pResSetLastEvt/*out*/,
 					int timeout/*in*/)
@@ -119,7 +119,7 @@ uint16_t	IPMICMD_SetLastEventID( IPMI20_SESSION_T *pSession/*in*/,
 
 
 	dwResLen = sizeof(uint8_t);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 						NETFNLUN_IPMI_SENSOR, CMD_SET_LAST_PROCESSED_EVENT_ID,
 						(uint8_t*)pReqSetLastEvt, sizeof(SetLastEvtIDReq_T),
 						pResSetLastEvt, &dwResLen,
@@ -129,7 +129,7 @@ uint16_t	IPMICMD_SetLastEventID( IPMI20_SESSION_T *pSession/*in*/,
 }
 
 /* Get Last Processed Event ID Command */
-uint16_t	IPMICMD_GetLastEventID( IPMI20_SESSION_T *pSession/*in*/,
+uint16_t	IPMICMD_GetLastEventID( IPMI20_UDS_SESSION_T *pUDSSession/*in*/,
 						GetLastEvtIDRes_T *pResGetLastEvt/*out*/,
 						int timeout/*in*/)
 {
@@ -139,7 +139,7 @@ uint16_t	IPMICMD_GetLastEventID( IPMI20_SESSION_T *pSession/*in*/,
 
 
 	dwResLen = sizeof(GetLastEvtIDRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 						NETFNLUN_IPMI_SENSOR, CMD_GET_LAST_PROCESSED_EVENT_ID,
 						(uint8_t*)Req, 0,
 						(uint8_t*)pResGetLastEvt, &dwResLen,
@@ -149,7 +149,7 @@ uint16_t	IPMICMD_GetLastEventID( IPMI20_SESSION_T *pSession/*in*/,
 }
 
 /* Alert Immediate Command */
-uint16_t	IPMICMD_AlertImmediate( IPMI20_SESSION_T *pSession/*in*/,
+uint16_t	IPMICMD_AlertImmediate( IPMI20_UDS_SESSION_T *pUDSSession/*in*/,
 						AlertImmReq_T *pReqAlertImmediate/*in*/,
 						AlertImmRes_T *pResAlertImmediate/*out*/,
 						int timeout/*in*/)
@@ -159,7 +159,7 @@ uint16_t	IPMICMD_AlertImmediate( IPMI20_SESSION_T *pSession/*in*/,
 
 
 	dwResLen = sizeof(AlertImmRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 						NETFNLUN_IPMI_SENSOR, CMD_ALERT_IMMEDIATE,
 						(uint8_t*)pReqAlertImmediate, sizeof(AlertImmReq_T),
 						(uint8_t*)pResAlertImmediate, &dwResLen,
@@ -169,7 +169,7 @@ uint16_t	IPMICMD_AlertImmediate( IPMI20_SESSION_T *pSession/*in*/,
 }
 
 /* PET Acknowledge Command */
-uint16_t	IPMICMD_PETAck( IPMI20_SESSION_T *pSession/*in*/,
+uint16_t	IPMICMD_PETAck( IPMI20_UDS_SESSION_T *pUDSSession/*in*/,
 						PETAckReq_T *pReqPETAck /*out*/,
 						uint8_t *pResPETACK /*out*/,
 						int timeout/*in*/)
@@ -178,7 +178,7 @@ uint16_t	IPMICMD_PETAck( IPMI20_SESSION_T *pSession/*in*/,
 	uint32_t	dwResLen;
 
 	dwResLen = sizeof(uint8_t);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 						NETFNLUN_IPMI_SENSOR, CMD_PET_ACKNOWLEDGE,
 						(uint8_t*)pReqPETAck, sizeof(PETAckReq_T),
 						(uint8_t*)pResPETACK, &dwResLen,
@@ -193,7 +193,7 @@ uint16_t	IPMICMD_PETAck( IPMI20_SESSION_T *pSession/*in*/,
 
 
 /*********** Alert Table **********/
-uint16_t LIBIPMI_HL_GetNumOfAlertPolicyEntries(IPMI20_SESSION_T *pSession,
+uint16_t LIBIPMI_HL_GetNumOfAlertPolicyEntries(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t* pNumOfAlertPolicyEntries,
 					int timeout)
 {
@@ -205,7 +205,7 @@ uint16_t LIBIPMI_HL_GetNumOfAlertPolicyEntries(IPMI20_SESSION_T *pSession,
 	memset(&GetPEFConfigReq,0x00,sizeof(GetPEFConfigReq_T));
 	GetPEFConfigReq.ParamSel = 0x08;
 
-	wRet = IPMICMD_GetPEFConf(pSession,&GetPEFConfigReq,PEFConf,timeout);
+	wRet = IPMICMD_GetPEFConf(pUDSSession,&GetPEFConfigReq,PEFConf,timeout);
 	if(wRet != 0)
 	{
 		printf("LIBIPMI_HL_GetNumOfAlertPolicyEntries: Error getting PEF Conf\n");
@@ -219,7 +219,7 @@ uint16_t LIBIPMI_HL_GetNumOfAlertPolicyEntries(IPMI20_SESSION_T *pSession,
 	return wRet;
 }
 
-uint16_t LIBIPMI_HL_GetAnAlertEntry(IPMI20_SESSION_T *pSession,
+uint16_t LIBIPMI_HL_GetAnAlertEntry(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t AlertEntryNumber,
 					AlertPolicyTblEntry_T* pAlertEntry,
 					int timeout)
@@ -232,7 +232,7 @@ uint16_t LIBIPMI_HL_GetAnAlertEntry(IPMI20_SESSION_T *pSession,
 	GetPEFConfigReq.ParamSel = 0x09;
 	GetPEFConfigReq.SetSel = AlertEntryNumber;
 
-	wRet = IPMICMD_GetPEFConf(pSession,&GetPEFConfigReq,PEFConf,timeout);
+	wRet = IPMICMD_GetPEFConf(pUDSSession,&GetPEFConfigReq,PEFConf,timeout);
 	if(wRet != 0)
 	{
 		printf("LIBIPMI_HL_GetAnAlertEntry: Error getting PEF Conf\n");
@@ -243,13 +243,13 @@ uint16_t LIBIPMI_HL_GetAnAlertEntry(IPMI20_SESSION_T *pSession,
 	return wRet;
 }
 
-uint16_t LIBIPMI_HL_EnDisPolicyTableEntry(IPMI20_SESSION_T *pSession,uint8_t IndexNum, int AlertNumEnable, uint8_t DestIndex,
+uint16_t LIBIPMI_HL_EnDisPolicyTableEntry(IPMI20_UDS_SESSION_T *pUDSSession,uint8_t IndexNum, int AlertNumEnable, uint8_t DestIndex,
 			uint8_t Channel, int timeout)
 {
 	uint16_t wRet = 0;
 	AlertPolicyTblEntry_T AlertEntry;
 
-	wRet = LIBIPMI_HL_GetAnAlertEntry(pSession,IndexNum,&AlertEntry,timeout);
+	wRet = LIBIPMI_HL_GetAnAlertEntry(pUDSSession,IndexNum,&AlertEntry,timeout);
 	if(wRet != 0)
 	{
 		printf("Critical error trying to Enable Disable alert policy - getting for index %d\n",IndexNum);
@@ -260,7 +260,7 @@ uint16_t LIBIPMI_HL_EnDisPolicyTableEntry(IPMI20_SESSION_T *pSession,uint8_t Ind
 	//AlertEntry.ChannelDestSel = (Channel << 4) | DestIndex;
 	AlertEntry.ChannelDestSel = (Channel << 4) | ((DestIndex-1)%(ALERT_POLICY_PER_CHANNEL)+1);
 
-	wRet = LIBIPMI_HL_SetAnAlertEntry(pSession,IndexNum,&AlertEntry,timeout);
+	wRet = LIBIPMI_HL_SetAnAlertEntry(pUDSSession,IndexNum,&AlertEntry,timeout);
 	if(wRet != 0)
 	{
 		printf("Critical error trying to Enable Disable alert policy - setting\n");
@@ -270,7 +270,7 @@ uint16_t LIBIPMI_HL_EnDisPolicyTableEntry(IPMI20_SESSION_T *pSession,uint8_t Ind
 	return wRet;
 }
 
-uint16_t LIBIPMI_HL_SetAnAlertEntry(IPMI20_SESSION_T *pSession,
+uint16_t LIBIPMI_HL_SetAnAlertEntry(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t AlertEntryNumber,
 					AlertPolicyTblEntry_T* pAlertEntry,
 					int timeout)
@@ -287,7 +287,7 @@ uint16_t LIBIPMI_HL_SetAnAlertEntry(IPMI20_SESSION_T *pSession,
 	memcpy(&SetPEFConfigReq[2],pAlertEntry,sizeof(AlertPolicyTblEntry_T));
 	reqLen = 2 + sizeof(AlertPolicyTblEntry_T);
 
-	wRet = IPMICMD_SetPEFConf(pSession,SetPEFConfigReq,reqLen,&response,timeout);
+	wRet = IPMICMD_SetPEFConf(pUDSSession,SetPEFConfigReq,reqLen,&response,timeout);
 	if(wRet != 0)
 	{
 		printf("LIBIPMI_HL_SetAnAlertEntry: Error setting PEF Conf\n");
@@ -295,7 +295,7 @@ uint16_t LIBIPMI_HL_SetAnAlertEntry(IPMI20_SESSION_T *pSession,
 	return wRet;
 }
 
-uint16_t LIBIPMI_HL_GetAlertTable(IPMI20_SESSION_T *pSession,
+uint16_t LIBIPMI_HL_GetAlertTable(IPMI20_UDS_SESSION_T *pUDSSession,
 					AlertPolicyTblEntry_T* pAlertTable,
 					uint8_t* pNumOfAlertEntries,
 					int timeout)
@@ -304,7 +304,7 @@ uint16_t LIBIPMI_HL_GetAlertTable(IPMI20_SESSION_T *pSession,
 	uint8_t i,nAlertEntries = 0;
 	AlertPolicyTblEntry_T AlertEntry;
 
-	wRet = LIBIPMI_HL_GetNumOfAlertPolicyEntries(pSession,&nAlertEntries,timeout);
+	wRet = LIBIPMI_HL_GetNumOfAlertPolicyEntries(pUDSSession,&nAlertEntries,timeout);
 	if(wRet != 0)
 	{
 		printf("LIBIPMI_HL_GetAlertTable: Error getting number of Alert policy entries\n");
@@ -315,7 +315,7 @@ uint16_t LIBIPMI_HL_GetAlertTable(IPMI20_SESSION_T *pSession,
 
 	for(i = 1; i <= nAlertEntries; i++)
 	{
-		wRet = LIBIPMI_HL_GetAnAlertEntry(pSession,(uint8_t)i,&AlertEntry,timeout);
+		wRet = LIBIPMI_HL_GetAnAlertEntry(pUDSSession,(uint8_t)i,&AlertEntry,timeout);
 		if(wRet != 0)
 		{
 			printf("LIBIPMI_HL_GetAlertTable: Error getting an Alert Entry\n");
@@ -357,7 +357,7 @@ policy table alerts will go out.
 #define ALERT_LEVEL_CRIT_AND_ABOVE     	1
 #define ALERT_LEVEL__AND_ABOVE     	1
 
-uint16_t LIBIPMI_HL_SetGraspAlertLevel(IPMI20_SESSION_T *pSession,
+uint16_t LIBIPMI_HL_SetGraspAlertLevel(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t IndexNum,
 					uint8_t AlertLevel, //NOTE: we use our alert levels and the input AlertNum is the structure arg is not used
 					uint8_t Channel,
@@ -389,7 +389,7 @@ uint16_t LIBIPMI_HL_SetGraspAlertLevel(IPMI20_SESSION_T *pSession,
 			AlertNumEnable = ((loopindex << 0x4) & 0xF7);
 
 
-			wRet = LIBIPMI_HL_EnDisPolicyTableEntry(pSession,(uint8_t)i,AlertNumEnable,IndexNum,Channel,timeout);
+			wRet = LIBIPMI_HL_EnDisPolicyTableEntry(pUDSSession,(uint8_t)i,AlertNumEnable,IndexNum,Channel,timeout);
 			if(wRet != 0)
 			{
 				printf("Error while enabling, disabling Policy Table entry\n");
@@ -402,7 +402,7 @@ uint16_t LIBIPMI_HL_SetGraspAlertLevel(IPMI20_SESSION_T *pSession,
 
 
 //this will just return the alert level that has been set for a prticular destination
-uint16_t LIBIPMI_HL_GetGraspAlertLevel(IPMI20_SESSION_T *pSession,
+uint16_t LIBIPMI_HL_GetGraspAlertLevel(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t IndexNum,
 					uint8_t* AlertLevel, //NOTE: we use our alert levels and the input AlertNum is the structure arg is not used
 					uint8_t* DestIndex,
@@ -421,7 +421,7 @@ uint16_t LIBIPMI_HL_GetGraspAlertLevel(IPMI20_SESSION_T *pSession,
 	for(i=(AlertEntryIndex - NUM_ALERT_CATEGORIES +1),loopindex = 1;i <= (AlertEntryIndex);i++,loopindex++)
 	{
 
-		wRet = LIBIPMI_HL_GetAnAlertEntry(pSession,(uint8_t)i,&AlertEntry,timeout);
+		wRet = LIBIPMI_HL_GetAnAlertEntry(pUDSSession,(uint8_t)i,&AlertEntry,timeout);
 		if(wRet != 0)
 		{
 			printf("Critical error trying to get alert policy for index num %d\n",i);
@@ -446,7 +446,7 @@ uint16_t LIBIPMI_HL_GetGraspAlertLevel(IPMI20_SESSION_T *pSession,
 
 
 /************* PEF Table **************/
-uint16_t LIBIPMI_HL_GetNumOfPEFEntries(IPMI20_SESSION_T *pSession,
+uint16_t LIBIPMI_HL_GetNumOfPEFEntries(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t* pNumOfPEFEntries,
 					int timeout)
 {
@@ -458,7 +458,7 @@ uint16_t LIBIPMI_HL_GetNumOfPEFEntries(IPMI20_SESSION_T *pSession,
 	memset(&GetPEFConfigReq,0x00,sizeof(GetPEFConfigReq_T));
 	GetPEFConfigReq.ParamSel = 0x05;
 
-	wRet = IPMICMD_GetPEFConf(pSession,&GetPEFConfigReq,PEFConf,timeout);
+	wRet = IPMICMD_GetPEFConf(pUDSSession,&GetPEFConfigReq,PEFConf,timeout);
 	if(wRet != 0)
 	{
 		printf("LIBIPMI_HL_GetNumOfPEFEntries: Error getting PEF Conf\n");
@@ -472,7 +472,7 @@ uint16_t LIBIPMI_HL_GetNumOfPEFEntries(IPMI20_SESSION_T *pSession,
 	return wRet;
 }
 
-uint16_t LIBIPMI_HL_SetPEFEntry(IPMI20_SESSION_T *pSession,
+uint16_t LIBIPMI_HL_SetPEFEntry(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t PEFEntryNumber,
 					EvtFilterTblEntry_T* pPEFEntry,
 					int timeout)
@@ -489,7 +489,7 @@ uint16_t LIBIPMI_HL_SetPEFEntry(IPMI20_SESSION_T *pSession,
 	memcpy(&SetPEFConfigReq[2],pPEFEntry,sizeof(EvtFilterTblEntry_T));
 	reqLen = 2 + sizeof(EvtFilterTblEntry_T);
 
-	wRet = IPMICMD_SetPEFConf(pSession,SetPEFConfigReq,reqLen,&response,timeout);
+	wRet = IPMICMD_SetPEFConf(pUDSSession,SetPEFConfigReq,reqLen,&response,timeout);
 	if(wRet != 0)
 	{
 		printf("LIBIPMI_HL_SetPEFEntry: Error setting PEF Conf\n");
@@ -497,7 +497,7 @@ uint16_t LIBIPMI_HL_SetPEFEntry(IPMI20_SESSION_T *pSession,
 	return wRet;
 }
 
-uint16_t LIBIPMI_HL_GetPEFEntry(IPMI20_SESSION_T *pSession,
+uint16_t LIBIPMI_HL_GetPEFEntry(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t PEFEntryNumber,
 					EvtFilterTblEntry_T* pPEFEntry,
 					int timeout)
@@ -510,7 +510,7 @@ uint16_t LIBIPMI_HL_GetPEFEntry(IPMI20_SESSION_T *pSession,
 	GetPEFConfigReq.ParamSel = 0x06;
 	GetPEFConfigReq.SetSel = PEFEntryNumber;
 
-	wRet = IPMICMD_GetPEFConf(pSession,&GetPEFConfigReq,PEFConf,timeout);
+	wRet = IPMICMD_GetPEFConf(pUDSSession,&GetPEFConfigReq,PEFConf,timeout);
 	if(wRet != 0)
 	{
 		printf("LIBIPMI_HL_GetPEFEntry: Error getting PEF Conf\n");
@@ -524,7 +524,7 @@ uint16_t LIBIPMI_HL_GetPEFEntry(IPMI20_SESSION_T *pSession,
 	return wRet;
 }
 
-uint16_t LIBIPMI_HL_GetPEFTable(IPMI20_SESSION_T *pSession,
+uint16_t LIBIPMI_HL_GetPEFTable(IPMI20_UDS_SESSION_T *pUDSSession,
 					EvtFilterTblEntry_T* pPEFTable,
 					uint8_t* pNumOfPEFEntries,
 					int timeout)
@@ -533,7 +533,7 @@ uint16_t LIBIPMI_HL_GetPEFTable(IPMI20_SESSION_T *pSession,
 	uint8_t i,nPEFEntries = 0;
 	EvtFilterTblEntry_T PEFEntry;
 
-	wRet = LIBIPMI_HL_GetNumOfPEFEntries(pSession,&nPEFEntries,timeout);
+	wRet = LIBIPMI_HL_GetNumOfPEFEntries(pUDSSession,&nPEFEntries,timeout);
 	if(wRet != 0)
 	{
 		printf("LIBIPMI_HL_GetPEFTable: Error getting number of PEF entries\n");
@@ -544,7 +544,7 @@ uint16_t LIBIPMI_HL_GetPEFTable(IPMI20_SESSION_T *pSession,
 
 	for(i = 1; i <= nPEFEntries; i++)
 	{
-		wRet = LIBIPMI_HL_GetPEFEntry(pSession,i,&PEFEntry,timeout);
+		wRet = LIBIPMI_HL_GetPEFEntry(pUDSSession,i,&PEFEntry,timeout);
 		if(wRet != 0)
 		{
 			printf("LIBIPMI_HL_GetPEFTable: Error getting a PEF Entry\n");

+ 6 - 6
app/goahead-5.1.0/src/libipmi/src/libipmi_fru.c

@@ -1005,7 +1005,7 @@ return 0;
 
 
 
-static uint16_t get_fru_info (IPMI20_SESSION_T* psession,
+static uint16_t get_fru_info (IPMI20_UDS_SESSION_T* pUDSSession,
 				  uint8_t fru_device_id,
 				  uint32_t* p_fru_size,
 				  FRUData_T* fru_data,
@@ -1026,7 +1026,7 @@ static uint16_t get_fru_info (IPMI20_SESSION_T* psession,
 	FRUCommonHeader_T *pTmp = NULL;
 	int i = 0;
 
-	// if(psession->byMediumType == IPMB_MEDIUM)
+	// if(pUDSSession->byMediumType == IPMB_MEDIUM)
 	// {
 	// 	BLOCK_OF_DATA_TO_READ = 24;	//IPMB max message packet is 32 bytes. 
 	// 											//24 + message header + completion code + checksum2 = 32
@@ -1037,7 +1037,7 @@ static uint16_t get_fru_info (IPMI20_SESSION_T* psession,
 	 **/
 	fru_inv_area_req.FRUDeviceID = fru_device_id;
 
-	wRet = IPMICMD_GetFRUInventoryAreaInfo (psession,
+	wRet = IPMICMD_GetFRUInventoryAreaInfo (pUDSSession,
 											&fru_inv_area_req,
 											&fru_inv_area_res,
 											timeout);
@@ -1092,7 +1092,7 @@ static uint16_t get_fru_info (IPMI20_SESSION_T* psession,
 		while (fru_size) //! while there is data to read
 		{
 			printf("---> get_fru_info log1, fru_size = %d, CountToRead = %d\n", fru_size, fru_read_req.CountToRead);
-			wRet = IPMICMD_ReadFRUData (psession,
+			wRet = IPMICMD_ReadFRUData (pUDSSession,
 										&fru_read_req,
 										(FRUReadRes_T *) fru_res_data,
 										timeout);
@@ -1153,13 +1153,13 @@ _exit_get_fru_info_:
 	return wRet;
 }
 
-uint16_t LIBIPMI_HL_GetFRUData(IPMI20_SESSION_T *pSession,
+uint16_t LIBIPMI_HL_GetFRUData(IPMI20_UDS_SESSION_T *pUDSSession,
 					uint8_t fru_device_id,
 				  	uint32_t* p_fru_size,
 				  	FRUData_T* fru_data,
 					int timeout)
 {
-	return(get_fru_info(pSession,fru_device_id,p_fru_size,fru_data,timeout));
+	return(get_fru_info(pUDSSession,fru_device_id,p_fru_size,fru_data,timeout));
 
 }
 

+ 49 - 49
app/goahead-5.1.0/src/libipmi/src/libipmi_sdr.c

@@ -36,7 +36,7 @@
 
 
 /* Get SDR Repository Info Command */
-  uint16_t    IPMICMD_GetSDRRepositoryInfo( IPMI20_SESSION_T *pSession,
+  uint16_t    IPMICMD_GetSDRRepositoryInfo( IPMI20_UDS_SESSION_T *pUDSSession,
                                         SDRRepositoryInfo_T *pResGetSDRRepositoryInfo,
                                         int timeout)
 {
@@ -45,7 +45,7 @@
     uint32_t    dwResLen;
 
     dwResLen = sizeof(SDRRepositoryInfo_T);
-    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
                                             NETFNLUN_IPMI_STORAGE, CMD_GET_SDR_REPOSITORY_INFO,
                                             (uint8_t*)Req, 0,
                                             (uint8_t *)pResGetSDRRepositoryInfo, &dwResLen,
@@ -55,7 +55,7 @@
 }
 
 /* Get SDR Repository Allocation Info Command */
-  uint16_t    IPMICMD_GetSDRRepositoryAllocInfo( IPMI20_SESSION_T *pSession,
+  uint16_t    IPMICMD_GetSDRRepositoryAllocInfo( IPMI20_UDS_SESSION_T *pUDSSession,
                                         SDRRepositoryAllocInfo_T *pResGetSDRRepositoryAllocInfo,
                                         int timeout)
 {
@@ -64,7 +64,7 @@
     uint32_t    dwResLen;
 
     dwResLen = sizeof(SDRRepositoryAllocInfo_T);
-    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
                                             NETFNLUN_IPMI_STORAGE, CMD_GET_SDR_REPOSITORY_ALLOCATION_INFO,
                                             (uint8_t*)Req, 0,
                                             (uint8_t *)pResGetSDRRepositoryAllocInfo, &dwResLen,
@@ -74,7 +74,7 @@
 }
 
 /* Reserve SDR Repository Command */
-  uint16_t    IPMICMD_ReserveSDRRepository( IPMI20_SESSION_T *pSession,
+  uint16_t    IPMICMD_ReserveSDRRepository( IPMI20_UDS_SESSION_T *pUDSSession,
                                         ReserveSDRRepositoryRes_T *pResReserveSDRRepository,
                                         int timeout)
 {
@@ -83,7 +83,7 @@
     uint32_t    dwResLen;
 
     dwResLen = sizeof(ReserveSDRRepositoryRes_T);
-    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
                                             NETFNLUN_IPMI_STORAGE, CMD_RESERVE_SDR_REPOSITORY,
                                             (uint8_t*)Req, 0,
                                             (uint8_t *)pResReserveSDRRepository, &dwResLen,
@@ -94,7 +94,7 @@
 
 
 /* Get SDR Command */
-  uint16_t    IPMICMD_GetSDR( IPMI20_SESSION_T *pSession,
+  uint16_t    IPMICMD_GetSDR( IPMI20_UDS_SESSION_T *pUDSSession,
                                     GetSDRReq_T *pReqGetSDR,
                                     GetSDRRes_T *pResGetSDR,
                                     uint32_t        *pdwOutBuffLen,
@@ -104,7 +104,7 @@
     uint32_t    dwResLen;
 
     dwResLen = *pdwOutBuffLen;
-    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
                                             NETFNLUN_IPMI_STORAGE, CMD_GET_SDR,
                                             (uint8_t*)pReqGetSDR, sizeof(GetSDRReq_T),
                                             (uint8_t *)pResGetSDR, &dwResLen,
@@ -117,7 +117,7 @@
 
 
 /* Add SDR Command */
-  uint16_t    IPMICMD_AddSDR( IPMI20_SESSION_T *pSession,
+  uint16_t    IPMICMD_AddSDR( IPMI20_UDS_SESSION_T *pUDSSession,
                                     uint8_t        *pReqAddSDR,
                                     uint32_t        dwInBuffLen,
                                     AddSDRRes_T *pResAddSDR,
@@ -127,7 +127,7 @@
     uint32_t    dwResLen;
 
     dwResLen = sizeof(AddSDRRes_T);
-    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
                                             NETFNLUN_IPMI_STORAGE, CMD_ADD_SDR,
                                             (uint8_t*)pReqAddSDR, dwInBuffLen,
                                             (uint8_t *)pResAddSDR, &dwResLen,
@@ -138,7 +138,7 @@
 
 
 /* Partial Add SDR Command */
-  uint16_t    IPMICMD_PartialAddSDR( IPMI20_SESSION_T *pSession,
+  uint16_t    IPMICMD_PartialAddSDR( IPMI20_UDS_SESSION_T *pUDSSession,
                                     PartialAddSDRReq_T *pReqPartialAddSDR,
                                     uint32_t        dwInBuffLen,
                                     PartialAddSDRRes_T *pResPartialAddSDR,
@@ -148,7 +148,7 @@
     uint32_t    dwResLen;
 
     dwResLen = sizeof(PartialAddSDRRes_T);
-    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
                                             NETFNLUN_IPMI_STORAGE, CMD_PARTIAL_ADD_SDR,
                                             (uint8_t*)pReqPartialAddSDR, dwInBuffLen,
                                             (uint8_t *)pResPartialAddSDR, &dwResLen,
@@ -159,7 +159,7 @@
 
 
 /* Delete SDR Command */
-  uint16_t    IPMICMD_DeleteSDR( IPMI20_SESSION_T *pSession,
+  uint16_t    IPMICMD_DeleteSDR( IPMI20_UDS_SESSION_T *pUDSSession,
                                     DeleteSDRReq_T *pReqDeleteSDR,
                                     DeleteSDRReq_T *pResDeleteSDR,
                                     int timeout)
@@ -168,7 +168,7 @@
     uint32_t    dwResLen;
 
     dwResLen = sizeof(DeleteSDRReq_T);
-    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
                                             NETFNLUN_IPMI_STORAGE, CMD_DELETE_SDR,
                                             (uint8_t*)pReqDeleteSDR, sizeof(DeleteSDRReq_T),
                                             (uint8_t *)pResDeleteSDR, &dwResLen,
@@ -179,7 +179,7 @@
 
 
 /* Clear SDR Repository Command */
-  uint16_t    IPMICMD_ClearSDRRepository( IPMI20_SESSION_T *pSession,
+  uint16_t    IPMICMD_ClearSDRRepository( IPMI20_UDS_SESSION_T *pUDSSession,
                                     ClearSDRReq_T *pReqClearSDR,
                                     ClearSDRRes_T *pResClearSDR,
                                     int timeout)
@@ -188,7 +188,7 @@
     uint32_t    dwResLen;
 
     dwResLen = sizeof(ClearSDRRes_T);
-    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
                                             NETFNLUN_IPMI_STORAGE, CMD_CLEAR_SDR_REPOSITORY,
                                             (uint8_t*)pReqClearSDR, sizeof(ClearSDRReq_T),
                                             (uint8_t *)pResClearSDR, &dwResLen,
@@ -199,7 +199,7 @@
 
 
 /* Get SDR Repository Time Command */
-  uint16_t    IPMICMD_GetSDRRepositoryTime( IPMI20_SESSION_T *pSession,
+  uint16_t    IPMICMD_GetSDRRepositoryTime( IPMI20_UDS_SESSION_T *pUDSSession,
                                     GetSDRRepositoryTimeRes_T *pResGetSDRRepositoryTime,
                                     int timeout)
 {
@@ -208,7 +208,7 @@
     uint32_t    dwResLen;
 
     dwResLen = sizeof(GetSDRRepositoryTimeRes_T);
-    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
                                             NETFNLUN_IPMI_STORAGE, CMD_GET_SDR_REPOSITORY_TIME,
                                             (uint8_t*)Req, 0,
                                             (uint8_t *)pResGetSDRRepositoryTime, &dwResLen,
@@ -219,7 +219,7 @@
 
 
 /* Set SDR Repository Time Command */
-  uint16_t    IPMICMD_SetSDRRepositoryTime( IPMI20_SESSION_T *pSession,
+  uint16_t    IPMICMD_SetSDRRepositoryTime( IPMI20_UDS_SESSION_T *pUDSSession,
                                     SetSDRRepositoryTimeReq_T *pReqSetSDRRepositoryTime,
                                     uint8_t *pResSetSDRRepositoryTime,
                                     int timeout)
@@ -228,7 +228,7 @@
     uint32_t    dwResLen;
 
     dwResLen = sizeof(uint8_t);
-    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
                                             NETFNLUN_IPMI_STORAGE, CMD_SET_SDR_REPOSITORY_TIME,
                                             (uint8_t*)pReqSetSDRRepositoryTime, sizeof(SetSDRRepositoryTimeReq_T),
                                             (uint8_t *)pResSetSDRRepositoryTime, &dwResLen,
@@ -239,7 +239,7 @@
 
 
 /* Enter SDR Repository Update Mode Command */
-  uint16_t    IPMICMD_EnterSDRUpdateMode( IPMI20_SESSION_T *pSession,
+  uint16_t    IPMICMD_EnterSDRUpdateMode( IPMI20_UDS_SESSION_T *pUDSSession,
                                     EnterSDRUpdateModeRes_T *pResEnterSDRUpdateMode,
                                     int timeout)
 {
@@ -248,7 +248,7 @@
     uint32_t    dwResLen;
 
     dwResLen = sizeof(EnterSDRUpdateModeRes_T);
-    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
                                             NETFNLUN_IPMI_STORAGE, CMD_ENTER_SDR_REPOSITORY_UPDATE_MODE,
                                             (uint8_t*)Req, 0,
                                             (uint8_t *)pResEnterSDRUpdateMode, &dwResLen,
@@ -258,7 +258,7 @@
 }
 
 /* Exit SDR Repository Update Mode Command */
-  uint16_t    IPMICMD_ExitSDRUpdateMode( IPMI20_SESSION_T *pSession,
+  uint16_t    IPMICMD_ExitSDRUpdateMode( IPMI20_UDS_SESSION_T *pUDSSession,
                                     ExitSDRUpdateModeRes_T *pResExitSDRUpdateMode,
                                     int timeout)
 {
@@ -267,7 +267,7 @@
     uint32_t    dwResLen;
 
     dwResLen = sizeof(ExitSDRUpdateModeRes_T);
-    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
                                             NETFNLUN_IPMI_STORAGE, CMD_EXIT_SDR_REPOSITORY_UPDATE_MODE,
                                             (uint8_t*)Req, 0,
                                             (uint8_t *)pResExitSDRUpdateMode, &dwResLen,
@@ -277,7 +277,7 @@
 }
 
 /* Run Initialization Agent Command */
-  uint16_t    IPMICMD_RunInitAgent( IPMI20_SESSION_T *pSession,
+  uint16_t    IPMICMD_RunInitAgent( IPMI20_UDS_SESSION_T *pUDSSession,
                                     RunInitAgentReq_T *pReqRunInitAgent,
                                     RunInitAgentRes_T *pResRunInitAgent,
                                     int timeout)
@@ -286,7 +286,7 @@
     uint32_t    dwResLen;
 
     dwResLen = sizeof(RunInitAgentRes_T);
-    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
                                             NETFNLUN_IPMI_STORAGE, CMD_RUN_INITIALIZATION_AGENT,
                                             (uint8_t*)pReqRunInitAgent, sizeof(RunInitAgentReq_T),
                                             (uint8_t *)pResRunInitAgent, &dwResLen,
@@ -297,7 +297,7 @@
 
 
 /***************** High level SDR commands *********************/
-static uint16_t ipmb_get_sdr( IPMI20_SESSION_T *pSession,
+static uint16_t ipmb_get_sdr( IPMI20_UDS_SESSION_T *pUDSSession,
                                               uint16_t reservation_id,
                                               uint16_t record_id,
 					      GetSDRRes_T *pGetSDRRes,
@@ -326,7 +326,7 @@ static uint16_t ipmb_get_sdr( IPMI20_SESSION_T *pSession,
 	get_sdr_req.Offset = 0;
 	get_sdr_req.Size = sizeof(SDRRecHdr_T);
 	dwRetLen = sizeof(SDRRecHdr_T) + sizeof(GetSDRRes_T);
-	wRet = IPMICMD_GetSDR( pSession, &get_sdr_req, (GetSDRRes_T *)&data_buffer[0],
+	wRet = IPMICMD_GetSDR( pUDSSession, &get_sdr_req, (GetSDRRes_T *)&data_buffer[0],
 			&dwRetLen, timeout );
 	
 	if(wRet != LIBIPMI_E_SUCCESS)
@@ -349,7 +349,7 @@ static uint16_t ipmb_get_sdr( IPMI20_SESSION_T *pSession,
 		get_sdr_req.Offset = offset;
 		get_sdr_req.Size = bytes_to_read;
 		dwRetLen = bytes_to_read + sizeof(GetSDRRes_T);
-		wRet = IPMICMD_GetSDR( pSession, &get_sdr_req, (GetSDRRes_T*)&data_buffer[0],
+		wRet = IPMICMD_GetSDR( pUDSSession, &get_sdr_req, (GetSDRRes_T*)&data_buffer[0],
 				&dwRetLen, timeout );
 		
 		if(wRet != LIBIPMI_E_SUCCESS)
@@ -369,7 +369,7 @@ static uint16_t ipmb_get_sdr( IPMI20_SESSION_T *pSession,
 	return LIBIPMI_E_SUCCESS;	
 }
 
-  uint16_t LIBIPMI_HL_GetSDR( IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetSDR( IPMI20_UDS_SESSION_T *pUDSSession,
                                               uint16_t reservation_id,
                                               uint16_t record_id,
 					      GetSDRRes_T *pGetSDRRes,
@@ -379,9 +379,9 @@ static uint16_t ipmb_get_sdr( IPMI20_SESSION_T *pSession,
 	uint16_t	wRet=LIBIPMI_E_SUCCESS;
 	
 	
-	// if( pSession->byMediumType == IPMB_MEDIUM )
+	// if( pUDSSession->byMediumType == IPMB_MEDIUM )
 	// {
-	// 	wRet = ipmb_get_sdr(pSession, reservation_id, 
+	// 	wRet = ipmb_get_sdr(pUDSSession, reservation_id, 
 	// 				record_id,
 	// 				pGetSDRRes,
 	// 				dwDataLen,
@@ -395,14 +395,14 @@ static uint16_t ipmb_get_sdr( IPMI20_SESSION_T *pSession,
 		get_sdr_req.RecID =  ( record_id );
 		get_sdr_req.Offset = 0;
 		get_sdr_req.Size = 0xff;
-    		wRet = IPMICMD_GetSDR( pSession, &get_sdr_req, pGetSDRRes,
+    		wRet = IPMICMD_GetSDR( pUDSSession, &get_sdr_req, pGetSDRRes,
                            dwDataLen, timeout );
 	}
 
 	return wRet;	
 }
 
-  uint16_t LIBIPMI_HL_GetCompleteSDR( IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetCompleteSDR( IPMI20_UDS_SESSION_T *pUDSSession,
                                               uint16_t record_id,
                                               uint16_t *next_record_id,
                                               uint8_t *sdr_buffer,
@@ -418,7 +418,7 @@ static uint16_t ipmb_get_sdr( IPMI20_SESSION_T *pSession,
     int max_sdr_len;
 
     /* Get repository allocation information */
-    wRet = IPMICMD_GetSDRRepositoryAllocInfo( pSession, &alloc_info, timeout );
+    wRet = IPMICMD_GetSDRRepositoryAllocInfo( pUDSSession, &alloc_info, timeout );
     if( wRet != LIBIPMI_E_SUCCESS )
         return( wRet );
     
@@ -437,7 +437,7 @@ static uint16_t ipmb_get_sdr( IPMI20_SESSION_T *pSession,
         return( STATUS_CODE( IPMI_ERROR_FLAG, OEMCC_NOMEM ) );
     
     get_sdr_res = (GetSDRRes_T *)temp_buffer;
-	// if(pSession->byMediumType == NETWORK_MEDIUM_UDP_SAL)
+	// if(pUDSSession->byMediumType == NETWORK_MEDIUM_UDP_SAL)
  //    {
  //        blen = max_sdr_len + sizeof(GetSDRRes_T);
  //    }
@@ -449,10 +449,10 @@ static uint16_t ipmb_get_sdr( IPMI20_SESSION_T *pSession,
     get_sdr_req.Size = 0xff;
 
     /* Now try to get the whole record */
-    wRet = IPMICMD_GetSDR( pSession, &get_sdr_req, (GetSDRRes_T *)temp_buffer,
+    wRet = IPMICMD_GetSDR( pUDSSession, &get_sdr_req, (GetSDRRes_T *)temp_buffer,
                            &blen, timeout );
 #endif
-    wRet = LIBIPMI_HL_GetSDR(pSession,  (reservation.ReservationID),
+    wRet = LIBIPMI_HL_GetSDR(pUDSSession,  (reservation.ReservationID),
     					record_id, (GetSDRRes_T *)temp_buffer, &blen, timeout);
     if( wRet != LIBIPMI_E_SUCCESS )
     {
@@ -469,7 +469,7 @@ static uint16_t ipmb_get_sdr( IPMI20_SESSION_T *pSession,
 }
 
 
-  uint16_t LIBIPMI_HL_GetAllSDRs( IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetAllSDRs( IPMI20_UDS_SESSION_T *pUDSSession,
                                           uint8_t *sdr_buffer, size_t buffer_len,
                                           int timeout )
 {
@@ -482,12 +482,12 @@ static uint16_t ipmb_get_sdr( IPMI20_SESSION_T *pSession,
     int i;
 
     /* Get repository allocation information */
-    wRet = IPMICMD_GetSDRRepositoryAllocInfo( pSession, &alloc_info, timeout );
+    wRet = IPMICMD_GetSDRRepositoryAllocInfo( pUDSSession, &alloc_info, timeout );
     if( wRet != LIBIPMI_E_SUCCESS )
         return( wRet );
 
     /* Get repository information */
-    wRet = IPMICMD_GetSDRRepositoryInfo( pSession, &repo_info, timeout );
+    wRet = IPMICMD_GetSDRRepositoryInfo( pUDSSession, &repo_info, timeout );
     if( wRet != LIBIPMI_E_SUCCESS )
         return( -1 );
 
@@ -507,7 +507,7 @@ static uint16_t ipmb_get_sdr( IPMI20_SESSION_T *pSession,
         uint16_t next_record_id;
 
         /* Read the full SDR into the buffer */
-        wRet = LIBIPMI_HL_GetCompleteSDR( pSession, record_id, &next_record_id,
+        wRet = LIBIPMI_HL_GetCompleteSDR( pUDSSession, record_id, &next_record_id,
                                           &sdr_buffer[ i * max_sdr_len ],
                                           max_sdr_len, timeout );
         if( wRet != LIBIPMI_E_SUCCESS )
@@ -519,9 +519,9 @@ static uint16_t ipmb_get_sdr( IPMI20_SESSION_T *pSession,
     return( wRet );
 }
 
-//int CacheGetAllSDRS(IPMI20_SESSION_T* pSession,uint8_t* sdr_buffer,uint32_t* buff_size,uint32_t* max_sdr_len,uint32_t* sdr_count);
+//int CacheGetAllSDRS(IPMI20_UDS_SESSION_T* pUDSSession,uint8_t* sdr_buffer,uint32_t* buff_size,uint32_t* max_sdr_len,uint32_t* sdr_count);
 
-  uint16_t LIBIPMI_HL_GetAllSDRs_Cached( IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetAllSDRs_Cached( IPMI20_UDS_SESSION_T *pUDSSession,
                                           uint8_t *sdr_buffer, 
 										  uint32_t* sdr_buff_size,
 										  uint32_t* max_sdr_len,
@@ -530,13 +530,13 @@ static uint16_t ipmb_get_sdr( IPMI20_SESSION_T *pSession,
 {
 	uint16_t wRet;
 
-//	wRet = CacheGetAllSDRS(pSession,sdr_buffer,sdr_buff_size,max_sdr_len,sdr_count);
+//	wRet = CacheGetAllSDRS(pUDSSession,sdr_buffer,sdr_buff_size,max_sdr_len,sdr_count);
 
     
 	return wRet;
 }
 
-  uint16_t LIBIPMI_HL_GetSpecificSDR( IPMI20_SESSION_T *pSession,
+  uint16_t LIBIPMI_HL_GetSpecificSDR( IPMI20_UDS_SESSION_T *pUDSSession,
                                                 uint8_t *sdr_buffer, 
                                                 uint32_t* sdr_buff_size,
                                                 int SensorNumber,
@@ -550,7 +550,7 @@ static uint16_t ipmb_get_sdr( IPMI20_SESSION_T *pSession,
     uint32_t      dwRetLen = sizeof data_buffer;
     int wRet = 0;
     
-    wRet = IPMICMD_ReserveSDRRepository(pSession, &ResReserveSDRRepository, timeout);
+    wRet = IPMICMD_ReserveSDRRepository(pUDSSession, &ResReserveSDRRepository, timeout);
         
     pResGetSDR->NextRecID = 0;
     while (1)
@@ -559,9 +559,9 @@ static uint16_t ipmb_get_sdr( IPMI20_SESSION_T *pSession,
         ReqGetSDR.RecID = pResGetSDR->NextRecID;
         ReqGetSDR.Offset = 0;
         ReqGetSDR.Size = 0xff;
-        //wRet = IPMICMD_GetSDR(pSession, &ReqGetSDR, pResGetSDR, &dwRetLen, timeout);
+        //wRet = IPMICMD_GetSDR(pUDSSession, &ReqGetSDR, pResGetSDR, &dwRetLen, timeout);
         //TODO: IPMICMD_GetSDR replaced by LIBIPMI_HL_GetSDR, by jimbo
-        wRet = LIBIPMI_HL_GetSDR(pSession,	ReqGetSDR.ReservationID, ReqGetSDR.RecID, pResGetSDR, &dwRetLen, timeout );
+        wRet = LIBIPMI_HL_GetSDR(pUDSSession,	ReqGetSDR.ReservationID, ReqGetSDR.RecID, pResGetSDR, &dwRetLen, timeout );
         if (wRet != LIBIPMI_E_SUCCESS)
             break;
         

+ 54 - 54
app/goahead-5.1.0/src/libipmi/src/libipmi_sensor.c

@@ -52,7 +52,7 @@
 #include "com_IPMI_SensorEvent.h"
 
 /* 35.2 Get Device SDR Info Command */
-uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
+uint16_t	IPMICMD_GetSDRInfo( IPMI20_UDS_SESSION_T *pUDSSession,
 							uint8_t	*pReqGetSDRInfo,
 							GetSDRInfoRes_T *pResGetSDRInfo,
 							int timeout)
@@ -61,7 +61,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 	uint32_t	dwResLen;
 
 	dwResLen = MAX_RESPONSE_SIZE;
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_SENSOR, CMD_GET_DEV_SDR_INFO,
 											(uint8_t*)pReqGetSDRInfo, sizeof(uint8_t),
 											(uint8_t *)pResGetSDRInfo, &dwResLen,
@@ -71,7 +71,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 }
 
 /* 35.3 Get Device SDR Command */
-  uint16_t	IPMICMD_GetDevSDR( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_GetDevSDR( IPMI20_UDS_SESSION_T *pUDSSession,
 										GetDevSDRReq_T	*pReqDevSDR,
 										GetDevSDRRes_T	*pResDevSDR,
 										uint32_t			*pOutBuffLen,
@@ -81,7 +81,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 	uint32_t	dwResLen;
 
 	dwResLen = sizeof(GetDevSDRRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_SENSOR, CMD_GET_DEV_SDR,
 											(uint8_t*)pReqDevSDR, sizeof(GetDevSDRReq_T),
 											(uint8_t *)pResDevSDR, &dwResLen,
@@ -93,7 +93,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 }
 
 /* 35.4 Reserve Device SDR Repository Command */
-  uint16_t	IPMICMD_ReserveDevSDR( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_ReserveDevSDR( IPMI20_UDS_SESSION_T *pUDSSession,
 										ReserveDevSDRRes_T *pResReserveDevSDR,
 										int timeout)
 {
@@ -102,7 +102,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 	uint32_t	dwResLen;
 
 	dwResLen = sizeof(ReserveDevSDRRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_SENSOR, CMD_RESERVE_DEV_SDR_REPOSITORY,
 											(uint8_t*)Req, 0,
 											(uint8_t *)pResReserveDevSDR, &dwResLen,
@@ -112,7 +112,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 }
 
 /* 35.5 Get Sensor Reading Factors Command */
-  uint16_t	IPMICMD_GetSensorReadingFactor( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_GetSensorReadingFactor( IPMI20_UDS_SESSION_T *pUDSSession,
 										GetSensorReadingFactorReq_T	*pReqGetSensorReadingFactor,
 										GetSensorReadingFactorRes_T *pResGetSensorReadingFactor,
 										int timeout)
@@ -121,7 +121,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 	uint32_t	dwResLen;
 
 	dwResLen = sizeof(GetSensorReadingFactorRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_SENSOR, CMD_GET_SENSOR_READING_FACTORS,
 											(uint8_t*)pReqGetSensorReadingFactor, sizeof(GetSensorReadingFactorReq_T),
 											(uint8_t *)pResGetSensorReadingFactor, &dwResLen,
@@ -131,7 +131,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 }
 
 /* 35.6 Set Sensor Hysteresis Command */
-  uint16_t	IPMICMD_SetSensorHysterisis( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_SetSensorHysterisis( IPMI20_UDS_SESSION_T *pUDSSession,
 										SetSensorHysterisisReq_T *pReqSetSensorHysterisis,
 										SetSensorHysterisisRes_T *pResSetSensorHysterisis,
 										int timeout)
@@ -140,7 +140,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 	uint32_t	dwResLen;
 
 	dwResLen = sizeof(SetSensorHysterisisRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_SENSOR, CMD_SET_SENSOR_HYSTERISIS,
 											(uint8_t*)pReqSetSensorHysterisis, sizeof(SetSensorHysterisisReq_T),
 											(uint8_t *)pResSetSensorHysterisis, &dwResLen,
@@ -150,7 +150,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 }
 
 /* 35.7 Get Sensor Hysteresis Command */
-  uint16_t	IPMICMD_GetSensorHysterisis( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_GetSensorHysterisis( IPMI20_UDS_SESSION_T *pUDSSession,
 										GetSensorHysterisisReq_T *pReqGetSensorHysterisis,
 										GetSensorHysterisisRes_T *pResGetSensorHysterisis,
 										int timeout)
@@ -159,7 +159,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 	uint32_t	dwResLen;
 
 	dwResLen = sizeof(GetSensorHysterisisRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_SENSOR, CMD_GET_SENSOR_HYSTERISIS,
 											(uint8_t*)pReqGetSensorHysterisis, sizeof(GetSensorHysterisisReq_T),
 											(uint8_t *)pResGetSensorHysterisis, &dwResLen,
@@ -169,7 +169,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 }
 
 /* 35.8 Set Sensor Thresholds Command */
-  uint16_t	IPMICMD_SetSensorThreshold( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_SetSensorThreshold( IPMI20_UDS_SESSION_T *pUDSSession,
 										SetSensorThresholdReq_T *pReqSetSensorThreshold,
 										SetSensorThresholdRes_T *pResSetSensorThreshold,
 										int timeout)
@@ -178,7 +178,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 	uint32_t	dwResLen;
 
 	dwResLen = sizeof(SetSensorThresholdRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_SENSOR, CMD_SET_SENSOR_THRESHOLDS,
 											(uint8_t*)pReqSetSensorThreshold, sizeof(SetSensorThresholdReq_T),
 											(uint8_t *)pResSetSensorThreshold, &dwResLen,
@@ -188,7 +188,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 }
 
 /* 35.9 Get Sensor Thresholds Command */
-  uint16_t	IPMICMD_GetSensorThreshold( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_GetSensorThreshold( IPMI20_UDS_SESSION_T *pUDSSession,
 										GetSensorThresholdReq_T *pReqGetSensorThreshold,
 										GetSensorThresholdRes_T *pResGetSensorThreshold,
 										int timeout)
@@ -197,7 +197,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 	uint32_t	dwResLen;
 
 	dwResLen = sizeof(GetSensorThresholdRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_SENSOR, CMD_GET_SENSOR_THRESHOLDS,
 											(uint8_t*)pReqGetSensorThreshold, sizeof(GetSensorThresholdReq_T),
 											(uint8_t *)pResGetSensorThreshold, &dwResLen,
@@ -207,7 +207,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 }
 
 /* 35.10 Set Sensor Event Enable Command */
-  uint16_t	IPMICMD_SetSensorEventEnable( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_SetSensorEventEnable( IPMI20_UDS_SESSION_T *pUDSSession,
 										SetSensorEventEnableReq_T *pReqSetSensorEventEnable,
 										SetSensorEventEnableRes_T *pResSetSensorEventEnable,
 										int timeout)
@@ -216,7 +216,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 	uint32_t	dwResLen;
 
 	dwResLen = sizeof(SetSensorEventEnableRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_SENSOR, CMD_SET_SENSOR_EVENT_ENABLE,
 											(uint8_t*)pReqSetSensorEventEnable, sizeof(SetSensorEventEnableReq_T),
 											(uint8_t *)pResSetSensorEventEnable, &dwResLen,
@@ -226,7 +226,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 }
 
 /* 35.11 Get Sensor Event Enable Command */
-  uint16_t	IPMICMD_GetSensorEventEnable( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_GetSensorEventEnable( IPMI20_UDS_SESSION_T *pUDSSession,
 										GetSensorEventEnableReq_T *pReqGetSensorEventEnable,
 										GetSensorEventEnableRes_T *pResGetSensorEventEnable,
 										int timeout)
@@ -235,7 +235,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 	uint32_t	dwResLen;
 
 	dwResLen = sizeof(GetSensorEventEnableRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_SENSOR, CMD_GET_SENSOR_EVENT_ENABLE,
 											(uint8_t*)pReqGetSensorEventEnable, sizeof(GetSensorEventEnableReq_T),
 											(uint8_t *)pResGetSensorEventEnable, &dwResLen,
@@ -246,7 +246,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 
 
 /* 35.12 ReArm Sensor Events Command */
-  uint16_t	IPMICMD_ReArmSensorEvents( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_ReArmSensorEvents( IPMI20_UDS_SESSION_T *pUDSSession,
 										ReArmSensorReq_T *pReArmSensorReq,
 										ReArmSensorRes_T *pReArmSensorRes,
 										int timeout)
@@ -255,7 +255,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 	uint32_t	dwResLen;
 
 	dwResLen = sizeof(ReArmSensorRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_SENSOR, CMD_REARM_SENSOR_EVENTS,
 											(uint8_t*)pReArmSensorReq, sizeof(ReArmSensorReq_T),
 											(uint8_t *)pReArmSensorRes, &dwResLen,
@@ -266,7 +266,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 
 
 /* 35.13 Get Sensor Event Status Command */
-  uint16_t	IPMICMD_GetSensorEventStatus( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_GetSensorEventStatus( IPMI20_UDS_SESSION_T *pUDSSession,
 										GetSensorEventStatusReq_T *pReqGetSensorEventStatus,
 										GetSensorEventStatusRes_T *pResGetSensorEventStatus,
 										int timeout)
@@ -275,7 +275,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 	uint32_t	dwResLen;
 
 	dwResLen = sizeof(GetSensorEventStatusRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_SENSOR, CMD_GET_SENSOR_EVENT_STATUS,
 											(uint8_t*)pReqGetSensorEventStatus, sizeof(GetSensorEventEnableReq_T),
 											(uint8_t *)pResGetSensorEventStatus, &dwResLen,
@@ -285,7 +285,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 }
 
 /* 35.14 Get Sensor Reading Command */
-  uint16_t	IPMICMD_GetSensorReading( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_GetSensorReading( IPMI20_UDS_SESSION_T *pUDSSession,
 										GetSensorReadingReq_T *pReqGetSensorReading,
 										GetSensorReadingRes_T *pResGetSensorReading,
 										int timeout)
@@ -294,7 +294,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 	uint32_t	dwResLen;
 
 	dwResLen = sizeof(GetSensorReadingRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_SENSOR, CMD_GET_SENSOR_READING,
 											(uint8_t*)pReqGetSensorReading, sizeof(GetSensorReadingReq_T),
 											(uint8_t *)pResGetSensorReading, &dwResLen,
@@ -304,7 +304,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 }
 
 /* 35.15 Set Sensor Type Command */
-  uint16_t	IPMICMD_SetSensorType( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_SetSensorType( IPMI20_UDS_SESSION_T *pUDSSession,
 										SetSensorTypeReq_T *pReqSetSensorType,
 										SetSensorTypeRes_T *pResSetSensorType,
 										int timeout)
@@ -313,7 +313,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 	uint32_t	dwResLen;
 
 	dwResLen = sizeof(SetSensorTypeRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_SENSOR, CMD_GET_SENSOR_READING,
 											(uint8_t*)pReqSetSensorType, sizeof(SetSensorTypeReq_T),
 											(uint8_t *)pResSetSensorType, &dwResLen,
@@ -324,7 +324,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 
 
 /* 35.16 Get Sensor Type Command */
-  uint16_t	IPMICMD_GetSensorType( IPMI20_SESSION_T *pSession,
+  uint16_t	IPMICMD_GetSensorType( IPMI20_UDS_SESSION_T *pUDSSession,
 										GetSensorTypeReq_T *pReqGetSensorType,
 										GetSensorTypeRes_T *pResGetSensorType,
 										int timeout)
@@ -333,7 +333,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 	uint32_t	dwResLen;
 
 	dwResLen = sizeof(GetSensorTypeRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_SENSOR, CMD_GET_SENSOR_READING,
 											(uint8_t*)pReqGetSensorType, sizeof(GetSensorTypeReq_T),
 											(uint8_t *)pResGetSensorType, &dwResLen,
@@ -341,7 +341,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 
 	return wRet;
 }
-  uint16_t IPMICMD_SetSensorReading( IPMI20_SESSION_T *pSession,
+  uint16_t IPMICMD_SetSensorReading( IPMI20_UDS_SESSION_T *pUDSSession,
                                             SetSensorReadingReq_T *pReqSetSensorReading,
                                             SetSensorReadingRes_T *pResSetSensorReading,
                                             int timeout)
@@ -350,7 +350,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
     uint32_t	dwResLen;
 
     dwResLen = sizeof(SetSensorReadingRes_T);
-    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+    wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
                                             NETFNLUN_IPMI_SENSOR,CMD_SET_SENSOR_READING,
                                             (uint8_t*)pReqSetSensorReading, sizeof(SetSensorReadingReq_T),
                                             (uint8_t *)pResSetSensorReading , &dwResLen,
@@ -365,7 +365,7 @@ uint16_t	IPMICMD_GetSDRInfo( IPMI20_SESSION_T *pSession,
 //#define SDR_FILE_PATH   "/tmp/sdr_data"
 
   uint16_t
-LIBIPMI_HL_ReadSensorFromSDR( IPMI20_SESSION_T *pSession, uint8_t *sdr_buffer,
+LIBIPMI_HL_ReadSensorFromSDR( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t *sdr_buffer,
 							  uint8_t *raw_reading, float *reading,
 							  uint8_t *discrete, int timeout )
 {
@@ -392,7 +392,7 @@ LIBIPMI_HL_ReadSensorFromSDR( IPMI20_SESSION_T *pSession, uint8_t *sdr_buffer,
  //            *discrete = record->EventTypeCode;
  //        if(record->OwnerID != 0x20)
  //        {
- //            wRet = IPMICMD_AMIGetChNum (pSession,&pAMIGetChNumRes,
+ //            wRet = IPMICMD_AMIGetChNum (pUDSSession,&pAMIGetChNumRes,
  //                                                                    timeout);
  //            SendMsg = TRUE;
  //            SendMsgReq[0] = 0x40 | pAMIGetChNumRes.ChannelNum;
@@ -417,7 +417,7 @@ LIBIPMI_HL_ReadSensorFromSDR( IPMI20_SESSION_T *pSession, uint8_t *sdr_buffer,
  //            *discrete = record->EventTypeCode;
  //        if(record->OwnerID != 0x20)
  //        {
- //            wRet = IPMICMD_AMIGetChNum (pSession,&pAMIGetChNumRes,
+ //            wRet = IPMICMD_AMIGetChNum (pUDSSession,&pAMIGetChNumRes,
  //                                                                    timeout);        
  //            SendMsg = TRUE;
  //            SendMsgReq[0] = 0x40 | pAMIGetChNumRes.ChannelNum;
@@ -442,7 +442,7 @@ LIBIPMI_HL_ReadSensorFromSDR( IPMI20_SESSION_T *pSession, uint8_t *sdr_buffer,
  //    if(SendMsg == TRUE)
  //    {
  //        /*SendMessage Command to Get Sensor Reading when sensor Owner ID is not 0x20 */
- //        wRet = IPMICMD_SendMessage(pSession,SendMsgReq,(uint8_t *)&get_reading_res,
+ //        wRet = IPMICMD_SendMessage(pUDSSession,SendMsgReq,(uint8_t *)&get_reading_res,
  //                                                           SendMsgReqLen,timeout);
         
  //        if(get_reading_res.CompletionCode == CC_TIMEOUT)
@@ -458,7 +458,7 @@ LIBIPMI_HL_ReadSensorFromSDR( IPMI20_SESSION_T *pSession, uint8_t *sdr_buffer,
  //    else
  //    {
  //        /* Get the sensor reading */
- //        wRet = IPMICMD_GetSensorReading( pSession, &get_reading_req,
+ //        wRet = IPMICMD_GetSensorReading( pUDSSession, &get_reading_req,
  //                                     &get_reading_res, timeout );
  //        if( wRet != LIBIPMI_E_SUCCESS )
  //        {
@@ -494,7 +494,7 @@ LIBIPMI_HL_ReadSensorFromSDR( IPMI20_SESSION_T *pSession, uint8_t *sdr_buffer,
 
 
   uint16_t
-LIBIPMI_HL_LoadSensorSDRs( IPMI20_SESSION_T *pSession, uint8_t **sdr_buffer, 
+LIBIPMI_HL_LoadSensorSDRs( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t **sdr_buffer, 
                            int *count, int timeout )
 {
     // FILE *sdrfile;
@@ -517,7 +517,7 @@ LIBIPMI_HL_LoadSensorSDRs( IPMI20_SESSION_T *pSession, uint8_t **sdr_buffer,
     //         }
 
     //         /* Read the SDRs from the BMC (Note: this function calls malloc) */
-    //         *count = read_sensor_sdrs( pSession,
+    //         *count = read_sensor_sdrs( pUDSSession,
     //                                    (struct sensor_info **)&local_sdr_buffer,
     //                                    timeout );
     //         if( *count < 0 )
@@ -614,12 +614,12 @@ LIBIPMI_HL_LoadSensorSDRs( IPMI20_SESSION_T *pSession, uint8_t **sdr_buffer,
 
 
   uint16_t
-LIBIPMI_HL_GetSensorCount( IPMI20_SESSION_T *pSession, int *sdr_count, int timeout )
+LIBIPMI_HL_GetSensorCount( IPMI20_UDS_SESSION_T *pUDSSession, int *sdr_count, int timeout )
 {
     uint16_t wRet;
     SDRRepositoryInfo_T pResSDRRepoInfo;
 
-    wRet =  IPMICMD_GetSDRRepositoryInfo( pSession,
+    wRet =  IPMICMD_GetSDRRepositoryInfo( pUDSSession,
                                                         &pResSDRRepoInfo,
                                                         timeout);
     if(wRet != LIBIPMI_E_SUCCESS)
@@ -634,7 +634,7 @@ LIBIPMI_HL_GetSensorCount( IPMI20_SESSION_T *pSession, int *sdr_count, int timeo
 
 #if 0
   uint16_t
-LIBIPMI_HL_GetAllSensorReadings( IPMI20_SESSION_T *pSession,
+LIBIPMI_HL_GetAllSensorReadings( IPMI20_UDS_SESSION_T *pUDSSession,
                                  struct sensor_data *sensor_list, int timeout )
 {
     uint16_t wRet;
@@ -645,7 +645,7 @@ LIBIPMI_HL_GetAllSensorReadings( IPMI20_SESSION_T *pSession,
     GetSensorThresholdRes_T * pResGetSensorThreshold;
 
     /* Load the SDRs related to sensors into memory */
-    wRet = LIBIPMI_HL_LoadSensorSDRs( pSession, &sdr_buffer, &sdr_count, timeout );
+    wRet = LIBIPMI_HL_LoadSensorSDRs( pUDSSession, &sdr_buffer, &sdr_count, timeout );
     if( wRet != LIBIPMI_E_SUCCESS )
     {
         printf( "Cannot load sensor SDRs\n" );
@@ -662,7 +662,7 @@ LIBIPMI_HL_GetAllSensorReadings( IPMI20_SESSION_T *pSession,
         FullSensorRec_T *record = (FullSensorRec_T *)( sensor->sdr_buffer );
 
         /* Get the reading from this sensor */
-        wRet = LIBIPMI_HL_ReadSensorFromSDR( pSession, sensor->sdr_buffer,
+        wRet = LIBIPMI_HL_ReadSensorFromSDR( pUDSSession, sensor->sdr_buffer,
                                              &raw_reading, &reading, &discrete, 15 );
 
         //assume sensor is accessible till we find out otherwise
@@ -698,7 +698,7 @@ LIBIPMI_HL_GetAllSensorReadings( IPMI20_SESSION_T *pSession,
         memset(pResGetSensorThreshold, 0, sizeof(GetSensorThresholdRes_T));
 
         pReqGetSensorThreshold->SensorNum = record->SensorNum;
-        wRet = IPMICMD_GetSensorThreshold(pSession, pReqGetSensorThreshold, 
+        wRet = IPMICMD_GetSensorThreshold(pUDSSession, pReqGetSensorThreshold, 
                                                                 pResGetSensorThreshold, 15);
 
         if( wRet == LIBIPMI_E_SUCCESS )
@@ -736,7 +736,7 @@ LIBIPMI_HL_GetAllSensorReadings( IPMI20_SESSION_T *pSession,
 
             /* ...if we have thresholds, get the threshold state and copy */
             /* all the threshold information to the caller's array.       */
-            retval = GetSensorState( pSession, raw_reading, sensor->sdr_buffer, & (sensor_list[ i ].sensor_state) , 15);
+            retval = GetSensorState( pUDSSession, raw_reading, sensor->sdr_buffer, & (sensor_list[ i ].sensor_state) , 15);
             if( retval < 0 )
                 printf( "get_sdr_sensor_state failed\n" );
             sensor_list[ i ].discrete_state = 0;
@@ -770,7 +770,7 @@ LIBIPMI_HL_GetAllSensorReadings( IPMI20_SESSION_T *pSession,
 #endif
 
 
-  uint16_t	LIBIPMI_HL_GetSensorReadingFactors( IPMI20_SESSION_T *pSession,
+  uint16_t	LIBIPMI_HL_GetSensorReadingFactors( IPMI20_UDS_SESSION_T *pUDSSession,
 										GetSensorReadingFactorReq_T	*pReqGetSensorReadingFactor,
 										GetSensorReadingFactorRes_T *pResGetSensorReadingFactor,
 										uint32_t* nNumSensor,
@@ -780,7 +780,7 @@ LIBIPMI_HL_GetAllSensorReadings( IPMI20_SESSION_T *pSession,
 	uint32_t	dwResLen;
 
 	dwResLen = sizeof(GetSensorReadingFactorRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession, 
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession, 
 		                                     
 											NETFNLUN_IPMI_SENSOR, 
 											CMD_GET_SENSOR_READING_FACTORS,
@@ -791,7 +791,7 @@ LIBIPMI_HL_GetAllSensorReadings( IPMI20_SESSION_T *pSession,
 											timeout);
 	
 #if 0
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,
 	                     
 						NetFnLunBladeSts, 
 						CMD_GET_BLADE_STS,
@@ -805,7 +805,7 @@ LIBIPMI_HL_GetAllSensorReadings( IPMI20_SESSION_T *pSession,
 	uint32_t	dwResLen;
 	
 	dwResLen = sizeof(GetSensorReadingFactorRes_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 											NETFNLUN_IPMI_SENSOR, CMD_GET_SENSOR_READING_FACTORS,
 											(uint8_t*)pReqGetSensorReadingFactor, 
 											sizeof(GetSensorReadingFactorReq_T),
@@ -817,7 +817,7 @@ LIBIPMI_HL_GetAllSensorReadings( IPMI20_SESSION_T *pSession,
 }
 
 //
-//  uint16_t LIBIPMI_HL_GetSensorHistoryReadingData( IPMI20_SESSION_T *pSession,            SensorhistoryData_T *pHistoryData, uint8_t nNumSensor, int timeout)
+//  uint16_t LIBIPMI_HL_GetSensorHistoryReadingData( IPMI20_UDS_SESSION_T *pUDSSession,            SensorhistoryData_T *pHistoryData, uint8_t nNumSensor, int timeout)
 //{
 //	uint8_t	nReq;
 //	uint16_t	wRet;
@@ -827,7 +827,7 @@ LIBIPMI_HL_GetAllSensorReadings( IPMI20_SESSION_T *pSession,
 //	nReq = nNumSensor;
 //	printf("LIBIPMI_HL_GetSensorHistoryReadingData: nReq=%d\n",nReq);
 //	dwResLen = sizeof(SensorhistoryData_T);
-//	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession, 
+//	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession, 
 //		                                     
 //										    NETFN_OEM<<2,  
 //										    0x0A,
@@ -855,7 +855,7 @@ LIBIPMI_HL_GetAllSensorReadings( IPMI20_SESSION_T *pSession,
  */
 
   uint16_t
-LIBIPMI_HL_GetAllSensorReadings( IPMI20_SESSION_T *pSession, struct sensor_data *sensor_list, uint32_t nNumSensor, int timeout )
+LIBIPMI_HL_GetAllSensorReadings( IPMI20_UDS_SESSION_T *pUDSSession, struct sensor_data *sensor_list, uint32_t nNumSensor, int timeout )
 {
     uint16_t wRet;
     int sdr_count;
@@ -870,7 +870,7 @@ LIBIPMI_HL_GetAllSensorReadings( IPMI20_SESSION_T *pSession, struct sensor_data
     for(i = 0; i < nNumSensor; i++)
     {
     	Req[0] = i;
-		wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession, 	//notice!
+		wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession, 	//notice!
 						(NETFN_STORLEAD << 2), CMD_GET_SENSOR_INFO,
 						Req, 1,
 						(uint8_t*)&GetSensorInfoRes, &dwResLen,

+ 141 - 185
app/goahead-5.1.0/src/libipmi/src/libipmi_session.c

@@ -22,35 +22,51 @@
 #include "com_IPMI_App.h"
 #include "com_IPMI_AppDevice.h"
 #include "com_IPMIDefs.h"
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <unistd.h>
+#include <sys/time.h>
+#include <sys/select.h>
+#include <sys/file.h>
+#include <fcntl.h>
+#include <errno.h>
 #define MAX_RETRIES	10
-//void *dl_salhandler = NULL;  //This handler will be used by SAL layer.
-void DeallocateMemory(IPMI20_SESSION_T *pSession);
-
-// extern int GetUserNameForUserID(IPMI20_SESSION_T *pSession,uint8_t UserID,char *UserName,uint8_t AuthEnable,int timeout);
-// extern int CheckUserPassword(IPMI20_SESSION_T *pSession, uint8_t UserID, char *Password, uint8_t AuthEnable, int timeout);
-// extern void UDS_Close(UDS_CHANNEL_T *UDSInfo );
-// extern uint16_t Close_IPMI20_UDS_Session( IPMI20_SESSION_T *pSession );
-// extern int16_t Send_RAW_IPMI2_0_UDS_Command(IPMI20_SESSION_T *pSession,
-//                                                 uint8_t byNetFnLUN, uint8_t byCommand,
-//                                                 uint8_t *pszReqData, uint32_t dwReqDataLen,
-//                                                 uint8_t *pszResData, uint32_t *pdwResDataLen,
-//                                                 uint8_t AuthEnable,int timeout);
-//void DeallocateMemory(IPMI20_SESSION_T *pSession);
-//uint16_t SetPrivilegeLevel(IPMI20_SESSION_T *pSession, uint8_t *byPrivilegeLevel, int timeout);
-
-uint16_t LIBIPMI_CreateSession(IPMI20_SESSION_T *pSession, int timeout)
+
+uint16_t LIBIPMI_CreateSession(IPMI20_UDS_SESSION_T *pUDSSession, int timeout)
 {
-    uint16_t wRet;
-    wRet = Create_IPMI20_UDS_Session(pSession, UDS_SOCKET_PATH, 
-    			NULL, NULL, NULL, NULL, NULL, 
-                timeout, UDS_CHANNEL);
+    uint16_t wRet = LIBIPMI_E_SUCCESS;
+    int client_sock;
+    struct sockaddr_un serv_addr;
+
+    printf("---> Create_IPMI20_UDS_Session\n");
+    
+    /* Open the socket */
+    client_sock = socket(AF_UNIX, SOCK_STREAM, 0);
+    if(client_sock == -1)
+    {
+        printf("LIBIPMI_UDS_SESSION.C: Unable to create socket \n");
+        return LIBIPMI_MEDIUM_E_INVALID_SOCKET;
+    }
+
+    /*Connect the client to server*/
+    memset ((char *) &serv_addr, 0, sizeof (serv_addr));
+    serv_addr.sun_family = AF_UNIX;
+    strcpy(serv_addr.sun_path,UDS_SOCKET_PATH);
 
-    if(wRet != LIBIPMI_E_SUCCESS)
+    printf("---> UDS_Connect, socket: %d, SocketPath: %s\n", client_sock, UDS_SOCKET_PATH);
+    if ( connect (client_sock, (struct sockaddr *) &serv_addr,sizeof(serv_addr)) < 0)
     {
-        DeallocateMemory(pSession);
-        return wRet;
+        printf("LIBIPMI_UDS_SESSION.C: Unable to connect to Server:\n");
+        return LIBIPMI_MEDIUM_E_CONNECT_FAILURE;
     }
 
+    pUDSSession->hUDSInfo.hSocket = client_sock;
+    pUDSSession->hUDSInfo.byIsConnected = 1;
+    pUDSSession->byDefTimeout = timeout;
+ 	pUDSSession->dwSessionID = 0;
+    pUDSSession->byChannelNum = UDS_CHANNEL;
+
     return wRet;
 }
 
@@ -59,188 +75,128 @@ LIBIPMI_Send_RAW_IPMI2_0_Command
 
 Sends RAW IPMI Command to BMC
 ----------------------------------------------------------------------*/
-uint16_t LIBIPMI_Send_RAW_IPMI2_0_Command(IPMI20_SESSION_T *pSession,		//notice!
+uint16_t LIBIPMI_Send_RAW_IPMI2_0_Command(IPMI20_UDS_SESSION_T *pUDSSession,		//notice!
 									uint8_t byNetFnLUN, uint8_t byCommand,
 									uint8_t *pszReqData, uint32_t dwReqDataLen,
 									uint8_t *pszResData, uint32_t *pdwResDataLen,
 									int	timeout)
 {
-	uint16_t wRet;
-	uint8_t retries = MAX_RETRIES;
-
-	if(pSession)
-	{
-		if(pSession->bySessionStarted == SESSION_NOT_STARTED)
-		{
-			printf("Attempt to send command on unstarted session.The socket may have possible timed out on the stack end\n");
-			return STATUS_CODE(MEDIUM_ERROR_FLAG, LIBIPMI_SESSION_E_EXPIRED);
-		}
-
-		wRet =  Send_RAW_IPMI2_0_UDS_Command(pSession,
-										byNetFnLUN, byCommand,
-										pszReqData, dwReqDataLen,
-										pszResData,pdwResDataLen,
-										timeout);
-		if( (wRet == LIBIPMI_MEDIUM_E_INVALID_SOCKET) ||
-			(wRet == LIBIPMI_MEDIUM_E_TIMED_OUT_ON_SEND) ||
-			(wRet == LIBIPMI_MEDIUM_E_SEND_DATA_FAILURE) ||
-			(wRet == LIBIPMI_MEDIUM_E_RECV_DATA_FAILURE))
-		{
-			printf("Encountered what may be socket closure in UDS..will close session here\n");
-			LIBIPMI_CloseSession(pSession);
-			return wRet;
-		}
-
-		return wRet;
-
-	}
-
-	return STATUS_CODE(MEDIUM_ERROR_FLAG, LIBIPMI_SESSION_E_EXPIRED);
-}
 
-/*---------------------------------------------------------------------
-LIBIPMI_CloseSession
+	uint8_t pbyIPMIUDSMsgReq[MAX_REQUEST_SIZE];
+   	uint8_t pbyIPMIUDSResData[MAX_RESPONSE_SIZE];
+   	uint32_t retlen=0,byretval=0;
 
-Closes the connection with BMC
-----------------------------------------------------------------------*/
-uint16_t LIBIPMI_CloseSession( IPMI20_SESSION_T *pSession )
-{
-	if(pSession)
-	{
-        uint16_t wRet;
+   	memset(pbyIPMIUDSMsgReq,0,MAX_REQUEST_SIZE);
+   	memset(pbyIPMIUDSResData,0,MAX_RESPONSE_SIZE);
 
-        wRet = Close_IPMI20_UDS_Session(pSession);
-        DeallocateMemory(pSession);
-        return wRet;
-	}
+   	retlen = FillUDSMessagePacket(pUDSSession,pbyIPMIUDSMsgReq,byNetFnLUN,byCommand,pszReqData,dwReqDataLen);
 
-	return STATUS_CODE(MEDIUM_ERROR_FLAG, LIBIPMI_SESSION_E_EXPIRED);
-}
+    if(retlen <= 0 )
+    {
+       printf("Data Length Invalid\n");
+       return -1;
+    }
 
-/*---------------------------------------------------------------------
-DeallocateMemory
+    byretval = UDS_SendData(&pUDSSession->hUDSInfo,(char *)pbyIPMIUDSMsgReq,retlen,timeout);
+    if(byretval != LIBIPMI_STATUS_SUCCESS)
+        return byretval;
 
-Deallocates the memory which was allocated during session establishment
-----------------------------------------------------------------------*/
-void DeallocateMemory(IPMI20_SESSION_T *pSession)
-{
-	if(pSession)
-	{
-	 	pSession->bySessionStarted = SESSION_NOT_STARTED;
-		if( pSession->hUDSSession != NULL )
-		{
-			/* Close UDS Session */
-            if(pSession->hUDSSession->hUDSInfo.byIsConnected)
+    byretval = UDS_ReceiveData(&pUDSSession->hUDSInfo, (char *)pbyIPMIUDSResData, pdwResDataLen,timeout);
+    if(byretval == LIBIPMI_STATUS_SUCCESS)
+    {
+        IPMIUDSMsg_T *pIPMIUDSMsg = (IPMIUDSMsg_T *)&pbyIPMIUDSResData[0];
+        uint8_t *bycompletioncode = (uint8_t *)&pbyIPMIUDSResData[sizeof(IPMIUDSMsg_T)];
+        
+        *pdwResDataLen = pIPMIUDSMsg->IPMIMsgLen-sizeof(IPMIUDSMsg_T) - 1;
+        memcpy(pszResData,&pbyIPMIUDSResData[sizeof(IPMIUDSMsg_T)],*pdwResDataLen);
+        
+        if(*bycompletioncode != CC_NORMAL)
+            return STATUS_CODE(IPMI_ERROR_FLAG, *bycompletioncode);
+        else
+        {
+            if((0 == pUDSSession->dwSessionID) && (pIPMIUDSMsg->Cmd == CMD_SET_USER_PASSWORD))
             {
-                UDS_Close(&pSession->hUDSSession->hUDSInfo);
+                pUDSSession->dwSessionID = pIPMIUDSMsg->SessionID;
+                pUDSSession->byRole = pIPMIUDSMsg->Privilege;
+                
+                if(UDS_CHANNEL == pUDSSession->byChannelNum)
+                {
+                    pUDSSession->byChannelNum = pIPMIUDSMsg->ChannelNum;
+                }
             }
-            free(pSession->hUDSSession);
-		}
-		memset(pSession, 0 , sizeof(IPMI20_SESSION_T) );
-	}
-	return;
-}
-
-/*---------------------------------------------------------------------
-IsSessionStarted
+            else if((0 == pUDSSession->dwSessionID) && (pIPMIUDSMsg->Cmd == CMD_GET_DEV_ID) )
+            {
+                pUDSSession->dwSessionID = pIPMIUDSMsg->SessionID;
+                pUDSSession->byRole = pIPMIUDSMsg->Privilege;
+                
+                if(UDS_CHANNEL == pUDSSession->byChannelNum)
+                {
+                    pUDSSession->byChannelNum = pIPMIUDSMsg->ChannelNum;
+                }
+            }
+        }
+    }
+    else
+        return STATUS_CODE(IPMI_ERROR_FLAG, byretval);
 
-Returns if the session has started
-----------------------------------------------------------------------*/
-uint8_t	IsSessionStarted(IPMI20_SESSION_T *pSession)
-{
-	return pSession->bySessionStarted;
+    return LIBIPMI_STATUS_SUCCESS;
 }
 
 /*---------------------------------------------------------------------
-SetPrivilegeLevel
+LIBIPMI_CloseSession
 
-Sets the session privilege to specified level
+Closes the connection with BMC
 ----------------------------------------------------------------------*/
-uint16_t SetPrivilegeLevel(IPMI20_SESSION_T *pSession, uint8_t *byPrivLevel, int timeout)
+uint16_t LIBIPMI_CloseSession( IPMI20_UDS_SESSION_T *pUDSSession )
 {
-	uint8_t			byReq;
-	uint8_t			pbyRes[2];
-	uint32_t			dwResLen;
-	uint16_t			wRet;
-
-
-	printf("---> SetPrivilegeLevel\n");
-	byReq = *byPrivLevel;
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command (pSession,DEFAULT_NET_FN_LUN,
-												CMD_SET_SESSION_PRIV_LEVEL,
-												&byReq, sizeof(uint8_t),
-												&pbyRes[0], &dwResLen, timeout);
-
-
-	if(wRet != 0)
-	{
-		printf("Originally requested priv level failed\n");
-		//find the current privilege level allowed
-		byReq = 0;
-		wRet = LIBIPMI_Send_RAW_IPMI2_0_Command (pSession, DEFAULT_NET_FN_LUN,
-												CMD_SET_SESSION_PRIV_LEVEL,
-												&byReq, sizeof(uint8_t),
-												&pbyRes[0], &dwResLen, timeout);
-		if(wRet != 0)
-		{
-			printf("Amazing..request for current privilege limit returned an error %x2\n",wRet);
-		}
-		else
-		{
-			printf("New priv level is %x\n",pbyRes[1]);
-			*byPrivLevel = pbyRes[1];
-		}
-	}
-
-	return wRet;
+    printf("LIBIPMI_CloseSession\n");
+	close(pUDSSession->hUDSInfo.hSocket);
+    /* reset the connected flag */
+    pUDSSession->hUDSInfo.byIsConnected = 0;
+    return LIBIPMI_STATUS_SUCCESS;
 }
 
+// /*---------------------------------------------------------------------
+// SetPrivilegeLevel
+
+// Sets the session privilege to specified level
+// ----------------------------------------------------------------------*/
+// uint16_t SetPrivilegeLevel(IPMI20_SESSION_T *pSession, uint8_t *byPrivLevel, int timeout)
+// {
+// 	uint8_t			byReq;
+// 	uint8_t			pbyRes[2];
+// 	uint32_t			dwResLen;
+// 	uint16_t			wRet;
+
+
+// 	printf("---> SetPrivilegeLevel\n");
+// 	byReq = *byPrivLevel;
+// 	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command (pSession,DEFAULT_NET_FN_LUN,
+// 												CMD_SET_SESSION_PRIV_LEVEL,
+// 												&byReq, sizeof(uint8_t),
+// 												&pbyRes[0], &dwResLen, timeout);
+
+
+// 	if(wRet != 0)
+// 	{
+// 		printf("Originally requested priv level failed\n");
+// 		//find the current privilege level allowed
+// 		byReq = 0;
+// 		wRet = LIBIPMI_Send_RAW_IPMI2_0_Command (pSession, DEFAULT_NET_FN_LUN,
+// 												CMD_SET_SESSION_PRIV_LEVEL,
+// 												&byReq, sizeof(uint8_t),
+// 												&pbyRes[0], &dwResLen, timeout);
+// 		if(wRet != 0)
+// 		{
+// 			printf("Amazing..request for current privilege limit returned an error %x2\n",wRet);
+// 		}
+// 		else
+// 		{
+// 			printf("New priv level is %x\n",pbyRes[1]);
+// 			*byPrivLevel = pbyRes[1];
+// 		}
+// 	}
+
+// 	return wRet;
+// }
 
-
-/**
-This function is used to get the UserID for given Username and Password.
-It compares all IPMI username with the IN argument Username.
-If it matches, then it checks for the password.
-If password also matches, it will return SUCCESS and corresponding User ID.
-Since duplicate username is supported in IPMI specification,
-It will executes unless it gets SUCCESS or reaches MAX_USERS_COUNT.
-Username and Password are IN arguments, UserID is OUT argument.
-**/
-int LIBIPMI_GetUserIDForUserName(IPMI20_SESSION_T *pSession, char *UserName, char *Password, uint8_t *UserID, int timeout)
-{
-	uint8_t Index = 0;
-	char IPMI_Username[MAX_USERNAME_LEN];
-	int retval = 0;
-	*UserID = 0;
-
-	for(Index = 1; Index <= MAX_USER_NUM; Index++)
-	{
-		memset(IPMI_Username, 0, MAX_USERNAME_LEN);
-		retval = GetUserNameForUserID(pSession, Index, IPMI_Username, timeout);
-		if(retval == LIBIPMI_E_SUCCESS)
-		{
-			if(strncmp(UserName, IPMI_Username, MAX_USERNAME_LEN) == 0)
-			{
-				*UserID = Index;
-				break;
-			}
-		}
-	}
-   
-	if(*UserID != 0)
-	{
-		retval = CheckUserPassword(pSession, Index, Password, timeout);
-		if(retval == LIBIPMI_E_SUCCESS)
-		{
-			*UserID = Index;
-			return LIBIPMI_E_SUCCESS;
-		}
-		else
-		{
-			*UserID = 0;
-			return LIBIPMI_E_INVALID_PASSWORD;
-		}
-	}
-  
-	return LIBIPMI_E_INVALID_USER_NAME;
-}

+ 314 - 314
app/goahead-5.1.0/src/libipmi/src/libipmi_storlead_OEM.c

@@ -21,12 +21,12 @@ OemWebFlags_T g_OemWebFlags;
 /*
 *@fn IPMICMD_AMIGetSensorInfo
 *@brief
-*@param pSession - IPMI Session Handle
+*@param pUDSSession - IPMI Session Handle
 *@param pAMIGetSensorInfoReq - Pointer to the request of AMI Get SensorInfo command
 *@param pAMIGetSensorInfoRes - Pointer to the response of AMI Get SensorInfo command
 *@param timeout - Timeout Value
 **/
-// uint16_t IPMICMD_GetIPMCSensorInfo(IPMI20_SESSION_T *pSession, AMIGetSensorInfoRes_T *pGetIPMCSensorInfoRes,int timeout)
+// uint16_t IPMICMD_GetIPMCSensorInfo(IPMI20_UDS_SESSION_T *pUDSSession, AMIGetSensorInfoRes_T *pGetIPMCSensorInfoRes,int timeout)
 // {
 //  	uint16_t wRet = 0;
 	
@@ -40,7 +40,7 @@ OemWebFlags_T g_OemWebFlags;
 // 	uint8_t NextRecIDMS = 0;
 // 	uint8_t cnt = 0;
 // 	uint8_t timeoutTick = 0;
-// 	wRet = IPMICMD_ReserveSDRRepository(pSession, (ReserveSDRRepositoryRes_T*)SDRData, timeout);
+// 	wRet = IPMICMD_ReserveSDRRepository(pUDSSession, (ReserveSDRRepositoryRes_T*)SDRData, timeout);
 // 	if(wRet != 0)
 // 	{
 // 		printf("Error Reserve SDR Repository\n");
@@ -52,7 +52,7 @@ OemWebFlags_T g_OemWebFlags;
 // 	do
 // 	{
 // 		//Get SDR
-// 		if(0 != LIBIPMI_HL_GetSDR(pSession, reservation_id, record_id, (GetSDRRes_T*)SDRData, &dwRecordLen, timeout ))
+// 		if(0 != LIBIPMI_HL_GetSDR(pUDSSession, reservation_id, record_id, (GetSDRRes_T*)SDRData, &dwRecordLen, timeout ))
 // 		{
 // 			printf("---> Get SDR error! record_id = %#x\n", record_id);
 // 			return -1;
@@ -96,7 +96,7 @@ OemWebFlags_T g_OemWebFlags;
 // 			memcpy(SensorInfo.SensorName, &SDRData[3+49-1], SDRData[3+48-1]&0x3f);
 			
 // 			//get sensor reading
-// 			if(0 != IPMICMD_GetSensorReading(pSession, (GetSensorReadingReq_T *)&SensorInfo.SensorNumber, 
+// 			if(0 != IPMICMD_GetSensorReading(pUDSSession, (GetSensorReadingReq_T *)&SensorInfo.SensorNumber, 
 // 				(GetSensorReadingRes_T *)SDRData, timeout))
 // 			{
 // 				printf("---> Get sensorReading error! sensorNum = %#x\n", SensorInfo.SensorNumber);
@@ -179,7 +179,7 @@ OemWebFlags_T g_OemWebFlags;
 // }
 
 
-// uint16_t LIBIPMI_HL_GetIPMCSensorInfo(IPMI20_SESSION_T *pSession,SenInfo_T *pSensorInfo,uint32_t *nNumSensor,int timeout)
+// uint16_t LIBIPMI_HL_GetIPMCSensorInfo(IPMI20_UDS_SESSION_T *pUDSSession,SenInfo_T *pSensorInfo,uint32_t *nNumSensor,int timeout)
 // {
 // 	uint16_t wRet = 0;
 // 	AMIGetSensorInfoRes_T *pGetIPMCSensorInfoRes;
@@ -196,7 +196,7 @@ OemWebFlags_T g_OemWebFlags;
 	
 // 	memset(SensorEntries,0,MAX_SENSOR_INFO_SIZE);
 // 	pGetIPMCSensorInfoRes = (AMIGetSensorInfoRes_T *)SensorEntries;
-// 	wRet = IPMICMD_GetIPMCSensorInfo(pSession,(AMIGetSensorInfoRes_T *)SensorEntries,timeout);
+// 	wRet = IPMICMD_GetIPMCSensorInfo(pUDSSession,(AMIGetSensorInfoRes_T *)SensorEntries,timeout);
 // 	if(wRet == LIBIPMI_E_SUCCESS)
 // 	{
 // 		*nNumSensor = pGetIPMCSensorInfoRes->Noofentries;
@@ -213,55 +213,55 @@ OemWebFlags_T g_OemWebFlags;
 // 	return (wRet);
 // }
 
-uint16_t LIBIPMI_HL_FanCtrol( IPMI20_SESSION_T *pSession, uint8_t fanIndex, uint8_t fanMode, uint8_t fanLevel, int timeout)
-{
-	uint16_t wRet = 0;
-	uint8_t	Res[10];
-	uint8_t Req[10];
-	uint32_t dwResLen;
-	Req[0]	= fanIndex;
-	Req[1] 	= fanMode;
-	Req[2]	= fanLevel;
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,   0x2e<<2, 0x87,
-													(uint8_t*)Req, 3,
-													(uint8_t *)Res, &dwResLen,
-													timeout);
-	return wRet;
-}
+// uint16_t LIBIPMI_HL_FanCtrol( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t fanIndex, uint8_t fanMode, uint8_t fanLevel, int timeout)
+// {
+// 	uint16_t wRet = 0;
+// 	uint8_t	Res[10];
+// 	uint8_t Req[10];
+// 	uint32_t dwResLen;
+// 	Req[0]	= fanIndex;
+// 	Req[1] 	= fanMode;
+// 	Req[2]	= fanLevel;
+// 	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,   0x2e<<2, 0x87,
+// 													(uint8_t*)Req, 3,
+// 													(uint8_t *)Res, &dwResLen,
+// 													timeout);
+// 	return wRet;
+// }
 
-int LIBIPMI_HL_GetFanStatus( IPMI20_SESSION_T *pSession, uint8_t fanIndex, OemFanStatus_T *pFanStatus, int timeout)
-{
-	uint16_t wRet = 0;
-	uint8_t	Res[32];
-	uint32_t dwResLen;
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,   0x2e<<2, 0x86,
-														(uint8_t*)&fanIndex, 1,
-														(uint8_t *)Res, &dwResLen,
-														timeout);
-	memset(pFanStatus->name, 0, 16);
-	if((wRet == 0) && (Res[0] == 0))
-	{
-		pFanStatus->index = fanIndex;
-		memcpy(pFanStatus->name, &Res[1], 16);
-		pFanStatus->level = Res[17];
-		pFanStatus->mode = Res[18];
-		pFanStatus->speed = (Res[19]<<24) | (Res[20]<<16) | (Res[21]<<8) | Res[22];
-	}
-	else
-	{
-		printf("---> LIBIPMI_HL_GetFanInfo get fan info error!\n");
-		pFanStatus->index = fanIndex;
-		memcpy(pFanStatus->name, "UNKNOWN", 7);
-		pFanStatus->level = 0;
-		pFanStatus->mode = 0;
-		pFanStatus->speed = 0;
-		return -1;
-	}
+// int LIBIPMI_HL_GetFanStatus( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t fanIndex, OemFanStatus_T *pFanStatus, int timeout)
+// {
+// 	uint16_t wRet = 0;
+// 	uint8_t	Res[32];
+// 	uint32_t dwResLen;
+// 	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,   0x2e<<2, 0x86,
+// 														(uint8_t*)&fanIndex, 1,
+// 														(uint8_t *)Res, &dwResLen,
+// 														timeout);
+// 	memset(pFanStatus->name, 0, 16);
+// 	if((wRet == 0) && (Res[0] == 0))
+// 	{
+// 		pFanStatus->index = fanIndex;
+// 		memcpy(pFanStatus->name, &Res[1], 16);
+// 		pFanStatus->level = Res[17];
+// 		pFanStatus->mode = Res[18];
+// 		pFanStatus->speed = (Res[19]<<24) | (Res[20]<<16) | (Res[21]<<8) | Res[22];
+// 	}
+// 	else
+// 	{
+// 		printf("---> LIBIPMI_HL_GetFanInfo get fan info error!\n");
+// 		pFanStatus->index = fanIndex;
+// 		memcpy(pFanStatus->name, "UNKNOWN", 7);
+// 		pFanStatus->level = 0;
+// 		pFanStatus->mode = 0;
+// 		pFanStatus->speed = 0;
+// 		return -1;
+// 	}
 	
-	return 0;	
-}
+// 	return 0;	
+// }
 
-uint16_t LIBIPMI_HL_GetSysInfo( IPMI20_SESSION_T *pSession, SysInfo_T *pSysInfo, int timeout)
+uint16_t LIBIPMI_HL_GetSysInfo( IPMI20_UDS_SESSION_T *pUDSSession, SysInfo_T *pSysInfo, int timeout)
 {
 	
 	uint16_t wRet = 0;
@@ -277,7 +277,7 @@ uint16_t LIBIPMI_HL_GetSysInfo( IPMI20_SESSION_T *pSession, SysInfo_T *pSysInfo,
 	Req[2] = 0;
 	Req[3] = (MAX_TITLE_LEN>>8)&0xff;	//max title len
 	Req[4] = MAX_TITLE_LEN&0xff;
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,   
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,   
 												NETFNLUN_IPMI_STORLEAD, CMD_GET_SYS_INFO,
 												(uint8_t*)Req, 5,
 												(uint8_t *)Res, &dwResLen,
@@ -297,7 +297,7 @@ uint16_t LIBIPMI_HL_GetSysInfo( IPMI20_SESSION_T *pSession, SysInfo_T *pSysInfo,
 	Req[2] = 0;
 	Req[3] = (MAX_TEXT_LEN>>8)&0xff;	//max text len
 	Req[4] = MAX_TEXT_LEN&0xff;
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,   
+	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,   
 												NETFNLUN_IPMI_STORLEAD, CMD_GET_SYS_INFO,
 												(uint8_t*)Req, 5,
 												(uint8_t *)Res, &dwResLen,
@@ -316,269 +316,269 @@ uint16_t LIBIPMI_HL_GetSysInfo( IPMI20_SESSION_T *pSession, SysInfo_T *pSysInfo,
 
 
 
-uint16_t
-LIBIPMI_HL_GetSensorHistory( IPMI20_SESSION_T *pSession, sensor_history_st *pSensorHistory_st, int card_index, int sensor_number, int IPMB_ADDR)
-{
-	printf(">come in history\n");
-	int i = 0;
-	uint8_t	 	RawHistory[MAX_HISTORY_LEN];
-	uint16_t    wRet;
-	uint32_t    dwResLen;
-	uint32_t	sdr_buff_size = 100;
-	uint8_t 	Req[5];
-	uint8_t 	Res[MAX_HISTORY_LEN+3];	
-	int timeout = 3;
-	FullSensorRec_T sdr_buffer;
-	uint16_t 	offset = 0;
-	uint16_t	reqLen = 0, resLen = 0;
-	//get factors
-	LIBIPMI_HL_GetSpecificSDR( pSession, (uint8_t*)&sdr_buffer, &sdr_buff_size, sensor_number, timeout );	
+// uint16_t
+// LIBIPMI_HL_GetSensorHistory( IPMI20_UDS_SESSION_T *pUDSSession, sensor_history_st *pSensorHistory_st, int card_index, int sensor_number, int IPMB_ADDR)
+// {
+// 	printf(">come in history\n");
+// 	int i = 0;
+// 	uint8_t	 	RawHistory[MAX_HISTORY_LEN];
+// 	uint16_t    wRet;
+// 	uint32_t    dwResLen;
+// 	uint32_t	sdr_buff_size = 100;
+// 	uint8_t 	Req[5];
+// 	uint8_t 	Res[MAX_HISTORY_LEN+3];	
+// 	int timeout = 3;
+// 	FullSensorRec_T sdr_buffer;
+// 	uint16_t 	offset = 0;
+// 	uint16_t	reqLen = 0, resLen = 0;
+// 	//get factors
+// 	LIBIPMI_HL_GetSpecificSDR( pUDSSession, (uint8_t*)&sdr_buffer, &sdr_buff_size, sensor_number, timeout );	
 	
-	//get history
-	// if( pSession->byMediumType == IPMB_MEDIUM )
-	// {
-	// 	reqLen = 22;	//32 bytes - ipmb message header - response header - checksum2
-	// 	do{
-	// 		Req[0] = sensor_number;
-	// 		Req[1] = (offset>>8)&0xff;
-	// 		Req[2] = offset&0xff;
-	// 		Req[3] = (reqLen>>8)&0xff;
-	// 		Req[4] = reqLen&0xff;
-	// 		wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,   0x2e<<2, 0x89,
-	// 												(uint8_t*)Req, 5,
-	// 												(uint8_t *)Res, &dwResLen,
-	// 												timeout);
-	// 		if(wRet != 0)
-	// 		{
-	// 			return -1;
-	// 		}
-	// 		resLen = (Res[1]<<8) | Res[2];
-	// 		if(resLen > MAX_HISTORY_LEN)
-	// 		{
-	// 			printf("---> response length error: resLen = %#x\n", resLen);
-	// 			return -1;
-	// 		}
-	// 		memcpy(&RawHistory[offset],&Res[3],resLen);
-	// 		offset += resLen;
-	// 		if(offset >= MAX_HISTORY_LEN)	//get all history datas
-	// 		{
-	// 			reqLen = 0;
-	// 			break;
-	// 		}
-	// 		reqLen = ((MAX_HISTORY_LEN-offset)>22) ? 22 : (MAX_HISTORY_LEN-offset);		
-	// 	}while(reqLen);		
-	// }
-	// else
-	{
-		Req[0] = sensor_number;
-		Req[1] = 0;
-		Req[2] = 0;
-		Req[3] = (MAX_HISTORY_LEN>>8)&0xff;
-		Req[4] = MAX_HISTORY_LEN & 0xff;
-		wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,   0x2e<<2, 0x89,
-														(uint8_t*)Req, 5,
-														(uint8_t *)Res, &dwResLen,
-														timeout);
-		if(wRet != 0)
-		{
-			return -1;
-		}
+// 	//get history
+// 	// if( pUDSSession->byMediumType == IPMB_MEDIUM )
+// 	// {
+// 	// 	reqLen = 22;	//32 bytes - ipmb message header - response header - checksum2
+// 	// 	do{
+// 	// 		Req[0] = sensor_number;
+// 	// 		Req[1] = (offset>>8)&0xff;
+// 	// 		Req[2] = offset&0xff;
+// 	// 		Req[3] = (reqLen>>8)&0xff;
+// 	// 		Req[4] = reqLen&0xff;
+// 	// 		wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,   0x2e<<2, 0x89,
+// 	// 												(uint8_t*)Req, 5,
+// 	// 												(uint8_t *)Res, &dwResLen,
+// 	// 												timeout);
+// 	// 		if(wRet != 0)
+// 	// 		{
+// 	// 			return -1;
+// 	// 		}
+// 	// 		resLen = (Res[1]<<8) | Res[2];
+// 	// 		if(resLen > MAX_HISTORY_LEN)
+// 	// 		{
+// 	// 			printf("---> response length error: resLen = %#x\n", resLen);
+// 	// 			return -1;
+// 	// 		}
+// 	// 		memcpy(&RawHistory[offset],&Res[3],resLen);
+// 	// 		offset += resLen;
+// 	// 		if(offset >= MAX_HISTORY_LEN)	//get all history datas
+// 	// 		{
+// 	// 			reqLen = 0;
+// 	// 			break;
+// 	// 		}
+// 	// 		reqLen = ((MAX_HISTORY_LEN-offset)>22) ? 22 : (MAX_HISTORY_LEN-offset);		
+// 	// 	}while(reqLen);		
+// 	// }
+// 	// else
+// 	{
+// 		Req[0] = sensor_number;
+// 		Req[1] = 0;
+// 		Req[2] = 0;
+// 		Req[3] = (MAX_HISTORY_LEN>>8)&0xff;
+// 		Req[4] = MAX_HISTORY_LEN & 0xff;
+// 		wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,   0x2e<<2, 0x89,
+// 														(uint8_t*)Req, 5,
+// 														(uint8_t *)Res, &dwResLen,
+// 														timeout);
+// 		if(wRet != 0)
+// 		{
+// 			return -1;
+// 		}
 		
-		resLen = (Res[1]<<8) | Res[2];
-		if(resLen > MAX_HISTORY_LEN)
-		{
-			printf("---> response length error: resLen = %#x\n", resLen);
-			return -1;
-		}
-		memcpy(RawHistory,&Res[3],resLen);
-	}
+// 		resLen = (Res[1]<<8) | Res[2];
+// 		if(resLen > MAX_HISTORY_LEN)
+// 		{
+// 			printf("---> response length error: resLen = %#x\n", resLen);
+// 			return -1;
+// 		}
+// 		memcpy(RawHistory,&Res[3],resLen);
+// 	}
 	
-	for(i=0;i < 480; i++)
-	{
-		ipmi_convert_reading( (uint8_t*)&sdr_buffer, RawHistory[i], (float*)&pSensorHistory_st->sensor_history[i] );
-	}
+// 	for(i=0;i < 480; i++)
+// 	{
+// 		ipmi_convert_reading( (uint8_t*)&sdr_buffer, RawHistory[i], (float*)&pSensorHistory_st->sensor_history[i] );
+// 	}
 	
-	memset(pSensorHistory_st->sensor_name, 0,sizeof(pSensorHistory_st->sensor_name));
-	memcpy(pSensorHistory_st->sensor_name, sdr_buffer.IDStr, sdr_buffer.IDStrTypeLen&0x3f);
-	pSensorHistory_st->sensor_num = sensor_number;
+// 	memset(pSensorHistory_st->sensor_name, 0,sizeof(pSensorHistory_st->sensor_name));
+// 	memcpy(pSensorHistory_st->sensor_name, sdr_buffer.IDStr, sdr_buffer.IDStrTypeLen&0x3f);
+// 	pSensorHistory_st->sensor_num = sensor_number;
 
-	return 0;
-}
+// 	return 0;
+// }
 
 
-uint16_t	LIBIPMI_HL_GetAllCards(IPMI20_SESSION_T *pSession,
-		         CardStatus_T*	pResBladeSts,
-					int timeout)
-{
-	uint16_t	wRet;
-	uint32_t	dwResLen;
-	uint8_t	  ReqData = g_OemWebFlags.bladeNum;
+// uint16_t	LIBIPMI_HL_GetAllCards(IPMI20_UDS_SESSION_T *pUDSSession,
+// 		         CardStatus_T*	pResBladeSts,
+// 					int timeout)
+// {
+// 	uint16_t	wRet;
+// 	uint32_t	dwResLen;
+// 	uint8_t	  ReqData = g_OemWebFlags.bladeNum;
 	
-	dwResLen = sizeof(CardStatus_T);
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
-						0x2e<<2, 0x82,
-						(uint8_t*)&ReqData, (uint32_t)1,
-						(uint8_t*)pResBladeSts, &dwResLen,
-						timeout);
-	if( wRet != 0 )
-		printf("Error getting Blade Status Info\n");
+// 	dwResLen = sizeof(CardStatus_T);
+// 	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
+// 						0x2e<<2, 0x82,
+// 						(uint8_t*)&ReqData, (uint32_t)1,
+// 						(uint8_t*)pResBladeSts, &dwResLen,
+// 						timeout);
+// 	if( wRet != 0 )
+// 		printf("Error getting Blade Status Info\n");
 						
-	return wRet;
-}
+// 	return wRet;
+// }
 
-/************************************************* new add **********************************************************************/
-int LIBIPMI_HL_GetChassisInfo(IPMI20_SESSION_T *pSession, OemChassisInfo_T* pChassisInfo, int timeout)
-{
-	uint8_t pRes[10];
-	int wRet = 0;
-	uint32_t	dwResLen;
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
-							0x2e<<2, 0x80,
-							NULL, 0,
-							(uint8_t*)pRes,  &dwResLen,
-							timeout);
-	if( wRet != 0 )
-		printf("Error getting Blade Status Info\n");
+// /************************************************* new add **********************************************************************/
+// int LIBIPMI_HL_GetChassisInfo(IPMI20_UDS_SESSION_T *pUDSSession, OemChassisInfo_T* pChassisInfo, int timeout)
+// {
+// 	uint8_t pRes[10];
+// 	int wRet = 0;
+// 	uint32_t	dwResLen;
+// 	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
+// 							0x2e<<2, 0x80,
+// 							NULL, 0,
+// 							(uint8_t*)pRes,  &dwResLen,
+// 							timeout);
+// 	if( wRet != 0 )
+// 		printf("Error getting Blade Status Info\n");
 		
-	pChassisInfo->slotNum = pRes[1];
-	pChassisInfo->supportChassisManageFn = pRes[2];
-	pChassisInfo->chassisManageFnEnable = pRes[3];
-	pChassisInfo->chMCIndex = pRes[4];
-	return 0;
-}
+// 	pChassisInfo->slotNum = pRes[1];
+// 	pChassisInfo->supportChassisManageFn = pRes[2];
+// 	pChassisInfo->chassisManageFnEnable = pRes[3];
+// 	pChassisInfo->chMCIndex = pRes[4];
+// 	return 0;
+// }
 
-int LIBIPMI_HL_GetBladeStatus(IPMI20_SESSION_T *pSession, OemBladeStatus_T BladeStatus[], int timeout)
-{
-	int wRet = 0;
-	uint32_t	dwResLen;
-	uint8_t pRes[MAX_BLADE_NUM*sizeof(OemBladeStatus_T)+1];
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
-							0x2e<<2, 0x81,
-							NULL, 0,
-							(uint8_t*)pRes,  &dwResLen,
-							timeout);
-	if( wRet != 0 )
-			printf("Error getting Blade Status Info\n");
+// int LIBIPMI_HL_GetBladeStatus(IPMI20_UDS_SESSION_T *pUDSSession, OemBladeStatus_T BladeStatus[], int timeout)
+// {
+// 	int wRet = 0;
+// 	uint32_t	dwResLen;
+// 	uint8_t pRes[MAX_BLADE_NUM*sizeof(OemBladeStatus_T)+1];
+// 	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
+// 							0x2e<<2, 0x81,
+// 							NULL, 0,
+// 							(uint8_t*)pRes,  &dwResLen,
+// 							timeout);
+// 	if( wRet != 0 )
+// 			printf("Error getting Blade Status Info\n");
 		
-	memcpy(BladeStatus, pRes+1, g_OemWebFlags.bladeNum*sizeof(OemBladeStatus_T));
-	return 0;
-}
+// 	memcpy(BladeStatus, pRes+1, g_OemWebFlags.bladeNum*sizeof(OemBladeStatus_T));
+// 	return 0;
+// }
 
-int LIBIPMI_HL_GetIPMCCapability(IPMI20_SESSION_T *pSession, uint8_t bladeIndex, OemIPMCCapability_T* pIPMCCapability, int timeout)
-{
-	int wRet = 0;
-	uint32_t	dwResLen;
-	uint8_t pRes[sizeof(OemIPMCCapability_T)+1];
+// int LIBIPMI_HL_GetIPMCCapability(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t bladeIndex, OemIPMCCapability_T* pIPMCCapability, int timeout)
+// {
+// 	int wRet = 0;
+// 	uint32_t	dwResLen;
+// 	uint8_t pRes[sizeof(OemIPMCCapability_T)+1];
 	
 
-	if(pSession->byMediumType == UDS_MEDIUM)
-	{
-		pRes[1] = 1;
-		pRes[2] = 1;
-		pRes[3] = 1;
-		pRes[4] = 1;
-		pRes[5] = 1;
-		pRes[6] = 1;
-		pRes[7] = 1;
-	}
-	else
-	{
-			wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
-									0x2e<<2, 0x88,
-									NULL, 0,
-									(uint8_t*)pRes,  &dwResLen,
-									timeout);
-			if( wRet != 0 )
-					printf("Error LIBIPMI_HL_GetIPMCCapability\n");
-	}
+// 	if(pUDSSession->byMediumType == UDS_MEDIUM)
+// 	{
+// 		pRes[1] = 1;
+// 		pRes[2] = 1;
+// 		pRes[3] = 1;
+// 		pRes[4] = 1;
+// 		pRes[5] = 1;
+// 		pRes[6] = 1;
+// 		pRes[7] = 1;
+// 	}
+// 	else
+// 	{
+// 			wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
+// 									0x2e<<2, 0x88,
+// 									NULL, 0,
+// 									(uint8_t*)pRes,  &dwResLen,
+// 									timeout);
+// 			if( wRet != 0 )
+// 					printf("Error LIBIPMI_HL_GetIPMCCapability\n");
+// 	}
 	
-	memcpy(pIPMCCapability, pRes+1, sizeof(OemIPMCCapability_T));
+// 	memcpy(pIPMCCapability, pRes+1, sizeof(OemIPMCCapability_T));
 	
-	return 0;
-}
+// 	return 0;
+// }
 
-int LIBIPMI_HL_SetBladeManageFn(IPMI20_SESSION_T *pSession, uint8_t enable, int timeout)
-{
-	int wRet = 0;
-	uint32_t	dwResLen;
-	uint8_t pReq[10];
-	uint8_t pRes[10];
+// int LIBIPMI_HL_SetBladeManageFn(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t enable, int timeout)
+// {
+// 	int wRet = 0;
+// 	uint32_t	dwResLen;
+// 	uint8_t pReq[10];
+// 	uint8_t pRes[10];
 	
-	pReq[0] = enable;
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
-							0x2e<<2, 0x8a,
-							(uint8_t*)pReq,	(uint32_t)1,
-							(uint8_t*)pRes,  &dwResLen,
-							timeout);
-	if( wRet != 0 )
-			printf("Error LIBIPMI_HL_SetBladeManageFn\n");
+// 	pReq[0] = enable;
+// 	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
+// 							0x2e<<2, 0x8a,
+// 							(uint8_t*)pReq,	(uint32_t)1,
+// 							(uint8_t*)pRes,  &dwResLen,
+// 							timeout);
+// 	if( wRet != 0 )
+// 			printf("Error LIBIPMI_HL_SetBladeManageFn\n");
 		
-	return 0;
-}
+// 	return 0;
+// }
 
-int LIBIPMI_HL_GetManageWebName(IPMI20_SESSION_T *pSession, char* webName, int timeout)
-{
-	int wRet = 0;
-	uint32_t	dwResLen;
-	uint8_t pRes[20];
+// int LIBIPMI_HL_GetManageWebName(IPMI20_UDS_SESSION_T *pUDSSession, char* webName, int timeout)
+// {
+// 	int wRet = 0;
+// 	uint32_t	dwResLen;
+// 	uint8_t pRes[20];
 	
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
-							0x2e<<2, 0x84,
-							NULL,	0,
-							(uint8_t*)pRes,  &dwResLen,
-							timeout);
-	if( wRet != 0 )
-			printf("Error LIBIPMI_HL_SetBladeManageFn\n");
+// 	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
+// 							0x2e<<2, 0x84,
+// 							NULL,	0,
+// 							(uint8_t*)pRes,  &dwResLen,
+// 							timeout);
+// 	if( wRet != 0 )
+// 			printf("Error LIBIPMI_HL_SetBladeManageFn\n");
 	
-	memset(webName, 0, 16);
-	memcpy(webName, pRes+1, 16);
-	return 0;
-}
+// 	memset(webName, 0, 16);
+// 	memcpy(webName, pRes+1, 16);
+// 	return 0;
+// }
 
-int LIBIPMI_HL_GetFanInfo(IPMI20_SESSION_T *pSession, OemFanInfo_T* pFanInfo, int timeout)
-{
-	int wRet = 0;
-	uint32_t	dwResLen;
-	uint8_t pRes[10];
+// int LIBIPMI_HL_GetFanInfo(IPMI20_UDS_SESSION_T *pUDSSession, OemFanInfo_T* pFanInfo, int timeout)
+// {
+// 	int wRet = 0;
+// 	uint32_t	dwResLen;
+// 	uint8_t pRes[10];
 	
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
-							0x2e<<2, 0x85,
-							NULL,	0,
-							(uint8_t*)pRes,  &dwResLen,
-							timeout);
-	if( wRet != 0 )
-			printf("Error LIBIPMI_HL_SetBladeManageFn\n");
+// 	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
+// 							0x2e<<2, 0x85,
+// 							NULL,	0,
+// 							(uint8_t*)pRes,  &dwResLen,
+// 							timeout);
+// 	if( wRet != 0 )
+// 			printf("Error LIBIPMI_HL_SetBladeManageFn\n");
 	
-	pFanInfo->fanNum = pRes[1];
-	return 0;
-}
+// 	pFanInfo->fanNum = pRes[1];
+// 	return 0;
+// }
 
-int LIBIPMI_HL_GetSensorHistoryCapability(IPMI20_SESSION_T *pSession, uint8_t sensorNum, SensorHistoryCapability_T* pSensorHistoryCapability, int timeout)
-{
-	int wRet = 0;
-	uint32_t	dwResLen;
-	uint8_t pRes[10];
+// int LIBIPMI_HL_GetSensorHistoryCapability(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t sensorNum, SensorHistoryCapability_T* pSensorHistoryCapability, int timeout)
+// {
+// 	int wRet = 0;
+// 	uint32_t	dwResLen;
+// 	uint8_t pRes[10];
 	
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
-							0x2e<<2, 0x88,
-							(uint8_t*)&sensorNum,	1,
-							(uint8_t*)pRes,  &dwResLen,
-							timeout);
-	if( wRet != 0 )
-			printf("Error LIBIPMI_HL_GetSensorHistoryCapability\n");
+// 	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
+// 							0x2e<<2, 0x88,
+// 							(uint8_t*)&sensorNum,	1,
+// 							(uint8_t*)pRes,  &dwResLen,
+// 							timeout);
+// 	if( wRet != 0 )
+// 			printf("Error LIBIPMI_HL_GetSensorHistoryCapability\n");
 	
-	pSensorHistoryCapability->isSupportSensorHistory = pRes[1];
-	pSensorHistoryCapability->SensorHistoryEnable	=	pRes[2];
-	return 0;
-}
+// 	pSensorHistoryCapability->isSupportSensorHistory = pRes[1];
+// 	pSensorHistoryCapability->SensorHistoryEnable	=	pRes[2];
+// 	return 0;
+// }
 
-//int LIBIPMI_HL_GetSensorHistoryEn(IPMI20_SESSION_T *pSession, uint8_t* SensorHistoryEnable, int timeout)
+//int LIBIPMI_HL_GetSensorHistoryEn(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t* SensorHistoryEnable, int timeout)
 //{
 // int wRet = 0;
 // uint32_t dwResLen;
 // uint8_t pRes[10];
 // 
-// wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
+// wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
 //       0x2e<<2, 0x8c,
 //       NULL, 0,
 //       (uint8_t*)pRes,  &dwResLen,
@@ -590,43 +590,43 @@ int LIBIPMI_HL_GetSensorHistoryCapability(IPMI20_SESSION_T *pSession, uint8_t se
 // return 0;
 //}
 
-int LIBIPMI_HL_SetSensorHistoryEn(IPMI20_SESSION_T *pSession, uint8_t sensorNum, uint8_t SensorHistoryEnable, int timeout)
-{
- int wRet = 0;
- uint32_t dwResLen;
- uint8_t pRes[10];
- uint8_t pReq[10];
+// int LIBIPMI_HL_SetSensorHistoryEn(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t sensorNum, uint8_t SensorHistoryEnable, int timeout)
+// {
+//  int wRet = 0;
+//  uint32_t dwResLen;
+//  uint8_t pRes[10];
+//  uint8_t pReq[10];
  
- pReq[0] = sensorNum;
- pReq[1] = SensorHistoryEnable;
- wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession,  
-       0x2e<<2, 0x8d,
-       (uint8_t*)pReq, 2,
-       (uint8_t*)pRes,  &dwResLen,
-       timeout);
- if( wRet != 0 )
-   printf("Error LIBIPMI_HL_SetSensorHistoryEn\n");
+//  pReq[0] = sensorNum;
+//  pReq[1] = SensorHistoryEnable;
+//  wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession,  
+//        0x2e<<2, 0x8d,
+//        (uint8_t*)pReq, 2,
+//        (uint8_t*)pRes,  &dwResLen,
+//        timeout);
+//  if( wRet != 0 )
+//    printf("Error LIBIPMI_HL_SetSensorHistoryEn\n");
  
- return 0;
-}
+//  return 0;
+// }
 
-uint16_t IPMICMD_GetSensorInfo(IPMI20_SESSION_T *pSession, uint8_t SensorIndex, StorleadGetSensorInfoRes_T *pGetSensorInfoRes,int timeout)
-{
-	uint16_t wRet;
-	uint32_t dwResLen = 0;
-	uint8_t Req[20];
+// uint16_t IPMICMD_GetSensorInfo(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t SensorIndex, StorleadGetSensorInfoRes_T *pGetSensorInfoRes,int timeout)
+// {
+// 	uint16_t wRet;
+// 	uint32_t dwResLen = 0;
+// 	uint8_t Req[20];
 	
-	Req[0] = SensorIndex;
-	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pSession, 	//notice!
-						(NETFN_STORLEAD << 2), CMD_GET_SENSOR_INFO,
-						Req, 1,
-						(uint8_t*)pGetSensorInfoRes, &dwResLen,
-						timeout);
+// 	Req[0] = SensorIndex;
+// 	wRet = LIBIPMI_Send_RAW_IPMI2_0_Command(pUDSSession, 	//notice!
+// 						(NETFN_STORLEAD << 2), CMD_GET_SENSOR_INFO,
+// 						Req, 1,
+// 						(uint8_t*)pGetSensorInfoRes, &dwResLen,
+// 						timeout);
 	
-	return (wRet);
-}
+// 	return (wRet);
+// }
 
-// uint16_t LIBIPMI_HL_GetSensorInfo(IPMI20_SESSION_T *pSession,SenInfo_T *pSensorInfo,uint32_t nNumSensor,int timeout)
+// uint16_t LIBIPMI_HL_GetSensorInfo(IPMI20_UDS_SESSION_T *pUDSSession,SenInfo_T *pSensorInfo,uint32_t nNumSensor,int timeout)
 // {
 // 	uint16_t wRet = 0;
 // 	StorleadGetSensorInfoRes_T GetSensorInfoRes;
@@ -634,7 +634,7 @@ uint16_t IPMICMD_GetSensorInfo(IPMI20_SESSION_T *pSession, uint8_t SensorIndex,
 
 // 	for(i=0;i<nNumSensor;i++)
 // 	{
-// 		wRet = IPMICMD_AMIGetSensorInfo(pSession, i, &GetSensorInfoRes,timeout);
+// 		wRet = IPMICMD_AMIGetSensorInfo(pUDSSession, i, &GetSensorInfoRes,timeout);
 // 		if(wRet == LIBIPMI_E_SUCCESS)
 // 		{
 // 			memcpy((uint8_t *)&pSensorInfo[i], GetSensorInfoRes.SensorInfo);

+ 7 - 421
app/goahead-5.1.0/src/libipmi/src/libipmi_uds_session.c

@@ -42,81 +42,9 @@
 #define gettid()  syscall(SYS_gettid)
 
 
-#define MAX_IPMI_MESSAGE_SIZE 1024   //1024
-
-
-// void UDS_Close(UDS_CHANNEL_T *UDSInfo);
-
-// uint8_t UDS_ReceiveData( UDS_CHANNEL_T *UDSInfo, char *szBuffer, uint32_t* pdwSize, int timeout);
-
-// int UDS_SendData(UDS_CHANNEL_T *UDSInfo,char *szBuffer,uint32_t dwsize,int timeout);
-
-// uint16_t Close_IPMI20_UDS_Session( IPMI20_SESSION_T *pSession );
-
-// uint16_t Send_RAW_IPMI2_0_UDS_Command(IPMI20_SESSION_T *pSession,
-// 										uint8_t byNetFnLUN, uint8_t byCommand,
-// 										uint8_t *pszReqData, uint32_t dwReqDataLen,
-// 										uint8_t *pszResData, uint32_t *pdwResDataLen,
-// 										uint8_t AuthEnable,int timeout);
-
-
-// int UDS_Connect(UDS_CHANNEL_T *UDSInfo,char *SocketPath);
-
-// int GetUserNameForUserID(IPMI20_SESSION_T *pSession,uint8_t UserID,char *UserName,uint8_t AuthEnable,int timeout);
-
-// int CheckUserPassword(IPMI20_SESSION_T *pSession, uint8_t UserID, char *Password, uint8_t AuthEnable, int timeout);
-
-// uint32_t FillUDSMessagePacket(IPMI20_SESSION_T *pSession, uint8_t *Buffer,
-//                                                         uint8_t byNetFnLUN, uint8_t byCommand,
-//                                                         uint8_t *pbyReqData, uint32_t dwReqDataLen,uint8_t AuthEnable);
-
-
-// int UDSGetDeviceID(IPMI20_SESSION_T *pSession,uint8_t AuthEnable,int timeout);
-
-
-
-/*This Function is used to connect UDS Client Socket*/
-int UDS_Connect(UDS_CHANNEL_T *UDSInfo,char *SocketPath)
-{
-    int client_sock;
-    struct sockaddr_un serv_addr;
-
-    /* Open the socket */
-    client_sock = socket(AF_UNIX, SOCK_STREAM, 0);
-
-    if(client_sock == -1)
-    {
-        printf("LIBIPMI_UDS_SESSION.C: Unable to create socket \n");
-        return LIBIPMI_MEDIUM_E_INVALID_SOCKET;
-    }
-
-    /*Connect the client to server*/
-
-    memset ((char *) &serv_addr, 0, sizeof (serv_addr));
-    serv_addr.sun_family = AF_UNIX;
-    strcpy(serv_addr.sun_path,SocketPath);
-
-    printf("---> UDS_Connect, socket: %d, SocketPath: %s\n", client_sock, SocketPath);
-    if ( connect (client_sock, (struct sockaddr *) &serv_addr,sizeof(serv_addr)) < 0)
-    {
-        printf("LIBIPMI_UDS_SESSION.C: Unable to connect to Server:\n");
-        return LIBIPMI_MEDIUM_E_CONNECT_FAILURE;
-    }
-
-    UDSInfo->hSocket = client_sock;
-    UDSInfo->byIsConnected = 1;
-
-    return LIBIPMI_E_SUCCESS;
-}
-
-
-
-
-
-
 /*This Functions Fills the Packet
  * with the valid fields for UDS*/
-uint32_t FillUDSMessagePacket(IPMI20_SESSION_T *pSession, uint8_t *Buffer,
+uint32_t FillUDSMessagePacket(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t *Buffer,
                         uint8_t byNetFnLUN, uint8_t byCommand,
                         uint8_t *pbyReqData, uint32_t dwReqDataLen)
 {
@@ -125,16 +53,16 @@ uint32_t FillUDSMessagePacket(IPMI20_SESSION_T *pSession, uint8_t *Buffer,
     pUDSMsg = (IPMIUDSMsg_T *)&Buffer[0];
     pbyIPMIUDSData = &Buffer[sizeof(IPMIUDSMsg_T)];
 
-    pUDSMsg->SessionID = pSession->hUDSSession->dwSessionID;
-    pUDSMsg->ChannelNum = pSession->hUDSSession->byChannelNum;
-    pUDSMsg->Privilege = pSession->hUDSSession->byRole;
+    pUDSMsg->SessionID = pUDSSession->dwSessionID;
+    pUDSMsg->ChannelNum = pUDSSession->byChannelNum;
+    pUDSMsg->Privilege = pUDSSession->byRole;
  //   pUDSMsg->AuthFlag = AuthEnable;
     pUDSMsg->IPMIMsgLen = sizeof(IPMIUDSMsg_T)+dwReqDataLen+1;
     pUDSMsg->Cmd = byCommand;
     pUDSMsg->NetFnLUN = byNetFnLUN;
 
-    memcpy(pUDSMsg->UserName, pSession->hUDSSession->szUName, MAX_USERNAME_LEN);
-    memcpy(pUDSMsg->IPAddr, pSession->hUDSSession->abyIPAddr, IP6_ADDR_LEN);
+    memcpy(pUDSMsg->UserName, pUDSSession->szUName, MAX_USERNAME_LEN);
+    memcpy(pUDSMsg->IPAddr, pUDSSession->abyIPAddr, IP6_ADDR_LEN);
 //    printf("---> FillUDSMessagePacket log2\n");
     pUDSMsg->ProcessID = getpid();
     pUDSMsg->ThreadID = gettid();
@@ -227,7 +155,7 @@ uint8_t UDS_ReceiveData( UDS_CHANNEL_T *UDSInfo, char *szBuffer, uint32_t* pdwSi
             }
         return LIBIPMI_STATUS_SUCCESS;
        }
-       close(UDSInfo->hSocket);
+
        return LIBIPMI_MEDIUM_E_RECV_DATA_FAILURE; 
      }
 }
@@ -319,348 +247,6 @@ TCPSendUDSDataSelect:
         return LIBIPMI_STATUS_SUCCESS;
 
     }
-
-    printf("select came out while trying to write for no good reason!!\n");
-    close(UDSInfo->hSocket);
     return LIBIPMI_MEDIUM_E_SEND_DATA_FAILURE;
  }
 
-
-/*This Function is used to send data
-* to UDS Interface in IPMI Layer*/
-uint16_t Send_RAW_IPMI2_0_UDS_Command(IPMI20_SESSION_T *pSession,
-            uint8_t byNetFnLUN, uint8_t byCommand,
-            uint8_t *pszReqData, uint32_t dwReqDataLen,
-            uint8_t *pszResData, uint32_t *pdwResDataLen,
-            int timeout)
-{
-   uint8_t pbyIPMIUDSMsgReq[MAX_IPMI_MESSAGE_SIZE];
-   uint8_t pbyIPMIUDSResData[MAX_RESPONSE_SIZE];
-   uint32_t retlen=0,byretval=0;
-
-   memset(pbyIPMIUDSMsgReq,0,MAX_IPMI_MESSAGE_SIZE);
-   memset(pbyIPMIUDSResData,0,MAX_RESPONSE_SIZE);
-
-//   printf("---> Send_RAW_IPMI2_0_UDS_Command, log0\n");
-   retlen = FillUDSMessagePacket(pSession,pbyIPMIUDSMsgReq,byNetFnLUN,byCommand,pszReqData,dwReqDataLen);
-
-    if(retlen <= 0 )
-    {
-       printf("Data Length Invalid\n");
-       return -1;
-    }
-
-    byretval = UDS_SendData(&pSession->hUDSSession->hUDSInfo,(char *)pbyIPMIUDSMsgReq,retlen,timeout);
-    if(byretval != LIBIPMI_STATUS_SUCCESS)
-        return byretval;
-
-    byretval = UDS_ReceiveData(&pSession->hUDSSession->hUDSInfo, (char *)pbyIPMIUDSResData, pdwResDataLen,timeout);
-    if(byretval == LIBIPMI_STATUS_SUCCESS)
-    {
-        IPMIUDSMsg_T *pIPMIUDSMsg = (IPMIUDSMsg_T *)&pbyIPMIUDSResData[0];
-        uint8_t *bycompletioncode = (uint8_t *)&pbyIPMIUDSResData[sizeof(IPMIUDSMsg_T)];
-        
-        *pdwResDataLen = pIPMIUDSMsg->IPMIMsgLen-sizeof(IPMIUDSMsg_T) - 1;
-        memcpy(pszResData,&pbyIPMIUDSResData[sizeof(IPMIUDSMsg_T)],*pdwResDataLen);
-        
-        if(*bycompletioncode != CC_NORMAL)
-            return STATUS_CODE(IPMI_ERROR_FLAG, *bycompletioncode);
-        else
-        {
-            if((0 == pSession->hUDSSession->dwSessionID) && (pIPMIUDSMsg->Cmd == CMD_SET_USER_PASSWORD))
-            {
-                pSession->hUDSSession->dwSessionID = pIPMIUDSMsg->SessionID;
-                pSession->hUDSSession->byRole = pIPMIUDSMsg->Privilege;
-                
-                if(UDS_CHANNEL == pSession->hUDSSession->byChannelNum)
-                {
-                    pSession->hUDSSession->byChannelNum = pIPMIUDSMsg->ChannelNum;
-                }
-            }
-            else if((0 == pSession->hUDSSession->dwSessionID) && (pIPMIUDSMsg->Cmd == CMD_GET_DEV_ID) )
-            {
-                pSession->hUDSSession->dwSessionID = pIPMIUDSMsg->SessionID;
-                pSession->hUDSSession->byRole = pIPMIUDSMsg->Privilege;
-                
-                if(UDS_CHANNEL == pSession->hUDSSession->byChannelNum)
-                {
-                    pSession->hUDSSession->byChannelNum = pIPMIUDSMsg->ChannelNum;
-                }
-            }
-        }
-    }
-    else
-        return STATUS_CODE(IPMI_ERROR_FLAG, byretval);
-
-    return LIBIPMI_STATUS_SUCCESS;
-}
-
-
-
-
-
-
-
-void UDS_Close(UDS_CHANNEL_T *UDSInfo )
-{
-    printf("---> UDS_Close\n");
-    close(UDSInfo->hSocket);
-    /* reset the connected flag */
-    UDSInfo->byIsConnected = 0;
-
-    return;
-}
-
-uint16_t Close_IPMI20_UDS_Session( IPMI20_SESSION_T *pSession )
-{
-    uint16_t	wRet;
-    uint32_t	Req;
-    uint8_t	byRes[MAX_RESPONSE_SIZE];
-    uint32_t	dwResLen;
-
-    printf("---> Close_IPMI20_UDS_Session\n");
-   if(pSession->hUDSSession == NULL)
-   {
-       printf("Session Information is Null\n");
-       return LIBIPMI_MEDIUM_E_INVALID_DATA;
-   }
-
-    Req = pSession->hUDSSession->dwSessionID;
-    wRet =  Send_RAW_IPMI2_0_UDS_Command (pSession,DEFAULT_NET_FN_LUN,
-                CMD_CLOSE_SESSION,(uint8_t *)&Req,
-                sizeof (uint32_t),byRes, &dwResLen,
-                pSession->hUDSSession->byDefTimeout);
-
-    return wRet;
-}
-
-
-/*This Function is used to 
-get the corresponding Session ID
-from UDS Inteface for CIM,Smash*/
-int UDSGetDeviceID(IPMI20_SESSION_T *pSession,int timeout)
-{
-    int RetVal = 0;
-    uint32_t dwIPMIResLen;
-    uint8_t pbyIPMIReq[MAX_IPMI_MESSAGE_SIZE];
-    uint8_t pbyIPMIRes[MAX_RESPONSE_SIZE];
-    uint32_t ReqLen;
-
-    memset(pbyIPMIReq,0,sizeof(pbyIPMIReq));
-    memset(pbyIPMIRes,0,sizeof(pbyIPMIRes));
-
-    /* The Request Data is only 
-    Command Number and NetFn
-    so ReqLen is Zero here*/
-    ReqLen = 0;
-    //dwIPMIResLen = sizeof(GetDevIDRes_T);
-    RetVal = Send_RAW_IPMI2_0_UDS_Command (pSession,DEFAULT_NET_FN_LUN,
-                CMD_GET_DEV_ID,pbyIPMIReq,ReqLen,
-                pbyIPMIRes, &dwIPMIResLen,timeout);
-    if(RetVal == LIBIPMI_E_SUCCESS)
-    {
-         GetDevIDRes_T *pUDSGetDevIDRes = (GetDevIDRes_T *)&pbyIPMIRes[0];
-         if(pUDSGetDevIDRes->CompletionCode == CC_NORMAL)
-         {
-            return CC_NORMAL;
-         }
-         else
-            return(pUDSGetDevIDRes->CompletionCode);
-    }
-    else
-        return RetVal;
-
-    return LIBIPMI_E_SUCCESS;
-}
-
-/*This API is used to create the IPMI Session
-for the web,CIM and Smash*/
-uint16_t Create_IPMI20_UDS_Session(IPMI20_SESSION_T *pSession, char *pszSocketPath,
-                             char *pszUserName, char *pszPassword, uint8_t *byPrivLevel,
-                             char *pUserName, uint8_t *ipaddr, int timeout,uint8_t ChannelNum)
-{
-    uint8_t retval = 0;
-    uint8_t UserID = 0;
-
-    printf("---> Create_IPMI20_UDS_Session\n");
-
-    pSession->hUDSSession = (IPMI20_UDS_SESSION_T*)malloc( sizeof(IPMI20_UDS_SESSION_T) );
-    if(pSession->hUDSSession == NULL)
-    {
-        printf("Could not allocate Memory\n");
-        return -1;
-    }
-    memset(pSession->hUDSSession, 0, sizeof(IPMI20_UDS_SESSION_T));
-
-    if(strlen(pszUserName)!=0)
-    {
-        strcpy(pSession->hUDSSession->szUserName,pszUserName);
-    }
-    if(strlen(pszPassword)!=0)
-    {
-        strcpy(pSession->hUDSSession->szPwd,pszPassword);
-    }
-
-    if( (NULL != pUserName) && (0 != strlen(pUserName)) && (strlen(pUserName) < MAX_USERNAME_LEN) )
-    {
-        strcpy(pSession->hUDSSession->szUName, pUserName);
-    }
-    else
-    {
-        strcpy(pSession->hUDSSession->szUName, "");
-    }
-    if(NULL != ipaddr)
-    {
-        memcpy(pSession->hUDSSession->abyIPAddr, ipaddr, IP6_ADDR_LEN);
-    }
-    else
-    {
-        memset(pSession->hUDSSession->abyIPAddr, 0, IP6_ADDR_LEN);
-    }
-
-
-    pSession->hUDSSession->byPreSession = TRUE;
-    pSession->hUDSSession->dwSessionID = 0;
-    pSession->hUDSSession->byRole = *byPrivLevel;
-    pSession->hUDSSession->byChannelNum = ChannelNum;
-
-    pSession->byMediumType = UDS_MEDIUM;
-
-
-    retval = UDS_Connect(&pSession->hUDSSession->hUDSInfo,pszSocketPath);
-    if(LIBIPMI_STATUS_SUCCESS != retval)
-    {
-        printf("Unable to Connect\n");
-        return STATUS_CODE(MEDIUM_ERROR_FLAG, retval);
-    }
-    // if(AUTH_FLAG == AuthFlag)
-    // {
-    //     retval = LIBIPMI_GetUserIDForUserName(pSession, pszUserName, pszPassword, &UserID, AuthFlag, timeout);
-    //     if(LIBIPMI_STATUS_SUCCESS == retval)
-    //     {
-    //         if (UserID != 0)
-    //         {
-    //             *byPrivLevel = pSession->hUDSSession->byRole;
-    //             pSession->hUDSSession->byPreSession = 0;
-    //             pSession->bySessionStarted = SESSION_STARTED;
-    //             pSession->hUDSSession->byDefTimeout = timeout;
-    //             return LIBIPMI_E_SUCCESS;
-    //         }
-    //     }
-    //     else
-    //         return STATUS_CODE(0, LIBIPMI_E_INVALID_USER_NAME);
-
-    // }
-    // else if(AUTH_BYPASS_FLAG == AuthFlag)
-    // {
-    retval = UDSGetDeviceID(pSession,timeout);
-    if(retval == LIBIPMI_E_SUCCESS)
-    {
-        *byPrivLevel = pSession->hUDSSession->byRole;
-        pSession->hUDSSession->byPreSession = 0;
-        pSession->bySessionStarted = SESSION_STARTED;
-        pSession->hUDSSession->byDefTimeout = timeout;
-        return LIBIPMI_E_SUCCESS;
-    }
-    return retval;
-    // }
-    // else
-    //     return LIBIPMI_E_AUTHTYPE_NOT_SUPPORTED;
-
-    //return 0;
-}
-
-/**
-This Function is used to get the Username for the given UserID.
-UserID is IN argument, UserName is OUT argument.
-**/
-int GetUserNameForUserID(IPMI20_SESSION_T *pSession,uint8_t UserID,char *UserName,int timeout)
-{
-    uint8_t pbyIPMIReq [MAX_REQUEST_SIZE];
-    uint8_t pbyIPMIRes [MAX_RESPONSE_SIZE];
-    GetUserNameReq_T* pUserNameReq;
-    GetUserNameRes_T* pUserNameRes;
-    uint32_t reslen = 0;
-    int retval = 0;
-
-    pUserNameReq = (GetUserNameReq_T *)&pbyIPMIReq[0];
-    memset(pUserNameReq,0,sizeof(GetUserNameReq_T));
-
-    pUserNameReq->UserID = UserID;
-    reslen = sizeof(GetUserNameRes_T);
-    retval = Send_RAW_IPMI2_0_UDS_Command ( pSession,
-                DEFAULT_NET_FN_LUN, CMD_GET_USER_NAME,
-                pbyIPMIReq, sizeof (GetUserNameReq_T),
-                pbyIPMIRes, &reslen,
-                timeout);
-
-    if(retval == LIBIPMI_E_SUCCESS)
-    {
-        pUserNameRes = (GetUserNameRes_T *)&pbyIPMIRes[0];
-        if(pUserNameRes->CompletionCode == CC_NORMAL)
-        {
-            memcpy(UserName,pUserNameRes->UserName,strlen((char *)pUserNameRes->UserName));
-            return CC_NORMAL;
-        }
-        else
-            return (pUserNameRes->CompletionCode);
-    }
-    else
-        return retval;
-
-    return LIBIPMI_E_SUCCESS;
-}
-
-
-/**
-This function is used to check the password matches with the corresponding User ID.
-First it will get 20byte password, if it matches then it returns SUCCCESS.
-otherwise it will try for 16byte password, if it matches then it returns SUCCESS.
-UserID and Password are IN arguments.
-**/
-int CheckUserPassword(IPMI20_SESSION_T *pSession, uint8_t UserID, char *Password, int timeout)
-{
-    SetUserPswdReq_T UDSReqSetUserPsswd;
-    SetUserPswdRes_T UDSResSetUserPsswd;
-    uint32_t reslen = 0;
-    int retval = 0;
-
-    /*First check whether it is a 20 byte password*/
-    memset(&UDSReqSetUserPsswd,0,sizeof(SetUserPswdReq_T));
-    memset(&UDSResSetUserPsswd,0,sizeof(SetUserPswdRes_T));
-    UDSReqSetUserPsswd.UserID = (uint8_t)(BIT7|UserID);
-    UDSReqSetUserPsswd.Operation = 0x03;
-    strncpy((char*)UDSReqSetUserPsswd.Password, (char *)Password, MAX_PASSWORD_LEN);
-
-    reslen = sizeof(SetUserPswdRes_T);
-    retval =  Send_RAW_IPMI2_0_UDS_Command(pSession,
-                  DEFAULT_NET_FN_LUN,CMD_SET_USER_PASSWORD,
-                  (uint8_t *)&UDSReqSetUserPsswd,sizeof(SetUserPswdReq_T),
-                  (uint8_t *)&UDSResSetUserPsswd,&reslen,
-                  timeout);
-
-    if((retval == STATUS_CODE(IPMI_ERROR_FLAG,CC_PASSWORD_TEST_FAILED_WRONG_SIZE)) &&
-       (IPMI15_MAX_PASSWORD_LEN >= strlen (Password)))
-    {
-        /*Password may be 16 Byte Password so trying it out*/
-        memset(&UDSReqSetUserPsswd,0,sizeof(SetUserPswdReq_T));
-        memset(&UDSResSetUserPsswd,0,sizeof(SetUserPswdRes_T));
-
-        UDSReqSetUserPsswd.UserID = (uint8_t)(UserID);
-        UDSReqSetUserPsswd.Operation = 0x03;
-        strncpy((char *)UDSReqSetUserPsswd.Password, (char *)Password, MAX_PASSWORD_LEN);
-        reslen = sizeof(SetUserPswdRes_T);
-
-        retval = Send_RAW_IPMI2_0_UDS_Command(pSession,
-                    DEFAULT_NET_FN_LUN,CMD_SET_USER_PASSWORD,
-                    (uint8_t *)&UDSReqSetUserPsswd,sizeof(SetUserPswdReq_T)-4,
-                    (uint8_t *)&UDSResSetUserPsswd,&reslen,
-                    timeout);
-
-        return retval;
-    }
-    else
-        return retval;
-
-    return 0;
-}

+ 7 - 7
app/goahead-5.1.0/src/libipmi/src/sensor_helpers.c

@@ -538,7 +538,7 @@ int get_sdr_sensor_state( uint8_t sensor_reading, uint8_t *sdr_buffer, uint16_t
     return( 0 );
 }
 
-int GetSensorState(IPMI20_SESSION_T *pSession, uint8_t sensor_reading, 
+int GetSensorState(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t sensor_reading, 
 	uint8_t *sdr_buffer, uint16_t *current_state, int timeout  )
 {
 	SDRRecHdr_T *header = (SDRRecHdr_T *)sdr_buffer;
@@ -587,12 +587,12 @@ int GetSensorState(IPMI20_SESSION_T *pSession, uint8_t sensor_reading,
 #ifdef CFG_PROJ_REARM_SENSOR
             /*Get Sensor Event Status*/
             ReArmSensorReq.SensorNum = record->SensorNum;
-            RetVal = IPMICMD_ReArmSensorEvents(pSession, &ReArmSensorReq, 
+            RetVal = IPMICMD_ReArmSensorEvents(pUDSSession, &ReArmSensorReq, 
                                 &ReArmSensorRes, timeout);
 #endif
             /*Get Sensor Event Status*/
             pReqGetSensorEventStatus.SensorNum = record->SensorNum;
-            RetVal = IPMICMD_GetSensorEventStatus(pSession, &pReqGetSensorEventStatus, 
+            RetVal = IPMICMD_GetSensorEventStatus(pUDSSession, &pReqGetSensorEventStatus, 
                                 &pResGetSensorEventStatus, timeout);
 			
 	     if( RetVal != LIBIPMI_E_SUCCESS )
@@ -642,7 +642,7 @@ int GetSensorState(IPMI20_SESSION_T *pSession, uint8_t sensor_reading,
 }
 
 
-int read_sensor_sdrs( IPMI20_SESSION_T *pSession, struct sensor_info **sensor_list,
+int read_sensor_sdrs( IPMI20_UDS_SESSION_T *pUDSSession, struct sensor_info **sensor_list,
                       int timeout )
 {
     uint16_t wRet;
@@ -658,12 +658,12 @@ int read_sensor_sdrs( IPMI20_SESSION_T *pSession, struct sensor_info **sensor_li
     int sdr_count;
 
     /* Get repository allocation information */
-    wRet = IPMICMD_GetSDRRepositoryAllocInfo( pSession, &alloc_info, timeout );
+    wRet = IPMICMD_GetSDRRepositoryAllocInfo( pUDSSession, &alloc_info, timeout );
     if( wRet != LIBIPMI_E_SUCCESS )
         return( wRet );
 
     /* Get repository information */
-    wRet = IPMICMD_GetSDRRepositoryInfo( pSession, &repo_info, timeout );
+    wRet = IPMICMD_GetSDRRepositoryInfo( pUDSSession, &repo_info, timeout );
     if( wRet != LIBIPMI_E_SUCCESS )
         return( -1 );
 
@@ -685,7 +685,7 @@ int read_sensor_sdrs( IPMI20_SESSION_T *pSession, struct sensor_info **sensor_li
         return( STATUS_CODE( IPMI_ERROR_FLAG, OEMCC_NOMEM ) );
 
     /* Read all the SDRs */
-    wRet = LIBIPMI_HL_GetAllSDRs( pSession, sdr_buffer, buffer_len, timeout );
+    wRet = LIBIPMI_HL_GetAllSDRs( pUDSSession, sdr_buffer, buffer_len, timeout );
     if( wRet != LIBIPMI_E_SUCCESS )
     {
         printf( "Failure getting all SDRs\n" );

+ 2 - 0
app/goahead-5.1.0/src/socket.c

@@ -45,6 +45,7 @@ PUBLIC int socketOpen(void)
 //    }
 //}
 //#endif
+
     socketList = NULL;
     socketMax = 0;
     socketHighestFd = -1;
@@ -975,6 +976,7 @@ PUBLIC void socketFree(int sid)
 WebsSocket *socketPtr(int sid)
 {
     if (sid < 0 || sid >= socketMax || socketList[sid] == NULL) {
+        printf("sid=%d, socketMax=%d, socketList[sid]=%p\n", sid, socketMax, socketList[sid]);
         assert(NULL);
         errno = EBADF;
         return NULL;

+ 1 - 1
app/goahead-5.1.0/src/utils/mine/ResultUtils.c

@@ -31,7 +31,7 @@ static void commResult(Webs *wp, int msgCode, int httpStatus, int isSuccess) {
     // cJSON * next =  cJSON_CreateObject();
 
     cJSON_AddItemToObject(root, "data", data);//根节点下添加
-    cJSON_AddItemToObject(root, "msg", "");
+ //   cJSON_AddItemToObject(root, "msg", "");
     cJSON_AddItemToObject(root, "code", cJSON_CreateNumber(msgCode));
     cJSON_AddItemToObject(root, "isSuccess", cJSON_CreateNumber(isSuccess));
     

+ 41 - 45
app/goahead-5.1.0/src/web_interface/src/dashboard.c

@@ -5,6 +5,10 @@
 #include    "cJSON.h"
 #include    "libipmi_storlead_OEM.h"
 #include    "libsensor.h"
+#include    <stdio.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <unistd.h>
 /*获取设备信息*/
 
 /*获取设备信息*/
@@ -16,27 +20,28 @@ void getDeviceInfo(Webs *wp){
     struct ifreq ifreq;
     int sock;
     struct sockaddr_in *myaddr;
+    IPMI20_UDS_SESSION_T    UDSSession;
 
     char BuildTime[30] = {0};
     char FwVersion[10] = {0};
-    // char MacAddr[18] = {0};
-    // char IpAddr[16] = {0};
+    char MacAddr[18] = {0};
+    char IpAddr[16] = {0};
     
 
     //Create session
-    LIBIPMI_CreateSession(&wp->ipmi_session, 10);
+    LIBIPMI_CreateSession(&UDSSession, 10);
 
     //get build time
     sprintf(BuildTime, "%s %s", __DATE__, __TIME__);
 
     //get firmware version
-    wRet = IPMICMD_GetDeviceID( &wp->ipmi_session, &DeviceID, DEFAULT_TIMEOUT);
+    wRet = IPMICMD_GetDeviceID( &UDSSession, &DeviceID, DEFAULT_TIMEOUT);
     if (wRet == LIBIPMI_E_SUCCESS)
     {
         sprintf(FwVersion, "%d.%d", DeviceID.FirmwareRevision1, DeviceID.FirmwareRevision2);
     }
 
-    //get mac address
+    // //get mac address
     // if((sock=socket(AF_INET,SOCK_STREAM,0))<0)
     // {
     //     printf("Get mac address socket fail!\n");
@@ -61,7 +66,7 @@ void getDeviceInfo(Webs *wp){
     // }
     // close(sock);
 
-    //get ip address
+    // //get ip address
     // strcpy(ifreq.ifr_name, "eth0");
     // if((sock=socket(AF_INET, SOCK_STREAM, 0))<0)
     // {
@@ -83,12 +88,12 @@ void getDeviceInfo(Webs *wp){
     // close(sock);
     
     //Close session
-    LIBIPMI_CloseSession(&wp->ipmi_session );
+    LIBIPMI_CloseSession(&UDSSession );
 
     printf("BuildTime: %s\n", BuildTime);
     printf("FwVersion: %s\n", FwVersion);
-    // printf("MacAddr: %s\n", MacAddr);
-    // printf("IpAddr: %s\n", IpAddr);
+    printf("MacAddr: %s\n", MacAddr);
+    printf("IpAddr: %s\n", IpAddr);
 
     cchar *pStr;
     int code = 200;
@@ -100,15 +105,15 @@ void getDeviceInfo(Webs *wp){
     cJSON_AddItemToObject(root, "code", cJSON_CreateString("200"));
     cJSON_AddStringToObject(data, "buildTime", BuildTime);
     cJSON_AddStringToObject(data, "fwVersion", FwVersion);
-    // cJSON_AddStringToObject(data, "macAddr", MacAddr);
-    // cJSON_AddStringToObject(data, "ipAddr", IpAddr);
+    cJSON_AddStringToObject(data, "macAddr", MacAddr);
+    cJSON_AddStringToObject(data, "ipAddr", IpAddr);
 
     pStr = cJSON_Print(root);
 
     printf("first json:\n%s\n", pStr);
     logmsg(2, "-----------------------jso1n----------------------%s", pStr);
     logmsg(2, "--------------------ccccccccccsscc----------------");
-    websSetStatus(wp, 200);
+    websSetStatus(wp, WEBS_KEEP_ALIVE);
     websWriteHeaders(wp, -1, 0);
     websWriteEndHeaders(wp); 
     //websWrite(wp, "[");
@@ -126,6 +131,7 @@ void getSysInfo(Webs *wp){
     uint8_t Req[5] = {0,0,0,0,0};
     uint8_t Res[MAX_TEXT_LEN+5];
     int dwResLen;
+    IPMI20_UDS_SESSION_T    UDSSession;
 
 
     sysInfo.title = malloc(MAX_TITLE_LEN);
@@ -147,12 +153,12 @@ void getSysInfo(Webs *wp){
         memset(sysInfo.text, 0, MAX_TEXT_LEN);
 
     //Create session
-    wRet = LIBIPMI_CreateSession(&wp->ipmi_session, 10);
+    wRet = LIBIPMI_CreateSession(&UDSSession, 10);
     
-    LIBIPMI_HL_GetSysInfo(&wp->ipmi_session, &sysInfo, DEFAULT_TIMEOUT);
+    LIBIPMI_HL_GetSysInfo(&UDSSession, &sysInfo, DEFAULT_TIMEOUT);
 
     //Close session
-    LIBIPMI_CloseSession(&wp->ipmi_session );
+    LIBIPMI_CloseSession(&UDSSession );
 
     printf("Title: %s\n", sysInfo.title);
     printf("Text: %s\n", sysInfo.text);
@@ -173,7 +179,7 @@ void getSysInfo(Webs *wp){
 
     printf("first json:\n%s\n", pStr);
     logmsg(2, "-----------------------sys----------------------%s", pStr);
-    websSetStatus(wp, 200);
+    websSetStatus(wp, WEBS_KEEP_ALIVE);
     websWriteHeaders(wp, -1, 0);
     websWriteEndHeaders(wp); 
     websWrite(wp, pStr);
@@ -218,12 +224,13 @@ void getSensorInfo(Webs *wp){
     struct sensor_data *pSensorBuff = NULL;
     long int reading,lownr,lowct,lownc,highnc,highct,highnr = 0;
     unsigned char *pStartBuff = NULL;
+    IPMI20_UDS_SESSION_T    UDSSession;
 
     //Create session
-    wRet = LIBIPMI_CreateSession(&wp->ipmi_session, 10);
+    wRet = LIBIPMI_CreateSession(&UDSSession, 10);
    
     /* Get number of SEL records in the system at this time */
-    wRet = LIBIPMI_HL_GetSensorCount(&wp->ipmi_session,&nSensors,DEFAULT_TIMEOUT);
+    wRet = LIBIPMI_HL_GetSensorCount(&UDSSession,&nSensors,DEFAULT_TIMEOUT);
     if( wRet != 0 )
     {
         printf("Error getting num of sensors\n");
@@ -251,10 +258,10 @@ void getSensorInfo(Webs *wp){
 
         printf("sensorcount = %d\n", nSensors);
         nSensors -= 1;  //remove first sdr
-        wRet = LIBIPMI_HL_GetAllSensorReadings(&wp->ipmi_session,pSensorBuff, nSensors,DEFAULT_TIMEOUT);
+        wRet = LIBIPMI_HL_GetAllSensorReadings(&UDSSession,pSensorBuff, nSensors,DEFAULT_TIMEOUT);
         
         //Close session
-        LIBIPMI_CloseSession(&wp->ipmi_session );
+        LIBIPMI_CloseSession(&UDSSession );
 
         if(wRet != 0)
         {
@@ -330,7 +337,7 @@ void getSensorInfo(Webs *wp){
 
             logmsg(2, "-----------------------sensor----------------------");
 
-            // websSetStatus(wp, 200);
+            // websSetStatus(wp, WEBS_KEEP_ALIVE);
             // websWriteHeaders(wp, -1, 0);
             // websWriteEndHeaders(wp); 
             // //websWrite(wp, "[");
@@ -371,7 +378,7 @@ void buy(Webs *wp)
      logmsg(2, "----------------------------11-----------------");
     logmsg(2, "name value is : %s", name );
      logmsg(2, "age value is : %s", age );
-    websSetStatus(wp, 200);
+    websSetStatus(wp, WEBS_KEEP_ALIVE);
     websWriteHeaders(wp, -1, 0);
     websWriteEndHeaders(wp);
    
@@ -388,37 +395,26 @@ void buy(Webs *wp)
 //  */
 void actionTest(Webs *wp)
 {
-
-
-logmsg(2, "--------------------ggggggggg----------------");
-
-    uint16_t    wRet = LIBIPMI_E_SUCCESS;
+    IPMI20_UDS_SESSION_T    UDSSession;
     GetDevIDRes_T   DeviceID;
-    char BuildTime[30] = {0};
-    char FwVersion[10] = {0};
+
     //Create session
-    LIBIPMI_CreateSession(&wp->ipmi_session, 10);
-    sprintf(BuildTime, "%s %s", __DATE__, __TIME__);
-    wRet = IPMICMD_GetDeviceID( &wp->ipmi_session, &DeviceID, DEFAULT_TIMEOUT);
-    if (wRet == LIBIPMI_E_SUCCESS)
-    {
-        sprintf(FwVersion, "%d.%d", DeviceID.FirmwareRevision1, DeviceID.FirmwareRevision2);
-    }
-    printf("BuildTime: %s\n", BuildTime);
-    printf("FwVersion: %s\n", FwVersion);
-    //Close session
-    LIBIPMI_CloseSession(&wp->ipmi_session );
-   
-    cchar   *name, *address;
+    printf("actionTest!\n");
+    LIBIPMI_CreateSession(&UDSSession, 10);
+    IPMICMD_GetDeviceID( &UDSSession, &DeviceID, DEFAULT_TIMEOUT);
 
-    name = websGetVar(wp, "name", NULL);
-    address = websGetVar(wp, "address", NULL);
-    websSetStatus(wp, 200);
+
+    char name[] = "jimbo";
+    char address[] = "shanghai";
+    printf("name: %s, address: %s\n", name, address);
+    websSetStatus(wp, WEBS_KEEP_ALIVE);
     websWriteHeaders(wp, -1, 0);
     websWriteEndHeaders(wp);
     websWrite(wp, "Name %s", name);
     websFlush(wp, 0);
     websDone(wp);
+
+    LIBIPMI_CloseSession(&UDSSession );
 }