/*******************************************************************************
 * (c) Copyright 2015 Microsemi Corporation.  All rights reserved.
 *
 *
 *
 * SVN $Revision: $
 * SVN $Date: $
 */

#ifndef __TABLE_MEM_ALLOC_H__
#define __TABLE_MEM_ALLOC_H__

#include <api_oam_sdk/common/types/inc/mr_api_types.h>
#include <api_oam_sdk/maintenance_association/src/ma_types.h>
#include <api_oam_sdk/maintenance_domain/src/md_types.h>
#include "egl_log.h"

#ifdef CPP
	extern "C" {
#endif

int 	requestNextFreeLMepTblIdx(maNum_t maNum,lMepNum_t *startIndex);
void 	acceptNextFreeLMepTblIdx(lMepNum_t index);
void 	releaseLMepTblIdx(lMepNum_t startIdx);

int 	requestNextFreeRxLMepRAMIdx(rxLMepTblIdx_t *startIndex, iFace_t iFace);
void 	acceptNextFreeRxLMepRAMIdx(rxLMepTblIdx_t startIndex, iFace_t iFace);
void 	releaseRxLMepRAMIdx(rxLMepTblIdx_t startIdx, iFace_t iFace);

int 	requestNextFreeRMepDBIdx(uint16_t *startIndex);
void 	acceptNextFreeRMepDBIdx(uint16_t startIndex);
void 	releaseRMepDBIdx(uint16_t startIdx);

void 	initMemAlloc(void);

/*
 * @brief	Changes the logging level for this module
 *
 * @param[i]	logLevel - The lowest level severity to log
 *
 * This function is used to change the lowest level severity to log for
 * this module. Values of eLOG_LEVEL_DEBUG (lowest) to eLOG_LEVEL_ERROR
 * can be selected. Levels with greater severity than eLOG_LEVEL_ERROR
 * will default to eLOG_LEVEL_ERROR since severity of eLOG_LEVEL_ERROR
 * and higher are non maskable.
 */
void 	setTableMemAllocLogLevel(log_level_t logLevel);

#ifdef CPP
	}
#endif
#endif  // __TABLE_MEM_ALLOC_H__
