⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bindint.c

📁 wm PNE 3.3 source code, running at more than vxworks6.x version.
💻 C
字号:
/* bindint.c - bindint.c routines *//* *  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: bindint.c,v $ * Revision 1.2  2001/11/06 21:20:04  josh * revised new path hacking * * Revision 1.1.1.1  2001/11/05 17:47:41  tneale * Tornado shuffle * * Revision 9.4  2001/01/19 22:22:17  paul * Update copyright. * * Revision 9.3  2000/03/17 00:18:57  meister * Update copyright message * * Revision 9.2  1999/09/14 19:10:26  josh * SNMP_Bind_*() functions are now just shells that call newly-written * VBL_Bind_*() functions -- they allow you to use a VarBindList (VBL_T) * instead of an SNMP Packet (SNMP_PKT_T) * * Revision 9.1  1999/05/24 20:12:14  josh * 'compc' and 'compl' have been replaced by 'tcount' and 'tlist' * to avoid C++ compiler errors. * * Revision 9.0  1998/10/16 22:11:00  sar * Update version stamp to match release * * Revision 8.2  1998/06/05 18:53:05  sra * "#include <foo.h>" => "#include <envoy/h/foo.h>". * * Revision 8.1  1998/02/25 04:51:20  sra * Update copyrights. * * Revision 8.0  1997/11/18 00:56:41  sar * Updated revision to 8.0 * * Revision 7.2  1997/03/20 06:48:36  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 * * Revision 6.0  1995/05/31  21:47:07  sra * Release 6.0. * * 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/04/27  21:10:00  sar * Replace locate_vb with index_to_vbp, so we can have only one copy of them. * * Revision 3.0  1992/04/03  19:52:37  dab * Release 3.0 * * Revision 2.102  91/10/30  20:41:36  dab * Directly include asn1conf.h, snmpdefs.h, and snmpstat.h (if needed). *  * Revision 2.101  91/08/15  12:30:42  dab * Removed <libfuncs.h>. *  * Revision 2.100  91/08/09  14:08:14  dab * Update version. *  * Revision 1.1  91/07/30  02:23:20  romkey * Initial revision *  *  *    Rev 2.0   31 Mar 1990 15:06:36 * Release 2.00 *  *    Rev 1.0   11 Jan 1989 12:11:52 * Initial revision. * * Separated from buildpkt.c on January 11, 1989.*//* [clearcase]modification history-------------------01d,12may05,job  fix apigen comments01c,18apr05,job  update copyright notices01b,28jan05,job  apigen for documented APIs01a,24nov03,job  update copyright information*//*DESCRIPTIONThis library contains bindint.c routines.INCLUDE FILES: auxfuncs.h*/#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>#include <wrn/wm/snmp/engine/buildpkt.h>/********************************************************************************* SNMP_Bind_Integer - bind an integer value into a 'VarBind'* SYNOPSIS** \cs* int SNMP_Bind_Integer*     ( *     SNMP_PKT_T  *  pktp, *     int            index, *     int            tcount, *     OIDC_T      *  tlist, *     INT_32_T       value *     )* \ce** DESCRIPTION** This routine binds an integer value into a 'VarBind' in the 'VarBindList' of * an SNMP packet structure created by either SNMP_Create_Request2(), * SNMP_Create_Request_V3(), or SNMP_Create_Trap().** PARAMETERS* \is* \i <*pktp>* Reference the packet being constructed.* \i <index>* Specify the zero-based index that indicates which 'VarBind' entry to use.* \i <tcount>* Specify the component count of the object identifier of the 'VarBind' being * bound.* \i <*tlist>* Specify the components of the object identifier of the 'VarBind' being bound.* \i <value>* Specify the integer value to be bound.* \ie** RETURNS: If successful, this routine returns 0. Otherwise, it returns -1.** ERRNO: N/A** SEE ALSO: SNMP_Bind_Unsigned_Integer(), SNMP_Create_Request2(), * SNMP_Create_Request_V3(), SNMP_Create_Trap()*/int  SNMP_Bind_Integer(SNMP_PKT_T *pktp,		    int		indx,		    int		tcount,		    OIDC_T     *tlist,		    INT_32_T	value){VBL_T	*vblp;#if INSTALL_ENVOY_SNMP_VERSION_1if (pktp->pdu_type == TRAP_PDU)    vblp = &(pktp->pdu.trap_pdu.trap_vbl);  else#endif    vblp = &(pktp->pdu.std_pdu.std_vbl);return (VBL_Bind_Integer(vblp, indx, tcount, tlist, value));}/********************************************************************************* VBL_Bind_Integer - bind an integer value into a 'VarBind'* SYNOPSIS** \cs* int VBL_Bind_Integer *     ( *     VBL_T      *  vblp, *     int           index, *     int           tcount, *     OIDC_T     *  tlist, *     INT_32_T      value *     )* \ce** DESCRIPTION** This routine binds an integer value into a 'VarBind' in the 'VBL_T' structure * (<vblp>) created by VBList_Allocate().** PARAMETERS* \is* \i <*vblp>* Reference the 'VBL_T' structure.* \i <index>* Specify the zero-based index that indicates which 'VarBind' entry to use.* \i <tcount>* Specify the component count of the object identifier of the 'VarBind' being * bound.* \i <*tlist>* Specify the components of the object identifier of the 'VarBind' being bound.* \i <value>* Specify the integer value to be bound.* \ie** RETURNS: If successful, this routine returns 0. Otherwise, it returns -1.** ERRNO: N/A** SEE ALSO: VBL_Bind_Counter(), VBL_Bind_Gauge(), VBL_Bind_IP_Address(), * VBL_Bind_Null(), VBL_Bind_Object_ID(), VBL_Bind_Opaque(), VBL_Bind_String(), * VBL_Bind_64_Unsigned_Integer(), VBL_Bind_Timeticks(), * VBL_Bind_Unsigned_Integer(), VBList_Allocate()*/int  VBL_Bind_Integer(VBL_T     *vblp,		   int	      indx,		   int	      tcount,		   OIDC_T    *tlist,		   INT_32_T   value){VB_T	*vbp;if ((vbp = vblp_index_to_vbp(vblp, indx)) == 0)    return -1;if (build_object_id(tcount, tlist, &(vbp->vb_obj_id)) == -1)    return -1;vbp->vb_data_flags_n_type = VT_NUMBER;vbp->value_u.v_number = value;return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -