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

   dxbdata.c

Abstract:

   Constant data structures used in Perfmon data requests.

Author:

   Michael Zarns

--*/
#include <windows.h>
#include <winperf.h>
#include <stddef.h>
#include <string.h>
#include "dxbctrs.h"
#include "dxbdata.h"

DXB_ADAPTER_DEFINITION gAdapterDefinition =
{
	{0, sizeof gAdapterDefinition, sizeof gAdapterDefinition.Type, ADAPTER_OBJECT, 0, ADAPTER_OBJECT, 0, PERF_DETAIL_NOVICE, (sizeof gAdapterDefinition - sizeof gAdapterDefinition.Type)/sizeof(PERF_COUNTER_DEFINITION), -1, 0, 0},
	{sizeof(PERF_COUNTER_DEFINITION), ADAPTER_HEARTBEAT, 0, ADAPTER_HEARTBEAT, 0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_ADAPTER_DATA,Heartbeat)},
	{sizeof(PERF_COUNTER_DEFINITION), ADAPTER_TXQIN,     0, ADAPTER_TXQIN,     0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_ADAPTER_DATA,TxQIn)    },
	{sizeof(PERF_COUNTER_DEFINITION), ADAPTER_TXQOUT,    0, ADAPTER_TXQOUT,    0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_ADAPTER_DATA,TxQOut)   },
	{sizeof(PERF_COUNTER_DEFINITION), ADAPTER_RXQIN,     0, ADAPTER_RXQIN,     0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_ADAPTER_DATA,RxQIn)    },
	{sizeof(PERF_COUNTER_DEFINITION), ADAPTER_RXQOUT,    0, ADAPTER_RXQOUT,    0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_ADAPTER_DATA,RxQOut)   }
};


DXB_CSU_DEFINITION gCsuDefinition =
{
	{0, sizeof gCsuDefinition, sizeof gCsuDefinition.Type, CSU_OBJECT, 0, CSU_OBJECT, 0, PERF_DETAIL_NOVICE, (sizeof gCsuDefinition - sizeof gCsuDefinition.Type)/sizeof(PERF_COUNTER_DEFINITION), -1, 0, 0},
	{sizeof(PERF_COUNTER_DEFINITION), CSU_LOS,                     0, CSU_LOS,                     0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CSU_DATA,Los)                  },
	{sizeof(PERF_COUNTER_DEFINITION), CSU_REDALARM,                0, CSU_REDALARM,                0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CSU_DATA,RedAlarm)             },
	{sizeof(PERF_COUNTER_DEFINITION), CSU_YELLOWALARM,             0, CSU_YELLOWALARM,             0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CSU_DATA,YellowAlarm)          },
	{sizeof(PERF_COUNTER_DEFINITION), CSU_BLUEALARM,               0, CSU_BLUEALARM,               0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CSU_DATA,BlueAlarm)            },
	{sizeof(PERF_COUNTER_DEFINITION), CSU_LOOPBACK,                0, CSU_LOOPBACK,                0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CSU_DATA,Loopback)             },
	{sizeof(PERF_COUNTER_DEFINITION), CSU_ERRORED_SECONDS,         0, CSU_ERRORED_SECONDS,         0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CSU_DATA,ErroredSeconds)       },
	{sizeof(PERF_COUNTER_DEFINITION), CSU_UNAVAILABLE_SECONDS,     0, CSU_UNAVAILABLE_SECONDS,     0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CSU_DATA,UnavailableSeconds)   },
	{sizeof(PERF_COUNTER_DEFINITION), CSU_BURSTY_SECONDS,          0, CSU_BURSTY_SECONDS,          0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CSU_DATA,BurstySeconds)        },
	{sizeof(PERF_COUNTER_DEFINITION), CSU_SEVERE_SECONDS,          0, CSU_SEVERE_SECONDS,          0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CSU_DATA,SevereSeconds)        },
	{sizeof(PERF_COUNTER_DEFINITION), CSU_SEVERE_FRAMING_SECONDS,  0, CSU_SEVERE_FRAMING_SECONDS,  0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CSU_DATA,SevereFramingSeconds) },
	{sizeof(PERF_COUNTER_DEFINITION), CSU_CONTROLLED_SLIP_SECONDS, 0, CSU_CONTROLLED_SLIP_SECONDS, 0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CSU_DATA,ControlledSlipSeconds)},
	{sizeof(PERF_COUNTER_DEFINITION), CSU_FRAME_LOSS_COUNT,        0, CSU_FRAME_LOSS_COUNT,        0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CSU_DATA,FrameLossCount)       },
	{sizeof(PERF_COUNTER_DEFINITION), CSU_DEGRADED_MINUTES,        0, CSU_DEGRADED_MINUTES,        0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CSU_DATA,DegradedMinutes)      },
	{sizeof(PERF_COUNTER_DEFINITION), CSU_LINE_ERRORED_SECONDS,    0, CSU_LINE_ERRORED_SECONDS,    0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CSU_DATA,LineErroredSeconds)   },
	{sizeof(PERF_COUNTER_DEFINITION), CSU_LINE_CODE_VIOLATIONS,    0, CSU_LINE_CODE_VIOLATIONS,    0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CSU_DATA,LineCodeViolations)   },
	{sizeof(PERF_COUNTER_DEFINITION), CSU_CRC_ERRORS,              0, CSU_CRC_ERRORS,              0, 1, PERF_DETAIL_NOVICE, PERF_COUNTER_RAWCOUNT, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CSU_DATA,CrcErrors)            }
};


DXB_CHANNEL_DEFINITION gChannelDefinition =
{
	{0, sizeof gChannelDefinition, sizeof gChannelDefinition.Type, CHANNEL_OBJECT, 0, CHANNEL_OBJECT, 0, PERF_DETAIL_NOVICE, (sizeof gChannelDefinition - sizeof gChannelDefinition.Type)/sizeof(PERF_COUNTER_DEFINITION), 0, 0, 0},
	{sizeof(PERF_COUNTER_DEFINITION), CHANNEL_TXOCTETS, 0, CHANNEL_TXOCTETS, 0, -2, PERF_DETAIL_NOVICE, PERF_COUNTER_COUNTER, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CHANNEL_DATA,TxOctets)},
	{sizeof(PERF_COUNTER_DEFINITION), CHANNEL_TXGOOD,   0, CHANNEL_TXGOOD,   0, 0, PERF_DETAIL_NOVICE, PERF_COUNTER_COUNTER, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CHANNEL_DATA,TxGood)  },
	{sizeof(PERF_COUNTER_DEFINITION), CHANNEL_TXCLASS1, 0, CHANNEL_TXCLASS1, 0, 0, PERF_DETAIL_NOVICE, PERF_COUNTER_COUNTER, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CHANNEL_DATA,TxClass1)},
	{sizeof(PERF_COUNTER_DEFINITION), CHANNEL_TXCLASS2, 0, CHANNEL_TXCLASS2, 0, 0, PERF_DETAIL_NOVICE, PERF_COUNTER_COUNTER, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CHANNEL_DATA,TxClass2)},
	{sizeof(PERF_COUNTER_DEFINITION), CHANNEL_TXDEF,    0, CHANNEL_TXDEF,    0, 0, PERF_DETAIL_NOVICE, PERF_COUNTER_COUNTER, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CHANNEL_DATA,TxDef)   },
	{sizeof(PERF_COUNTER_DEFINITION), CHANNEL_TXURUN,   0, CHANNEL_TXURUN,   0, 0, PERF_DETAIL_NOVICE, PERF_COUNTER_COUNTER, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CHANNEL_DATA,TxUrun)  },
	{sizeof(PERF_COUNTER_DEFINITION), CHANNEL_RXOCTETS, 0, CHANNEL_RXOCTETS, 0, -2, PERF_DETAIL_NOVICE, PERF_COUNTER_COUNTER, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CHANNEL_DATA,RxOctets)},
	{sizeof(PERF_COUNTER_DEFINITION), CHANNEL_RXGOOD,   0, CHANNEL_RXGOOD,   0, 0, PERF_DETAIL_NOVICE, PERF_COUNTER_COUNTER, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CHANNEL_DATA,RxGood)  },
	{sizeof(PERF_COUNTER_DEFINITION), CHANNEL_RXERR,    0, CHANNEL_RXERR,    0, 0, PERF_DETAIL_NOVICE, PERF_COUNTER_COUNTER, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CHANNEL_DATA,RxErr)   },
	{sizeof(PERF_COUNTER_DEFINITION), CHANNEL_RXORUN,   0, CHANNEL_RXORUN,   0, 0, PERF_DETAIL_NOVICE, PERF_COUNTER_COUNTER, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CHANNEL_DATA,RxOrun)  },
	{sizeof(PERF_COUNTER_DEFINITION), CHANNEL_RXCRC,    0, CHANNEL_RXCRC,    0, 0, PERF_DETAIL_NOVICE, PERF_COUNTER_COUNTER, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CHANNEL_DATA,RxCrc)   },
	{sizeof(PERF_COUNTER_DEFINITION), CHANNEL_RXNOBUF,  0, CHANNEL_RXNOBUF,  0, 0, PERF_DETAIL_NOVICE, PERF_COUNTER_COUNTER, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CHANNEL_DATA,RxNoBuf) },
	{sizeof(PERF_COUNTER_DEFINITION), CHANNEL_RXNFLOW,  0, CHANNEL_RXNFLOW,  0, 0, PERF_DETAIL_NOVICE, PERF_COUNTER_COUNTER, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CHANNEL_DATA,RxNflow) },
	{sizeof(PERF_COUNTER_DEFINITION), CHANNEL_RXOVLOW,  0, CHANNEL_RXOVLOW,  0, 0, PERF_DETAIL_NOVICE, PERF_COUNTER_COUNTER, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CHANNEL_DATA,RxOflow) },
	{sizeof(PERF_COUNTER_DEFINITION), CHANNEL_RXABORT,  0, CHANNEL_RXABORT,  0, 0, PERF_DETAIL_NOVICE, PERF_COUNTER_COUNTER, sizeof(DWORD), sizeof(PERF_COUNTER_BLOCK) + offsetof(DXB_CHANNEL_DATA,RxAbort) }
};
