252N/A * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 252N/A * U.S. Government Rights - Commercial software. Government users are subject 252N/A * to the Sun Microsystems, Inc. standard license agreement and applicable 252N/A * provisions of the FAR and its supplements. 252N/A * This distribution may include materials developed by third parties. Sun, 252N/A * Sun Microsystems, the Sun logo and Solaris are trademarks or registered 252N/A * trademarks of Sun Microsystems, Inc. in the U.S. and other countries. 252N/A** Sun considers its source code as an unpublished, proprietary trade 252N/A** secret, and it is available only under strict license provisions. 252N/A** This copyright notice is placed here only to protect Sun in the event 252N/A** the source is deemed a published work. Disassembly, decompilation, 252N/A** or other means of reducing the object code to human readable form is 252N/A** prohibited by the license agreement under which this code is provided 252N/A** to the user or company in possession of this copy. 252N/A** RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the 252N/A** Government is subject to restrictions as set forth in subparagraph 252N/A** (c)(1)(ii) of the Rights in Technical Data and Computer Software 252N/A** clause at DFARS 52.227-7013 and in similar clauses in the FAR and 252N/A/**************************************************************************** 252N/A * Copyright (c) 1986, 1988 Epilogue Technology Corporation 252N/A * This is unpublished proprietary source code of Epilogue Technology 252N/A * The copyright notice above does not evidence any actual or intended 252N/A * publication of such source code. 252N/A ****************************************************************************/ 252N/A * Revision 1.3 2003/08/12 21:14:53 rr144420 252N/A * 4895376 - correct Sun copyright statements. Cannot use (c), and must use Copyright Copyright in makefiles 252N/A * Revision 1.2 2003/08/08 15:39:52 pcarroll 252N/A * 4895376 - The copyright statement in the demo* codes do not look right 252N/A * Revision 1.1 2003/07/28 17:59:15 dporter 252N/A * 4892877 - Need SMA Agent to implement sun extensions found in SEA sun.mib 252N/A * Rev 2.0 31 Mar 1990 15:11:26 252N/A * Rev 1.1 14 Dec 1989 16:01:16 252N/A * Added support for Borland Turbo C compiler 252N/A * Rev 1.0 12 Sep 1988 10:46:12 252N/A/********************************************************************** 252N/A If necessary adjust the following to match the compiler being used. 252N/A **********************************************************************/ 252N/A /* SNMP ASN.1 tags and lengths can always fit into 16 bits... */ 252N/A/* Allow the components of an object identifer to be either 16 or 32-bits */ 252N/A/* 16-bit is default, define OIDC_32 to switch to 32-bits. */ 252N/A/* ASN.1 FLAGS (form and class), adjusted for position within an octet */ 252N/A/* ASN.1 basic types, all in UNIVERSAL scope */ 252N/A/* ASN.1 defined types, all based on OCTETSTRING */ 252N/A/* Other ASN.1 defined universal types */ 252N/A/**************************************************************************** 252N/APURPOSE: Compute the number of octets needed to hold an ASN.1 length field. 252N/A ALENGTH_T The proposed length 252N/ARETURNS: ALENGTH_T The number of octets needed 252N/A****************************************************************************/ 252N/A/**************************************************************************** 252N/APURPOSE: Compute the number of octets needed to hold an ASN.1 type field 252N/A ATVALUE_T The proposed type (without CLASS & FORM bits) 252N/ARETURNS: unsigned int The number of octets needed 252N/A****************************************************************************/ 252N/A ((V) <=
127 ?
2 : ((V) <=
16383 ?
3 :
4))))
252N/A/**************************************************************************** 252N/AA_SizeOfOctetString -- Return total size that an octet string would 252N/A occupy when ASN.1 encoded (tag and length fields 252N/A ALENGTH_T The size of the string 252N/AReturns: ALENGTH_T Number of octets the octet string would occupy if 252N/A of the outermost wrapper. Since these routines only 252N/A generate non-constructor encodings, the length is 252N/A****************************************************************************/ 252N/A/**************************************************************************** 252N/A****************************************************************************/ 252N/A/* The following structure is used to internally hold an object identifier */ 252N/A/* Each component is limited in range from 0 to 64K-1. */ 252N/A /* Note: this is the number of */ 252N/A /* components in the object id, */ 252N/A /* which is one more than the # */ 252N/A /* of subidentifiers in an */ 252N/A /* encoded object id. */