/*******************************************************************************
** Document: xmgr_proc.c
** Copyright (c) 2004 R&D Center, Tailyn Communication Company, Ltd.  
** Created by: Chien Chung Lo
** Date: JAN. 20, 2005
** Description: XDSL manager process.
** Version: 0.1
*******************************************************************************/
#include <stdio.h>
#include "xmgr_proc.h"
#include "debug_msg.h"
#include "xmgr_proc_fun.h"
#include "umap_type.h"

UMAP_S32 ProcessMsg(UMAP_Msg* pmsg,UMAP_Msg* ret_pmsg)
{
	UMAP_S32 result;
	ret_pmsg->type = MSG_TYPE_ACK;
	ret_pmsg->data.InvokeId = pmsg->data.InvokeId; 
	ret_pmsg->data.Dtid = pmsg->data.Stid;
	ret_pmsg->data.Stid = pmsg->data.Dtid;	
	switch(pmsg->data.CmdId)
	{
//mm
		case CmdIdAccessCardResetSet:
			result = SetAccessCardResetFun(pmsg, ret_pmsg);
			break;
//cm
		case CmdIdXdslLineConfSet:
			result = SetXdslLineConfFun(pmsg, ret_pmsg);
			break;
			
		case CmdIdXdslXturInventoryGet:
			result = GetXdslXturInventoryFun(pmsg, ret_pmsg);
			break;
			
		case CmdIdXdslXtucInventoryGet:
			result = GetXdslXtucInventoryFun(pmsg, ret_pmsg);
			break;
			
		case CmdIdXdslLineOperDataGet:
			result = GetXdslLineOperDataFun(pmsg, ret_pmsg);
			break;
		
		case CmdIdXdslFarEndLineOperDataGet:
			result = GetXdslFarEndLineOperDataFun(pmsg, ret_pmsg);
			break;
			
		case CmdIdXdslChannelOperDataGet:
			result = GetXdslChannelOperDataFun(pmsg, ret_pmsg);
			break;
			
		case CmdIdXdslFarEndChannelOperDataGet:
			result = GetXdslFarEndChannelOperDataFun(pmsg, ret_pmsg);
			break;
			
		case CmdIdXdslLineCarrierDataSet:
			result = SetXdslLineCarrierDataFun(pmsg, ret_pmsg);
			break;
			
		case CmdIdXdslFarEndLineCarrierDataGet:
			result = GetXdslFarEndLineCarrierDataFun(pmsg, ret_pmsg);
			break;
			
		case CmdIdXdslLineFailureStatusGet:
			result = GetXdslLineFailureStatusFun(pmsg, ret_pmsg);
			break;
			
		//case CmdIdXdslLineCurrentIntervalGet:
		//	result = GetXdslLineCurrentIntervalFun(pmsg, ret_pmsg);
		//	break;
			
		//case CmdIdXdslFarEndLineCurrentIntervalGet:
		//	result = GetXdslFarEndLineCurrentIntervalFun(pmsg, ret_pmsg);
		//	break;
			
		case CmdIdXdslTestGet:
			result = GetXdslTestFun(pmsg, ret_pmsg);
			break;
		
		case CmdIdXdslXtucSeltDataGet:
			result = GetXdslXtucSeltDataFun(pmsg, ret_pmsg);
			break;
			
//pm
		case CmdIdXdslChannelIntervalGet:
			result = GetXdslChannelIntervalFun(pmsg, ret_pmsg);
			break;
			
		case CmdIdXdslFarEndChannelIntervalGet:
			result = GetXdslFarEndChannelIntervalFun(pmsg, ret_pmsg);
			break;
			
		//case CmdIdXdslLineCurrent1DayGet:
		//	result = GetXdslLineCurrent1DayFun(pmsg, ret_pmsg);
		//	break;
			
		//case CmdIdXdslFarEndLineCurrent1DayGet:
		//	result = GetXdslFarEndLineCurrent1DayFun(pmsg, ret_pmsg);
		//	break;
			
		case CmdIdXdslChannel1DayGet:
			result = GetXdslChannel1DayFun(pmsg, ret_pmsg);
			break;
			
		case CmdIdXdslFarEndChannel1DayGet:
			result = GetXdslFarEndChannel1DayFun(pmsg, ret_pmsg);
			break;

		default:
			MSG("unknown command\n");
			result = -1;
			break;
	};
	
	return result;
}

