📄 snmpicmp.c
字号:
/* snmpIcmp.c - snmp v1 method routines for icmp group *//* * Copyright 1984-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. */#include "copyright_wrs.h"/*modification history-------------------01b,19apr05,job update copyright notices01a,01dec03,job update copyright information01a,10mar96,rjc written*//* * $Log: snmpicmp.c,v $ * Revision 1.4 2001/11/09 17:30:25 tneale * Another adjustment for generated header files * * Revision 1.3 2001/11/09 14:54:08 tneale * Fixed paths for generated files mibhand.h and mibleaf.h * * Revision 1.2 2001/11/08 22:18:34 meister * rework pathnames * * Revision 1.1.1.1 2001/11/05 17:47:49 tneale * Tornado shuffle * * Revision 1.5 2001/01/19 22:25:05 paul * Update copyright. * * Revision 1.4 2000/03/09 17:42:26 josh * setting up prototypes and includes where appropriate to eliminate * build warnings * * Revision 1.3 2000/03/07 21:17:26 josh * fixing log comments * * Revision 1.2 2000/03/07 20:58:36 josh * putting CVS headers and logs into files that were lacking * *//* includes */#include <wrn/wm/snmp/vxagent/snmpdLib.h>#include <wrn/wm/snmp/engine/mib.h>#include "m2Lib.h"#include <wrn/wm/snmp/vxagent/mibleaf.h>#include <wrn/wm/snmp/vxagent/mibhand.h>#include <wrn/wm/snmp/engine/auxfuncs.h> /******************************************************************************* icmpGet - Get method routine for icmp group.** Parameters to this routine are ** <lastmatch> - the last oid component that was matched to get to this leaf.* <compc> - count of components remaining in the unmatched portion i.e.* the length of the instance portion.* <compl> - ptr to the oid sequence remaining, i.e. the instance portion.* <pktp> - ptr to internal representation of the snmp pkt.* <vbp> - ptr to var bind being processed.** NOMANUAL** RETURNS: N/A*/void icmpGet ( OIDC_T lastmatch, int compc, OIDC_T * compl, SNMP_PKT_T * pktp, VB_T * vbp ) { M2_ICMP icmpVars; /* Group together all varbinds which have the same getproc and instance */ snmpdGroupByGetprocAndInstance (pktp, vbp, compc, compl); if ((compc != 1) || (*compl != 0)) { for ( ; vbp != NULL; vbp = vbp->vb_link) { getproc_nosuchins (pktp, vbp); } return; } if ( m2IcmpGroupInfoGet (&icmpVars) != OK) { for ( ; vbp != NULL; vbp = vbp->vb_link) { getproc_error (pktp, vbp, GEN_ERR); } return; } for ( ; vbp != NULL; vbp = vbp->vb_link) { /* ml_last_match field indicates which variable in this group to retrieve */ switch (vbp->vb_ml.ml_last_match) { case LEAF_icmpInMsgs: getproc_got_uint32 (pktp, vbp, icmpVars.icmpInMsgs, VT_COUNTER); break; case LEAF_icmpInErrors: getproc_got_uint32 (pktp, vbp, icmpVars.icmpInErrors, VT_COUNTER); break; case LEAF_icmpInDestUnreachs: getproc_got_uint32 (pktp, vbp, icmpVars.icmpInDestUnreachs, VT_COUNTER); break; case LEAF_icmpInTimeExcds: getproc_got_uint32 (pktp, vbp, icmpVars.icmpInTimeExcds, VT_COUNTER); break; case LEAF_icmpInParmProbs: getproc_got_uint32 (pktp, vbp, icmpVars.icmpInParmProbs, VT_COUNTER); break; case LEAF_icmpInSrcQuenchs: getproc_got_uint32 (pktp, vbp, icmpVars.icmpInSrcQuenchs, VT_COUNTER); break; case LEAF_icmpInRedirects: getproc_got_uint32 (pktp, vbp, icmpVars.icmpInRedirects, VT_COUNTER); break; case LEAF_icmpInEchos: getproc_got_uint32 (pktp, vbp, icmpVars.icmpInEchos, VT_COUNTER); break; case LEAF_icmpInEchoReps: getproc_got_uint32 (pktp, vbp, icmpVars.icmpInEchoReps, VT_COUNTER); break; case LEAF_icmpInTimestamps: getproc_got_uint32 (pktp, vbp, icmpVars.icmpInTimestamps, VT_COUNTER); break; case LEAF_icmpInTimestampReps: getproc_got_uint32 (pktp, vbp, icmpVars.icmpInTimestampReps, VT_COUNTER); break; case LEAF_icmpInAddrMasks: getproc_got_uint32 (pktp, vbp, icmpVars.icmpInAddrMasks, VT_COUNTER); break; case LEAF_icmpInAddrMaskReps: getproc_got_uint32 (pktp, vbp, icmpVars.icmpInAddrMaskReps, VT_COUNTER); break; case LEAF_icmpOutMsgs: getproc_got_uint32 (pktp, vbp, icmpVars.icmpOutMsgs, VT_COUNTER); break; case LEAF_icmpOutErrors: getproc_got_uint32 (pktp, vbp, icmpVars.icmpOutErrors, VT_COUNTER); break; case LEAF_icmpOutDestUnreachs: getproc_got_uint32 (pktp, vbp, icmpVars.icmpOutDestUnreachs, VT_COUNTER); break; case LEAF_icmpOutTimeExcds: getproc_got_uint32 (pktp, vbp, icmpVars.icmpOutTimeExcds, VT_COUNTER); break; case LEAF_icmpOutParmProbs: getproc_got_uint32 (pktp, vbp, icmpVars.icmpOutParmProbs, VT_COUNTER); break; case LEAF_icmpOutSrcQuenchs: getproc_got_uint32 (pktp, vbp, icmpVars.icmpOutSrcQuenchs, VT_COUNTER); break; case LEAF_icmpOutRedirects: getproc_got_uint32 (pktp, vbp, icmpVars.icmpOutRedirects, VT_COUNTER); break; case LEAF_icmpOutEchos: getproc_got_uint32 (pktp, vbp, icmpVars.icmpOutEchos, VT_COUNTER); break; case LEAF_icmpOutEchoReps: getproc_got_uint32 (pktp, vbp, icmpVars.icmpOutEchoReps, VT_COUNTER); break; case LEAF_icmpOutTimestamps: getproc_got_uint32 (pktp, vbp, icmpVars.icmpOutTimestamps, VT_COUNTER); break; case LEAF_icmpOutTimestampReps: getproc_got_uint32 (pktp, vbp, icmpVars.icmpOutTimestampReps, VT_COUNTER); break; case LEAF_icmpOutAddrMasks: getproc_got_uint32 (pktp, vbp, icmpVars.icmpOutAddrMasks, VT_COUNTER); break; case LEAF_icmpOutAddrMaskReps: getproc_got_uint32 (pktp, vbp, icmpVars.icmpOutAddrMaskReps, VT_COUNTER); break; default: getproc_error (pktp, vbp, GEN_ERR); break; } } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -