2019-03-11 08:57:19 +01:00
|
|
|
|
// /**
|
|
|
|
|
// * File: SnmpV1Message.cs
|
|
|
|
|
// * Author: haraldwolff
|
|
|
|
|
// *
|
|
|
|
|
// * This file and it's content is copyrighted by the Author and / or copyright holder.
|
|
|
|
|
// * Any use wihtout proper permission is illegal and may lead to legal actions.
|
|
|
|
|
// *
|
|
|
|
|
// *
|
|
|
|
|
// **/
|
|
|
|
|
using System;
|
|
|
|
|
using ln.snmp.asn1;
|
|
|
|
|
namespace ln.snmp.types
|
|
|
|
|
{
|
|
|
|
|
public class SnmpV1Message : SnmpMessage
|
|
|
|
|
{
|
|
|
|
|
public OctetString snmpCommunity { get; set; }
|
2019-03-11 15:07:34 +01:00
|
|
|
|
public override PDU snmpPDU { get; set; }
|
2019-03-11 08:57:19 +01:00
|
|
|
|
|
|
|
|
|
public SnmpV1Message()
|
|
|
|
|
:base(SnmpVersion.V1)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
public SnmpV1Message(ASN1Value value)
|
|
|
|
|
:this()
|
|
|
|
|
{
|
|
|
|
|
snmpCommunity = (OctetString)value.Items[1];
|
|
|
|
|
snmpPDU = (PDU)value.Items[2];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int MessageID
|
|
|
|
|
{
|
|
|
|
|
get => (int)snmpPDU.RequestID.LongValue;
|
|
|
|
|
set => snmpPDU.RequestID.LongValue = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override Variable[] Items
|
|
|
|
|
{
|
|
|
|
|
get => new Variable[] { new Integer((int)SnmpVersion), snmpCommunity, snmpPDU };
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
snmpCommunity = value[1] as OctetString;
|
|
|
|
|
snmpPDU = value[2] as PDU;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|