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

   SohIoctl.h

Abstract:

   Header file for DIGISOH API IOCTL function definitions, typedefs and
   structures.

Author:

   Jeff Romatoski

--*/

#ifndef _SOHAPI_
#define _SOHAPI_

#ifdef _NTDDK_
#include <devioctl.h>		// Kernelmode drivers need this.  Resides in ddk.
#else
#include <winioctl.h>		// Usermode apps need this.  Resides in msdev\include.
#endif

#include "DgDevice.h"


///////////////////////////////////////////////////////////////////////////////
//
// SOH Perfmon IOCTLs
//

// Open request
#define IOCTL_SOH_GET_STREAMS		CTL_CODE(FILE_DEVICE_PERF,			\
										DIGI_FUNCTION_CODE_START,		\
										METHOD_BUFFERED, 				\
										FILE_ANY_ACCESS)

// Close request
#define IOCTL_SOH_GET_DATABLOCKS	CTL_CODE(FILE_DEVICE_PERF,			\
										DIGI_FUNCTION_CODE_START + 1,	\
										METHOD_BUFFERED,				\
										FILE_ANY_ACCESS)




///////////////////////////////////////////////////////////////////////////////
//
// PerfMon IOCTL Structures
// 
// These structures define the IOCTL interface for the DigiSOH performance
// monitor. 
//

typedef enum SOH_STREAMS_OBJECTS
{
	SOH_STREAMS_QPAIRS  = 1,
	SOH_STREAMS_STREAMS,
	SOH_STREAMS_BUFCALL,
	SOH_STREAMS_TIMEOUT,
	SOH_STREAMS_MSGBLKS,
	SOH_STREAMS_COUNT	= SOH_STREAMS_MSGBLKS
} SOH_STREAMS_OBJECTS;


typedef struct SOH_QUEUE_STATS
{	
	OUT ULONG   Min;			
	OUT ULONG   Max;			
	OUT ULONG   Used;			
	OUT ULONG   Hwm;			
	OUT ULONG   Free;			
	OUT ULONG   Fail;			
	OUT ULONG   Size;			
	OUT ULONG   Total;			
} SOH_QUEUE_STATS, *PSOH_QUEUE_STATS;


typedef struct SOH_GET_STREAMS
{	
	OUT SOH_QUEUE_STATS  Stats[SOH_STREAMS_COUNT];
} SOH_GET_STREAMS, *PSOH_GET_STREAMS;

// The number of stats needs to match the #define SOH_NDBCLASSES
// in sohalloc.h.  I did not include this header, since it would
// involve the inclusion of all the DigiSoh headers.
#define SOH_DATABLOCKS_COUNT	10

typedef struct SOH_GET_DATABLOCKS
{	
	OUT SOH_QUEUE_STATS  Stats[SOH_DATABLOCKS_COUNT];
} SOH_GET_DATABLOCKS, *PSOH_GET_DATABLOCKS;

#ifdef SOH_INCLUDE_GLOBALS

// These match the streams object enum above
WCHAR	*StreamsObjectNames[SOH_STREAMS_COUNT] =	{	L"Queue Pairs",
														L"Stream",
														L"Buffer Call",
														L"Timeout",
														L"Msg Block"
													};

// These match the Data Blocks object enum above
WCHAR	*DataBlocksObjectNames[SOH_DATABLOCKS_COUNT] ={	L"  16 Bytes",
														L"  32 Bytes",
														L"  64 Bytes",
														L" 128 Bytes",
														L" 256 Bytes",
														L" 512 Bytes",
														L"1024 Bytes",
														L"2048 Bytes",
														L"4096 Bytes",
														L"8192 Bytes"
													};

#endif


#endif // _SOHAPI_

