Quantcast
Channel: C# Based Open Source SNMP Library for .NET and Mono
Viewing all articles
Browse latest Browse all 576

Commented Unassigned: "truncation error for 32-bit integer coding" exception when trying to connect to a snmpv3-enabled device [7282]

$
0
0
Hello,
Sometimes when trying to connect to a snmpv3-enabled device using the following code:

```
var discovery = Messenger.GetNextDiscovery(SnmpType.GetRequestPdu);
var report = discovery.GetResponse(6000, endpoint);
```
I receive the following exception:
"truncation error for 32-bit integer coding"
Stack trace:

```
at Lextm.SharpSnmpLib.Integer32..ctor(Tuple`2 length, Stream stream)
at Lextm.SharpSnmpLib.DataFactory.CreateSnmpData(Int32 type, Stream stream)
at Lextm.SharpSnmpLib.DataFactory.CreateSnmpData(Stream stream)
at Lextm.SharpSnmpLib.ReportPdu..ctor(Tuple`2 length, Stream stream)
at Lextm.SharpSnmpLib.DataFactory.CreateSnmpData(Int32 type, Stream stream)
at Lextm.SharpSnmpLib.DataFactory.CreateSnmpData(Stream stream)
at Lextm.SharpSnmpLib.Sequence..ctor(Tuple`2 length, Stream stream)
at Lextm.SharpSnmpLib.DataFactory.CreateSnmpData(Int32 type, Stream stream)
at Lextm.SharpSnmpLib.DataFactory.CreateSnmpData(Stream stream)
at Lextm.SharpSnmpLib.Sequence..ctor(Tuple`2 length, Stream stream)
at Lextm.SharpSnmpLib.DataFactory.CreateSnmpData(Int32 type, Stream stream)
at Lextm.SharpSnmpLib.Messaging.MessageFactory.ParseMessage(Int32 first, Stream stream, UserRegistry registry)
at Lextm.SharpSnmpLib.Messaging.MessageFactory.ParseMessages(Byte[] buffer, Int32 index, Int32 length, UserRegistry registry)
at Lextm.SharpSnmpLib.Messaging.SnmpMessageExtension.GetResponse(ISnmpMessage request, Int32 timeout, IPEndPoint receiver, UserRegistry registry, Socket udpSocket)
at Lextm.SharpSnmpLib.Messaging.Discovery.GetResponse(Int32 timeout,
...
```

The weird thing is that it does not always happen.

Thanks in advance.
Comments: https://sharpsnmplib.codeplex.com/wikipage?title=FAQ Just added a new section "Does it support all SNMP devices?" for your reference. It is very likely that you hit an encoding issue on Integer type. You will have to capture network packets to confirm. #SNMP is not designed to support non standard devices, but you are free to modify its source code.

Viewing all articles
Browse latest Browse all 576

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>