[AGENT++] AgenPro 2 problems [Re: does Agenpro2 call correct OctetStr constructor?]
Dave Mason
dmason at transat-tech.com
Fri Sep 5 22:48:37 CEST 2003
Hi Frank,
I dont think we're out of the woods quite yet. I picked up AgenPro
v2.0.6a but I have two problems and a question:
1. The IpAddress problem isnt fixed. Actually, because I have six bytes
of data (host and port), I didnt use an IpAddress but rather an octet
string. I saw where you changed cpp_code.vm, but since I didnt use
IpAddress, I dont think it helped, although including IpAddress was
probably necessary.
2. I see the new agentgen creates the code for tables when agent
capabilities is turned on in the project file, but I found a problem
with it. The first columnar object in one of my tables (after the
not-accessible index object) is a DateAndTime, specified like this:
almTime OBJECT-TYPE
SYNTAX DateAndTime
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"This attribute specifies the time when the notification was
issued."
::= { almEntry 2 }
AgenPro v1.8.6 created the constructor like this:
almTime::almTime(const Oidx& id):
MibLeaf(id, READONLY, new OctetStr())
{
}
AgenPro v2.0.6a does this:
almTime::almTime(const Oidx& id):
DateAndTime(id, READONLY, VMODE_DEFAULT)
{
}
You'll see that the "new OctetStr()" is not done, so the agent crashes
later when I try to assign a value. This problem also occurs with
scalar DateAndTime objects, but I didnt see this problem for any other
syntax.
3. I'm not sure if this is a problem, but I thought I'd run it by you.
The MIB module I'm working with is defined like this:
ttiWsNotification MODULE-IDENTITY
LAST-UPDATED "200206120000Z" -- Midnight June 12, 2002
ORGANIZATION "Transat Technologies, Inc."
CONTACT-INFO ".."
DESCRIPTION "Notifications MIB."
REVISION "200206120000Z" -- Midnight June 12, 2002
DESCRIPTION "Initial version."
::= { ttiWs 11 }
where ttiWs is "1.3.6.1.4.1.13448.3.1". AgenPro v1.8.6 created the
MibGroup constructor like this:
ttiwsnotificationmib::ttiwsnotificationmib():
MibGroup("1.3.6.1.4.1.13448.3.1.11", "ttiWsNotification")
{
...
}
AgenPro v2.0.6a does it like this:
ttiwsnotificationmib::ttiwsnotificationmib():
MibGroup("1.3.6.1.4.1.13448.3.1", "ttiwsnotificationmib")
{
...
}
Shouldnt the OID end in .11 as before? Also, it would be nice if the
persistent name stayed the same. Is there a reason for the switch?
While I'm here, has the persistence data file format changed any since
agent++v3.5.3a? I would like to be able to build an agent with the new
agent++ and read old persistence files. On the other hand, any fixes or
improvements are welcome.
Regards,
Dave
Dave Mason wrote:
> Hi,
> I'm comparing the output of AgenPro v2 with v1.8.6 and noticed this
> difference. I have a MIB object that is a 6 byte hex value, used for
> IP address and port. The MIB definition looks like this:
>
> ipAddrPort OBJECT-TYPE
> SYNTAX OCTET STRING (SIZE (6))
> MAX-ACCESS read-write
> STATUS current
> DESCRIPTION
> ""
> DEFVAL { '7f00000100a2'H }
> ::= { configObjects 1 }
>
> AgenPro v1.8.6 generated this constructor:
>
> ipAddrPort::ipAddrPort():
> MibLeaf(oidIpAddrPort, READWRITE, new OctetStr((unsigned
> char*)"\x7f\x00\x00\x01\x00\xa2", 6ul), VMODE_DEFAULT)
> {
> ...
> }
>
> AgenPro v2.0.6 does this:
>
> ipAddrPort::ipAddrPort():
> MibLeaf(oidIpAddrPort, READWRITE, new
> OctetStr("\x7f\x00\x00\x01\x00\xa2"), VMODE_DEFAULT){
> ...
> }
>
> If we dont't have the second 6ul size argument, won't the OctetStr
> constructor assume that the first \x00 is an end of string?
>
> Regards,
> Dave
>
>
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://agentpp.org/mailman/listinfo/agentpp
>
>
--
--------------------------------------------------------------------------------
Dave Mason (817)481-4412 x139 voice, (817)481-4461 fax, dmason at transat-tech.com
Transat Technologies 180 State St, Suite 240, Southlake, TX 76092
Integrating 3GSM and WLAN http://www.transat-tech.com
--------------------------------------------------------------------------------
More information about the AGENTPP
mailing list