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

📄 row_get.c

📁 wm PNE 3.3 source code, running at more than vxworks6.x version.
💻 C
字号:
/* row_get.c - row_get.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 1996-1997 Epilogue Technology Corporation. *  Copyright 1998 Integrated Systems, Inc. *  All rights reserved. *//* * $Log: row_get.c,v $ * Revision 1.2  2001/11/06 21:20:21  josh * revised new path hacking * * Revision 1.1.1.1  2001/11/05 17:47:40  tneale * Tornado shuffle * * Revision 9.3  2001/01/19 22:21:58  paul * Update copyright. * * Revision 9.2  2000/03/17 00:17:42  meister * Update copyright message * * Revision 9.1  1999/05/24 20:12:06  josh * 'compc' and 'compl' have been replaced by 'tcount' and 'tlist' * to avoid C++ compiler errors. * * Revision 9.0  1998/10/16 22:09:38  sar * Update version stamp to match release * * Revision 8.3  1998/06/08 20:02:22  sar * Modify var bind check to make sure we have a leaf and to check * all of the flags before the oid compare * * Revision 8.2  1998/06/05 18:52:57  sra * "#include <foo.h>" => "#include <envoy/h/foo.h>". * * Revision 8.1  1998/02/25 04:49:59  sra * Update copyrights. * * Revision 8.0  1997/11/18 00:56:13  sar * Updated revision to 8.0 * * Revision 7.2  1997/03/20 06:50:21  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/15 22:21:24  sar * Updated revision to 7.0 and copyright to 96 * * Revision 1.1  1996/01/05  18:58:29  sar * Initial revision * * *//* [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 row_get.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/vbdefs.h>#include <wrn/wm/snmp/engine/snmpdefs.h>#include <wrn/wm/snmp/engine/snmp.h>#include <wrn/wm/snmp/engine/auxfuncs.h>/********************************************************************************* group_by_getproc_and_instance - group similar 'VarBinds'* SYNOPSIS** \cs* void group_by_getproc_and_instance*     ( *     SNMP_PKT_T *  pktp, *     VB_T       *  first_vbp, *     int           tcount, *     OIDC_T     *  tlist *     )* \ce** DESCRIPTION** This routine groups similar 'VarBinds'. Starting at <first_vbp>, it searches * the packet for any 'VarBinds' that match the 'getproc' pointer of <first_vbp> * and have an instance of <tcount> and <tlist> and it links all the 'VarBinds' * that match this criteria.** \&NOTE: This routine does not set any flags in the 'VarBinds'. Your calling * routine must set the tested or set flags.** PARAMETERS* \is* \i <*pktp>* Specify a packet.* \i <*first_vbp>* Specify the first 'VarBind' entry to use. If this value is 0, there are no * more 'VarBinds'.* \i <tcount>* Specify the component count of the object identifier of the 'VarBind'.* \i <*tlist>* Specify the components of the object identifier of the 'VarBind'.* \ie** RETURNS: None.** ERRNO: N/A** SEE ALSO: vb_extract_row(), vb_extract_row()*/void  group_by_getproc_and_instance(SNMP_PKT_T *pktp,				VB_T       *first_vbp,				int         tcount,				OIDC_T     *tlist){  VBL_T *vblp;  VB_T  *last_vbp;  VB_T  *vbp;  VB_T  *list;  #if INSTALL_ENVOY_SNMP_VERSION_1  if (pktp->pdu_type == TRAP_PDU)    vblp = &(pktp->pdu.trap_pdu.trap_vbl);    else#endif    /* find the last vblp, which is always the one we are working on */    for (vblp = &(pktp->pdu.std_pdu.std_vbl); vblp->vblp; vblp = vblp->vblp)      ;        list = first_vbp;  list->vb_link = 0;  for (last_vbp = &vblp->vblist[vblp->vbl_count], vbp = first_vbp + 1;       vbp < last_vbp; vbp++) {    /* find varbinds with the same getproc which aren't already in use */    if (vbp->vb_ml.ml_leaf &&	((vbp->vb_flags & (VFLAG_SET_STARTED | VFLAG_SET_DONE |			   VFLAG_TEST_STARTED | VFLAG_TEST_DONE)) == 0) &&	(vbp->vb_ml.ml_leaf->getproc == first_vbp->vb_ml.ml_leaf->getproc) &&	(oidcmp2(tcount, tlist, vbp->vb_ml.ml_remaining_objid.num_components,		 vbp->vb_ml.ml_remaining_objid.component_list) == 0)) {      /* link onto the list */      list->vb_link = vbp;      list = vbp;      vbp->vb_link = 0;    }  }}

⌨️ 快捷键说明

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