/*** * * This file was originally generated by the libsmi DMH-SNMP backend. * It is part of DMH-SNMP, the easy to use SNMP Agent. * * Copyright (c) Yigal Hochberg, DMH Software 1993-2001 * DMH-SNMP libsmi backend version 1.1.6.2, May 13 2001 * libsmi version: 2:16:0 *---------------------------------------------------------------------- * * Module name: OwnMIB * * Pathname: ../mibs/dmh/ownmib.mib * * File name: ownmib.c * * Purpose: * Implementation of Semantic, Instance, Browse and Registration * functions, and SNMP subtree object-table. * * ASN.1 Imports: * RFC1155-SMI.enterprises * RFC1158-MIB.DisplayString * SNMPv2-SMI.MODULE-IDENTITY * SNMPv2-SMI.OBJECT-TYPE * SNMPv2-SMI.Counter32 * SNMPv2-SMI.Integer32 * * Created: Fri Apr 19 15:59:02 2002 * ***/ /* * include files for DMH-snmp method-function(s) file */ #include "std_c.h" #include "snmib.h" #include /* "h" file generated by dmh backend */ #include "ownmib.h" /* start global user code such as #include, extern, globals */ /* end global user code */ /* * DMH-snmp Method functions */ /* * OwnMIB::dmh 1.3.6.1.4.1.1070 * * ASN1_ObjectIdentifier not-accessible */ /* * OwnMIB::dmhDirectory 1.3.6.1.4.1.1070.1 * * ASN1_ObjectIdentifier not-accessible */ /* * OwnMIB::dmhMib 1.3.6.1.4.1.1070.2 * * ASN1_ObjectIdentifier not-accessible */ /* * OwnMIB::dmhTemp 1.3.6.1.4.1.1070.3 * * ASN1_ObjectIdentifier not-accessible */ /* * OwnMIB::dmhdemo 1.3.6.1.4.1.1070.3.1 * * ASN1_ObjectIdentifier not-accessible */ /* * OwnMIB::dmhdemo.dmhdCounter 1.3.6.1.4.1.1070.3.1.1 * Type: Counter32 Unsigned32 (ASN_INTEGER), Access: read-only * Scalar * Range: [0..4294967295] */ static SnSubid O_dmhdCounter[] = { 1,3,6,1,4,1,1070,3,1,1 }; static SnErr f_dmhdCounter( SnValue *pValue) { /* DMHmib template of GET function */ /* * Retrieve the current value into pValue->x, where x is: i=integer * oid=oid, s=string, i64.low and i64.high=uint64 * * Syntax: ASN1_Unsigned * NodeKind: scalar * */ /* start user code */ /* ASN1_Unsigned */ static int ownCounter = 0; ownCounter += 5; pValue->i = ownCounter; /* returned value */ return SnErrNoError; /* end user code */ } /* end f_dmhdCounter() */ /* * OwnMIB::dmhModules 1.3.6.1.4.1.1070.4 * * ASN1_ObjectIdentifier not-accessible */ /* * OwnMIB::dmhDemoMIB 1.3.6.1.4.1.1070.4.1 * * ASN1_ObjectIdentifier not-accessible */ /* * DMH-snmp Trap/Notification functions */ /* * DMH-snmp Compliance sysORTable registration function */ #if defined(HAVE_SYSOR_TABLE) static void ownmib_sysORTable_register(void) { /* start user code */ /* compliance entries oids and description * User-note: comment out non supported compliance vars. * chnage description as needed. */ /* register compliance entries * User-note: comment out non supported compliance registration */ /* end user code */ } #endif /* HAVE_SYSOR_TABLE */ /* * DMH-snmp Registration Table */ static snObjDef subTable[] = { /* * OwnMIB::dmhdemo.dmhdCounter 1.3.6.1.4.1.1070.3.1.1 * Type: Counter32 Unsigned32 (ASN_INTEGER), Access: read-only * Scalar */ { O_dmhdCounter, sizeofoname(O_dmhdCounter), SN_COUNTER, SnReadOnly, f_dmhdCounter, NULL, SnViewDefault }, }; /* end snObjDef subTable[] */ /* * Registration of the objects defined in this file */ void SnMibInit_ownmib(void) { snRegisterMibGroup(subTable, NRows(subTable)); #if defined(HAVE_SYSOR_TABLE) ownmib_sysORTable_register(); #endif } /* * Remove (unregister) the objects defined in this file from the * SNMP-Agent view */ void SnMibFinish_ownmib(void) { snUnregisterMibGroup(subTable, NRows(subTable)); } /* start additional user code */ /* end additional user code */ /* * Local Variables: * mode:c * cc: "gcc" * cc-flags: "-c -g -Wall -If:/yigal/snmpv3/include " * eval: (make-local-variable 'compile-command) * eval: (setq compile-command (concat cc " " cc-flags " " (file-name-nondirectory buffer-file-name))) * End: */ /* EOF: ownmib.c */