📄 objectid.c
字号:
/* * Copyright 2000-2005 Wind River Systems, Inc. * All rights reserved. Provided under license only. * Distribution or other use of this software is only * permitted pursuant to the terms of a license agreement * from Wind River Systems (and is otherwise prohibited). * Refer to that license agreement for terms of use. *//* * Copyright 1988-1997 Epilogue Technology Corporation. * Copyright 1998 Integrated Systems, Inc. * All rights reserved. *//* * $Log: objectid.c,v $ * Revision 1.2 2001/11/06 21:20:18 josh * revised new path hacking * * Revision 1.1.1.1 2001/11/05 17:47:43 tneale * Tornado shuffle * * Revision 9.2 2001/01/19 22:22:23 paul * Update copyright. * * Revision 9.1 2000/03/17 00:19:14 meister * Update copyright message * * Revision 9.0 1998/10/16 22:11:47 sar * Update version stamp to match release * * Revision 8.2 1998/06/05 18:53:16 sra * "#include <foo.h>" => "#include <envoy/h/foo.h>". * * Revision 8.1 1998/02/25 04:52:11 sra * Update copyrights. * * Revision 8.0 1997/11/18 00:56:54 sar * Updated revision to 8.0 * * Revision 7.2 1997/03/20 06:49:05 sra * DFARS-safe copyright text. Zap! * * Revision 7.1 1997/02/25 10:49:26 sra * Update copyright notice, dust under the bed. * * Revision 7.0 1996/03/18 20:01:11 sar * Updated revision to 7.0 and copyright to 96 * * Revision 6.1 1995/10/20 22:59:09 sar * removed no_pp stuff & casts of 0 * modified memcpy to MEMCPY * * Revision 6.0 1995/05/31 21:47:37 sra * Release 6.0. * * Revision 5.1 1995/03/21 00:25:01 sar * Minor cleanup, removed unneeded casts of 0 and started using MEMCPY * * Revision 5.0 1994/05/16 15:42:42 sar * Updated revision to 5.0 and copyright to include 1994 * * Revision 4.0 1993/06/24 15:45:46 sar * Updated revision to 4.0 and copyright to 93 * * Revision 3.1 1993/02/17 21:06:14 sar * Removed the #define the and uses of it. * * Revision 3.0 92/04/03 19:52:37 dab * Release 3.0 * * Revision 2.103 91/10/30 20:42:06 dab * Directly include asn1conf.h, snmpdefs.h, and snmpstat.h (if needed). * * Revision 2.102 91/09/18 12:32:26 dab * Updated to use new macros from <asn1conf.h> and <snmpconf.h>. * * Revision 2.101 91/08/15 12:31:06 dab * Removed <libfuncs.h>. * * Revision 2.100 91/08/09 14:08:23 dab * Update version. * * Revision 1.1 91/07/30 02:23:46 romkey * Initial revision * * * Rev 2.0 31 Mar 1990 15:06:50 * Release 2.00 * * Rev 1.4 17 Mar 1989 21:41:28 * Calls to memcpy/memset protected against zero lengths * * Rev 1.3 04 Mar 1989 10:35:34 * Added cast to actual parameter on call to memcpy to avoid warnings on * some compilers. * * Rev 1.2 11 Jan 1989 12:46:44 * Moved Clean_Obj_ID() to objectid.c * * Rev 1.1 14 Sep 1988 17:57:16 * Moved includes of system include files into libfuncs.h. * * Rev 1.0 12 Sep 1988 10:47:04 * Initial revision.*//* [clearcase]modification history-------------------01b,18apr05,job update copyright notices01a,24nov03,job update copyright information*/#include <wrn/wm/snmp/engine/asn1conf.h>#include <wrn/wm/snmp/engine/asn1.h>#include <wrn/wm/snmp/engine/snmpdefs.h>#include <wrn/wm/snmp/engine/snmp.h>#include <wrn/wm/snmp/engine/objectid.h>/****************************************************************************NAME: build_object_idPURPOSE: Build an object id structurePARAMETERS: int Number of components in the old structure OIDC_T * List of components in the old structure OBJ_ID_T * The new Object Identifier structureRETURNS: 0 if sucessful, -1 if not****************************************************************************/int build_object_id(int oldc, OIDC_T *oldl, OBJ_ID_T *new){new->component_list = 0; /* Just in case the list is empty */if ((new->num_components = oldc) != 0) { unsigned int need; need = (unsigned int)(sizeof(OIDC_T) * new->num_components); if ((new->component_list = (OIDC_T *)SNMP_memory_alloc(need)) == 0) return -1; if (need != 0) MEMCPY(new->component_list, oldl, need); }return 0;}/****************************************************************************NAME: Clean_Obj_IDPURPOSE: Clean up an OBJ_ID_T structurePARAMETERS: OBJ_ID_T *RETURNS: Nothing****************************************************************************/void Clean_Obj_ID(OBJ_ID_T *objp){if (objp->component_list != 0){ SNMP_memory_free(objp->component_list); objp->component_list = 0; }objp->num_components = 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -