/// <summary> /// Perform SNMP version 3 discovery operation. This is the first operation that needs to be /// performed on a newly accessed agent to retrieve agentId, agentBoots and agentTime values, critical /// for further authentication and privacy operations. /// </summary> /// <param name="param"><see cref="SecureAgentParameters"/> class instance that will be updated /// with discovered agent values. This class with be reset to its defaults prior to agent /// discovered values so do not store any critical information in it prior to calling the /// discovery method</param> /// <returns>True if discovery operation was a success, otherwise false</returns> public bool Discovery(SecureAgentParameters param) { param.Reset(); param.SecurityName.Set(""); param.Reportable = true; Pdu pdu = new Pdu(); // just leave everything at default. SnmpV3Packet inpkt = (SnmpV3Packet)Request(pdu, param); if (inpkt != null) { if (inpkt.USM.EngineBoots == 0 && inpkt.USM.EngineTime == 0) { inpkt = (SnmpV3Packet)Request(pdu, param); if (inpkt != null) { return(true); } } else { return(true); } } return(false); }
/// <summary> /// Perform SNMP version 3 discovery operation. This is the first operation that needs to be /// performed on a newly accessed agent to retrieve agentId, agentBoots and agentTime values, critical /// for further authentication and privacy operations. /// </summary> /// <param name="param"><see cref="SecureAgentParameters"/> class instance that will be updated /// with discovered agent values. This class with be reset to its defaults prior to agent /// discovered values so do not store any critical information in it prior to calling the /// discovery method</param> /// <returns>True if discovery operation was a success, otherwise false</returns> public bool Discovery(SecureAgentParameters param) { param.Reset(); param.SecurityName.Set(""); param.Reportable = true; Pdu pdu = new Pdu(); // just leave everything at default. SnmpV3Packet inpkt = (SnmpV3Packet)Request(pdu, param); if (inpkt != null) { if (inpkt.USM.EngineBoots == 0 && inpkt.USM.EngineTime == 0) { inpkt = (SnmpV3Packet)Request(pdu, param); if (inpkt != null) return true; } else return true; } return false; }