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

#ifndef SERVICEACTIVATION_H_
#define SERVICEACTIVATION_H_

#define MAX_NUM_FRAME_SIZES 	(8)		// Sets the number of different packet sizes that can be specified for each test
#define Y1564_DEFAULT_FRAME_SIZE			(512)
#define RFC2544_BINARY_DURATION	(2)
#define RFC2544_MIN_RATE		(1000)
#define RFC2544_MAX_RATE		(1000000)
#define RFC2544_STEP_SIZE		(1000)
#define RFC2544_B2B_REPEATS		(50)
#define RFC2544_AFL				(0)

#define RFC2544_TRIAL_DURATION	(60)
#define RFC2544_TRIAL_DURATION_LATENCY	(120)
#define RFC2544_TRIAL_DURATION_B2B	(2000)

#include "egl_types.h"
#include <api_oam_sdk/common/types/inc/mr_api_types.h>

typedef enum {
	y1731_lbm_frames = 1,
	y1731_tst_frames = 2				// Not yet supported
} saFrameType_t;

typedef enum {
	test_disabled		= 0,
	test_running		= 1,
	test_pending		= 2,
	test_stopped 		= 3,
	test_completed		= 4,
	test_failed			= 5
} testStatus_t;

typedef enum {
	fail_no_reason		= 0,			// Test did not fail
	fail_tx_count_0		= 1,			// The test resulted in no transmitted packets
	fail_rx_count_0		= 2,			// No packets were received
	fail_fdv_thres		= 3,			// The measured maximum FDV value exceeded the allowable threshold
	fail_ftd_thres		= 4,			// The measured maximum FTD value exceeded the allowable threshold
	fail_loss_thres		= 5,			// The measured frame loss value exceeded the allowable threshold
	fail_avail_thres	= 6,			// The measured availability value exceeded the allowable threshold
	fail_irAvg_high		= 7,			// The measured information rate is above the maximum allowable rate.
	fail_irAvg_low		= 8,			// The measured information rate is below the minimum allowable rate.
	fail_target_unknown = 9				// The MAC address of the target MEP was not known.
} failReason_t;

typedef struct {
	macAddress_t		destMac;
	mdLevel_t			mdLevel;
	mrPort_t			port;
	tag_t				cTag;
	tag_t				sTag;
} frameCfg_t;

typedef struct {
	mdIndex_t			mdIndex;
	maIndex_t			maIndex;
	mepId_t				lMepId;
	mepId_t				rMepId;
	bool				overwritePCP;		// If true then the pcp in the MEP's TAG is overwritten by prio and de
	prio_t				prio;				// The priority in the MEP's TAG is replace with this priority if overwritePCP = true
	uint8_t				de;					// The de in the MEP's TAG is replace with this de if overwritePCP = true
} mepIndices_t;

#endif /* SERVICEACTIVATION_H_ */
