> > how would I use the InetAddress object binary string to return
> > an IPv6 address in my custom MIB?  None of those types seem related to a
> > binary string.
> 
> I haven't checked the code, but it should be possible to use the 'string'
> type to return a binary string value, as well as regular ASCII strings.
> 
> Try it.
> 

I looked at the pass_persist.c code and if "string" is passed in it sets the 
'type' in the structure to ASN_OCTET_STR.  So I think that means I could pass 
in the binary representation of the IPv6 address.  After reading 
INET-ADDRESS-MIB I'm still unclear as to how to convert and IPv6 address into 
the binary format the net-snmp code expects.  There is not an existing 
conversion function I could call?
 
> >   The situation with snmptrap seems better
> > because it can accept arguments with a type of "HEX STRING" or "DECIMAL
> > STRING".  I don't know how to convert an IPv6 address into that format
> > though.
> 
> Try querying the agent for an existing table object that shows such
> an IPv6 address, and use the '-d' flag to dump the raw packets.
> That will show how IPv6 addresses are represented.
> 
> Or see the description in the INET-ADDRESS-MIB
> 
> Dave

I'm still struggling to understand why the implementation is how it currently 
is.  I enabled IPv6 support when I compiled the net-snmp tool.  Therefore it's 
very easy to specify an IPv6 address to snmptrap as the destination of where 
the trap should be sent.  If you're able to easily specify an IPv6 destination 
then it stands to reason that in your trap you would want to include some IPv6 
IP address information.  So in this example below the trap's destination of ::1 
(the first one) is happily accepted by the code but the trap argument of ::1 
(the second one) is not.
 
/bin/snmptrap -v 3 -u userid -a MD5 -A authpasswd -x DES -X encryptpasswd -l 
authPriv ::1 449800 IpInfo TheIp a ::1                                       
------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to