/**
 * @file   libipmi_session.h
 * @author Rajasekhar (rajasekharj@amiindia.co.in)
 * @date   02-Sep-2004
 *
 * @brief  Contains function definitions & data structures
 *			required for establishing a session
 *			
 */

#ifndef __LIBIPMI_SESSION_H__
#define __LIBIPMI_SESSION_H__

#include <stdio.h>
#include "libipmi_struct.h"
#include "libipmi_errorcodes.h"


#ifdef  __cplusplus
extern "C" {
#endif

/**
\breif	Create UDS session to comunitation with BMC
 @param	pSession			[in]Session Info handle
 @param	timeout				[in]timeout value in seconds.

 @retval Returns LIBIPMI_E_SUCCESS on success and error codes on failure
*/
uint16_t LIBIPMI_CreateSession(IPMI20_UDS_SESSION_T *pUDSSession, int timeout);

/**
\breif	Sends RAW IPMI Command to the BMC
 @param	pSession			[in]Session Info handle
 @param	byPayLoadType		[in]Pay Load Type in NETWORK_MEDIUM.
								shd be 0 in case of serial and kcs mediums.
 @param	byNetFnLUN			[in] Net Function and LUN for the given byCommand
 @param byCommand			[in] Command number.
 @param pszReqData			[in] Command Request Data
 @param dwReqDataLen		[in] size of Command Request data.
 @param pszResData			[in] Command Response Data
 @param	pdwResDataLen		[in] size of Command Response data.
 @param	timeout				[in]timeout value in seconds.

 @retval Returns LIBIPMI_E_SUCCESS on success and error codes on failure
*/
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,
									int	timeout);


/**
\breif	Closes the IPMI 2.0 Session
 @param	pSession			[in]Session Info handle

 @retval Returns LIBIPMI_E_SUCCESS on success and error codes on failure
*/
extern uint16_t LIBIPMI_CloseSession( IPMI20_UDS_SESSION_T *pUDSSession );

#ifdef  __cplusplus
}
#endif


#endif /* __LIBIPMI_SESSION_H__ */
