Bluehost.com Web Hosting $6.95

NetSNMP::agent and ASN_COUNTER64

This is a discussion on NetSNMP::agent and ASN_COUNTER64 within the SNMP Users forums, part of the Networking and Network Related category; Hello all, It seems the NetSNMP::agent module can't deal properly with ASN_COUNTER64 types. Whenever I try to use ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2007
Maxime Henrion
 
Posts: n/a
Default NetSNMP::agent and ASN_COUNTER64

Hello all,


It seems the NetSNMP::agent module can't deal properly with
ASN_COUNTER64 types. Whenever I try to use this type when calling the
setValue() method on the request object from an embedded perl agent, no
value is returned at all from the OID. There are no errors at all in
the log, it looks as if it was silently discarded. Is this a known
problem?

I've had a quick look at the code, and even though this is not
sufficient to explain this problem, the code that handles ASN_COUNTER64
types is broken. Indeed, it's trying to store the value in an "unsigned
long" variable, which is going to be 32bits on the vast majority of
32bits platforms. If we get a string and parsing is required, the code
uses strtoul() which is similarly inadequate.

A possible fix would be to use "unsigned long long" variables and
strtoull(), but that has the drawback that this variable type and
associated function is only standard starting with C99, and some
platforms may not support it. I've had a try at this, but I can't
report on wether it works or not, since there is some other problem that
causes the value to be discarded somehow.

This happens with net-snmp 5.3.1 from the FreeBSD port, which contains a
few patches from the SVN repository that I had to add to fix other
issues (memory leaks and 64bits fixes). From what I can see, there
haven't been any changes in the trunk that are likely to fix these
issues; the agent.xs file is basically the same. Any help on this would
be greatly appreciated. If more information is needed, please just tell
me and I will send it as soon as possible.

Thanks,
Maxime

PS: Please keep me in the Cc: list since I am not subscribed to this
mailing list.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:53 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0