AgentGen Pro uses wrong constructor for OCTET STRINGs

Dave Mason dmason____transat-tech.com
Mon Sep 9 20:55:52 CEST 2002


Hi,
I have a MIB object that contains an IP address and port, all in hex. 
 The syntax is OCTET STRING (SIZE(6)).  The default value I use is the 
SNMP standard trap port on the local host, 127.0.0.1/162.  In the MIB I 
specify this in hex: DEFVAL { '7f00000100a2'H }.  When AgentGen Pro sees 
this, it makes a contructor like this:

mibObject::mibObject():
   MibLeaf(oidMibObject, READWRITE, new 
OctetStr("\x7f\x00\x00\x01\x00\xa2"), VMODE_DEFAULT)

The problem is that whent the default value is passed to the OctetStr 
constructor, it thinks it's a normal null terminated string, so my 
default value becomes 127 instead of the full 6 bytes.  I see that 
OctetStr has another constructor which takes the string length as an 
argument.  Is there any way to force AgentGen Pro to use that one?  I 
use AgentGen Pro with a plugin to make this attribute be a subclass of 
MibLeaf.

Thanks,
Dave





More information about the AGENTPP mailing list