FW: Problems while generating C++ code using AgentGen

Chaudhury, Neel nchaudhury____iPolicyNet.COM
Fri Apr 20 09:40:29 CEST 2001


Hi All,

Let me tell you more about the way I tried to generate the C++ code. 
Repository Directory : mibdefn

1. The MIB definition is as follows:
File name : tempmib.txt

	SAMPLE-SMI DEFINITIONS ::= BEGIN

IMPORTS
	
	MODULE-IDENTITY, Counter64, TimeTicks FROM SNMPv2-SMI
	enterprises 	FROM RFC1155-SMI
	DisplayString	FROM RFC1213-MIB
	OBJECT-TYPE	FROM RFC-1212
	TRAP-TYPE	FROM RFC-1215;
			
	my_sample	OBJECT IDENTIFIER ::= { enterprises 10000 }

	sample1		OBJECT IDENTIFIER ::= { my_sample 1 }
	
--
--  Sample MIB table
--

	mySampleTable	OBJECT-TYPE
		SYNTAX SEQUENCE OF MySampleEntry
		ACCESS not-accessible
		STATUS mandatory
		DESCRIPTION
			"The MIB table that gives statistics of the
application per Interface"
	::= { sample1 1 }
	
	mySampleEntry	OBJECT-TYPE
		SYNTAX MySampleEntry
		ACCESS not-accessible
		STATUS mandatory
		DESCRIPTION
			"A record describing one of the entries of the
table"
		INDEX { mySampleCompId, mySampleIfNo, mySampleTimestamp }
	::= { mySampleTable 1 }

	MySampleEntry 	::= SEQUENCE 
	{
		mySampleCompId			INTEGER,
		mySampleName			DisplayString,
		mySampleIfNo			INTEGER,
		mySampleTimestamp			TimeTicks,
		mySamplePktsProcessed		Counter64,
		mySamplePktsProcessedForCust	Counter64,
		mySampleEventLogs			Counter64
	}

	mySampleCompId	OBJECT-TYPE
		SYNTAX INTEGER
		ACCESS read-only
		STATUS mandatory
		DESCRIPTION
			"A 4-byte unique ID, comprised of component type and
parent component ID, assigned to an application "
	::= { mySampleEntry 1 }

	mySampleName	OBJECT-TYPE
		SYNTAX DisplayString
		ACCESS read-only
		STATUS mandatory
		DESCRIPTION
			"The name of the application"
	::= { mySampleEntry 2 }

	mySampleIfNo	OBJECT-TYPE
		SYNTAX INTEGER
		ACCESS read-only
		STATUS mandatory
		DESCRIPTION
			"The interface number that is used for inbound
traffic"
	::= { mySampleEntry 3 }

	mySampleTimestamp OBJECT-TYPE
		SYNTAX TimeTicks
		ACCESS read-only
		STATUS mandatory
		DESCRIPTION
			"Time stamp as integer value when entry is made/last
updated"
	 ::= { mySampleEntry 4 }

	mySamplePktsProcessed OBJECT-TYPE
		SYNTAX Counter64
		ACCESS read-write
		STATUS mandatory
		DESCRIPTION
			"Number of packets processed"
	 ::= { mySampleEntry 5 }

	mySamplePktsProcessedForCust OBJECT-TYPE
		SYNTAX Counter64
		ACCESS read-write
		STATUS mandatory
		DESCRIPTION
			"Number of UDP Packets processed for the customer"
	 ::= { mySampleEntry 6 }

	mySampleEventLogs OBJECT-TYPE
		SYNTAX Counter64
		ACCESS read-write
		STATUS mandatory
		DESCRIPTION
			"Events/Logs collected"
	 ::= { mySampleEntry 7 }
END


2. I use load option of AgentGen to load the MIB modules to the repository.
and load the following MIB modules through a file.
File name : loadmib.txt

	..\rfcmibs\SMIv1\RFC-1212-rfc1212.txt
	..\rfcmibs\SMIv1\RFC1155-SMI-rfc1155.txt
	..\rfcmibs\SMIv1\RFC1213-MIB-rfc1213.txt
	..\rfcmibs\SMIv1\RFC-1215-rfc1215.txt
	..\rfcmibs\SMIv2\SNMPv2-SMI-rfc2578.txt
	..\samplemib\tempmib.txt

3. I issued the following command to load the MIB modules, after I
initialized the repository.

Cmd Prompt> agentgen.bat .\mibdefn load .\samplemib\loadmib.txt

AgentGen Standard v1.5.4  Copyright (C) Frank Fock, All rights reserved

Loading MIB file
[.\samplemib\..\rfcmibs\SMIv1\RFC-1212-rfc1212.txt]...parsed, done.
   Loaded RFC-1212

Loading MIB file
[.\samplemib\..\rfcmibs\SMIv1\RFC1155-SMI-rfc1155.txt]...parsed, done.
   Loaded RFC1155-SMI

Loading MIB file
[.\samplemib\..\rfcmibs\SMIv1\RFC1213-MIB-rfc1213.txt]...parsed, done.
   Loaded RFC1213-MIB which imports from RFC1155-SMI, RFC-1212

Loading MIB file
[.\samplemib\..\rfcmibs\SMIv1\RFC-1215-rfc1215.txt]...parsed, done.
   Loaded RFC-1215

Loading MIB file
[.\samplemib\..\rfcmibs\SMIv2\SNMPv2-SMI-rfc2578.txt]...parsed, done.
   Loaded SNMPv2-SMI

Loading MIB file [.\samplemib\..\samplemib\tempmib.txt]...parsed, failed.
   Reason: Undefined syntax(es): Counter64.


Please tell me if I have done anything wrong and how to overcome this
problem.

Thanking you all in advance,
Neel

-----Original Message-----
From: Chaudhury, Neel [mailto:nchaudhury____iPolicyNet.COM]
Sent: Friday, April 20, 2001 9:46 AM
To: Agent++ (E-mail)
Subject: Problems while generating C++ code using AgentGen


Hi All,

I have written a MIB for my own application and use AgentGen for generating
C++ stub code for my agent. Earlier I was able to generate the C++ code
properly and they were fine. Now I changed the data types of some of the
leaf node to Counter64. Now when I try to generate the stubs, I get some
errors for Counter64, as the definition of Counter64 is not found. I looked
for Counter64 in rfcmibs folder that comes with the download, but found the
following line or lines similar to it:

MODULE-IDENTITY, OBJECT-TYPE,
           Counter64, Counter32, Gauge32,
           mib-2, Unsigned32, zeroDotZero   FROM SNMPv2-SMI
The SNMPv2-SMI is defined in the file SNMPv2-SMI-rfc2578.txt, but it does
not include the definitions of Counter64.
I am stuck now, any suggestion would be greatful.


Thanks and regards,
Neel
iPolicy Networks Inc,
nchaudhury at ipolicynet.com





More information about the AGENTPP mailing list