/*	DS_RAS.h
*
*******************************************************************************
* Copyright (c) 1996-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 copyright work  Digi   International *
* Inc.    Except   as   permitted   by  federal  law,  17 USC 117, copying is *
* strictly prohibited.                                                        *
*                                                                             *
* Digi  International  Inc.  CONFIDENTIAL  -   (Digi    International    Inc. *
* Confidential  when   combined   with   the   aggregated  modules  for  this *
* product) OBJECT CODE ONLY SOURCE MATERIALS                                  *
*                                                                             *
* (C) COPYRIGHT Digi International Inc. 1996-97                               *
*                                                                             *
* All Rights Reserved                                                         *
*                                                                             *
* US   Government   Users   Restricted   Rights   -   Use,   duplication   or *
* disclosure  restricted by GSA ADP Schedule Contract with Digi International *
* Inc.                                                                        *
*                                                                             *
*******************************************************************************
*
*/

#if !defined(__DS_RAS_H__)
#define	__DS_RAS_H__

#include <stddef.h>
#include <stdio.h>
#include <limits.h>
#include <time.h>

#if defined(_WINDOWS)
#include <windows.h>
#include <snmp.h>
#include "DS_RAS_MC.h"
#endif

#include "Macros.h"
#include "SNMPx.h"
#include "Cache.h"
#include "Traps.h"

typedef BOOL (*OID_HANDLER)(BYTE const eType, void const * const pvMulti, size_t const iOffset, RFC1157VarBind * const pvb, AsnInteger * const piaErrorStatus);

typedef enum
{
	Object_Data,
	Object_List,
	Object_Table
}
Object_t;

typedef struct
{
	Object_t const eObjectType;
	void const * const pvMulti;		/* One of: OID_DATA *, OID_LIST *, or OID_TABLE *. */
}
OID_HANDLER_DATA;

typedef struct
{
	AsnObjectIdentifier const * const poiaPartial;
	OID_HANDLER_DATA const ohd;
	OID_HANDLER const pfnVarBind;
}
OID_MAP_ENTRY;

typedef struct
{
	size_t const cMaps;
	OID_MAP_ENTRY const * const aome;
}
OID_MAP;

#define	ACCESS_READONLY		0
#define	ACCESS_READWRITE	1

typedef BOOL (*SET_CACHE_OBJECT_HANDLER)(size_t const iOffset, RFC1157VarBind const * const pvb, CacheObject_t * const pco);

typedef struct
{
	UINT const eAccess;
	UINT const eType;
	SET_CACHE_OBJECT_HANDLER pfnSetCacheObject;
	CacheValue_t const cv;
}
OID_DATA;

typedef struct
{
	OID_MAP const om;
}
OID_LIST;

typedef enum
{
	Index_First,
	Index_Next
}
IndexFunction_t;

typedef BOOL (*INDEX_HANDLER)(IndexFunction_t const eType, size_t const cIndicies, size_t const iOffset, AsnObjectIdentifier * const poia, AsnInteger * const piaErrorStatus);

typedef struct OID_TABLE
{
	size_t const cIndicies;
	INDEX_HANDLER pfnIndex;
	OID_MAP const om;
}
OID_TABLE;

typedef size_t (*MAX_GENERIC_INDEX)(size_t const iAdapter);

typedef struct
{
	uint16 eType;
	AsnInteger iaGenericType;
	AsnInteger iaSpecificType;
	size_t iOffsetToTraceData;
	size_t cbTraceData;
	TRAP_HANDLER pfnTrapHandler;
	MAX_GENERIC_INDEX pfnMaxGeneric1;
	MAX_GENERIC_INDEX pfnMaxGeneric2;
}
TRAP_ENTRY;

typedef struct
{
	size_t const cTraps;
	TRAP_ENTRY const * const ate;
}
TRAP_MAP;

typedef struct
{
	AsnObjectIdentifier const * const poiaPartial;
	OID_MAP const om;
	TRAP_MAP const tm;
}
ROOT_MAP;

#endif