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

📄 toastmth.c

📁 wm PNE 3.3 source code, running at more than vxworks6.x version.
💻 C
字号:
/* $Header: /usr/cvsroot/target/src/wrn/wm/demo/winagent/toastmth.c,v 1.2 2001/11/09 21:29:37 josh Exp $ *//* * Copyright (C) 1999-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: toastmth.c,v $ * Revision 1.2  2001/11/09 21:29:37  josh * winagent path retooling * * Revision 1.1.1.1  2001/11/05 17:49:18  tneale * Tornado shuffle * * Revision 1.8  2001/01/19 22:25:11  paul * Update copyright. * * Revision 1.7  2000/03/17 00:15:51  meister * Update copyright message * * Revision 1.6  1998/02/25 04:58:31  sra * Update copyrights. * * Revision 1.5  1997/03/20 06:53:37  sra * DFARS-safe copyright text.  Zap! * * Revision 1.4  1997/02/25 16:34:43  mrf * Added RCS log and copyright notice * *//* [clearcase]modification history-------------------01a,19apr05,job  update copyright notices*//*---------------------------------------------------------  TOASTMTH.C -- Method routines and global declarations		for the toaster MIB, an example MIB found in		TOASTER.MIB.-----------------------------------------------------------*/#include <sys\types.h>#include <wrn/wm/snmp/engine/snmp.h>#include <wrn/wm/snmp/engine/snmpdefs.h>#include <wrn/wm/snmp/engine/snmpstat.h>#include <wrn/wm/snmp/engine/objectid.h>#include "toastmth.h"#include "toastvar.h"/* global initialization of toaster MIB variables. */char toaster_manf[] = "Sunbeam";char toaster_ModelNumber[] = "Radiant Automatic";long toasterstate = 1;long toasterdoneness = 1;long toasttype = 1;/*---------------------------------------------------------    toaster_test() --		TESTPROC for toaster MIB.  ---------------------------------------------------------*/void toaster_test(OIDC_T			last_match,               int               tcount,               OIDC_T           *tlist,               SNMP_PKT_T       *pktp,               VB_T             *vbp){long value;value = VB_GET_INT32(vbp);if (value < 1) {    testproc_error(pktp, vbp, WRONG_VALUE);    return;    }switch (last_match) {   case LM_toastControl:        if (value > 2) {            testproc_error(pktp, vbp, WRONG_VALUE);            return;            }        break;    case LM_toastDone:        if (value > 10) {            testproc_error(pktp, vbp, WRONG_VALUE);            return;            }        break;    case LM_toastType:        if (value > 7) {            testproc_error(pktp, vbp, WRONG_VALUE);            return;            }        break;    }if ((tcount != 1) || (*tlist != 0)) {    testproc_error(pktp, vbp, NO_CREATION);    return;    }testproc_good(pktp, vbp);return;}/*---------------------------------------------------------  toaster_set() --		SETPROC for toaster MIB.  ---------------------------------------------------------*/void toaster_set(OIDC_T          last_match,              int                tcount,              OIDC_T            *tlist,              SNMP_PKT_T        *pktp,              VB_T              *vbp){switch (last_match) {    case LM_toastControl:        toasterstate = VB_GET_INT32(vbp);        break;    case LM_toastDone:        toasterdoneness = VB_GET_INT32(vbp);        break;    case LM_toastType:        toasttype = VB_GET_INT32(vbp);        break;    }setproc_good(pktp, vbp);return;}

⌨️ 快捷键说明

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