📄 bindui64.c
字号:
/* bindui64.c - bindui64.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: bindui64.c,v $ * Revision 1.2 2001/11/06 21:20:05 josh * revised new path hacking * * Revision 1.1.1.1 2001/11/05 17:47:42 tneale * Tornado shuffle * * Revision 9.4 2001/01/19 22:22:18 paul * Update copyright. * * Revision 9.3 2000/03/17 00:18:59 meister * Update copyright message * * Revision 9.2 1999/09/14 19:10:28 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:16 josh * 'compc' and 'compl' have been replaced by 'tcount' and 'tlist' * to avoid C++ compiler errors. * * Revision 9.0 1998/10/16 22:11:06 sar * Update version stamp to match release * * Revision 8.2 1998/06/05 18:53:09 sra * "#include <foo.h>" => "#include <envoy/h/foo.h>". * * Revision 8.1 1998/02/25 04:51:26 sra * Update copyrights. * * Revision 8.0 1997/11/18 00:56:43 sar * Updated revision to 8.0 * * Revision 7.2 1997/03/20 06:48:41 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:12 sra * Release 6.0. * *//* [clearcase]modification history-------------------01d,12may05,job fix apigen comments01c,18apr05,job update copyright notices01b,16feb05,job apigen for documented APIs01a,24nov03,job update copyright information*//*DESCRIPTIONThis library contains bindui64.c routines.INCLUDE FILES: snmp.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>#include <wrn/wm/snmp/engine/ui64.h>/********************************************************************************* SNMP_Bind_64_Unsigned_Integer - bind a 64-bit unsigned integer value into a 'VarBind'* SYNOPSIS** \cs* int SNMP_Bind_64_Unsigned_Integer* ( * SNMP_PKT_T * pktp, * int index, * int tcount, * OIDC_T * tlist, * OCTET_T flags_n_type, * UINT_32_T high, * UINT_32_T low * )* \ce** DESCRIPTION** This routine binds a 64-bit unsigned 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().** \&NOTE: It may be more convenient to use SNMP_Bind_Counter().** 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 <flags_n_type>* Specify the 'VarBindType' constant 'VT_COUNTER64', which is defined in the * file 'vbdefs.h'.* \i <high>* Specify the high 32-bit section of the 64-bit value to be bound.* \i <low>* Specify the low 32-bit section of the 64-bit value to be bound.* \ie** RETURNS: If successful, this routine returns 0. Otherwise, it returns -1.** ERRNO: N/A** SEE ALSO: SNMP_Bind_Counter(), SNMP_Create_Request2(), * SNMP_Create_Request_V3(), SNMP_Create_Trap()*/int SNMP_Bind_64_Unsigned_Integer(SNMP_PKT_T *pktp, int indx, int tcount, OIDC_T *tlist, OCTET_T flags_n_type, UINT_32_T high, UINT_32_T low){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_64_Unsigned_Integer(vblp, indx, tcount, tlist, flags_n_type, high, low));}/********************************************************************************* VBL_Bind_64_Unsigned_Integer - bind a 64-bit unsigned integer value into a 'VarBind'* SYNOPSIS** \cs* int VBL_Bind_64_Unsigned_Integer * ( * VBL_T * vblp, * int index, * int tcount, * OIDC_T * tlist, * OCTET_T flags_n_type, * UINT_32_T high, * UINT_32_T low * )* \ce** DESCRIPTION** This routine binds a 64-bit unsigned integer value into a 'VarBind' in the * 'VBL_T' structure (<vblp>) created by VBList_Allocate().** \&NOTE: It may be more convenient to use VBL_Bind_Counter().** 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 <flags_n_type>* Specify the 'VarBindType' constant 'VT_COUNTER64', which is defined in the * file 'vbdefs.h'.* \i <high>* Specify the high 32-bit section of the 64-bit value to be bound.* \i <low>* Specify the low 32-bit section of the 64-bit 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_Integer(), * 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_64_Unsigned_Integer(VBL_T *vblp, int indx, int tcount, OIDC_T *tlist, OCTET_T flags_n_type, UINT_32_T high, UINT_32_T low){VB_T *vbp;if (flags_n_type != VT_COUNTER64) return (-1);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 = flags_n_type;vbp->value_u.v_counter64.high = high;vbp->value_u.v_counter64.low = low;return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -