/*++
*******************************************************************************
* Copyright (c) 1999-2000 Digi International Inc., All Rights Reserved        *
*                                                                             *
* This software contains proprietary and confidential information of Digi     *
* International Inc.  By accepting transfer of this copy, Recipient agrees    *
* to retain this software in confidence, to prevent disclosure to others,     *
* and to make no use of this software other than that for which it was        *
* delivered.  This is an unpublished copyrighted work of Digi International   *
* Inc.  Except as permitted by federal law, 17 USC 117, copying is strictly   *
* prohibited.                                                                 *
*                                                                             *
* Restricted Rights Legend                                                    *
*                                                                             *
* Use, duplication, or disclosure by the Government is subject to             *
* restrictions set forth in sub-paragraph (c)(1)(ii) of The Rights in         *
* Technical Data and Computer Software clause at DFARS 252.227-7031 or        *
* subparagraphs (c)(1) and (2) of the Commercial Computer Software -          *
* Restricted Rights at 48 CFR 52.227-19, as applicable.                       *
*                                                                             *
* Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343          *
*                                                                             *
*******************************************************************************

Module Name:

	FRDataSource.h

Abstract:

	Frame Relay datasource implementation.

Author:

	Michael Zarns

--*/


class CFRDataSourceBase : public CDataSource
{
	virtual CTracer *CreateTracer();
	virtual CTraceData *CreateTraceData(DWORD, CDWordArray&);

// lmi type; Annex A,D, Stratacom, etc...
	eLMIType m_LMIType;

	CFR_LINK_STATS  m_LinkStats;
	CFR_LINK_ERRORS m_LinkErrors;
	CFR_LMI_STATS   m_LMIStats;

	CArray<CFR_PROTOCOL_ERRORS *, CFR_PROTOCOL_ERRORS *> m_ProtocolErrors;
	CArray<CFR_PLL_STATS *, CFR_PLL_STATS *> m_PllStats;
	CArray<CFR_INJ_MANG *, CFR_INJ_MANG *> m_InjManager;

public:
	CFRDataSourceBase(const HKEY hkLine, const CString& DeviceName);

// Attributes
	virtual const CSXB_USER_IOCTL *GetStatType(const type_info&, int = -1) const;
	virtual CRuntimeClass *GetStatDocClass() const = 0;

	virtual LPCSTR GetProtocol() const { return c_pszValueFRProtocol; };
	virtual eSourceType GetDefaultFirmwareDevice() = 0;
	virtual BOOL UpdateDataSourceStats();

	eLMIType GetLMIType() const { return m_LMIType; };

// Operations
	virtual void LoadConfigCircuits();
	virtual void LoadSummaryInfo(const CString&);
};


//------------------------------------------------------------ MLZ 4/15/2000 {
class CFRDataSource : public CFRDataSourceBase
{
public:
	CFRDataSource(const HKEY hkLine, const CString& DeviceName);

	virtual CRuntimeClass *GetStatDocClass() const;
	virtual eSourceType GetDefaultFirmwareDevice() {return stWANS;}
	virtual BOOL UpdateDataSourceStats();
	virtual void LoadConfigCircuits();
};


class CFRCsuDataSource : public CFRDataSourceBase
{
	CIfaceState m_IfaceState;	// IfaceState defines Alarms, loopback, etc.
	CRfc1406    m_Rfc1406;		// Defines DS1 Near End group, ie Errored seconds, etc.

public:
	CFRCsuDataSource(const HKEY hkLine, const CString& DeviceName);

	virtual CRuntimeClass *GetStatDocClass() const;
	virtual const CSXB_USER_IOCTL *GetStatType(const type_info&, int = -1) const;
	virtual eSourceType GetDefaultFirmwareDevice() {return stT1;}
	virtual BOOL UpdateDataSourceStats();
	virtual void LoadConfigCircuits();
};

//------------------------------------------------------------ MLZ 4/15/2000 }
