/// <summary> Constructs a new trap pdu that is identical to the /// passed pdu. /// </summary> /// <param name="second">The object to copy. /// </param> public TrapPdu(TrapPdu second) : this() { _enterprise.Set(second._enterprise); _agentAddr.Set(second._agentAddr); _generic.Value = second.Generic; _specific.Value = second.Specific; _timeStamp.Value = second.TimeStamp; for (int x = 0; x < second.VbList.Count; x++) { VbList = (VbCollection)second.VbList.Clone(); } }
/// <summary>Constructs a new trap pdu that is identical to the passed pdu.</summary> /// <param name="second">The object to copy. /// </param> public TrapPdu(TrapPdu second) : this() { enterprise.Set(second.enterprise); agentAddr.Set(second.agentAddr); generic.Value = second.Generic; specific.Value = second.Specific; timeStamp.Value = second.TimeStamp; for (int x = 0; x < second.variables.Count; x++) { variables = (VbCollection)second.VbList.Clone(); } }
/// <summary> Constructs a new trap pdu that is identical to the /// passed pdu. /// </summary> /// <param name="second">The object to copy. /// </param> public TrapPdu(TrapPdu second) : this() { _enterprise.Set(second._enterprise); _agentAddr.Set(second._agentAddr); _generic.Value = second.Generic; _specific.Value = second.Specific; _timeStamp.Value = second.TimeStamp; for (int x = 0; x < second._variables.Count; x++) { _variables = (VbCollection)second.VbList.Clone(); } }
/// <summary> /// Initialize the class with values from another <see cref="TrapPdu"/> class. /// </summary> /// <param name="second">TrapPdu class whose values are used to initialize this class.</param> public void Set(TrapPdu second) { if (second != null) { _enterprise.Set(second._enterprise); _agentAddr.Set(second._agentAddr); _generic.Value = second.Generic; _specific.Value = second.Specific; _timeStamp.Value = second.TimeStamp; VbList.Clear(); for (int x = 0; x < second.VbList.Count; x++) { VbList = (VbCollection)second.VbList.Clone(); } } else { throw new ArgumentException("Invalid argument type.", "value"); } }
/// <summary>Initialize the class with values from another <see cref="TrapPdu"/> class.</summary> /// <param name="second">TrapPdu class whose values are used to initialize this class.</param> public void Set(TrapPdu second) { if (second != null) { enterprise.Set(second.enterprise); agentAddr.Set(second.agentAddr); generic.Value = second.Generic; specific.Value = second.Specific; timeStamp.Value = second.TimeStamp; variables.Clear(); for (int x = 0; x < second.variables.Count; x++) { variables = (VbCollection)second.VbList.Clone(); } } else { throw new ArgumentException("Invalid argument type.", nameof(second)); } }
/// <summary> /// Standard constructor. /// </summary> public SnmpV1TrapPacket() : base(ESnmpVersion.Ver1) { snmpCommunity = new OctetString(); pdu = new TrapPdu(); }
/// <summary> /// Initialize the class with values from another <see cref="TrapPdu"/> class. /// </summary> /// <param name="second">TrapPdu class whose values are used to initialize this class.</param> public void Set(TrapPdu second) { if (second != null) { _enterprise.Set(second._enterprise); _agentAddr.Set(second._agentAddr); _generic.Value = second.Generic; _specific.Value = second.Specific; _timeStamp.Value = second.TimeStamp; _variables.Clear(); for (int x = 0; x < second._variables.Count; x++) { _variables = (VbCollection)second.VbList.Clone(); } } else throw new ArgumentException("Invalid argument type.", "value"); }
/// <summary> /// Standard constructor. /// </summary> public SnmpV1TrapPacket() : base(SnmpVersion.Ver1) { _snmpCommunity = new OctetString(); _pdu = new TrapPdu(); }