89 lines
2.2 KiB
C#
89 lines
2.2 KiB
C#
// /**
|
|
// * File: Integer.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;
|
|
namespace ln.snmp.types
|
|
{
|
|
public class Unsigned32 : Variable
|
|
{
|
|
public uint UIntValue { get; set; }
|
|
|
|
public Unsigned32()
|
|
:base(new Identifier(IdentifierClass.APPLICATION, false, 0x102))
|
|
{
|
|
}
|
|
|
|
public Unsigned32(uint value)
|
|
:this()
|
|
{
|
|
UIntValue = value;
|
|
}
|
|
|
|
protected Unsigned32(Identifier identifier)
|
|
: base(identifier)
|
|
{
|
|
|
|
}
|
|
protected Unsigned32(Identifier identifier,uint value)
|
|
: base(identifier)
|
|
{
|
|
UIntValue = value;
|
|
}
|
|
|
|
public override byte[] Bytes
|
|
{
|
|
get => BasicEncodingRules.EncodeInteger(UIntValue);
|
|
set => UIntValue = (uint)BasicEncodingRules.DecodeInteger(value);
|
|
}
|
|
public override object Value { get => UIntValue; set => UIntValue = (uint)value; }
|
|
|
|
|
|
public override string ToString()
|
|
{
|
|
return String.Format("[Unsigned32 UIntValue={0}]", UIntValue);
|
|
}
|
|
}
|
|
|
|
public class Counter32 : Unsigned32
|
|
{
|
|
public Counter32()
|
|
: base(new Identifier(IdentifierClass.APPLICATION, false, 0x01))
|
|
{
|
|
}
|
|
public Counter32(uint value)
|
|
: base(new Identifier(IdentifierClass.APPLICATION, false, 0x01), value)
|
|
{
|
|
}
|
|
}
|
|
|
|
public class Gauge32 : Unsigned32
|
|
{
|
|
public Gauge32()
|
|
: base(new Identifier(IdentifierClass.APPLICATION, false, 0x02))
|
|
{
|
|
}
|
|
public Gauge32(uint value)
|
|
: base(new Identifier(IdentifierClass.APPLICATION, false, 0x02), value)
|
|
{
|
|
}
|
|
}
|
|
|
|
public class TimeTicks : Unsigned32
|
|
{
|
|
public TimeTicks()
|
|
: base(new Identifier(IdentifierClass.APPLICATION, false, 0x03))
|
|
{
|
|
}
|
|
public TimeTicks(uint value)
|
|
: base(new Identifier(IdentifierClass.APPLICATION, false, 0x03), value)
|
|
{
|
|
}
|
|
}
|
|
}
|