/*	SNMPx.h - SNMP support routines.
*
*******************************************************************************
* 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(__SNMPX_H__)
#define	__SNMPX_H__

size_t OidPartialMatchCountEx(AsnObjectIdentifier const * const poia1, size_t const iOffset1, AsnObjectIdentifier const * const poia2, size_t const iOffset2, size_t const cItems);
size_t OidPartialMatchCount(AsnObjectIdentifier const * const poia1, size_t const iOffset1, AsnObjectIdentifier const * const poia2);

BOOL OidPartialMatchEx(AsnObjectIdentifier const * const poia1, size_t const iOffset1, AsnObjectIdentifier const * const poia2, size_t const iOffset2, size_t const cItems);
BOOL OidPartialMatch(AsnObjectIdentifier const * const poia1, size_t const iOffset1, AsnObjectIdentifier const * const poia2);

BOOL OidRangeToValue(AsnObjectIdentifier const * const poia, size_t const iOffset, size_t const cIds, BYTE const asnType, AsnAny * const pResult);

/* Fix buggy (non-const parameters) Microsoft header prototypes (the debug version verifies types). */
#if defined(DEBUG)

static SNMPAPI _SnmpUtilOidCpy(OUT AsnObjectIdentifier * const DstObjId, IN AsnObjectIdentifier const * const SrcObjId)			{ return SnmpUtilOidCpy(DstObjId, (AsnObjectIdentifier *) SrcObjId);		}
static SNMPAPI _SnmpUtilOidAppend(IN OUT AsnObjectIdentifier * const DstObjId, IN AsnObjectIdentifier const * const SrcObjId)	{ return SnmpUtilOidAppend(DstObjId, (AsnObjectIdentifier *) SrcObjId));	}

#else

#define	_SnmpUtilOidCpy(DstObjId, SrcObjId)		SnmpUtilOidCpy(DstObjId, (AsnObjectIdentifier *) SrcObjId)
#define	_SnmpUtilOidAppend(DstObjId, SrcObjId)	SnmpUtilOidAppend(DstObjId, (AsnObjectIdentifier *) SrcObjId)

#endif

#define	ASN_OBJECT_ARRAY_VAR(name)	aid##name
#define	ASN_OBJECT_ID_VAR(name)		oia##name

#define	ASN_OBJECT_ARRAY(name)	UINT const ASN_OBJECT_ARRAY_VAR(name)[] = 
#define	ASN_OBJECT_ID(name)		AsnObjectIdentifier const ASN_OBJECT_ID_VAR(name) = { ElementCount(ASN_OBJECT_ARRAY_VAR(name)), (UINT *) ASN_OBJECT_ARRAY_VAR(name) }

extern AsnObjectIdentifier const ASN_OBJECT_ID_VAR(Scalar);
extern AsnObjectIdentifier const ASN_OBJECT_ID_VAR(Index);

/*

	NOT TO BE EXPORTED.

	ASN_DIGI_DISPSTRING is used internally to distinguish byte arrays from C-style strings.
	It must be converted to ASN_RFC1213_DISPSTRING before returning a value back to the OS.

*/

#define ASN_INTERNAL_DISPSTRING  (ASN_PRIVATE|ASN_PRIMATIVE|0x01)

#endif