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

Reopened Issue: Responding to V3 Inform messages [7245]

$
0
0
Hi Lex,<br /><br />I hope you can help with a problem responding to V3 Inform messages.<br /><br />We have a device that is configured to send Informs to a trap receiver that we're writing using SharpSnmpLib.<br /><br />We're using SNMP V3 for security (Auth/NoPriv) and have traps working very well.<br /><br /> <br /><br />Our problem comes when we try to respond to V3 Inform messages.<br /><br />When I use an off the shelf trap receiver and follow the traffic using Wireshark I can see:<br /><br /><br />The device sends an empty Inform request to the manager. The manager responds with a Report including the AuthoritativeEngineID. The device sends the intended Inform, including all the expected OIDs and the AuthoritativeEngineID.<br /><br />However when I compare that to the traffic using our SharpSnmpLib manager I can only see the following request:<br /><br /><br />The device sends an empty Inform request to the manager. <br />Stepping into the code I can see that SharpSnmpLib is throwing a missing index exception:<br /><br /> <br /><br />at System.Collections.Generic.List`1.get_Item(Int32 index)<br /> at Lextm.SharpSnmpLib.InformRequestPdu..ctor(Tuple`2 length, Stream stream)<br /> at Lextm.SharpSnmpLib.DataFactory.CreateSnmpData(Int32 type, Stream stream)<br /> at Lextm.SharpSnmpLib.DataFactory.CreateSnmpData(Stream stream)<br /> at Lextm.SharpSnmpLib.Sequence..ctor(Tuple`2 length, Stream stream)<br /> at Lextm.SharpSnmpLib.DataFactory.CreateSnmpData(Int32 type, Stream stream)<br /> at Lextm.SharpSnmpLib.DataFactory.CreateSnmpData(Stream stream)<br /> at Lextm.SharpSnmpLib.Sequence..ctor(Tuple`2 length, Stream stream)<br /> at Lextm.SharpSnmpLib.DataFactory.CreateSnmpData(Int32 type, Stream stream)<br /> at Lextm.SharpSnmpLib.Messaging.MessageFactory.ParseMessage(Int32 first, Stream stream, UserRegistry registry)<br /> at Lextm.SharpSnmpLib.Messaging.MessageFactory.ParseMessages(Byte[] buffer, Int32 index, Int32 length, UserRegistry registry)<br /> at Lextm.SharpSnmpLib.Messaging.ListenerBinding.HandleMessage(MessageParams param)<br /><br />And on further examination I can see that the problem is with these lines in InformRequestPdu:<br /><br /><br />_time = (TimeTicks)Variables[0].Data;<br />Variables.RemoveAt(0);<br />Enterprise = (ObjectIdentifier)Variables[0].Data;<br />Variables.RemoveAt(0);<br /> _length = length.Item2;<br /><br /><br />The problem is that the Inform request the device is sending contains no Variables at all – and therefore there is no data at either:<br /><br /><br />private readonly uint[] _timeId = new uint[] { 1, 3, 6, 1, 2, 1, 1, 3, 0 }; or<br />private readonly uint[] _enterpriseId = new uint[] { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };<br /><br /><br />So – my first question is - as we are in control of the device software, should we insist that the two OIDs are populated; i.e. is this part of the standard?<br /><br />And my second question is - does SharpSnmpLib support this security model, i.e. where the empty Inform is first sent to the manager to learn the engine Id?<br /><br />Thanks in advance!<br /><br />Stuart

Viewing all articles
Browse latest Browse all 576

Trending Articles



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