/*++
*******************************************************************************
* Copyright (c) 1990-98 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:

   houston.h

Abstract:

   Houston adapter data source.

Author:

   Michael Zarns

--*/

class CHlcDataSource : public CDataSource
{
	CString m_Protocol;

	virtual CTracer *CreateTracer() = 0;
	virtual CTraceData *CreateTraceData(DWORD, CDWordArray&) = 0;

	CDS1_STATUS m_Ds1Status;		 	// DS1 status on a Houston card
	CDS1_EXT_STATUS m_Ds1ExtStatus;	// DS1 status on a Houston card

	CBRI_STATUS m_BriStatus;			// BRI status on a London card
	CDCHAN_EXT_STATUS m_DChanExtStatus; // Dchan extended status on a london card
	CBRI_CONFIG m_BriConfig;	// BRI config on a london card


	ULONG m_ModemStart;	// Adapter index of first modem on this line
	ULONG m_ModemCount;	// Number of modems on this line
	CArray<CMODEM_STATUS *, CMODEM_STATUS *> m_ModemStatus;
	CArray<CMODEM_EXT_STATUS *, CMODEM_EXT_STATUS *> m_ModemExtStatus;

protected:
	ULONG m_Channels;		// Number of usable channels, usually == number of modems
	void AddModems( ULONG count );
	BOOL m_IsDs1;		// Does this datasource support DS1 (T1/E1)?
	BOOL m_IsE1R2;		// Does this datasource support E1R2?
	BOOL m_IsBri;		// Does this datasource support BRI?
	BOOL m_IsIsdn;		// Does this datasource support ISDN.  Used for tracing.
	BOOL m_IsModems;	// Does this datasource support Modems 

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

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

	virtual LPCSTR GetProtocol() const { return m_Protocol; };
	virtual eSourceType GetDefaultFirmwareDevice() {return stMGMT;}
	virtual BOOL UpdateDataSourceStats();

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


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

public:
	CHlcPriDataSource(const HKEY hkLine, const CString& DeviceName, const CString& Protocol, ULONG iLine );
	virtual CRuntimeClass *GetStatDocClass() const { return RUNTIME_CLASS( CPriStatDoc ); }
};


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

public:
	CHlcE1R2DataSource(const HKEY hkLine, const CString& DeviceName, const CString& Protocol, ULONG iLine );
	virtual CRuntimeClass *GetStatDocClass() const { return RUNTIME_CLASS( CPriStatDoc ); }
};

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

public:
	CHlcCt1DataSource(const HKEY hkLine, const CString& DeviceName, const CString& Protocol );
	virtual CRuntimeClass *GetStatDocClass() const { return RUNTIME_CLASS( CPriStatDoc ); }
};


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

public:
	CHlcBriDataSource(const HKEY hkLine, const CString& DeviceName, const CString& Protocol );
	virtual CRuntimeClass *GetStatDocClass() const { return RUNTIME_CLASS( CBriStatDoc ); }
};


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

public:
	CHlcModemDataSource(const HKEY hkLine, const CString& DeviceName, const CString& Protocol );
	virtual CRuntimeClass *GetStatDocClass() const { return RUNTIME_CLASS( CModemStatDoc ); }
};
