Skip to content

Commit

Permalink
Revised the new constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Feb 6, 2024
1 parent 30234e6 commit da4a39f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions SharpSnmpLib/Messaging/TrapV2Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public TrapV2Message(int requestId, VersionCode version, OctetString community,
/// <param name="engineTime">The engine time.</param>
[CLSCompliant(false)]
public TrapV2Message(VersionCode version, int messageId, int requestId, OctetString userName, ObjectIdentifier enterprise, uint time, IList<Variable> variables, IPrivacyProvider privacy, int maxMessageSize, OctetString engineId, int engineBoots, int engineTime)
: this(version, messageId, requestId, userName, enterprise, time, variables, privacy, maxMessageSize, engineId, OctetString.Empty, engineBoots, engineTime)
: this(version, messageId, requestId, userName, enterprise, time, variables, privacy, maxMessageSize, engineId, engineBoots, engineTime, OctetString.Empty, OctetString.Empty)
{
}

Expand All @@ -107,11 +107,12 @@ public TrapV2Message(VersionCode version, int messageId, int requestId, OctetStr
/// <param name="privacy">The privacy.</param>
/// <param name="maxMessageSize">Size of the max message.</param>
/// <param name="engineId">The engine ID.</param>
/// <param name="contextName">The context name.</param>
/// <param name="engineBoots">The engine boots.</param>
/// <param name="engineTime">The engine time.</param>
/// <param name="contextEngineId">The context engine ID.</param>
/// <param name="contextName">The context name.</param>
[CLSCompliant(false)]
public TrapV2Message(VersionCode version, int messageId, int requestId, OctetString userName, ObjectIdentifier enterprise, uint time, IList<Variable> variables, IPrivacyProvider privacy, int maxMessageSize, OctetString engineId, OctetString contextName, int engineBoots, int engineTime)
public TrapV2Message(VersionCode version, int messageId, int requestId, OctetString userName, ObjectIdentifier enterprise, uint time, IList<Variable> variables, IPrivacyProvider privacy, int maxMessageSize, OctetString engineId, int engineBoots, int engineTime, OctetString contextEngineId, OctetString contextName)
{
if (userName == null)
{
Expand Down Expand Up @@ -153,7 +154,7 @@ public TrapV2Message(VersionCode version, int messageId, int requestId, OctetStr
time,
variables);

Scope = new Scope(engineId, contextName, pdu);
Scope = new Scope(contextEngineId, contextName, pdu);
Privacy.ComputeHash(Version, Header, Parameters, Scope);
_bytes = this.PackMessage(null).ToBytes();
}
Expand Down

0 comments on commit da4a39f

Please sign in to comment.