diff options
author | Graham Barr <gbarr@pobox.com> | 2000-03-29 12:36:59 +0000 |
---|---|---|
committer | Graham Barr <gbarr@pobox.com> | 2000-03-29 12:36:59 +0000 |
commit | f1d942aebe2a3556a82636e79dbdef4e3a2bdc77 (patch) | |
tree | 5c303211591aa395931cd7653ef2c1c1c96841b3 | |
parent | aa9064ea73e4862bf8abf6c118ac5a1643f6235b (diff) | |
download | perl-libnet-f1d942aebe2a3556a82636e79dbdef4e3a2bdc77.tar.gz |
Net::FTP
- Add Timeout to listen socket
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | Net/FTP.pm | 5 | ||||
-rw-r--r-- | mib/Makefile | 22 | ||||
-rw-r--r-- | mib/README | 39 | ||||
-rw-r--r-- | mib/dump_tree | 19 | ||||
-rw-r--r-- | mib/mib.txt | 3270 | ||||
-rw-r--r-- | mib/parse.c | 1895 | ||||
-rw-r--r-- | mib/parse.h | 89 |
8 files changed, 17 insertions, 5336 deletions
@@ -1,3 +1,17 @@ +Change 402 on 2000/03/23 by <gbarr@pobox.com> (Graham Barr) + + Net::Config + - Fix typos in requires_firewall(), Thanks to Johan Vromans <jvromans@squirrel.nl> + +Change 401 on 2000/03/23 by <gbarr@pobox.com> (Graham Barr) + + Net::FTP + - fix rmdir for when ls() returns full paths + +Change 379 on 2000/03/13 by <gbarr@pobox.com> (Graham Barr) + + Release 1.0702 + Change 378 on 2000/03/10 by <gbarr@pobox.com> (Graham Barr) Net::FTP::A @@ -1,4 +1,4 @@ -# Net::FTP.pm $Id: //depot/libnet/Net/FTP.pm#48 $ +# Net::FTP.pm $Id: //depot/libnet/Net/FTP.pm#49 $ # # Copyright (c) 1995-8 Graham Barr <gbarr@pobox.com>. All rights reserved. # This program is free software; you can redistribute it and/or @@ -747,6 +747,7 @@ sub port ${*$ftp}{'net_ftp_listen'} ||= IO::Socket::INET->new(Listen => 5, Proto => 'tcp', + Timeout => $ftp->timeout, ); my $listen = ${*$ftp}{'net_ftp_listen'}; @@ -1652,6 +1653,6 @@ Copyright (c) 1995-1998 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. -$Id: //depot/libnet/Net/FTP.pm#48 $ +$Id: //depot/libnet/Net/FTP.pm#49 $ =cut diff --git a/mib/Makefile b/mib/Makefile deleted file mode 100644 index 27a200c..0000000 --- a/mib/Makefile +++ /dev/null @@ -1,22 +0,0 @@ - -MIB_PL = ./mib.pl -MIB_TXT = mib.txt - -PERL = perl - -all : $(MIB_PL) - -$(MIB_PL) : parse $(MIB_TXT) - parse $(MIB_TXT) $(MIB_PL) - -parse : parse.c - $(CC) parse.c -o parse - -install : - cp $(MIB_PL) ../Net/SNMP/$(MIB_PL) - -dump : - $(PERL) dump_tree $(MIB_PL) - -clean : - rm -f core *.b[ac]k $(MIB_PL) parse diff --git a/mib/README b/mib/README deleted file mode 100644 index 29865c8..0000000 --- a/mib/README +++ /dev/null @@ -1,39 +0,0 @@ -The contents of this directory are not really needed to be able to -use the libnet modules. However if you have a new mib.txt you will -need to convert it to perl before Net::SNMP will be able to use it. - -This directory contains a copy of mib.txt that was used to create -the mib information that is in the libnet tree. - -To re-create the data in the libnet tree follow these instruction, however I -do not gaurantee that this program will compile on all platforms. - - make MIB_TXT=/path/to/mib.txt - make dump - make install - - -parse.c and parse.h were extracted, and modified, from the cmu-snmp-linux-3.2 -and contain thier own Copyright. - -/****************************************************************** - Copyright 1989, 1991, 1992 by Carnegie Mellon University - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of CMU not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. -******************************************************************/ diff --git a/mib/dump_tree b/mib/dump_tree deleted file mode 100644 index 60d0be4..0000000 --- a/mib/dump_tree +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/local/bin/perl - -use lib '..'; -use Net::SNMP::MIB ($ARGV[0]); - - -sub dump_tree { - my($node,$depth) = @_; - my $indent = " " x $depth; - print $indent,".",$node->name,"\n"; - if(defined($desc = $node->description)) { - $desc =~ s/(.*)/$indent $1/g; - print $desc; - } - map { dump_tree($_,$depth+1) } $node->children; -} - - -dump_tree(Net::SNMP::MIB->root, 0); diff --git a/mib/mib.txt b/mib/mib.txt deleted file mode 100644 index a8bf0fd..0000000 --- a/mib/mib.txt +++ /dev/null @@ -1,3270 +0,0 @@ - mgmt OBJECT IDENTIFIER ::= { iso org(3) dod(6) internet(1) mgmt(2) } - mib-2 OBJECT IDENTIFIER ::= { mgmt 1 } - directory OBJECT IDENTIFIER ::= { internet 1 } - experimental OBJECT IDENTIFIER ::= { internet 3 } - private OBJECT IDENTIFIER ::= { internet 4 } - snmpV2 OBJECT IDENTIFIER ::= { internet 6 } - enterprises OBJECT IDENTIFIER ::= { private 1 } - snmpModules OBJECT IDENTIFIER ::= { snmpV2 3 } - - interfaces OBJECT IDENTIFIER ::= { mib-2 2 } - at OBJECT IDENTIFIER ::= { mib-2 3 } - ip OBJECT IDENTIFIER ::= { mib-2 4 } - icmp OBJECT IDENTIFIER ::= { mib-2 5 } - tcp OBJECT IDENTIFIER ::= { mib-2 6 } - udp OBJECT IDENTIFIER ::= { mib-2 7 } - egp OBJECT IDENTIFIER ::= { mib-2 8 } - snmp OBJECT IDENTIFIER ::= { mib-2 11 } - - -- object types - - --- from rfc 1907: --- the System group --- --- a collection of objects common to all managed systems. - -system OBJECT IDENTIFIER ::= { mib-2 1 } - -sysDescr OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "A textual description of the entity. This value should - include the full name and version identification of the - system's hardware type, software operating-system, and - networking software." - ::= { system 1 } - -sysObjectID OBJECT-TYPE - SYNTAX OBJECT IDENTIFIER - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The vendor's authoritative identification of the network - management subsystem contained in the entity. This value is - allocated within the SMI enterprises subtree (1.3.6.1.4.1) - and provides an easy and unambiguous means for determining - `what kind of box' is being managed. For example, if vendor - `Flintstones, Inc.' was assigned the subtree - 1.3.6.1.4.1.4242, it could assign the identifier - 1.3.6.1.4.1.4242.1.1 to its `Fred Router'." - ::= { system 2 } - -sysUpTime OBJECT-TYPE - SYNTAX TimeTicks - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The time (in hundredths of a second) since the network - management portion of the system was last re-initialized." - ::= { system 3 } - -sysContact OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-write - STATUS current - DESCRIPTION - "The textual identification of the contact person for this - managed node, together with information on how to contact - this person. If no contact information is known, the value - is the zero-length string." - ::= { system 4 } - -sysName OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-write - STATUS current - DESCRIPTION - "An administratively-assigned name for this managed node. - By convention, this is the node's fully-qualified domain - name. If the name is unknown, the value is the zero-length - string." - ::= { system 5 } - -sysLocation OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-write - STATUS current - DESCRIPTION - "The physical location of this node (e.g., `telephone - closet, 3rd floor'). If the location is unknown, the value - is the zero-length string." - ::= { system 6 } - -sysServices OBJECT-TYPE - SYNTAX INTEGER (0..127) - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "A value which indicates the set of services that this - entity may potentially offers. The value is a sum. This - sum initially takes the value zero, Then, for each layer, L, - in the range 1 through 7, that this node performs - transactions for, 2 raised to (L - 1) is added to the sum. - For example, a node which performs only routing functions - would have a value of 4 (2^(3-1)). In contrast, a node - which is a host offering application services would have a - value of 72 (2^(4-1) + 2^(7-1)). Note that in the context - of the Internet suite of protocols, values should be - calculated accordingly: - - layer functionality - 1 physical (e.g., repeaters) - 2 datalink/subnetwork (e.g., bridges) - 3 internet (e.g., supports the IP) - 4 end-to-end (e.g., supports the TCP) - 7 applications (e.g., supports the SMTP) - - For systems including OSI protocols, layers 5 and 6 may also - be counted." - ::= { system 7 } - - --- object resource information --- --- a collection of objects which describe the SNMPv2 entity's --- (statically and dynamically configurable) support of --- various MIB modules. - -sysORLastChange OBJECT-TYPE - SYNTAX TimeStamp - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The value of sysUpTime at the time of the most recent - change in state or value of any instance of sysORID." - ::= { system 8 } - -sysORTable OBJECT-TYPE - SYNTAX SEQUENCE OF SysOREntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "The (conceptual) table listing the capabilities of the - local SNMPv2 entity acting in an agent role with respect to - various MIB modules. SNMPv2 entities having dynamically- - configurable support of MIB modules will have a - dynamically-varying number of conceptual rows." - ::= { system 9 } - -sysOREntry OBJECT-TYPE - SYNTAX SysOREntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "An entry (conceptual row) in the sysORTable." - INDEX { sysORIndex } - ::= { sysORTable 1 } - -SysOREntry ::= SEQUENCE { - sysORIndex INTEGER, - sysORID OBJECT IDENTIFIER, - sysORDescr DisplayString, - sysORUpTime TimeStamp -} - -sysORIndex OBJECT-TYPE - SYNTAX INTEGER (1..2147483647) - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION - "The auxiliary variable used for identifying instances of - the columnar objects in the sysORTable." - ::= { sysOREntry 1 } - -sysORID OBJECT-TYPE - SYNTAX OBJECT IDENTIFIER - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "An authoritative identification of a capabilities statement - with respect to various MIB modules supported by the local - SNMPv2 entity acting in an agent role." - ::= { sysOREntry 2 } - -sysORDescr OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "A textual description of the capabilities identified by the - corresponding instance of sysORID." - ::= { sysOREntry 3 } - -sysORUpTime OBJECT-TYPE - SYNTAX TimeStamp - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The value of sysUpTime at the time this conceptual row was - last instanciated." - ::= { sysOREntry 4 } - - - - - -- the Interfaces group - - ifNumber OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - ::= { interfaces 1 } - - -- the Interfaces table - - ifTable OBJECT-TYPE - SYNTAX SEQUENCE OF IfEntry - ACCESS read-write - STATUS mandatory - ::= { interfaces 2 } - - ifEntry OBJECT-TYPE - SYNTAX IfEntry - ACCESS read-write - STATUS mandatory - ::= { ifTable 1 } - - IfEntry ::= SEQUENCE { - ifIndex - INTEGER, - ifDescr - OCTET STRING, - ifType - INTEGER, - ifMtu - INTEGER, - ifSpeed - Gauge, - ifPhysAddress - OCTET STRING, - ifAdminStatus - INTEGER, - ifOperStatus - INTEGER, - ifLastChange - TimeTicks, - ifInOctets - Counter, - ifInUcastPkts - Counter, - ifInNUcastPkts - Counter, - ifInDiscards - Counter, - ifInErrors - Counter, - ifInUnknownProtos - Counter, - ifOutOctets - Counter, - ifOutUcastPkts - Counter, - ifOutNUcastPkts - Counter, - ifOutDiscards - Counter, - ifOutErrors - Counter, - ifOutQLen - Gauge - } - - ifIndex OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - ::= { ifEntry 1 } - - ifDescr OBJECT-TYPE - SYNTAX OCTET STRING - ACCESS read-only - STATUS mandatory - ::= { ifEntry 2 } - - ifType OBJECT-TYPE - SYNTAX INTEGER { - other(1), -- none of the following - regular1822(2), - hdh1822(3), - ddn-x25(4), - rfc877-x25(5), - ethernet-csmacd(6), - iso88023-csmacd(7), - iso88024-tokenBus(8), - iso88025-tokenRing(9), - iso88026-man(10), - starLan(11), - proteon-10MBit(12), - proteon-80MBit(13), - hyperchannel(14), - fddi(15), - lapb(16), - sdlc(17), - t1-carrier(18), - cept(19), - basicIsdn(20), - primaryIsdn(21), - -- proprietary serial - propPointToPointSerial(22) - } - ACCESS read-only - STATUS mandatory - ::= { ifEntry 3 } - - ifMtu OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - ::= { ifEntry 4 } - - ifSpeed OBJECT-TYPE - SYNTAX Gauge - ACCESS read-only - STATUS mandatory - ::= { ifEntry 5 } - - ifPhysAddress OBJECT-TYPE - SYNTAX OCTET STRING - ACCESS read-only - STATUS mandatory - ::= { ifEntry 6 } - - ifAdminStatus OBJECT-TYPE - SYNTAX INTEGER { - up(1), -- ready to pass packets - down(2), - testing(3) -- in some test mode - } - ACCESS read-write - STATUS mandatory - ::= { ifEntry 7 } - - ifOperStatus OBJECT-TYPE - SYNTAX INTEGER { - up(1), -- ready to pass packets - down(2), - testing(3) -- in some test mode - } - ACCESS read-only - STATUS mandatory - ::= { ifEntry 8 } - - ifLastChange OBJECT-TYPE - SYNTAX TimeTicks - ACCESS read-only - STATUS mandatory - ::= { ifEntry 9 } - - ifInOctets OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ifEntry 10 } - - ifInUcastPkts OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ifEntry 11 } - - ifInNUcastPkts OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ifEntry 12 } - - ifInDiscards OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ifEntry 13 } - - ifInErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ifEntry 14 } - - ifInUnknownProtos OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ifEntry 15 } - - ifOutOctets OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ifEntry 16 } - - ifOutUcastPkts OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ifEntry 17 } - - ifOutNUcastPkts OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ifEntry 18 } - - ifOutDiscards OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ifEntry 19 } - - ifOutErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ifEntry 20 } - - ifOutQLen OBJECT-TYPE - SYNTAX Gauge - ACCESS read-only - STATUS mandatory - ::= { ifEntry 21 } - - -- the Address Translation group - - atTable OBJECT-TYPE - SYNTAX SEQUENCE OF AtEntry - ACCESS read-write - STATUS mandatory - ::= { at 1 } - - atEntry OBJECT-TYPE - SYNTAX AtEntry - ACCESS read-write - STATUS mandatory - ::= { atTable 1 } - - AtEntry ::= SEQUENCE { - atIfIndex - INTEGER, - atPhysAddress - OCTET STRING, - atNetAddress - NetworkAddress - } - - atIfIndex OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-write - STATUS mandatory - ::= { atEntry 1 } - - atPhysAddress OBJECT-TYPE - SYNTAX OCTET STRING - ACCESS read-write - STATUS mandatory - ::= { atEntry 2 } - - atNetAddress OBJECT-TYPE - SYNTAX NetworkAddress - ACCESS read-write - STATUS mandatory - ::= { atEntry 3 } - - -- the IP group - - ipForwarding OBJECT-TYPE - SYNTAX INTEGER { - gateway(1), -- entity forwards datagrams - host(2) -- entity does NOT forward datagrams - } - ACCESS read-only - STATUS mandatory - ::= { ip 1 } - - ipDefaultTTL OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-write - STATUS mandatory - ::= { ip 2 } - - ipInReceives OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ip 3 } - - ipInHdrErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ip 4 } - - ipInAddrErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ip 5 } - - ipForwDatagrams OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ip 6 } - - ipInUnknownProtos OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ip 7 } - - ipInDiscards OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ip 8 } - - ipInDelivers OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ip 9 } - - ipOutRequests OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ip 10 } - - ipOutDiscards OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ip 11 } - - ipOutNoRoutes OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ip 12 } - - ipReasmTimeout OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - ::= { ip 13 } - - ipReasmReqds OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ip 14 } - - ipReasmOKs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ip 15 } - - ipReasmFails OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ip 16 } - - ipFragOKs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ip 17 } - - ipFragFails OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ip 18 } - - ipFragCreates OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { ip 19 } - - -- the IP Interface table - - ipAddrTable OBJECT-TYPE - SYNTAX SEQUENCE OF IpAddrEntry - ACCESS read-only - STATUS mandatory - ::= { ip 20 } - - ipAddrEntry OBJECT-TYPE - SYNTAX IpAddrEntry - ACCESS read-only - STATUS mandatory - ::= { ipAddrTable 1 } - - IpAddrEntry ::= SEQUENCE { - ipAdEntAddr - IpAddress, - ipAdEntIfIndex - INTEGER, - ipAdEntNetMask - IpAddress, - ipAdEntBcastAddr - INTEGER - } - - ipAdEntAddr OBJECT-TYPE - SYNTAX IpAddress - ACCESS read-only - STATUS mandatory - ::= { ipAddrEntry 1 } - - ipAdEntIfIndex OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - ::= { ipAddrEntry 2 } - - ipAdEntNetMask OBJECT-TYPE - SYNTAX IpAddress - ACCESS read-only - STATUS mandatory - ::= { ipAddrEntry 3 } - - ipAdEntBcastAddr OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - ::= { ipAddrEntry 4 } - - -- the IP Routing table - - ipRoutingTable OBJECT-TYPE - SYNTAX SEQUENCE OF IpRouteEntry - ACCESS read-write - STATUS mandatory - ::= { ip 21 } - - ipRouteEntry OBJECT-TYPE - SYNTAX IpRouteEntry - ACCESS read-write - STATUS mandatory - ::= { ipRoutingTable 1 } - - IpRouteEntry ::= SEQUENCE { - ipRouteDest - IpAddress, - ipRouteIfIndex - INTEGER, - ipRouteMetric1 - INTEGER, - ipRouteMetric2 - INTEGER, - ipRouteMetric3 - INTEGER, - ipRouteMetric4 - INTEGER, - ipRouteNextHop - IpAddress, - ipRouteType - INTEGER, - ipRouteProto - INTEGER, - ipRouteAge - INTEGER - } - - ipRouteDest OBJECT-TYPE - SYNTAX IpAddress - ACCESS read-write - STATUS mandatory - ::= { ipRouteEntry 1 } - - ipRouteIfIndex OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-write - STATUS mandatory - ::= { ipRouteEntry 2 } - - ipRouteMetric1 OBJECT-TYPE - - SYNTAX INTEGER - ACCESS read-write - STATUS mandatory - ::= { ipRouteEntry 3 } - - ipRouteMetric2 OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-write - STATUS mandatory - ::= { ipRouteEntry 4 } - - ipRouteMetric3 OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-write - STATUS mandatory - ::= { ipRouteEntry 5 } - - ipRouteMetric4 OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-write - STATUS mandatory - ::= { ipRouteEntry 6 } - - ipRouteNextHop OBJECT-TYPE - SYNTAX IpAddress - ACCESS read-write - STATUS mandatory - ::= { ipRouteEntry 7 } - - ipRouteType OBJECT-TYPE - SYNTAX INTEGER { - other(1), -- none of the following - - invalid(2), -- an invalidated route - - -- route to directly - direct(3), -- connected (sub-)network - - -- route to a non-local - remote(4), -- host/network/sub-network - } - ACCESS read-write - STATUS mandatory - ::= { ipRouteEntry 8 } - - ipRouteProto OBJECT-TYPE - SYNTAX INTEGER { - other(1), -- none of the following - - -- non-protocol information - -- e.g., manually - local(2), -- configured entries - - -- set via a network - netmgmt(3), -- management protocol - - -- obtained via ICMP, - icmp(4), -- e.g., Redirect - - -- the following are - -- gateway routing protocols - egp(5), - ggp(6), - hello(7), - rip(8), - is-is(9), - es-is(10), - ciscoIgrp(11), - bbnSpfIgp(12), - oigp(13) - } - ACCESS read-only - STATUS mandatory - ::= { ipRouteEntry 9 } - - ipRouteAge OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-write - STATUS mandatory - ::= { ipRouteEntry 10 } - - - - -- the IP Address Translation table - - -- The IP address translation table contain the IpAddress to - -- `physical' address equivalences. Some interfaces do not - -- use translation tables for determining address - -- equivalences (e.g., DDN-X.25 has an algorithmic method); - -- if all interfaces are of this type, then the Address - -- Translation table is empty, i.e., has zero entries. - - ipNetToMediaTable OBJECT-TYPE - SYNTAX SEQUENCE OF IpNetToMediaEntry - ACCESS not-accessible - STATUS mandatory - - - DESCRIPTION - "The IP Address Translation table used for mapping - from IP addresses to physical addresses." - ::= { ip 22 } - - ipNetToMediaEntry OBJECT-TYPE - SYNTAX IpNetToMediaEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "Each entry contains one IpAddress to `physical' - address equivalence." - INDEX { ipNetToMediaIfIndex, - ipNetToMediaNetAddress } - ::= { ipNetToMediaTable 1 } - - IpNetToMediaEntry ::= - SEQUENCE { - ipNetToMediaIfIndex - INTEGER, - ipNetToMediaPhysAddress - PhysAddress, - ipNetToMediaNetAddress - IpAddress, - ipNetToMediaType - INTEGER - } - - ipNetToMediaIfIndex OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The interface on which this entry's equivalence - is effective. The interface identified by a - particular value of this index is the same - interface as identified by the same value of - ifIndex." - ::= { ipNetToMediaEntry 1 } - - ipNetToMediaPhysAddress OBJECT-TYPE - SYNTAX PhysAddress - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The media-dependent `physical' address." - ::= { ipNetToMediaEntry 2 } - - - ipNetToMediaNetAddress OBJECT-TYPE - SYNTAX IpAddress - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The IpAddress corresponding to the media- - dependent `physical' address." - ::= { ipNetToMediaEntry 3 } - - ipNetToMediaType OBJECT-TYPE - SYNTAX INTEGER { - other(1), -- none of the following - invalid(2), -- an invalidated mapping - dynamic(3), - static(4) - } - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The type of mapping. - - Setting this object to the value invalid(2) has - the effect of invalidating the corresponding entry - in the ipNetToMediaTable. That is, it effectively - dissasociates the interface identified with said - entry from the mapping identified with said entry. - It is an implementation-specific matter as to - whether the agent removes an invalidated entry - from the table. Accordingly, management stations - must be prepared to receive tabular information - from agents that corresponds to entries not - currently in use. Proper interpretation of such - entries requires examination of the relevant - ipNetToMediaType object." - ::= { ipNetToMediaEntry 4 } - - - - - -- the ICMP group - - icmpInMsgs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 1 } - - icmpInErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 2 } - - icmpInDestUnreachs OBJECT-TYPE - SYNTAX Counter - - ACCESS read-only - STATUS mandatory - ::= { icmp 3 } - - icmpInTimeExcds OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 4 } - - icmpInParmProbs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 5 } - - icmpInSrcQuenchs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 6 } - - icmpInRedirects OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 7 } - - icmpInEchos OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 8 } - - icmpInEchoReps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 9 } - - icmpInTimestamps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 10 } - - icmpInTimestampReps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 11 } - - icmpInAddrMasks OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 12 } - - icmpInAddrMaskReps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 13 } - - icmpOutMsgs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 14 } - - icmpOutErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 15 } - - icmpOutDestUnreachs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 16 } - - icmpOutTimeExcds OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 17 } - - icmpOutParmProbs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 18 } - - icmpOutSrcQuenchs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 19 } - - icmpOutRedirects OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 20 } - - icmpOutEchos OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 21 } - - icmpOutEchoReps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 22 } - - icmpOutTimestamps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 23 } - - icmpOutTimestampReps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 24 } - - icmpOutAddrMasks OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 25 } - - icmpOutAddrMaskReps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { icmp 26 } - - -- the TCP group - - tcpRtoAlgorithm OBJECT-TYPE - SYNTAX INTEGER { - other(1), -- none of the following - constant(2), -- a constant rto - rsre(3), -- MIL-STD-1778, Appendix B - vanj(4) -- Van Jacobson's algorithm [11] - } - ACCESS read-only - STATUS mandatory - ::= { tcp 1 } - - tcpRtoMin OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - ::= { tcp 2 } - - tcpRtoMax OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - ::= { tcp 3 } - - tcpMaxConn OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - ::= { tcp 4 } - - tcpActiveOpens OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { tcp 5 } - - tcpPassiveOpens OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { tcp 6 } - - tcpAttemptFails OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { tcp 7 } - - tcpEstabResets OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { tcp 8 } - - tcpCurrEstab OBJECT-TYPE - SYNTAX Gauge - ACCESS read-only - STATUS mandatory - ::= { tcp 9 } - - tcpInSegs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { tcp 10 } - - tcpOutSegs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { tcp 11 } - - tcpRetransSegs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { tcp 12 } - - -- the TCP connections table - - tcpConnTable OBJECT-TYPE - SYNTAX SEQUENCE OF TcpConnEntry - ACCESS read-only - STATUS mandatory - ::= { tcp 13 } - - tcpConnEntry OBJECT-TYPE - SYNTAX TcpConnEntry - ACCESS read-only - STATUS mandatory - ::= { tcpConnTable 1 } - - TcpConnEntry ::= SEQUENCE { - tcpConnState - INTEGER, - tcpConnLocalAddress - IpAddress, - tcpConnLocalPort - INTEGER (0..65535), - tcpConnRemAddress - IpAddress, - tcpConnRemPort - INTEGER (0..65535) - } - - tcpConnState OBJECT-TYPE - SYNTAX INTEGER { - closed(1), - listen(2), - synSent(3), - synReceived(4), - established(5), - finWait1(6), - finWait2(7), - closeWait(8), - lastAck(9), - closing(10), - timeWait(11) - } - ACCESS read-only - STATUS mandatory - ::= { tcpConnEntry 1 } - - tcpConnLocalAddress OBJECT-TYPE - SYNTAX IpAddress - ACCESS read-only - STATUS mandatory - ::= { tcpConnEntry 2 } - - tcpConnLocalPort OBJECT-TYPE - SYNTAX INTEGER (0..65535) - ACCESS read-only - STATUS mandatory - ::= { tcpConnEntry 3 } - - tcpConnRemAddress OBJECT-TYPE - SYNTAX IpAddress - ACCESS read-only - STATUS mandatory - ::= { tcpConnEntry 4 } - - tcpConnRemPort OBJECT-TYPE - SYNTAX INTEGER (0..65535) - ACCESS read-only - STATUS mandatory - ::= { tcpConnEntry 5 } - - -- the UDP group - - udpInDatagrams OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { udp 1 } - - udpNoPorts OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { udp 2 } - - udpInErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { udp 3 } - - udpOutDatagrams OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { udp 4 } - - -- the EGP group - - egpInMsgs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { egp 1 } - - egpInErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { egp 2 } - - egpOutMsgs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { egp 3 } - - egpOutErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - ::= { egp 4 } - - -- the EGP Neighbor table - - egpNeighTable OBJECT-TYPE - SYNTAX SEQUENCE OF EgpNeighEntry - ACCESS read-only - STATUS mandatory - ::= { egp 5 } - - egpNeighEntry OBJECT-TYPE - SYNTAX EgpNeighEntry - ACCESS read-only - STATUS mandatory - ::= { egpNeighTable 1 } - - EgpNeighEntry ::= SEQUENCE { - egpNeighState - INTEGER, - egpNeighAddr - IpAddress - } - - egpNeighState OBJECT-TYPE - SYNTAX INTEGER { - idle(1), - acquisition(2), - down(3), - up(4), - cease(5) - } - ACCESS read-only - STATUS mandatory - ::= { egpNeighEntry 1 } - - egpNeighAddr OBJECT-TYPE - SYNTAX IpAddress - ACCESS read-only - STATUS mandatory - ::= { egpNeighEntry 2 } - - - - -- the SNMP group - - -- Implementation of the SNMP group is mandatory for all - -- systems which support an SNMP protocol entity. Some of - -- the objects defined below will be zero-valued in those - -- SNMP implementations that are optimized to support only - -- those functions specific to either a management agent or - -- a management station. In particular, it should be - -- observed that the objects below refer to an SNMP entity, - -- and there may be several SNMP entities residing on a - -- managed node (e.g., if the node is hosting acting as - -- a management station). - - snmpInPkts OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of Messages delivered to the - SNMP entity from the transport service." - ::= { snmp 1 } - - snmpOutPkts OBJECT-TYPE - SYNTAX Counter - - - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Messages which were - passed from the SNMP protocol entity to the - transport service." - ::= { snmp 2 } - - snmpInBadVersions OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Messages which were - delivered to the SNMP protocol entity and were for - an unsupported SNMP version." - ::= { snmp 3 } - - snmpInBadCommunityNames OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Messages delivered to - the SNMP protocol entity which used a SNMP - community name not known to said entity." - ::= { snmp 4 } - - snmpInBadCommunityUses OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Messages delivered to - the SNMP protocol entity which represented an SNMP - operation which was not allowed by the SNMP - community named in the Message." - ::= { snmp 5 } - - snmpInASNParseErrs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of ASN.1 or BER errors - encountered by the SNMP protocol entity when - decoding received SNMP Messages." - ::= { snmp 6 } - - - -- { snmp 7 } is not used - - snmpInTooBigs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP PDUs which were - delivered to the SNMP protocol entity and for - which the value of the error-status field is - `tooBig'." - ::= { snmp 8 } - - snmpInNoSuchNames OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP PDUs which were - delivered to the SNMP protocol entity and for - which the value of the error-status field is - `noSuchName'." - ::= { snmp 9 } - - snmpInBadValues OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP PDUs which were - delivered to the SNMP protocol entity and for - which the value of the error-status field is - `badValue'." - ::= { snmp 10 } - - snmpInReadOnlys OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number valid SNMP PDUs which were - delivered to the SNMP protocol entity and for - which the value of the error-status field is - `readOnly'. It should be noted that it is a - protocol error to generate an SNMP PDU which - contains the value `readOnly' in the error-status - field, as such this object is provided as a means - of detecting incorrect implementations of the - - - SNMP." - ::= { snmp 11 } - - snmpInGenErrs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP PDUs which were - delivered to the SNMP protocol entity and for - which the value of the error-status field is - `genErr'." - ::= { snmp 12 } - - snmpInTotalReqVars OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of MIB objects which have been - retrieved successfully by the SNMP protocol entity - as the result of receiving valid SNMP Get-Request - and Get-Next PDUs." - ::= { snmp 13 } - - snmpInTotalSetVars OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of MIB objects which have been - altered successfully by the SNMP protocol entity - as the result of receiving valid SNMP Set-Request - PDUs." - ::= { snmp 14 } - - snmpInGetRequests OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Get-Request PDUs which - have been accepted and processed by the SNMP - protocol entity." - ::= { snmp 15 } - - snmpInGetNexts OBJECT-TYPE - SYNTAX Counter - - - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Get-Next PDUs which have - been accepted and processed by the SNMP protocol - entity." - ::= { snmp 16 } - - snmpInSetRequests OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Set-Request PDUs which - have been accepted and processed by the SNMP - protocol entity." - ::= { snmp 17 } - - snmpInGetResponses OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Get-Response PDUs which - have been accepted and processed by the SNMP - protocol entity." - ::= { snmp 18 } - - snmpInTraps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Trap PDUs which have - been accepted and processed by the SNMP protocol - entity." - ::= { snmp 19 } - - snmpOutTooBigs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP PDUs which were - generated by the SNMP protocol entity and for - which the value of the error-status field is - `tooBig.'" - ::= { snmp 20 } - - - snmpOutNoSuchNames OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP PDUs which were - generated by the SNMP protocol entity and for - which the value of the error-status is - `noSuchName'." - ::= { snmp 21 } - - snmpOutBadValues OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP PDUs which were - generated by the SNMP protocol entity and for - which the value of the error-status field is - `badValue'." - ::= { snmp 22 } - - -- { snmp 23 } is not used - - snmpOutGenErrs OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP PDUs which were - generated by the SNMP protocol entity and for - which the value of the error-status field is - `genErr'." - ::= { snmp 24 } - - snmpOutGetRequests OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Get-Request PDUs which - have been generated by the SNMP protocol entity." - ::= { snmp 25 } - - snmpOutGetNexts OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - - - DESCRIPTION - "The total number of SNMP Get-Next PDUs which have - been generated by the SNMP protocol entity." - ::= { snmp 26 } - - snmpOutSetRequests OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Set-Request PDUs which - have been generated by the SNMP protocol entity." - ::= { snmp 27 } - - snmpOutGetResponses OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Get-Response PDUs which - have been generated by the SNMP protocol entity." - ::= { snmp 28 } - - snmpOutTraps OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total number of SNMP Trap PDUs which have - been generated by the SNMP protocol entity." - ::= { snmp 29 } - - snmpEnableAuthenTraps OBJECT-TYPE - SYNTAX INTEGER { enabled(1), disabled(2) } - ACCESS read-write - STATUS mandatory - DESCRIPTION - "Indicates whether the SNMP agent process is - permitted to generate authentication-failure - traps. The value of this object overrides any - configuration information; as such, it provides a - means whereby all authentication-failure traps may - be disabled. - - Note that it is strongly recommended that this - object be stored in non-volatile memory so that it - remains constant between re-initializations of the - network management system." - - - ::= { snmp 30 } - - - - usecMIB OBJECT IDENTIFIER ::= { snmpModules 6 } - usecMIBObjects OBJECT IDENTIFIER ::= { usecMIB 1 } - usecAgent OBJECT IDENTIFIER ::= { usecMIBObjects 1 } - - agentID OBJECT-TYPE - SYNTAX OCTET STRING - ACCESS read-only - STATUS current - ::= { usecAgent 1 } - agentBoots OBJECT-TYPE - SYNTAX Gauge - ACCESS read-only - STATUS current - ::= { usecAgent 2 } - - agentTime OBJECT-TYPE - SYNTAX Gauge - UNITS "seconds" - ACCESS read-only - STATUS current - ::= { usecAgent 3 } - - agentSize OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS current - ::= { usecAgent 4 } - - usecStats OBJECT IDENTIFIER ::= { usecMIBObjects 2 } - - usecStatsUnsupportedQoS OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS current - ::= { usecStats 1 } - - usecStatsNotInWindows OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS current - ::= { usecStats 2 } - - usecStatsUnknownUserNames OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS current - ::= { usecStats 3 } - usecStatsWrongDigestValues OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS current - ::= { usecStats 4 } - - usecStatsUnknownContextSelectors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS current - ::= { usecStats 5 } - - cmu OBJECT IDENTIFIER ::= { enterprises 3 } - systems OBJECT IDENTIFIER ::= { cmu 1 } - mibs OBJECT IDENTIFIER ::= { cmu 2 } - cmuSNMP OBJECT IDENTIFIER ::= { systems 1 } - cmuKip OBJECT IDENTIFIER ::= { systems 2 } - cmuRouter OBJECT IDENTIFIER ::= { systems 3 } - - - -HOST-RESOURCES-MIB DEFINITIONS ::= BEGIN - - IMPORTS - OBJECT-TYPE FROM RFC-1212 - DisplayString FROM RFC1213-MIB - TimeTicks, - Counter, Gauge FROM RFC1155-SMI; - - host OBJECT IDENTIFIER ::= { mib-2 25 } - - hrSystem OBJECT IDENTIFIER ::= { host 1 } - hrStorage OBJECT IDENTIFIER ::= { host 2 } - hrDevice OBJECT IDENTIFIER ::= { host 3 } - hrSWRun OBJECT IDENTIFIER ::= { host 4 } - hrSWRunPerf OBJECT IDENTIFIER ::= { host 5 } - hrSWInstalled OBJECT IDENTIFIER ::= { host 6 } - - -- textual conventions - - -- a truth value - Boolean ::= INTEGER { true(1), false(2) } - - -- memory size, expressed in units of 1024bytes - KBytes ::= INTEGER (0..2147483647) - - -- This textual convention is intended to identify the manufacturer, - -- model, and version of a specific hardware or software product. - -- It is suggested that these OBJECT IDENTIFIERs are allocated such - -- that all products from a particular manufacturer are registered - -- under a subtree distinct to that manufacturer. In addition, all - - - -- versions of a product should be registered under a subtree - -- distinct to that product. With this strategy, a management - -- station may uniquely determine the manufacturer and/or model of a - -- product whose productID is unknown to the management station. - -- Objects of this type may be useful for inventory purposes or for - -- automatically detecting incompatibilities or version mismatches - -- between various hardware and software components on a system. - ProductID ::= OBJECT IDENTIFIER - -- unknownProduct will be used for any unknown ProductID - -- unknownProduct OBJECT IDENTIFIER ::= { 0 0 } - - -- For example, the product ID for the ACME 4860 66MHz clock doubled - -- processor might be: - -- enterprises.acme.acmeProcessors.a4860DX2.MHz66 - -- A software product might be registered as: - -- enterprises.acme.acmeOperatingSystems.acmeDOS.six(6).one(1) - - DateAndTime ::= OCTET STRING (SIZE (8 | 11)) - -- A date-time specification for the local time of day. - -- This data type is intended to provide a consistent - -- method of reporting date information. - -- - -- field octets contents range - -- _____ ______ ________ _____ - -- 1 1-2 year 0..65536 - -- (in network byte order) - -- 2 3 month 1..12 - -- 3 4 day 1..31 - -- 4 5 hour 0..23 - -- 5 6 minutes 0..59 - -- 6 7 seconds 0..60 - -- (use 60 for leap-second) - -- 7 8 deci-seconds 0..9 - -- 8 9 direction from UTC "+" / "-" - -- (in ascii notation) - -- 9 10 hours from UTC 0..11 - -- 10 11 minutes from UTC 0..59 - -- - -- Note that if only local time is known, then - -- timezone information (fields 8-10) is not present. - - InternationalDisplayString ::= OCTET STRING - -- This data type is used to model textual information in some - -- character set. A network management station should use a local - -- algorithm to determine which character set is in use and how it - -- should be displayed. Note that this character set may be encoded - -- with more than one octet per symbol, but will most often be NVT - - - -- ASCII. - - -- The Host Resources System Group - -- - -- Implementation of this group is mandatory for all host systems. - hrSystemUptime OBJECT-TYPE - SYNTAX TimeTicks - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The amount of time since this host was last - initialized. Note that this is different from - sysUpTime in MIB-II [3] because sysUpTime is the - uptime of the network management portion of the - system." - ::= { hrSystem 1 } - - hrSystemDate OBJECT-TYPE - SYNTAX DateAndTime - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The host's notion of the local date and time of - day." - ::= { hrSystem 2 } - - hrSystemInitialLoadDevice OBJECT-TYPE - SYNTAX INTEGER (1..2147483647) - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The index of the hrDeviceEntry for the device from - which this host is configured to load its initial - operating system configuration." - ::= { hrSystem 3 } - - hrSystemInitialLoadParameters OBJECT-TYPE - SYNTAX InternationalDisplayString (SIZE (0..128)) - ACCESS read-write - STATUS mandatory - DESCRIPTION - "This object contains the parameters (e.g. a - pathname and parameter) supplied to the load device - when requesting the initial operating system - configuration from that device." - ::= { hrSystem 4 } - - - hrSystemNumUsers OBJECT-TYPE - SYNTAX Gauge - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of user sessions for which this host is - storing state information. A session is a - collection of processes requiring a single act of - user authentication and possibly subject to - collective job control." - ::= { hrSystem 5 } - - hrSystemProcesses OBJECT-TYPE - SYNTAX Gauge - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of process contexts currently loaded or - running on this system." - ::= { hrSystem 6 } - - hrSystemMaxProcesses OBJECT-TYPE - SYNTAX INTEGER (0..2147483647) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The maximum number of process contexts this system - can support. If there is no fixed maximum, the - value should be zero. On systems that have a fixed - maximum, this object can help diagnose failures - that occur when this maximum is reached." - ::= { hrSystem 7 } - - -- The Host Resources Storage Group - -- - -- Implementation of this group is mandatory for all host systems. - - -- Registration for some storage types, for use with hrStorageType - hrStorageTypes OBJECT IDENTIFIER ::= { hrStorage 1 } - hrStorageOther OBJECT IDENTIFIER ::= { hrStorageTypes 1 } - hrStorageRam OBJECT IDENTIFIER ::= { hrStorageTypes 2 } - -- hrStorageVirtualMemory is temporary storage of swapped - -- or paged memory - hrStorageVirtualMemory OBJECT IDENTIFIER ::= { hrStorageTypes 3 } - hrStorageFixedDisk OBJECT IDENTIFIER ::= { hrStorageTypes 4 } - hrStorageRemovableDisk OBJECT IDENTIFIER ::= { hrStorageTypes 5 } - hrStorageFloppyDisk OBJECT IDENTIFIER ::= { hrStorageTypes 6 } - - - hrStorageCompactDisc OBJECT IDENTIFIER ::= { hrStorageTypes 7 } - hrStorageRamDisk OBJECT IDENTIFIER ::= { hrStorageTypes 8 } - - hrMemorySize OBJECT-TYPE - SYNTAX KBytes - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The amount of physical main memory contained by - the host." - ::= { hrStorage 2 } - - hrStorageTable OBJECT-TYPE - SYNTAX SEQUENCE OF HrStorageEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "The (conceptual) table of logical storage areas on - the host. - - An entry shall be placed in the storage table for - each logical area of storage that is allocated and - has fixed resource limits. The amount of storage - represented in an entity is the amount actually - usable by the requesting entity, and excludes loss - due to formatting or file system reference - information. - - These entries are associated with logical storage - areas, as might be seen by an application, rather - than physical storage entities which are typically - seen by an operating system. Storage such as tapes - and floppies without file systems on them are - typically not allocated in chunks by the operating - system to requesting applications, and therefore - shouldn't appear in this table. Examples of valid - storage for this table include disk partitions, - file systems, ram (for some architectures this is - further segmented into regular memory, extended - memory, and so on), backing store for virtual - memory (`swap space'). - - This table is intended to be a useful diagnostic - for `out of memory' and `out of buffers' types of - failures. In addition, it can be a useful - performance monitoring tool for tracking memory, - disk, or buffer usage." - - - ::= { hrStorage 3 } - - hrStorageEntry OBJECT-TYPE - SYNTAX HrStorageEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "A (conceptual) entry for one logical storage area - on the host. As an example, an instance of the - hrStorageType object might be named - hrStorageType.3" - INDEX { hrStorageIndex } - ::= { hrStorageTable 1 } - - HrStorageEntry ::= SEQUENCE { - hrStorageIndex INTEGER, - hrStorageType OBJECT IDENTIFIER, - hrStorageDescr DisplayString, - hrStorageAllocationUnits INTEGER, - hrStorageSize INTEGER, - hrStorageUsed INTEGER, - hrStorageAllocationFailures Counter - } - - hrStorageIndex OBJECT-TYPE - SYNTAX INTEGER (1..2147483647) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A unique value for each logical storage area - contained by the host." - ::= { hrStorageEntry 1 } - - hrStorageType OBJECT-TYPE - SYNTAX OBJECT IDENTIFIER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The type of storage represented by this entry." - ::= { hrStorageEntry 2 } - - hrStorageDescr OBJECT-TYPE - SYNTAX DisplayString - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A description of the type and instance of the - storage described by this entry." - - - ::= { hrStorageEntry 3 } - - hrStorageAllocationUnits OBJECT-TYPE - SYNTAX INTEGER (1..2147483647) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The size, in bytes, of the data objects allocated - from this pool. If this entry is monitoring - sectors, blocks, buffers, or packets, for example, - this number will commonly be greater than one. - Otherwise this number will typically be one." - ::= { hrStorageEntry 4 } - - hrStorageSize OBJECT-TYPE - SYNTAX INTEGER (0..2147483647) - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The size of the storage represented by this entry, - in units of hrStorageAllocationUnits." - ::= { hrStorageEntry 5 } - - hrStorageUsed OBJECT-TYPE - SYNTAX INTEGER (0..2147483647) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The amount of the storage represented by this - entry that is allocated, in units of - hrStorageAllocationUnits." - ::= { hrStorageEntry 6 } - - hrStorageAllocationFailures OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of requests for storage represented by - this entry that could not be honored due to not - enough storage. It should be noted that as this - object has a SYNTAX of Counter, that it does not - have a defined initial value. However, it is - recommended that this object be initialized to - zero." - ::= { hrStorageEntry 7 } - - - -- The Host Resources Device Group - -- - -- Implementation of this group is mandatory for all host systems. - -- - -- The device group is useful for identifying and diagnosing the - -- devices on a system. The hrDeviceTable contains common - -- information for any type of device. In addition, some devices - -- have device-specific tables for more detailed information. More - -- such tables may be defined in the future for other device types. - - -- Registration for some device types, for use with hrDeviceType - hrDeviceTypes OBJECT IDENTIFIER ::= { hrDevice 1 } - - hrDeviceOther OBJECT IDENTIFIER ::= { hrDeviceTypes 1 } - hrDeviceUnknown OBJECT IDENTIFIER ::= { hrDeviceTypes 2 } - hrDeviceProcessor OBJECT IDENTIFIER ::= { hrDeviceTypes 3 } - hrDeviceNetwork OBJECT IDENTIFIER ::= { hrDeviceTypes 4 } - hrDevicePrinter OBJECT IDENTIFIER ::= { hrDeviceTypes 5 } - hrDeviceDiskStorage OBJECT IDENTIFIER ::= { hrDeviceTypes 6 } - hrDeviceVideo OBJECT IDENTIFIER ::= { hrDeviceTypes 10 } - hrDeviceAudio OBJECT IDENTIFIER ::= { hrDeviceTypes 11 } - hrDeviceCoprocessor OBJECT IDENTIFIER ::= { hrDeviceTypes 12 } - hrDeviceKeyboard OBJECT IDENTIFIER ::= { hrDeviceTypes 13 } - hrDeviceModem OBJECT IDENTIFIER ::= { hrDeviceTypes 14 } - hrDeviceParallelPort OBJECT IDENTIFIER ::= { hrDeviceTypes 15 } - hrDevicePointing OBJECT IDENTIFIER ::= { hrDeviceTypes 16 } - hrDeviceSerialPort OBJECT IDENTIFIER ::= { hrDeviceTypes 17 } - hrDeviceTape OBJECT IDENTIFIER ::= { hrDeviceTypes 18 } - hrDeviceClock OBJECT IDENTIFIER ::= { hrDeviceTypes 19 } - hrDeviceVolatileMemory OBJECT IDENTIFIER ::= { hrDeviceTypes 20 } - hrDeviceNonVolatileMemory OBJECT IDENTIFIER ::= { hrDeviceTypes 21 } - - hrDeviceTable OBJECT-TYPE - SYNTAX SEQUENCE OF HrDeviceEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "The (conceptual) table of devices contained by the - host." - ::= { hrDevice 2 } - - hrDeviceEntry OBJECT-TYPE - SYNTAX HrDeviceEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "A (conceptual) entry for one device contained by - - - the host. As an example, an instance of the - hrDeviceType object might be named hrDeviceType.3" - INDEX { hrDeviceIndex } - ::= { hrDeviceTable 1 } - - HrDeviceEntry ::= SEQUENCE { - hrDeviceIndex INTEGER, - hrDeviceType OBJECT IDENTIFIER, - hrDeviceDescr DisplayString, - hrDeviceID ProductID, - hrDeviceStatus INTEGER, - hrDeviceErrors Counter - } - - hrDeviceIndex OBJECT-TYPE - SYNTAX INTEGER (1..2147483647) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A unique value for each device contained by the - host. The value for each device must remain - constant at least from one re-initialization of the - agent to the next re-initialization." - ::= { hrDeviceEntry 1 } - - hrDeviceType OBJECT-TYPE - SYNTAX OBJECT IDENTIFIER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "An indication of the type of device. - - If this value is `hrDeviceProcessor { hrDeviceTypes - 3 }' then an entry exists in the hrProcessorTable - which corresponds to this device. - - If this value is `hrDeviceNetwork { hrDeviceTypes 4 - }', then an entry exists in the hrNetworkTable - which corresponds to this device. - - If this value is `hrDevicePrinter { hrDeviceTypes 5 - }', then an entry exists in the hrPrinterTable - which corresponds to this device. - - If this value is `hrDeviceDiskStorage { - hrDeviceTypes 6 }', then an entry exists in the - hrDiskStorageTable which corresponds to this - device." - - - ::= { hrDeviceEntry 2 } - - hrDeviceDescr OBJECT-TYPE - SYNTAX DisplayString - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A textual description of this device, including - the device's manufacturer and revision, and - optionally, its serial number." - ::= { hrDeviceEntry 3 } - - hrDeviceID OBJECT-TYPE - SYNTAX ProductID - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The product ID for this device." - ::= { hrDeviceEntry 4 } - - hrDeviceStatus OBJECT-TYPE - SYNTAX INTEGER { - unknown(1), - running(2), - warning(3), - testing(4), - down(5) - } - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The current operational state of the device - described by this row of the table. A value - unknown(1) indicates that the current state of the - device is unknown. running(2) indicates that the - device is up and running and that no unusual error - conditions are known. The warning(3) state - indicates that agent has been informed of an - unusual error condition by the operational software - (e.g., a disk device driver) but that the device is - still 'operational'. An example would be high - number of soft errors on a disk. A value of - testing(4), indicates that the device is not - available for use because it is in the testing - state. The state of down(5) is used only when the - agent has been informed that the device is not - available for any use." - ::= { hrDeviceEntry 5 } - - - hrDeviceErrors OBJECT-TYPE - SYNTAX Counter - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of errors detected on this device. It - should be noted that as this object has a SYNTAX - of Counter, that it does not have a defined - initial value. However, it is recommended that - this object be initialized to zero." - ::= { hrDeviceEntry 6 } - - hrProcessorTable OBJECT-TYPE - SYNTAX SEQUENCE OF HrProcessorEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "The (conceptual) table of processors contained by - the host. - - Note that this table is potentially sparse: a - (conceptual) entry exists only if the correspondent - value of the hrDeviceType object is - `hrDeviceProcessor'." - ::= { hrDevice 3 } - - hrProcessorEntry OBJECT-TYPE - SYNTAX HrProcessorEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "A (conceptual) entry for one processor contained - by the host. The hrDeviceIndex in the index - represents the entry in the hrDeviceTable that - corresponds to the hrProcessorEntry. - - As an example of how objects in this table are - named, an instance of the hrProcessorFrwID object - might be named hrProcessorFrwID.3" - INDEX { hrDeviceIndex } - ::= { hrProcessorTable 1 } - - HrProcessorEntry ::= SEQUENCE { - hrProcessorFrwID ProductID, - hrProcessorLoad INTEGER - } - - hrProcessorFrwID OBJECT-TYPE - - - SYNTAX ProductID - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The product ID of the firmware associated with the - processor." - ::= { hrProcessorEntry 1 } - - hrProcessorLoad OBJECT-TYPE - SYNTAX INTEGER (0..100) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The average, over the last minute, of the - percentage of time that this processor was not - idle." - ::= { hrProcessorEntry 2 } - - hrNetworkTable OBJECT-TYPE - SYNTAX SEQUENCE OF HrNetworkEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "The (conceptual) table of network devices - contained by the host. - - Note that this table is potentially sparse: a - (conceptual) entry exists only if the correspondent - value of the hrDeviceType object is - `hrDeviceNetwork'." - ::= { hrDevice 4 } - - hrNetworkEntry OBJECT-TYPE - SYNTAX HrNetworkEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "A (conceptual) entry for one network device - contained by the host. The hrDeviceIndex in the - index represents the entry in the hrDeviceTable - that corresponds to the hrNetworkEntry. - - As an example of how objects in this table are - named, an instance of the hrNetworkIfIndex object - might be named hrNetworkIfIndex.3" - INDEX { hrDeviceIndex } - ::= { hrNetworkTable 1 } - - - HrNetworkEntry ::= SEQUENCE { - hrNetworkIfIndex INTEGER - } - - hrNetworkIfIndex OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The value of ifIndex which corresponds to this - network device." - ::= { hrNetworkEntry 1 } - - hrPrinterTable OBJECT-TYPE - SYNTAX SEQUENCE OF HrPrinterEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "The (conceptual) table of printers local to the - host. - - Note that this table is potentially sparse: a - (conceptual) entry exists only if the correspondent - value of the hrDeviceType object is - `hrDevicePrinter'." - ::= { hrDevice 5 } - - hrPrinterEntry OBJECT-TYPE - SYNTAX HrPrinterEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "A (conceptual) entry for one printer local to the - host. The hrDeviceIndex in the index represents - the entry in the hrDeviceTable that corresponds to - the hrPrinterEntry. - - As an example of how objects in this table are - named, an instance of the hrPrinterStatus object - might be named hrPrinterStatus.3" - INDEX { hrDeviceIndex } - ::= { hrPrinterTable 1 } - - HrPrinterEntry ::= SEQUENCE { - hrPrinterStatus INTEGER, - hrPrinterDetectedErrorState OCTET STRING - } - - - hrPrinterStatus OBJECT-TYPE - SYNTAX INTEGER { - other(1), - unknown(2), - idle(3), - printing(4), - warmup(5) - } - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The current status of this printer device. When - in the idle(1), printing(2), or warmup(3) state, - the corresponding hrDeviceStatus should be - running(2) or warning(3). When in the unknown - state, the corresponding hrDeviceStatus should be - unknown(1)." - ::= { hrPrinterEntry 1 } - - hrPrinterDetectedErrorState OBJECT-TYPE - SYNTAX OCTET STRING - ACCESS read-only - STATUS mandatory - DESCRIPTION - "This object represents any error conditions - detected by the printer. The error conditions are - encoded as bits in an octet string, with the - following definitions: - - Condition Bit # hrDeviceStatus - - lowPaper 0 warning(3) - noPaper 1 down(5) - lowToner 2 warning(3) - noToner 3 down(5) - doorOpen 4 down(5) - jammed 5 down(5) - offline 6 down(5) - serviceRequested 7 warning(3) - - If multiple conditions are currently detected and - the hrDeviceStatus would not otherwise be - unknown(1) or testing(4), the hrDeviceStatus shall - correspond to the worst state of those indicated, - where down(5) is worse than warning(3) which is - worse than running(2). - - Bits are numbered starting with the most - - - significant bit of the first byte being bit 0, the - least significant bit of the first byte being bit - 7, the most significant bit of the second byte - being bit 8, and so on. A one bit encodes that - the condition was detected, while a zero bit - encodes that the condition was not detected. - - This object is useful for alerting an operator to - specific warning or error conditions that may - occur, especially those requiring human - intervention." - ::= { hrPrinterEntry 2 } - - hrDiskStorageTable OBJECT-TYPE - SYNTAX SEQUENCE OF HrDiskStorageEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "The (conceptual) table of long-term storage - devices contained by the host. In particular, disk - devices accessed remotely over a network are not - included here. - - Note that this table is potentially sparse: a - (conceptual) entry exists only if the correspondent - value of the hrDeviceType object is - `hrDeviceDiskStorage'." - ::= { hrDevice 6 } - - hrDiskStorageEntry OBJECT-TYPE - SYNTAX HrDiskStorageEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "A (conceptual) entry for one long-term storage - device contained by the host. The hrDeviceIndex in - the index represents the entry in the hrDeviceTable - that corresponds to the hrDiskStorageEntry. As an - example, an instance of the hrDiskStorageCapacity - object might be named hrDiskStorageCapacity.3" - INDEX { hrDeviceIndex } - ::= { hrDiskStorageTable 1 } - - HrDiskStorageEntry ::= SEQUENCE { - hrDiskStorageAccess INTEGER, - hrDiskStorageMedia INTEGER, - hrDiskStorageRemoveble Boolean, - hrDiskStorageCapacity KBytes - - - } - - hrDiskStorageAccess OBJECT-TYPE - SYNTAX INTEGER { - readWrite(1), - readOnly(2) - } - ACCESS read-only - STATUS mandatory - DESCRIPTION - "An indication if this long-term storage device is - readable and writable or only readable. This - should reflect the media type, any write-protect - mechanism, and any device configuration that - affects the entire device." - ::= { hrDiskStorageEntry 1 } - - hrDiskStorageMedia OBJECT-TYPE - SYNTAX INTEGER { - other(1), - unknown(2), - hardDisk(3), - floppyDisk(4), - opticalDiskROM(5), - opticalDiskWORM(6), -- Write Once Read Many - opticalDiskRW(7), - ramDisk(8) - } - ACCESS read-only - STATUS mandatory - DESCRIPTION - "An indication of the type of media used in this - long-term storage device." - ::= { hrDiskStorageEntry 2 } - - hrDiskStorageRemoveble OBJECT-TYPE - SYNTAX Boolean - ACCESS read-only - STATUS mandatory - DESCRIPTION - "Denotes whether or not the disk media may be - removed from the drive." - ::= { hrDiskStorageEntry 3 } - - hrDiskStorageCapacity OBJECT-TYPE - SYNTAX KBytes - ACCESS read-only - STATUS mandatory - - - DESCRIPTION - "The total size for this long-term storage device." - ::= { hrDiskStorageEntry 4 } - - hrPartitionTable OBJECT-TYPE - SYNTAX SEQUENCE OF HrPartitionEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "The (conceptual) table of partitions for long-term - storage devices contained by the host. In - particular, partitions accessed remotely over a - network are not included here." - ::= { hrDevice 7 } - - hrPartitionEntry OBJECT-TYPE - SYNTAX HrPartitionEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "A (conceptual) entry for one partition. The - hrDeviceIndex in the index represents the entry in - the hrDeviceTable that corresponds to the - hrPartitionEntry. - - As an example of how objects in this table are - named, an instance of the hrPartitionSize object - might be named hrPartitionSize.3.1" - INDEX { hrDeviceIndex, hrPartitionIndex } - ::= { hrPartitionTable 1 } - - HrPartitionEntry ::= SEQUENCE { - hrPartitionIndex INTEGER, - hrPartitionLabel InternationalDisplayString, - hrPartitionID OCTET STRING, - hrPartitionSize KBytes, - hrPartitionFSIndex INTEGER - } - - hrPartitionIndex OBJECT-TYPE - SYNTAX INTEGER (1..2147483647) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A unique value for each partition on this long- - term storage device. The value for each long-term - storage device must remain constant at least from - one re-initialization of the agent to the next re- - - - initialization." - ::= { hrPartitionEntry 1 } - - hrPartitionLabel OBJECT-TYPE - SYNTAX InternationalDisplayString (SIZE (0..128)) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A textual description of this partition." - ::= { hrPartitionEntry 2 } - - hrPartitionID OBJECT-TYPE - SYNTAX OCTET STRING - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A descriptor which uniquely represents this - partition to the responsible operating system. On - some systems, this might take on a binary - representation." - ::= { hrPartitionEntry 3 } - - hrPartitionSize OBJECT-TYPE - SYNTAX KBytes - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The size of this partition." - ::= { hrPartitionEntry 4 } - - hrPartitionFSIndex OBJECT-TYPE - SYNTAX INTEGER (0..2147483647) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The index of the file system mounted on this - partition. If no file system is mounted on this - partition, then this value shall be zero. Note - that multiple partitions may point to one file - system, denoting that that file system resides on - those partitions. Multiple file systems may not - reside on one partition." - ::= { hrPartitionEntry 5 } - - -- The File System Table - hrFSTable OBJECT-TYPE - SYNTAX SEQUENCE OF HrFSEntry - - - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "The (conceptual) table of file systems local to - this host or remotely mounted from a file server. - File systems that are in only one user's - environment on a multi-user system will not be - included in this table." - ::= { hrDevice 8 } - - hrFSEntry OBJECT-TYPE - SYNTAX HrFSEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "A (conceptual) entry for one file system local to - this host or remotely mounted from a file server. - File systems that are in only one user's - environment on a multi-user system will not be - included in this table. - - As an example of how objects in this table are - named, an instance of the hrFSMountPoint object - might be named hrFSMountPoint.3" - INDEX { hrFSIndex } - ::= { hrFSTable 1 } - - -- Registration for some popular File System types, - -- for use with hrFSType. - - hrFSTypes OBJECT IDENTIFIER ::= { hrDevice 9 } - - hrFSOther OBJECT IDENTIFIER ::= { hrFSTypes 1 } - hrFSUnknown OBJECT IDENTIFIER ::= { hrFSTypes 2 } - hrFSBerkeleyFFS OBJECT IDENTIFIER ::= { hrFSTypes 3 } - hrFSSys5FS OBJECT IDENTIFIER ::= { hrFSTypes 4 } - -- DOS - hrFSFat OBJECT IDENTIFIER ::= { hrFSTypes 5 } - -- OS/2 High Performance File System - hrFSHPFS OBJECT IDENTIFIER ::= { hrFSTypes 6 } - -- Macintosh Hierarchical File System - hrFSHFS OBJECT IDENTIFIER ::= { hrFSTypes 7 } - - -- Macintosh File System - hrFSMFS OBJECT IDENTIFIER ::= { hrFSTypes 8 } - -- Windows NT - hrFSNTFS OBJECT IDENTIFIER ::= { hrFSTypes 9 } - - - hrFSVNode OBJECT IDENTIFIER ::= { hrFSTypes 10 } - hrFSJournaled OBJECT IDENTIFIER ::= { hrFSTypes 11 } - -- CD File systems - hrFSiso9660 OBJECT IDENTIFIER ::= { hrFSTypes 12 } - hrFSRockRidge OBJECT IDENTIFIER ::= { hrFSTypes 13 } - - hrFSNFS OBJECT IDENTIFIER ::= { hrFSTypes 14 } - hrFSNetware OBJECT IDENTIFIER ::= { hrFSTypes 15 } - -- Andrew File System - hrFSAFS OBJECT IDENTIFIER ::= { hrFSTypes 16 } - -- OSF DCE Distributed File System - hrFSDFS OBJECT IDENTIFIER ::= { hrFSTypes 17 } - hrFSAppleshare OBJECT IDENTIFIER ::= { hrFSTypes 18 } - hrFSRFS OBJECT IDENTIFIER ::= { hrFSTypes 19 } - -- Data General - hrFSDGCFS OBJECT IDENTIFIER ::= { hrFSTypes 20 } - -- SVR4 Boot File System - hrFSBFS OBJECT IDENTIFIER ::= { hrFSTypes 21 } - - HrFSEntry ::= SEQUENCE { - hrFSIndex INTEGER, - hrFSMountPoint InternationalDisplayString, - hrFSRemoteMountPoint InternationalDisplayString, - hrFSType OBJECT IDENTIFIER, - hrFSAccess INTEGER, - hrFSBootable Boolean, - hrFSStorageIndex INTEGER, - hrFSLastFullBackupDate DateAndTime, - hrFSLastPartialBackupDate DateAndTime - } - - hrFSIndex OBJECT-TYPE - SYNTAX INTEGER (1..2147483647) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A unique value for each file system local to this - host. The value for each file system must remain - constant at least from one re-initialization of - the agent to the next re-initialization." - ::= { hrFSEntry 1 } - - hrFSMountPoint OBJECT-TYPE - SYNTAX InternationalDisplayString (SIZE(0..128)) - ACCESS read-only - STATUS mandatory - - - DESCRIPTION - "The path name of the root of this file system." - ::= { hrFSEntry 2 } - - hrFSRemoteMountPoint OBJECT-TYPE - SYNTAX InternationalDisplayString (SIZE(0..128)) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A description of the name and/or address of the - server that this file system is mounted from. - This may also include parameters such as the mount - point on the remote file system. If this is not a - remote file system, this string should have a - length of zero." - ::= { hrFSEntry 3 } - - hrFSType OBJECT-TYPE - SYNTAX OBJECT IDENTIFIER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The value of this object identifies the type of - this file system." - ::= { hrFSEntry 4 } - - hrFSAccess OBJECT-TYPE - SYNTAX INTEGER { - readWrite(1), - readOnly(2) - } - ACCESS read-only - STATUS mandatory - DESCRIPTION - "An indication if this file system is logically - configured by the operating system to be readable - and writable or only readable. This does not - represent any local access-control policy, except - one that is applied to the file system as a whole." - ::= { hrFSEntry 5 } - - hrFSBootable OBJECT-TYPE - SYNTAX Boolean - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A flag indicating whether this file system is - bootable." - - - ::= { hrFSEntry 6 } - - hrFSStorageIndex OBJECT-TYPE - SYNTAX INTEGER (0..2147483647) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The index of the hrStorageEntry that represents - information about this file system. If there is - no such information available, then this value - shall be zero. The relevant storage entry will be - useful in tracking the percent usage of this file - system and diagnosing errors that may occur when - it runs out of space." - ::= { hrFSEntry 7 } - - hrFSLastFullBackupDate OBJECT-TYPE - SYNTAX DateAndTime - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The last date at which this complete file system - was copied to another storage device for backup. - This information is useful for ensuring that - backups are being performed regularly. - - If this information is not known, then this - variable shall have the value corresponding to - January 1, year 0000, 00:00:00.0, which is encoded - as (hex)'00 00 01 01 00 00 00 00'." - ::= { hrFSEntry 8 } - - hrFSLastPartialBackupDate OBJECT-TYPE - SYNTAX DateAndTime - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The last date at which a portion of this file - system was copied to another storage device for - backup. This information is useful for ensuring - that backups are being performed regularly. - - If this information is not known, then this - variable shall have the value corresponding to - January 1, year 0000, 00:00:00.0, which is encoded - as (hex)'00 00 01 01 00 00 00 00'." - ::= { hrFSEntry 9 } - - - -- The Host Resources Running Software Group - -- - -- Implementation of this group is optional. - -- - -- The hrSWRunTable contains an entry for each distinct piece of - -- software that is running or loaded into physical or virtual - -- memory in preparation for running. This includes the host's - -- operating system, device drivers, and applications. - - hrSWOSIndex OBJECT-TYPE - SYNTAX INTEGER (1..2147483647) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The value of the hrSWRunIndex for the - hrSWRunEntry that represents the primary operating - system running on this host. This object is - useful for quickly and uniquely identifying that - primary operating system." - ::= { hrSWRun 1 } - - hrSWRunTable OBJECT-TYPE - SYNTAX SEQUENCE OF HrSWRunEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "The (conceptual) table of software running on the - host." - ::= { hrSWRun 2 } - - hrSWRunEntry OBJECT-TYPE - SYNTAX HrSWRunEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "A (conceptual) entry for one piece of software - running on the host Note that because the installed - software table only contains information for - software stored locally on this host, not every - piece of running software will be found in the - installed software table. This is true of software - that was loaded and run from a non-local source, - such as a network-mounted file system. - - As an example of how objects in this table are - named, an instance of the hrSWRunName object might - be named hrSWRunName.1287" - INDEX { hrSWRunIndex } - - - ::= { hrSWRunTable 1 } - - HrSWRunEntry ::= SEQUENCE { - hrSWRunIndex INTEGER, - hrSWRunName InternationalDisplayString, - hrSWRunID ProductID, - hrSWRunPath InternationalDisplayString, - hrSWRunParameters InternationalDisplayString, - hrSWRunType INTEGER, - hrSWRunStatus INTEGER - } - - hrSWRunIndex OBJECT-TYPE - SYNTAX INTEGER (1..2147483647) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A unique value for each piece of software running - on the host. Wherever possible, this should be the - system's native, unique identification number." - ::= { hrSWRunEntry 1 } - - hrSWRunName OBJECT-TYPE - SYNTAX InternationalDisplayString (SIZE (0..64)) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A textual description of this running piece of - software, including the manufacturer, revision, - and the name by which it is commonly known. If - this software was installed locally, this should be - the same string as used in the corresponding - hrSWInstalledName." - ::= { hrSWRunEntry 2 } - - hrSWRunID OBJECT-TYPE - SYNTAX ProductID - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The product ID of this running piece of software." - ::= { hrSWRunEntry 3 } - - hrSWRunPath OBJECT-TYPE - SYNTAX InternationalDisplayString (SIZE(0..128)) - ACCESS read-only - STATUS mandatory - DESCRIPTION - - - "A description of the location on long-term storage - (e.g. a disk drive) from which this software was - loaded." - ::= { hrSWRunEntry 4 } - - hrSWRunParameters OBJECT-TYPE - SYNTAX InternationalDisplayString (SIZE(0..128)) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A description of the parameters supplied to this - software when it was initially loaded." - ::= { hrSWRunEntry 5 } - - hrSWRunType OBJECT-TYPE - SYNTAX INTEGER { - unknown(1), - operatingSystem(2), - deviceDriver(3), - application(4) - } - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The type of this software." - ::= { hrSWRunEntry 6 } - - hrSWRunStatus OBJECT-TYPE - SYNTAX INTEGER { - running(1), - runnable(2), -- waiting for resource (CPU, memory, IO) - notRunnable(3), -- loaded but waiting for event - invalid(4) -- not loaded - } - ACCESS read-write - STATUS mandatory - DESCRIPTION - "The status of this running piece of software. - Setting this value to invalid(4) shall cause this - software to stop running and to be unloaded." - ::= { hrSWRunEntry 7 } - - -- The Host Resources Running Software Performance Group - -- Implementation of this group is optional. - -- - -- The hrSWRunPerfTable contains an entry corresponding to - -- each entry in the hrSWRunTable. - - - hrSWRunPerfTable OBJECT-TYPE - SYNTAX SEQUENCE OF HrSWRunPerfEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "The (conceptual) table of running software - performance metrics." - ::= { hrSWRunPerf 1 } - - hrSWRunPerfEntry OBJECT-TYPE - SYNTAX HrSWRunPerfEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "A (conceptual) entry containing software - performance metrics. As an example, an instance - of the hrSWRunPerfCPU object might be named - hrSWRunPerfCPU.1287" - INDEX { hrSWRunIndex } -- This table augments information in - -- the hrSWRunTable. - ::= { hrSWRunPerfTable 1 } - - HrSWRunPerfEntry ::= SEQUENCE { - hrSWRunPerfCPU INTEGER, - hrSWRunPerfMem KBytes - } - - hrSWRunPerfCPU OBJECT-TYPE - SYNTAX INTEGER - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The number of centi-seconds of the total system's - CPU resources consumed by this process. Note that - on a multi-processor system, this value may - increment by more than one centi-second in one - centi-second of real (wall clock) time." - ::= { hrSWRunPerfEntry 1 } - - hrSWRunPerfMem OBJECT-TYPE - SYNTAX KBytes - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The total amount of real system memory allocated - to this process." - ::= { hrSWRunPerfEntry 2 } - - - -- The Host Resources Installed Software Group - -- - -- Implementation of this group is optional. - -- - -- The hrSWInstalledTable contains an entry for each piece - -- of software installed in long-term storage (e.g. a disk - -- drive) locally on this host. Note that this does not - -- include software loadable remotely from a network - -- server. - -- - -- This table is useful for identifying and inventorying - -- software on a host and for diagnosing incompatibility - -- and version mismatch problems between various pieces - -- of hardware and software. - - hrSWInstalledLastChange OBJECT-TYPE - SYNTAX TimeTicks - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The value of sysUpTime when an entry in the - hrSWInstalledTable was last added, renamed, or - deleted. Because this table is likely to contain - many entries, polling of this object allows a - management station to determine when re-downloading - of the table might be useful." - ::= { hrSWInstalled 1 } - - hrSWInstalledLastUpdateTime OBJECT-TYPE - SYNTAX TimeTicks - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The value of sysUpTime when the hrSWInstalledTable - was last completely updated. Because caching of - this data will be a popular implementation - strategy, retrieval of this object allows a - management station to obtain a guarantee that no - data in this table is older than the indicated - time." - ::= { hrSWInstalled 2 } - - hrSWInstalledTable OBJECT-TYPE - SYNTAX SEQUENCE OF HrSWInstalledEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "The (conceptual) table of software installed on - - - this host." - ::= { hrSWInstalled 3 } - - hrSWInstalledEntry OBJECT-TYPE - SYNTAX HrSWInstalledEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "A (conceptual) entry for a piece of software - installed on this host. - - As an example of how objects in this table are - named, an instance of the hrSWInstalledName object - might be named hrSWInstalledName.96" - INDEX { hrSWInstalledIndex } - ::= { hrSWInstalledTable 1 } - - HrSWInstalledEntry ::= SEQUENCE { - hrSWInstalledIndex INTEGER, - hrSWInstalledName InternationalDisplayString, - hrSWInstalledID ProductID, - hrSWInstalledType INTEGER, - hrSWInstalledDate DateAndTime - } - - hrSWInstalledIndex OBJECT-TYPE - SYNTAX INTEGER (1..2147483647) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A unique value for each piece of software - installed on the host. This value shall be in the - range from 1 to the number of pieces of software - installed on the host." - ::= { hrSWInstalledEntry 1 } - - hrSWInstalledName OBJECT-TYPE - SYNTAX InternationalDisplayString (SIZE (0..64)) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "A textual description of this installed piece of - software, including the manufacturer, revision, the - name by which it is commonly known, and optionally, - its serial number." - ::= { hrSWInstalledEntry 2 } - - hrSWInstalledID OBJECT-TYPE - - - SYNTAX ProductID - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The product ID of this installed piece of - software." - ::= { hrSWInstalledEntry 3 } - - hrSWInstalledType OBJECT-TYPE - SYNTAX INTEGER { - unknown(1), - operatingSystem(2), - deviceDriver(3), - application(4) - } - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The type of this software." - ::= { hrSWInstalledEntry 4 } - - hrSWInstalledDate OBJECT-TYPE - SYNTAX DateAndTime - ACCESS read-only - STATUS mandatory - DESCRIPTION - "The last-modification date of this application as - it would appear in a directory listing." - ::= { hrSWInstalledEntry 5 } - -END - -RFC1414-MIB DEFINITIONS ::= BEGIN - - IMPORTS - OBJECT-TYPE - FROM RFC-1212 - tcpConnLocalAddress, tcpConnLocalPort, - tcpConnRemAddress, tcpConnRemPort - FROM RFC1213-MIB; - - ident OBJECT IDENTIFIER ::= { mib-2 24 } - - -- conformance groups - - identInfo OBJECT IDENTIFIER ::= { ident 1 } - - -- textual conventions - - -- none - - -- the ident information system group - -- - -- implementation of this group is mandatory - - identTable OBJECT-TYPE - SYNTAX SEQUENCE OF IdentEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "A table containing user information for TCP - connections. - - Note that this table contains entries for all TCP - connections on a managed system. The - corresponding instance of tcpConnState (defined in - MIB-II) indicates the state of a particular - - - connection." - ::= { identInfo 1 } - - identEntry OBJECT-TYPE - SYNTAX IdentEntry - ACCESS not-accessible - STATUS mandatory - DESCRIPTION - "User information about a particular TCP - connection." - INDEX { tcpConnLocalAddress, tcpConnLocalPort, - tcpConnRemAddress, tcpConnRemPort } - ::= { identTable 1 } - - IdentEntry ::= - SEQUENCE { - identStatus INTEGER, - identOpSys OCTET STRING, - identCharset OCTET STRING, - identUserid OCTET STRING, - identMisc OCTET STRING - } - - identStatus OBJECT-TYPE - SYNTAX INTEGER { - noError(1), - unknownError(2) - } - ACCESS read-only - STATUS mandatory - DESCRIPTION - "Indicates whether user information for the - associated TCP connection can be determined. A - value of `noError(1)' indicates that user - information is available. A value of - `unknownError(2)' indicates that user information - is not available." - ::= { identEntry 1 } - - identOpSys OBJECT-TYPE - SYNTAX OCTET STRING (SIZE(0..40)) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "Indicates the type of operating system in use. - In addition to identifying an operating system, - each assignment made for this purpose also - (implicitly) identifies the textual format and - - - maximum size of the corresponding identUserid and - identMisc objects. - - The legal values for the `indentOpSys' strings - are those listed in the SYSTEM NAMES section of - the most recent edition of the ASSIGNED NUMBERS - RFC [8]." - ::= { identEntry 2 } - - identCharset OBJECT-TYPE - SYNTAX OCTET STRING (SIZE(0..40)) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "Indicates the repertoire of the corresponding - identUserid and identMisc objects. - - The legal values for the `identCharset' strings - are those listed in the CHARACTER SET section of - the most recent edition of the ASSIGNED NUMBERS - RFC [8]." - ::= { identEntry 3 } - - identUserid OBJECT-TYPE - SYNTAX OCTET STRING (SIZE (0..255)) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "Indicates the user's identity. Interpretation of - this object requires examination of the - corresponding value of the identOpSys and - identCharset objects." - ::= { identEntry 4 } - - identMisc OBJECT-TYPE - SYNTAX OCTET STRING (SIZE (0..255)) - ACCESS read-only - STATUS mandatory - DESCRIPTION - "Indicates miscellaneous information about the - user. Interpretation of this object requires - examination of the corresponding value of the - identOpSys and identCharset objects." - ::= { identEntry 5 } - -END - - - -TUBS-LINUX-MIB DEFINITIONS ::= BEGIN - -IMPORTS - MODULE-IDENTITY, OBJECT-TYPE, - enterprises, Counter32, Integer32, TimeTicks, Unsigned32 - FROM SNMPv2-SMI - DisplayString, RowStatus, DateAndTime, TruthValue, TimeStamp, TAddress - FROM SNMPv2-TC; - -linuxMIB MODULE-IDENTITY - LAST-UPDATED "9607182024Z" - ORGANIZATION "TU Braunschweig" - CONTACT-INFO - " Juergen Schoenwaelder - - Postal: TU Braunschweig - Bueltenweg 74/75 - D-38108 Braunschweig - GERMANY - - Tel: +49 531 391 3249 - Fax: +49 531 391 5936 - - E-mail: schoenw@ibr.cs.tu-bs.de" - DESCRIPTION - "Experimental MIB modules for the linux operating system." - ::= { enterprises tubs(1575) ibr(1) 5 } - -tubs OBJECT IDENTIFIER ::= { enterprises 1575 } -ibr OBJECT IDENTIFIER ::= { tubs 1 } --- linuxMIB OBJECT IDENTIFIER ::= { ibr 5 } -linuxAgents OBJECT IDENTIFIER ::= { linuxMIB 1 } - -linuxMIBObjects OBJECT IDENTIFIER ::= { linuxMIB 2 } - -linuxCPU OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The identification of the linux CPU." - ::= { linuxMIBObjects 1 } - -linuxBogo OBJECT-TYPE - SYNTAX Gauge32 - MAX-ACCESS read-only - STATUS current - DESCRIPTION - "The number of BOGO MIPS of the linux system." - ::= { linuxMIBObjects 2 } - --- conformance information - -linuxMIBConformance - OBJECT IDENTIFIER ::= { linuxMIB 3 } - -linuxMIBCompliances - OBJECT IDENTIFIER ::= { linuxMIBConformance 1 } -linuxMIBGroups OBJECT IDENTIFIER ::= { linuxMIBConformance 2 } - -END diff --git a/mib/parse.c b/mib/parse.c deleted file mode 100644 index df92890..0000000 --- a/mib/parse.c +++ /dev/null @@ -1,1895 +0,0 @@ -/****************************************************************** - Copyright 1989, 1991, 1992 by Carnegie Mellon University - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of CMU not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. -******************************************************************/ -/* - * parse.c - */ -#include <stdio.h> -#include <ctype.h> -#include <sys/types.h> -#include <stdlib.h> -#include <string.h> - - -#include "parse.h" - -/* A quoted string value-- too long for a general "token" */ -char *quoted_string_buffer; - -/* - * This is one element of an object identifier with either an integer - * subidentifier, or a textual string label, or both. - * The subid is -1 if not present, and label is NULL if not present. - */ -struct subid { - int subid; - char *label; -}; - -#define MAXTC 128 -struct tc { /* textual conventions */ - int type; - char descriptor[MAXTOKEN]; - struct enum_list *enums; -} tclist[MAXTC]; - - - -int Line = 1; - -#define SYNTAX_MASK 0x80 -/* types of tokens - Tokens wiht the SYNTAX_MASK bit set are syntax tokens */ -#define CONTINUE -1 -#define ENDOFFILE 0 -#define LABEL 1 -#define SUBTREE 2 -#define SYNTAX 3 -#define OBJID (4 | SYNTAX_MASK) -#define OCTETSTR (5 | SYNTAX_MASK) -#define INTEGER (6 | SYNTAX_MASK) -#define NETADDR (7 | SYNTAX_MASK) -#define IPADDR (8 | SYNTAX_MASK) -#define COUNTER (9 | SYNTAX_MASK) -#define GAUGE (10 | SYNTAX_MASK) -#define TIMETICKS (11 | SYNTAX_MASK) -#define OPAQUE (12 | SYNTAX_MASK) -#define NUL (13 | SYNTAX_MASK) -#define SEQUENCE 14 -#define OF 15 /* SEQUENCE OF */ -#define OBJTYPE 16 -#define ACCESS 17 -#define READONLY 18 -#define READWRITE 19 -#define WRITEONLY 20 -#define NOACCESS 21 -#define STATUS 22 -#define MANDATORY 23 -#define OPTIONAL 24 -#define OBSOLETE 25 -/* #define RECOMMENDED 26 */ -#define PUNCT 27 -#define EQUALS 28 -#define NUMBER 29 -#define LEFTBRACKET 30 -#define RIGHTBRACKET 31 -#define LEFTPAREN 32 -#define RIGHTPAREN 33 -#define COMMA 34 -#define DESCRIPTION 35 -#define QUOTESTRING 36 -#define INDEX 37 -#define DEFVAL 38 -#define DEPRECATED 39 -#define SIZE 40 -#define BITSTRING (41 | SYNTAX_MASK) -#define NSAPADDRESS (42 | SYNTAX_MASK) -#define COUNTER64 (43 | SYNTAX_MASK) -#define OBJGROUP 44 -#define NOTIFTYPE 45 -#define AUGMENTS 46 -#define COMPLIANCE 47 -#define READCREATE 48 -#define UNITS 49 -#define REFERENCE 50 -#define NUM_ENTRIES 51 -#define MODULEIDENTITY 52 -#define LASTUPDATED 53 -#define ORGANIZATION 54 -#define CONTACTINFO 55 -#define UINTEGER32 (56 | SYNTAX_MASK) -#define CURRENT 57 -#define DEFINITIONS 58 -#define END 59 -#define SEMI 60 - -struct tok { - char *name; /* token name */ - int len; /* length not counting nul */ - int token; /* value */ - int hash; /* hash of name */ - struct tok *next; /* pointer to next in hash table */ -}; - -char *type_name[] = { - "undef", - "\"OBJECTID\"", - "\"STRING\"", - "\"INTEGER\"", - "\"NETADDR\"", - "\"IPADDR\"", - "\"COUNTER\"", - "\"GAUGE\"", - "\"TIMETICKS\"", - "\"OPAQUE\"", - "\"NULL\"", - "\"COUNTER64\"", - "\"BITSTRING\"", - "\"NSAPADDRESS\"", - "\"UINTEGER\"" -}; - -struct tok tokens[] = { - { "obsolete", sizeof ("obsolete")-1, OBSOLETE }, - { "Opaque", sizeof ("Opaque")-1, OPAQUE }, -/* { "recommended", sizeof("recommended")-1, RECOMMENDED }, */ - { "optional", sizeof ("optional")-1, OPTIONAL }, - { "LAST-UPDATED", sizeof ("LAST-UPDATED")-1, LASTUPDATED }, - { "ORGANIZATION", sizeof ("ORGANIZATION")-1, ORGANIZATION }, - { "CONTACT-INFO", sizeof ("CONTACT-INFO")-1, CONTACTINFO }, - { "MODULE-IDENTITY", sizeof ("MODULE-IDENTITY")-1, MODULEIDENTITY }, - { "MODULE-COMPLIANCE", sizeof ("MODULE-COMPLIANCE")-1, COMPLIANCE }, - { "DEFINITIONS", sizeof("DEFINITIONS")-1, DEFINITIONS}, - { "END", sizeof("END")-1, END}, - { ";", sizeof(";")-1, SEMI}, - { "AUGMENTS", sizeof ("AUGMENTS")-1, AUGMENTS }, - { "not-accessible", sizeof ("not-accessible")-1, NOACCESS }, - { "write-only", sizeof ("write-only")-1, WRITEONLY }, - { "NsapAddress", sizeof("NsapAddress")-1, NSAPADDRESS}, - { "UNITS", sizeof("Units")-1, UNITS}, - { "REFERENCE", sizeof("REFERENCE")-1, REFERENCE}, - { "NUM-ENTRIES", sizeof("NUM-ENTRIES")-1, NUM_ENTRIES}, - { "BITSTRING", sizeof("BitString")-1, BITSTRING}, - { "BIT", sizeof("BIT")-1, CONTINUE}, - { "Counter64", sizeof("Counter64")-1, COUNTER64}, - { "TimeTicks", sizeof ("TimeTicks")-1, TIMETICKS }, - { "NOTIFICATION-TYPE", sizeof ("NOTIFICATION-TYPE")-1, NOTIFTYPE }, - { "OBJECT-GROUP", sizeof ("OBJECT-GROUP")-1, OBJGROUP }, - { "OBJECTIDENTIFIER", sizeof ("OBJECTIDENTIFIER")-1, OBJID }, - /* - * This CONTINUE appends the next word onto OBJECT, - * hopefully matching OBJECTIDENTIFIER above. - */ - { "OBJECT", sizeof ("OBJECT")-1, CONTINUE }, - { "NetworkAddress", sizeof ("NetworkAddress")-1, NETADDR }, - { "Gauge", sizeof ("Gauge")-1, GAUGE }, - { "read-write", sizeof ("read-write")-1, READWRITE }, - { "read-create", sizeof ("read-create")-1, READCREATE }, - { "OCTETSTRING", sizeof ("OCTETSTRING")-1, OCTETSTR }, - { "OCTET", sizeof ("OCTET")-1, -1 }, - { "OF", sizeof ("OF")-1, OF }, - { "SEQUENCE", sizeof ("SEQUENCE")-1, SEQUENCE }, - { "NULL", sizeof ("NULL")-1, NUL }, - { "IpAddress", sizeof ("IpAddress")-1, IPADDR }, - { "UInteger32", sizeof ("UInteger32")-1, UINTEGER32 }, - { "INTEGER", sizeof ("INTEGER")-1, INTEGER }, - { "Counter", sizeof ("Counter")-1, COUNTER }, - { "read-only", sizeof ("read-only")-1, READONLY }, - { "DESCRIPTION", sizeof ("DESCRIPTION")-1, DESCRIPTION }, - { "INDEX", sizeof ("INDEX")-1, INDEX }, - { "DEFVAL", sizeof ("DEFVAL")-1, DEFVAL }, - { "deprecated", sizeof ("deprecated")-1, DEPRECATED }, - { "SIZE", sizeof ("SIZE")-1, SIZE }, - { "MAX-ACCESS", sizeof ("MAX-ACCESS")-1, ACCESS }, - { "ACCESS", sizeof ("ACCESS")-1, ACCESS }, - { "mandatory", sizeof ("mandatory")-1, MANDATORY }, - { "current", sizeof ("current")-1, CURRENT }, - { "STATUS", sizeof ("STATUS")-1, STATUS }, - { "SYNTAX", sizeof ("SYNTAX")-1, SYNTAX }, - { "OBJECT-TYPE", sizeof ("OBJECT-TYPE")-1, OBJTYPE }, - { "{", sizeof ("{")-1, LEFTBRACKET }, - { "}", sizeof ("}")-1, RIGHTBRACKET }, - { "::=", sizeof ("::=")-1, EQUALS }, - { "(", sizeof ("(")-1, LEFTPAREN }, - { ")", sizeof (")")-1, RIGHTPAREN }, - { ",", sizeof (",")-1, COMMA }, - { NULL } -}; - -#define HASHSIZE 32 -#define BUCKET(x) (x & 0x01F) - -struct tok *buckets[HASHSIZE]; - -static void do_subtree(); -static int get_token(); -static int parseQuoteString(); -static int tossObjectIdentifier(); - -static void -hash_init() -{ - register struct tok *tp; - register char *cp; - register int h; - register int b; - - bzero((char *)buckets, sizeof(buckets)); - for (tp = tokens; tp->name; tp++) { - for (h = 0, cp = tp->name; *cp; cp++) - h += *cp; - tp->hash = h; - b = BUCKET(h); - if (buckets[b]) - tp->next = buckets[b]; /* BUG ??? */ - buckets[b] = tp; - } -} - -#define NHASHSIZE 128 -#define NBUCKET(x) (x & 0x7F) -struct node *nbuckets[NHASHSIZE]; - -void -init_node_hash(nodes) - struct node *nodes; -{ - register struct node *np, *nextp; - register char *cp; - register int hash; - - bzero((char *)nbuckets,sizeof(nbuckets)); - for(np = nodes; np;){ - nextp = np->next; - hash = 0; - for(cp = np->parent; *cp; cp++) - hash += *cp; - np->next = nbuckets[NBUCKET(hash)]; - nbuckets[NBUCKET(hash)] = np; - np = nextp; - } -} - -static char * -Malloc(num) - unsigned num; -{ - /* this is to fix (what seems to be) a problem with the IBM RT C - library malloc */ - if (num < 16) - num = 16; - return (char *)malloc(num); -} - -static void -print_error(string, token, type) - char *string; - char *token; - int type; -{ - if (type == ENDOFFILE) - fprintf(stderr, "%s(EOF): On or around line %d\n", string, Line); - else if (token) - fprintf(stderr, "%s(%s): On or around line %d\n", string, token, Line); - else - fprintf(stderr, "%s: On or around line %d\n", string, Line); -} - -#ifdef TEST -print_subtree(tree, count) - struct tree *tree; - int count; -{ - struct tree *tp; - int i; - - for(i = 0; i < count; i++) - printf(" "); - printf("Children of %s:\n", tree->label); - count++; - for(tp = tree->child_list; tp; tp = tp->next_peer){ - for(i = 0; i < count; i++) - printf(" "); - printf("%s\n", tp->label); - } - for(tp = tree->child_list; tp; tp = tp->next_peer){ - print_subtree(tp, count); - } -} -#endif /* TEST */ - -print_subtree_perl(tree, count, fp) - struct tree *tree; - int count; - FILE *fp; -{ - struct tree *tp; - int i; - char *desc; - - if(!count++){ - fprintf(fp,"{\n"); - fprintf(fp," my $curent;\n"); - fprintf(fp," my $parent = Net::SNMP::MIB->root;\n"); - } - - fprintf(fp,"%*s$current = $parent->add('%s',%d,%s," - ,count,"",tree->label,tree->subid,type_name[tree->type]); - - if((desc = tree->description) != NULL) { - char ch; - putc('"',fp); - while(ch = *desc++) { - if(ch == '\n') { - putc('\\',fp); - putc('n',fp); - continue; - } - else if(ch == '@' || ch == '"' || ch == '$' || ch == '%') - putc('\\',fp); - putc(ch,fp); - } - putc('"',fp); - putc(',',fp); - } - else - fprintf(fp,"undef,"); - if(tree->enums) { - struct enum_list *e; - fprintf(fp,"{ "); - for(e = tree->enums;e;e = e->next) { - fprintf(fp,"'%s' => %d, ",e->label,e->value); - } - fprintf(fp,"}"); - } - else { - fprintf(fp,"undef"); - } - - fprintf(fp,");\n"); - - if(tree->child_list) { - fprintf(fp,"%*s$parent = $current;\n",count,""); - for(tp = tree->child_list; tp; tp = tp->next_peer){ - print_subtree_perl(tp, count, fp); - } - fprintf(fp,"%*s$parent = $parent->parent;\n",count,""); - } - if(! --count) - fprintf(fp,"}\n1;\n"); - -} - -int translation_table[256]; - -void -build_translation_table() -{ - int count; - - for(count = 0; count < 256; count++){ - switch(count){ - case OBJID: - translation_table[count] = TYPE_OBJID; - break; - case OCTETSTR: - translation_table[count] = TYPE_OCTETSTR; - break; - case INTEGER: - translation_table[count] = TYPE_INTEGER; - break; - case NETADDR: - translation_table[count] = TYPE_IPADDR; - break; - case IPADDR: - translation_table[count] = TYPE_IPADDR; - break; - case COUNTER: - translation_table[count] = TYPE_COUNTER; - break; - case GAUGE: - translation_table[count] = TYPE_GAUGE; - break; - case TIMETICKS: - translation_table[count] = TYPE_TIMETICKS; - break; - case OPAQUE: - translation_table[count] = TYPE_OPAQUE; - break; - case NUL: - translation_table[count] = TYPE_NULL; - break; - case COUNTER64: - translation_table[count] = TYPE_COUNTER64; - break; - case BITSTRING: - translation_table[count] = TYPE_BITSTRING; - break; - case NSAPADDRESS: - translation_table[count] = TYPE_NSAPADDRESS; - break; - case UINTEGER32: - translation_table[count] = TYPE_UINTEGER; - break; - default: - translation_table[count] = TYPE_OTHER; - break; - } - } -} - -static struct tree * -build_tree(nodes) - struct node *nodes; -{ - struct node *np; - struct tree *tp, *lasttp; - int bucket, nodes_left = 0; - - build_translation_table(); - /* grow tree from this root node */ - init_node_hash(nodes); - - /* build root node */ - tp = (struct tree *)Malloc(sizeof(struct tree)); - tp->parent = NULL; - tp->next_peer = NULL; - tp->child_list = NULL; - tp->enums = NULL; - strcpy(tp->label, "joint-iso-ccitt"); - tp->subid = 2; - tp->type = 0; - tp->description = 0; - /* XXX nodes isn't needed in do_subtree() ??? */ - do_subtree(tp, &nodes); - lasttp = tp; - - /* build root node */ - tp = (struct tree *)Malloc(sizeof(struct tree)); - tp->parent = NULL; - tp->next_peer = lasttp; - tp->child_list = NULL; - tp->enums = NULL; - strcpy(tp->label, "ccitt"); - tp->subid = 0; - tp->type = 0; - tp->description = 0; - /* XXX nodes isn't needed in do_subtree() ??? */ - do_subtree(tp, &nodes); - lasttp = tp; - - /* build root node */ - tp = (struct tree *)Malloc(sizeof(struct tree)); - tp->parent = NULL; - tp->next_peer = lasttp; - tp->child_list = NULL; - tp->enums = NULL; - strcpy(tp->label, "iso"); - tp->subid = 1; - tp->type = 0; - tp->description = 0; - /* XXX nodes isn't needed in do_subtree() ??? */ - do_subtree(tp, &nodes); - - -#ifdef TEST - print_subtree(tp, 0); -#endif /* TEST */ - /* If any nodes are left, the tree is probably inconsistent */ - for(bucket = 0; bucket < NHASHSIZE; bucket++){ - if (nbuckets[bucket]){ - nodes_left = 1; - break; - } - } - if (nodes_left){ - fprintf(stderr, "The mib description doesn't seem to be consistent.\n"); - fprintf(stderr, "Some nodes couldn't be linked under the \"iso\" tree.\n"); - fprintf(stderr, "these nodes are left:\n"); - for(bucket = 0; bucket < NHASHSIZE; bucket++){ - for(np = nbuckets[bucket]; np; np = np->next) - fprintf(stderr, "%s ::= { %s %ld } (%d)\n", np->label, - np->parent, np->subid, np->type); - } - } - return tp; -} - -/* - * Find all the children of root in the list of nodes. Link them into the - * tree and out of the nodes list. - */ -static void -do_subtree(root, nodes) - struct tree *root; - struct node **nodes; -{ - register struct tree *tp; - struct tree *peer = NULL; - register struct node *np, **headp; - struct node *oldnp = NULL, *child_list = NULL, *childp = NULL; - char *cp; - int hash; - - tp = root; - hash = 0; - for(cp = tp->label; *cp; cp++) - hash += *cp; - headp = &nbuckets[NBUCKET(hash)]; - /* - * Search each of the nodes for one whose parent is root, and - * move each into a separate list. - */ - for(np = *headp; np; np = np->next){ - if ((*tp->label != *np->parent) || strcmp(tp->label, np->parent)){ - if ((*tp->label == *np->label) && !strcmp(tp->label, np->label)){ - /* if there is another node with the same label, assume that - * any children after this point in the list belong to the other node. - * This adds some scoping to the table and allows vendors to - * reuse names such as "ip". - */ - break; - } - oldnp = np; - } else { - if (child_list == NULL){ - child_list = childp = np; /* first entry in child list */ - } else { - childp->next = np; - childp = np; - } - /* take this node out of the node list */ - if (oldnp == NULL){ - *headp = np->next; /* fix root of node list */ - } else { - oldnp->next = np->next; /* link around this node */ - } - } - } - if (childp) - childp->next = 0; /* re-terminate list */ - /* - * Take each element in the child list and place it into the tree. - */ - for(np = child_list; np; np = np->next){ - tp = (struct tree *)Malloc(sizeof(struct tree)); - tp->parent = root; - tp->next_peer = NULL; - tp->child_list = NULL; - strcpy(tp->label, np->label); - tp->subid = np->subid; - tp->type = translation_table[np->type]; - tp->enums = np->enums; - np->enums = NULL; /* so we don't free them later */ - tp->description = np->description; /* steals memory from np */ - np->description = NULL; /* so we don't free it later */ - if (root->child_list == NULL){ - root->child_list = tp; - } else { - peer->next_peer = tp; - } - peer = tp; -/* if (tp->type == TYPE_OTHER) */ - do_subtree(tp, nodes); /* recurse on this child if it isn't - an end node */ - } - /* free all nodes that were copied into tree */ - oldnp = NULL; - for(np = child_list; np; np = np->next){ - if (oldnp) - free(oldnp); - oldnp = np; - } - if (oldnp) - free(oldnp); -} - - -/* - * Takes a list of the form: - * { iso org(3) dod(6) 1 } - * and creates several nodes, one for each parent-child pair. - * Returns NULL on error. - */ -static int -getoid(fp, oid, length) - register FILE *fp; - register struct subid *oid; /* an array of subids */ - int length; /* the length of the array */ -{ - register int count; - int type; - char token[MAXTOKEN]; - register char *cp; - - if ((type = get_token(fp, token)) != LEFTBRACKET){ - print_error("Expected \"{\"", token, type); - return 0; - } - type = get_token(fp, token); - for(count = 0; count < length; count++, oid++){ - oid->label = 0; - oid->subid = -1; - if (type == RIGHTBRACKET){ - return count; - } else if (type != LABEL && type != NUMBER){ - print_error("Not valid for object identifier", token, type); - return 0; - } - if (type == LABEL){ - /* this entry has a label */ - cp = (char *)Malloc((unsigned)strlen(token) + 1); - strcpy(cp, token); - oid->label = cp; - type = get_token(fp, token); - if (type == LEFTPAREN){ - type = get_token(fp, token); - if (type == NUMBER){ - oid->subid = atoi(token); - if ((type = get_token(fp, token)) != RIGHTPAREN){ - print_error("Unexpected a closing parenthesis", token, type); - return 0; - } - } else { - print_error("Expected a number", token, type); - return 0; - } - } else { - continue; - } - } else { - /* this entry has just an integer sub-identifier */ - oid->subid = atoi(token); - } - type = get_token(fp, token); - } - return count; - - -} - -static void -free_node(np) - struct node *np; -{ - struct enum_list *ep, *tep; - - ep = np->enums; - while(ep){ - tep = ep; - ep = ep->next; - free((char *)tep); - } - free((char *)np); -} - -/* - * Parse an entry of the form: - * label OBJECT IDENTIFIER ::= { parent 2 } - * The "label OBJECT IDENTIFIER" portion has already been parsed. - * Returns 0 on error. - */ -static struct node * -parse_objectid(fp, name) - FILE *fp; - char *name; -{ - int type; - char token[MAXTOKEN]; - register int count; - register struct subid *op, *nop; - int length; - struct subid oid[32]; - struct node *np, *root, *oldnp = NULL; - - type = get_token(fp, token); - if (type != EQUALS){ - print_error("Bad format", token, type); - return 0; - } - if ((length = getoid(fp, oid, 32)) != 0){ - np = root = (struct node *)Malloc(sizeof(struct node)); - bzero((char *)np, sizeof(struct node)); - /* - * For each parent-child subid pair in the subid array, - * create a node and link it into the node list. - */ - for(count = 0, op = oid, nop=oid+1; count < (length - 2); count++, - op++, nop++){ - /* every node must have parent's name and child's name or number */ - if (op->label && (nop->label || (nop->subid != -1))){ - strcpy(np->parent, op->label); - if (nop->label) - strcpy(np->label, nop->label); - if (nop->subid != -1) - np->subid = nop->subid; - np->type = 0; - np->enums = 0; - /* set up next entry */ - np->next = (struct node *)Malloc(sizeof(*np->next)); - bzero((char *)np->next, sizeof(struct node)); - oldnp = np; - np = np->next; - } - } - np->next = (struct node *)NULL; - /* - * The above loop took care of all but the last pair. This pair is taken - * care of here. The name for this node is taken from the label for this - * entry. - * np still points to an unused entry. - */ - if (count == (length - 2)){ - if (op->label){ - strcpy(np->parent, op->label); - strcpy(np->label, name); - if (nop->subid != -1) - np->subid = nop->subid; - else - print_error("Warning: This entry is pretty silly", - np->label, type); - } else { - free_node(np); - if (oldnp) - oldnp->next = NULL; - else - return NULL; - } - } else { - print_error("Missing end of oid", (char *)NULL, type); - free_node(np); /* the last node allocated wasn't used */ - if (oldnp) - oldnp->next = NULL; - return NULL; - } - /* free the oid array */ - for(count = 0, op = oid; count < length; count++, op++){ - if (op->label) - free(op->label); - op->label = 0; - } - return root; - } else { - print_error("Bad object identifier", (char *)NULL, type); - return 0; - } -} - -static int -get_tc(descriptor, ep) - char *descriptor; - struct enum_list **ep; -{ - int i; - - for(i = 0; i < MAXTC; i++){ - if (tclist[i].type == 0) - break; - if (!strcmp(descriptor, tclist[i].descriptor)){ - *ep = tclist[i].enums; - return tclist[i].type; - } - } - return LABEL; -} - -/* - * Parses an asn type. Structures are ignored by this parser. - * Returns NULL on error. - */ -static int -parse_asntype(fp, name, ntype, ntoken) - FILE *fp; - char *name; - int *ntype; - char *ntoken; -{ - int type, i; - char token[MAXTOKEN]; - struct enum_list *ep = 0; - struct tc *tcp; - int level; - - type = get_token(fp, token); - if (type == SEQUENCE){ - while((type = get_token(fp, token)) != ENDOFFILE){ - if (type == RIGHTBRACKET){ - *ntype = get_token(fp, ntoken); - return 1; - } - } - print_error("Expected \"}\"", token, type); - return 0; - } else { - if (!strcmp(token, "TEXTUAL-CONVENTION")){ - while (type != SYNTAX) - type = get_token(fp, token); - type = get_token(fp, token); - } - /* textual convention */ - for(i = 0; i < MAXTC; i++){ - if (tclist[i].type == 0) - break; - } - if (i == MAXTC){ - print_error("No more textual conventions possible.", token, type); - return 0; - } - tcp = &tclist[i]; - strcpy(tcp->descriptor, name); - if (!(type & SYNTAX_MASK)){ - print_error("Textual convention doesn't map to real type.", token, - type); - return 0; - } - tcp->type = type; - *ntype = get_token(fp, ntoken); - if (*ntype == LEFTPAREN){ - level = 1; - /* don't record any constraints for now */ - while(level > 0){ - *ntype = get_token(fp, ntoken); - if (*ntype == LEFTPAREN) - level++; - if (*ntype == RIGHTPAREN) - level--; - } - *ntype = get_token(fp, ntoken); - } else if (*ntype == LEFTBRACKET) { - /* if there is an enumeration list, parse it */ - while((type = get_token(fp, token)) != ENDOFFILE){ - if (type == RIGHTBRACKET) - break; - if (type == LABEL){ - /* this is an enumerated label */ - if (tcp->enums == 0){ - ep = tcp->enums = (struct enum_list *) - Malloc(sizeof(struct enum_list)); - } else { - ep->next = (struct enum_list *) - Malloc(sizeof(struct enum_list)); - ep = ep->next; - } - ep->next = 0; - /* a reasonable approximation for the length */ - ep->label = - (char *)Malloc((unsigned)strlen(token) + 1); - strcpy(ep->label, token); - type = get_token(fp, token); - if (type != LEFTPAREN){ - print_error("Expected \"(\"", token, type); - /* free_node(np); */ - return 0; - } - type = get_token(fp, token); - if (type != NUMBER){ - print_error("Expected integer", token, type); - /* free_node(np); */ - return 0; - } - ep->value = atoi(token); - type = get_token(fp, token); - if (type != RIGHTPAREN){ - print_error("Expected \")\"", token, type); - /* free_node(np); */ - return 0; - } - } - } - if (type == ENDOFFILE){ - print_error("Expected \"}\"", token, type); - /* free_node(np); */ - return 0; - } - *ntype = get_token(fp, ntoken); - } - return 1; - } -} - - -/* - * Parses an OBJECT TYPE macro. - * Returns 0 on error. - */ -static struct node * -parse_objecttype(fp, name) - register FILE *fp; - char *name; -{ - register int type; - char token[MAXTOKEN]; - int count, length; - struct subid oid[32]; - char syntax[MAXTOKEN]; - int nexttype, tctype; - char nexttoken[MAXTOKEN]; - register struct node *np; - register struct enum_list *ep = 0; - - type = get_token(fp, token); - if (type != SYNTAX){ - print_error("Bad format for OBJECT TYPE", token, type); - return 0; - } - np = (struct node *)Malloc(sizeof(struct node)); - np->next = 0; - np->enums = 0; - np->description = NULL; /* default to an empty description */ - type = get_token(fp, token); - if (type == LABEL){ - tctype = get_tc(token, &(np->enums)); -#if 0 - if (tctype == LABEL){ - print_error("No known translation for type", token, type); - return 0; - } -#endif - type = tctype; - } - np->type = type; - nexttype = get_token(fp, nexttoken); - switch(type){ - case SEQUENCE: - strcpy(syntax, token); - if (nexttype == OF){ - strcat(syntax, " "); - strcat(syntax, nexttoken); - nexttype = get_token(fp, nexttoken); - strcat(syntax, " "); - strcat(syntax, nexttoken); - nexttype = get_token(fp, nexttoken); - } - break; - case INTEGER: - case UINTEGER32: - strcpy(syntax, token); - if (nexttype == LEFTBRACKET) { - /* if there is an enumeration list, parse it */ - while((type = get_token(fp, token)) != ENDOFFILE){ - if (type == RIGHTBRACKET) - break; - if (type == LABEL){ - /* this is an enumerated label */ - if (np->enums == 0){ - ep = np->enums = (struct enum_list *) - Malloc(sizeof(struct enum_list)); - } else { - ep->next = (struct enum_list *) - Malloc(sizeof(struct enum_list)); - ep = ep->next; - } - ep->next = 0; - /* a reasonable approximation for the length */ - ep->label = - (char *)Malloc((unsigned)strlen(token) + 1); - strcpy(ep->label, token); - type = get_token(fp, token); - if (type != LEFTPAREN){ - print_error("Expected \"(\"", token, type); - free_node(np); - return 0; - } - type = get_token(fp, token); - if (type != NUMBER){ - print_error("Expected integer", token, type); - free_node(np); - return 0; - } - ep->value = atoi(token); - type = get_token(fp, token); - if (type != RIGHTPAREN){ - print_error("Expected \")\"", token, type); - free_node(np); - return 0; - } - } - } - if (type == ENDOFFILE){ - print_error("Expected \"}\"", token, type); - free_node(np); - return 0; - } - nexttype = get_token(fp, nexttoken); - } else if (nexttype == LEFTPAREN){ - /* ignore the "constrained integer" for now */ - nexttype = get_token(fp, nexttoken); - nexttype = get_token(fp, nexttoken); - nexttype = get_token(fp, nexttoken); - } - break; - case BITSTRING: - strcpy(syntax, token); - if (nexttype == LEFTBRACKET) { - /* if there is an enumeration list, parse it */ - while((type = get_token(fp, token)) != ENDOFFILE){ - if (type == RIGHTBRACKET) - break; - if (type == LABEL){ - /* this is an enumerated label */ - if (np->enums == 0){ - ep = np->enums = (struct enum_list *) - Malloc(sizeof(struct enum_list)); - } else { - ep->next = (struct enum_list *) - Malloc(sizeof(struct enum_list)); - ep = ep->next; - } - ep->next = 0; - /* a reasonable approximation for the length */ - ep->label = - (char *)Malloc((unsigned)strlen(token) + 1); - strcpy(ep->label, token); - type = get_token(fp, token); - if (type != LEFTPAREN){ - print_error("Expected \"(\"", token, type); - free_node(np); - return 0; - } - type = get_token(fp, token); - if (type != NUMBER){ - print_error("Expected integer", token, type); - free_node(np); - return 0; - } - ep->value = atoi(token); - type = get_token(fp, token); - if (type != RIGHTPAREN){ - print_error("Expected \")\"", token, type); - free_node(np); - return 0; - } - } - } - if (type == ENDOFFILE){ - print_error("Expected \"}\"", token, type); - free_node(np); - return 0; - } - nexttype = get_token(fp, nexttoken); - } else if (nexttype == LEFTPAREN){ - /* ignore the "constrained integer" for now */ - nexttype = get_token(fp, nexttoken); - nexttype = get_token(fp, nexttoken); - nexttype = get_token(fp, nexttoken); - } - break; - case OCTETSTR: - strcpy(syntax, token); - /* ignore the "constrained octet string" for now */ - if (nexttype == LEFTPAREN) { - nexttype = get_token(fp, nexttoken); - if (nexttype == SIZE) { - nexttype = get_token(fp, nexttoken); - if (nexttype == LEFTPAREN) { - nexttype = get_token(fp, nexttoken); /* 0..255 */ - nexttype = get_token(fp, nexttoken); /* ) */ - nexttype = get_token(fp, nexttoken); /* ) */ - if (nexttype == RIGHTPAREN) - { - nexttype = get_token(fp, nexttoken); - break; - } - } - } - print_error("Bad syntax", token, type); - free_node(np); - return 0; - } - break; - case OBJID: - case NETADDR: - case IPADDR: - case COUNTER: - case GAUGE: - case TIMETICKS: - case OPAQUE: - case NUL: - case LABEL: - case NSAPADDRESS: - case COUNTER64: - strcpy(syntax, token); - break; - default: - print_error("Bad syntax", token, type); - free_node(np); - return 0; - } - if (nexttype == UNITS){ - type = get_token(fp, token); - if (type != QUOTESTRING) { - print_error("Bad DESCRIPTION", token, type); - free_node(np); - return 0; - } - nexttype = get_token(fp, nexttoken); - } - if (nexttype != ACCESS){ - print_error("Should be ACCESS", nexttoken, nexttype); - free_node(np); - return 0; - } - type = get_token(fp, token); - if (type != READONLY && type != READWRITE && type != WRITEONLY - && type != NOACCESS && type != READCREATE){ - print_error("Bad access type", nexttoken, nexttype); - free_node(np); - return 0; - } - type = get_token(fp, token); - if (type != STATUS){ - print_error("Should be STATUS", token, nexttype); - free_node(np); - return 0; - } - type = get_token(fp, token); - if (type != MANDATORY && type != CURRENT && type != OPTIONAL && type != OBSOLETE && type != DEPRECATED){ - print_error("Bad status", token, type); - free_node(np); - return 0; - } - /* - * Optional parts of the OBJECT-TYPE macro - */ - type = get_token(fp, token); - while (type != EQUALS) { - switch (type) { - case DESCRIPTION: - type = get_token(fp, token); - if (type != QUOTESTRING) { - print_error("Bad DESCRIPTION", token, type); - free_node(np); - return 0; - } -#ifdef TEST -printf("Description== \"%.50s\"\n", quoted_string_buffer); -#endif - np->description = quoted_string_buffer; - quoted_string_buffer = (char *)malloc(MAXQUOTESTR); - break; - - case REFERENCE: - type = get_token(fp, token); - if (type != QUOTESTRING) { - print_error("Bad DESCRIPTION", token, type); - free_node(np); - return 0; - } - break; - case INDEX: - case DEFVAL: - case AUGMENTS: - case NUM_ENTRIES: - if (tossObjectIdentifier(fp) != OBJID) { - print_error("Bad Object Identifier", token, type); - free_node(np); - return 0; - } - break; - - default: - print_error("Bad format of optional clauses", token,type); - free_node(np); - return 0; - - } - type = get_token(fp, token); - } - if (type != EQUALS){ - print_error("Bad format", token, type); - free_node(np); - return 0; - } - length = getoid(fp, oid, 32); - if (length > 1 && length <= 32){ - /* just take the last pair in the oid list */ - if (oid[length - 2].label) - strncpy(np->parent, oid[length - 2].label, MAXLABEL); - strcpy(np->label, name); - if (oid[length - 1].subid != -1) - np->subid = oid[length - 1].subid; - else - print_error("Warning: This entry is pretty silly", np->label, type); - } else { - print_error("No end to oid", (char *)NULL, type); - free_node(np); - np = 0; - } - /* free oid array */ - for(count = 0; count < length; count++){ - if (oid[count].label) - free(oid[count].label); - oid[count].label = 0; - } - return np; -} - - -/* - * Parses an OBJECT GROUP macro. - * Returns 0 on error. - */ -static struct node * -parse_objectgroup(fp, name) - register FILE *fp; - char *name; -{ - register int type; - char token[MAXTOKEN]; - int count, length; - struct subid oid[32]; - register struct node *np; - - np = (struct node *)Malloc(sizeof(struct node)); - np->type = 0; - np->next = 0; - np->enums = 0; - np->description = NULL; /* default to an empty description */ - type = get_token(fp, token); - while (type != EQUALS) { - switch (type) { - case DESCRIPTION: - type = get_token(fp, token); - if (type != QUOTESTRING) { - print_error("Bad DESCRIPTION", token, type); - free_node(np); - return 0; - } -#ifdef TEST -printf("Description== \"%.50s\"\n", quoted_string_buffer); -#endif - np->description = quoted_string_buffer; - quoted_string_buffer = (char *)malloc(MAXQUOTESTR); - break; - - default: - /* NOTHING */ - break; - } - type = get_token(fp, token); - } - length = getoid(fp, oid, 32); - if (length > 1 && length <= 32){ - /* just take the last pair in the oid list */ - if (oid[length - 2].label) - strncpy(np->parent, oid[length - 2].label, MAXLABEL); - strcpy(np->label, name); - if (oid[length - 1].subid != -1) - np->subid = oid[length - 1].subid; - else - print_error("Warning: This entry is pretty silly", np->label, type); - } else { - print_error("No end to oid", (char *)NULL, type); - free_node(np); - np = 0; - } - /* free oid array */ - for(count = 0; count < length; count++){ - if (oid[count].label) - free(oid[count].label); - oid[count].label = 0; - } - return np; -} - -/* - * Parses a NOTIFICATION-TYPE macro. - * Returns 0 on error. - */ -static struct node * -parse_notificationDefinition(fp, name) - register FILE *fp; - char *name; -{ - register int type; - char token[MAXTOKEN]; - int count, length; - struct subid oid[32]; - register struct node *np; - - np = (struct node *)Malloc(sizeof(struct node)); - np->type = 0; - np->next = 0; - np->enums = 0; - np->description = NULL; /* default to an empty description */ - type = get_token(fp, token); - while (type != EQUALS) { - switch (type) { - case DESCRIPTION: - type = get_token(fp, token); - if (type != QUOTESTRING) { - print_error("Bad DESCRIPTION", token, type); - free_node(np); - return 0; - } -#ifdef TEST -printf("Description== \"%.50s\"\n", quoted_string_buffer); -#endif - np->description = quoted_string_buffer; - quoted_string_buffer = (char *)malloc(MAXQUOTESTR); - break; - - default: - /* NOTHING */ - break; - } - type = get_token(fp, token); - } - length = getoid(fp, oid, 32); - if (length > 1 && length <= 32){ - /* just take the last pair in the oid list */ - if (oid[length - 2].label) - strncpy(np->parent, oid[length - 2].label, MAXLABEL); - strcpy(np->label, name); - if (oid[length - 1].subid != -1) - np->subid = oid[length - 1].subid; - else - print_error("Warning: This entry is pretty silly", np->label, type); - } else { - print_error("No end to oid", (char *)NULL, type); - free_node(np); - np = 0; - } - /* free oid array */ - for(count = 0; count < length; count++){ - if (oid[count].label) - free(oid[count].label); - oid[count].label = 0; - } - return np; -} - -/* - * Parses a compliance macro - * Returns 0 on error. - */ -static struct node * -parse_compliance(fp, name) - register FILE *fp; - char *name; -{ - register int type; - char token[MAXTOKEN]; - int count, length; - struct subid oid[32]; - register struct node *np; - - np = (struct node *)Malloc(sizeof(struct node)); - np->type = 0; - np->next = 0; - np->enums = 0; - np->description = NULL; /* default to an empty description */ - type = get_token(fp, token); - while (type != EQUALS) { - type = get_token(fp, token); - } - length = getoid(fp, oid, 32); - if (length > 1 && length <= 32){ - /* just take the last pair in the oid list */ - if (oid[length - 2].label) - strncpy(np->parent, oid[length - 2].label, MAXLABEL); - strcpy(np->label, name); - if (oid[length - 1].subid != -1) - np->subid = oid[length - 1].subid; - else - print_error("Warning: This entry is pretty silly", np->label, type); - } else { - print_error("No end to oid", (char *)NULL, type); - free_node(np); - np = 0; - } - /* free oid array */ - for(count = 0; count < length; count++){ - if (oid[count].label) - free(oid[count].label); - oid[count].label = 0; - } - return np; -} - - - -/* - * Parses a module identity macro - * Returns 0 on error. - */ -static struct node * -parse_moduleIdentity(fp, name) - register FILE *fp; - char *name; -{ - register int type; - char token[MAXTOKEN]; - int count, length; - struct subid oid[32]; - register struct node *np; - - np = (struct node *)Malloc(sizeof(struct node)); - np->type = 0; - np->next = 0; - np->enums = 0; - np->description = NULL; /* default to an empty description */ - type = get_token(fp, token); - while (type != EQUALS) { - type = get_token(fp, token); - } - length = getoid(fp, oid, 32); - if (length > 1 && length <= 32){ - /* just take the last pair in the oid list */ - if (oid[length - 2].label) - strncpy(np->parent, oid[length - 2].label, MAXLABEL); - strcpy(np->label, name); - if (oid[length - 1].subid != -1) - np->subid = oid[length - 1].subid; - else - print_error("Warning: This entry is pretty silly", np->label, type); - } else { - print_error("No end to oid", (char *)NULL, type); - free_node(np); - np = 0; - } - /* free oid array */ - for(count = 0; count < length; count++){ - if (oid[count].label) - free(oid[count].label); - oid[count].label = 0; - } - return np; -} - -int parse_mib_header(fp, name) - register FILE *fp; - char *name; -{ - int type = DEFINITIONS; - char token[MAXTOKEN]; - - /* This probably isn't good enough. If there is no - imports clause we can't go around waiting (forever) for a semicolon. - We need to check for semi following an EXPORTS clause or an IMPORTS - clause of both. Look for BEGIN; in my initial MIBs to see those - that I needed to hack to get to parse because they didn't have - an IMPORTS or and EXPORTS clause. - */ - while(type != SEMI){ - type = get_token(fp, token); - } - return 1; -} - - - -/* - * Parses a mib file and returns a linked list of nodes found in the file. - * Returns NULL on error. - */ -static struct node * -parse(fp) - FILE *fp; -{ - char token[MAXTOKEN]; - char name[MAXTOKEN]; - int type = 1; -#define BETWEEN_MIBS 1 -#define IN_MIB 2 - int state = BETWEEN_MIBS; - struct node *np = 0, *root = NULL; - - hash_init(); - quoted_string_buffer = (char *)malloc(MAXQUOTESTR); /* free this later */ - bzero(tclist, 64 * sizeof(struct tc)); - - while(type != ENDOFFILE){ - type = get_token(fp, token); -skipget: - if (type == END){ - if (state != IN_MIB){ - print_error("Error, end before start of MIB.", (char *)NULL, type); - return NULL; - } - state = BETWEEN_MIBS; - continue; - } else if (type != LABEL){ - if (type == ENDOFFILE){ - return root; - } - print_error(token, "is a reserved word", type); - return NULL; - } - strncpy(name, token, MAXTOKEN); - type = get_token(fp, token); - if (type == DEFINITIONS){ - if (state != BETWEEN_MIBS){ - print_error("Error, nested MIBS.", (char *)NULL, type); - return NULL; - } - state = IN_MIB; - if (!parse_mib_header(fp, name)){ - print_error("Bad parse of module header", (char *)NULL, type); - return NULL; - } - } else if (type == OBJTYPE){ - if (root == NULL){ - /* first link in chain */ - np = root = parse_objecttype(fp, name); - if (np == NULL){ - print_error("Bad parse of object type", (char *)NULL, - type); - return NULL; - } - } else { - np->next = parse_objecttype(fp, name); - if (np->next == NULL){ - print_error("Bad parse of objecttype", (char *)NULL, - type); - return NULL; - } - } - /* now find end of chain */ - while(np->next) - np = np->next; - } else if (type == OBJGROUP){ - if (root == NULL){ - /* first link in chain */ - np = root = parse_objectgroup(fp, name); - if (np == NULL){ - print_error("Bad parse of object group", (char *)NULL, - type); - return NULL; - } - } else { - np->next = parse_objectgroup(fp, name); - if (np->next == NULL){ - print_error("Bad parse of objectgroup", (char *)NULL, - type); - return NULL; - } - } - /* now find end of chain */ - while(np->next) - np = np->next; - } else if (type == NOTIFTYPE){ - if (root == NULL){ - /* first link in chain */ - np = root = parse_notificationDefinition(fp, name); - if (np == NULL){ - print_error("Bad parse of notification definition", - (char *)NULL, type); - return NULL; - } - } else { - np->next = parse_notificationDefinition(fp, name); - if (np->next == NULL){ - print_error("Bad parse of notification definition", - (char *)NULL, type); - return NULL; - } - } - /* now find end of chain */ - while(np->next) - np = np->next; - } else if (type == COMPLIANCE){ - if (root == NULL){ - /* first link in chain */ - np = root = parse_compliance(fp, name); - if (np == NULL){ - print_error("Bad parse of module compliance", (char *)NULL, - type); - return NULL; - } - } else { - np->next = parse_compliance(fp, name); - if (np->next == NULL){ - print_error("Bad parse of module compliance", (char *)NULL, - type); - return NULL; - } - } - /* now find end of chain */ - while(np->next) - np = np->next; - } else if (type == MODULEIDENTITY){ - if (root == NULL){ - /* first link in chain */ - np = root = parse_moduleIdentity(fp, name); - if (np == NULL){ - print_error("Bad parse of module identity", (char *)NULL, - type); - return NULL; - } - } else { - np->next = parse_moduleIdentity(fp, name); - if (np->next == NULL){ - print_error("Bad parse of module identity", (char *)NULL, - type); - return NULL; - } - } - /* now find end of chain */ - while(np->next) - np = np->next; - } else if (type == OBJID){ - if (root == NULL){ - /* first link in chain */ - np = root = parse_objectid(fp, name); - if (np == NULL){ - print_error("Bad parse of object id", (char *)NULL, type); - return NULL; - } - } else { - np->next = parse_objectid(fp, name); - if (np->next == NULL){ - print_error("Bad parse of object type", (char *)NULL, - type); - return NULL; - } - } - /* now find end of chain */ - while(np->next) - np = np->next; - } else if (type == EQUALS){ - if (!parse_asntype(fp, name, &type, token)){ - print_error("Bad parse of ASN type definition.", NULL, EQUALS); - return NULL; - } - goto skipget; - } else if (type == ENDOFFILE){ - break; - } else { - print_error("Bad operator", (char *)NULL, type); - return NULL; - } - } -#ifdef TEST -{ - struct enum_list *ep; - - for(np = root; np; np = np->next){ - printf("%s ::= { %s %d } (%d)\n", np->label, np->parent, np->subid, - np->type); - if (np->enums){ - printf("Enums: \n"); - for(ep = np->enums; ep; ep = ep->next){ - printf("%s(%d)\n", ep->label, ep->value); - } - } - } -} -#endif /* TEST */ - return root; -} - -/* - * Parses a token from the file. The type of the token parsed is returned, - * and the text is placed in the string pointed to by token. - */ - -static int -get_token(fp, token) - register FILE *fp; - register char *token; -{ - static char last = ' '; - register int ch; - register char *cp = token; - register int hash = 0; - register struct tok *tp; - - *cp = 0; - ch = last; - /* skip all white space */ - while(isspace(ch) && ch != -1){ - ch = getc(fp); - if (ch == '\n') - Line++; - } - if (ch == -1) { - return ENDOFFILE; - } else if (ch == '"') { - return parseQuoteString(fp, token); - } - - /* - * Accumulate characters until end of token is found. Then attempt to - * match this token as a reserved word. If a match is found, return the - * type. Else it is a label. - */ - do { - if (ch == '\n') - Line++; - if (isspace(ch) || ch == '(' || ch == ')' || ch == '{' || ch == '}' || - ch == ',' || ch == ';'){ - if (!isspace(ch) && *token == 0){ - hash += ch; - *cp++ = ch; - last = ' '; - } else { - last = ch; - } - *cp = '\0'; - - for (tp = buckets[BUCKET(hash)]; tp; tp = tp->next) { - if ((tp->hash == hash) && (strcmp(tp->name, token) == 0)) - break; - } - if (tp){ - if (tp->token == CONTINUE) - continue; - return (tp->token); - } - - if (token[0] == '-' && token[1] == '-'){ - /* strip comment */ - if (ch != '\n'){ - while ((ch = getc(fp)) != -1) - if (ch == '\n'){ - Line++; - break; - } - } - if (ch == -1) - return ENDOFFILE; - last = ch; - return get_token(fp, token); - } - for(cp = token; *cp; cp++) - if (!isdigit(*cp)) - return LABEL; - return NUMBER; - } else { - hash += ch; - *cp++ = ch; - if (ch == '\n') - Line++; - } - - } while ((ch = getc(fp)) != -1); - return ENDOFFILE; -} - -struct tree * -read_mib(filename) - char *filename; -{ - FILE *fp; - struct node *nodes; - struct tree *tree; - - fp = fopen(filename, "r"); - if (fp == NULL) - return NULL; - nodes = parse(fp); - if (!nodes){ - fprintf(stderr, "Mib table is bad. Exiting\n"); - exit(1); - } - tree = build_tree(nodes); - fclose(fp); - return tree; -} - - -main(argc, argv) - int argc; - char *argv[]; -{ - FILE *fp; - struct node *nodes; - struct tree *tp; - - if(argc != 3) { - fprintf(stderr,"usage: %s <input> <output>\n",argv[0]); - exit(1); - } - - fp = fopen(argv[1], "r"); - if (fp == NULL){ - perror(argv[1]); - exit(1); - } - nodes = parse(fp); - tp = build_tree(nodes); - fclose(fp); - - fp = fopen(argv[2], "w"); - if (fp == NULL){ - perror(argv[2]); - exit(1); - } - print_subtree_perl(tp, 0, fp); - fclose(fp); - exit(0); -} - -static int -parseQuoteString(fp, token) - register FILE *fp; - register char *token; -{ - register int ch; - char *ptr = quoted_string_buffer; - int skip = 0; - int maxlen = MAXQUOTESTR; - int len = 0; - - ch = ' '; - *token = '\0'; /* make the token empty */ - - while((ch = getc(fp)) != -1) { - if(skip && isspace(ch)) { - continue; - } - if (ch == '\n') { - Line++; - skip = 1; - } - else if (ch == '"') { - *ptr = '\0'; - return QUOTESTRING; - } - else { - skip = 0; - } - if(++len >= (maxlen-2)) { - int index = ptr - quoted_string_buffer; - maxlen <<= 1; - quoted_string_buffer = realloc(quoted_string_buffer, maxlen); - ptr = "ed_string_buffer[index]; - } - *ptr++ = ch; - } - - return 0; -} - -/* - * This routine parses a string like { blah blah blah } and returns OBJID if - * it is well formed, and NULL if not. - */ -static int -tossObjectIdentifier(fp) - register FILE *fp; -{ - register int ch; - - ch = getc(fp); -/* ch = last; = ' '? */ - /* skip all white space */ - while(isspace(ch) && ch != -1){ - ch = getc(fp); - if (ch == '\n') - Line++; - } - if (ch != '{') - return 0; - - while(ch != -1) { - ch = getc(fp); - - if (ch == '\n') - Line++; - else if (ch == '}') - return OBJID; - } - -/* last = ch;*/ - return 0; -} diff --git a/mib/parse.h b/mib/parse.h deleted file mode 100644 index 8304360..0000000 --- a/mib/parse.h +++ /dev/null @@ -1,89 +0,0 @@ -/*********************************************************** - Copyright 1989 by Carnegie Mellon University - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of CMU not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. -******************************************************************/ -/* - * parse.h - */ - -#define MAXLABEL 64 /* maximum characters in a label */ -#define MAXTOKEN 64 /* maximum characters in a token */ -#define MAXQUOTESTR 512 /* maximum characters in a quoted string */ - - - -/* - * A linked list of tag-value pairs for enumerated integers. - */ -struct enum_list { - struct enum_list *next; - int value; - char *label; -}; - -/* - * A linked list of nodes. - */ -struct node { - struct node *next; - char label[MAXLABEL]; /* This node's (unique) textual name */ - u_long subid; /* This node's integer subidentifier */ - char parent[MAXLABEL];/* The parent's textual name */ - int type; /* The type of object this represents */ - struct enum_list *enums; /* (optional) list of enumerated integers -(otherwise NULL) */ - char *description; /* description (a quoted string) */ -}; - -/* - * A tree in the format of the tree structure of the MIB. - */ -struct tree { - struct tree *child_list; /* list of children of this node */ - struct tree *next_peer; /* Next node in list of peers */ - struct tree *parent; - char label[MAXLABEL]; /* This node's textual name */ - u_long subid; /* This node's integer subidentifier */ - int type; /* This node's object type */ - struct enum_list *enums; /* (optional) list of enumerated integers -(otherwise NULL) */ - void (*printer)(); /* Value printing function */ - char *description; /* description (a quoted string) */ -}; - -/* non-aggregate types for tree end nodes */ -#define TYPE_OTHER 0 -#define TYPE_OBJID 1 -#define TYPE_OCTETSTR 2 -#define TYPE_INTEGER 3 -#define TYPE_NETADDR 4 -#define TYPE_IPADDR 5 -#define TYPE_COUNTER 6 -#define TYPE_GAUGE 7 -#define TYPE_TIMETICKS 8 -#define TYPE_OPAQUE 9 -#define TYPE_NULL 10 -#define TYPE_COUNTER64 11 -#define TYPE_BITSTRING 12 -#define TYPE_NSAPADDRESS 13 -#define TYPE_UINTEGER 14 - -struct tree *read_mib(); - |