/*++
*******************************************************************************
* 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:

	pppdatasource.h

Abstract:

	PPP datasource implementation.

Author:

	Michael Zarns

--*/


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

public:
	CPPPDataSourceBase(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 "PPP"; };
	virtual eSourceType GetDefaultFirmwareDevice() = 0;
	virtual BOOL UpdateDataSourceStats();

	const CWANLINESTATUS& GetLineStatus() const {return m_WanLineStatus;}

// Operations
//	virtual void LoadConfigCircuits() {}
	virtual void LoadSummaryInfo(const CString&);
	virtual eDataSourceStatus GetStatus(eSourceType FirmwareDevice = stWANS) {return CDataSource::GetStatus( FirmwareDevice );}
};


///////////////////////////////////////////////////////////////////////////////
//
// SYNC Line PPP
//
///////////////////////////////////////////////////////////////////////////////

class CPPPDataSource : public CPPPDataSourceBase
{

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

// Attributes
	virtual CRuntimeClass *GetStatDocClass() const;
	virtual eSourceType GetDefaultFirmwareDevice() {return stWANS;}
};


///////////////////////////////////////////////////////////////////////////////
//
// CSU Line PPP
//
///////////////////////////////////////////////////////////////////////////////

class CT1PPPDataSource : public CPPPDataSourceBase
{
	// T1 CSU lines have some additional status information
	CIfaceState         m_IfaceState;	// IfaceState defines Alarms, loopback, etc.
	CRfc1406            m_Rfc1406;		// Defines DS1 Near End group, ie Errored seconds, etc.

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

// Attributes
	virtual CRuntimeClass *GetStatDocClass() const;
	virtual const CSXB_USER_IOCTL *GetStatType(const type_info&, int = -1) const;
	virtual eSourceType GetDefaultFirmwareDevice() {return stT1;}

// Operations
	virtual BOOL UpdateDataSourceStats();
};


