SnmpSharpNet.SnmpV3Packet.DiscoveryResponse C# (CSharp) Метод

DiscoveryResponse() публичный статический Метод

Build SNMP discovery response packet.
Manager application has to be able to respond to discovery requests to be able to handle SNMPv3 INFORM notifications. In an INFORM packet, engineId value is set to the manager stations id (unlike all other requests where agent is the authoritative SNMP engine). For the agent to discover appropriate manager engine id, boots and time values (required for authentication and privacy packet handling), manager has to be able to respond to the discovery request.
public static DiscoveryResponse ( Int32 messageId, Int32 requestId, OctetString engineId, Int32 engineBoots, Int32 engineTime, Int32 unknownEngineIdCount ) : SnmpV3Packet
messageId System.Int32 Message id from the received discovery packet
requestId System.Int32 Request id from the received discovery packets Pdu
engineId OctetString Local engine id
engineBoots System.Int32 Number of times local SNMP engine has been restarted
engineTime System.Int32 Time since the engine was started in seconds
unknownEngineIdCount System.Int32 Number of discovery packets received by the local SNMP engine
Результат SnmpV3Packet
        public static SnmpV3Packet DiscoveryResponse(Int32 messageId, Int32 requestId, OctetString engineId, Int32 engineBoots, Int32 engineTime, Int32 unknownEngineIdCount)
        {
            SnmpV3Packet packet = new SnmpV3Packet();
            packet.Pdu.Type = PduType.Report;
            packet.Pdu.RequestId = requestId;
            packet.Pdu.VbList.Add(SnmpConstants.usmStatsUnknownEngineIDs, new Integer32(unknownEngineIdCount));
            // discovery response is a report packet. We don't want to receive reports about a report
            packet.MsgFlags.Reportable = false;
            packet.SetEngineId(engineId);
            packet.MessageId = messageId;
            packet.USM.EngineBoots = engineBoots;
            packet.USM.EngineTime = engineTime;
            return packet;
        }