Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Gauge32"/> class.
        /// </summary>
        /// <param name="length">The length.</param>
        /// <param name="stream">The stream.</param>
        public Gauge32(int length, Stream stream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }

            _count = new Counter32(length, stream);
        }
Пример #2
0
 public TimeTicks(uint count)
 {
     _count = new Counter32(count);
 }
Пример #3
0
 public Gauge32(uint value)
 {
     _count = new Counter32(value);
 }
Пример #4
0
        //-----------------------------------------------------------------------------------
        public static ISnmpData CreateSnmpDataFromStringUnsafe(SnmpType type, string strValeur)
        {
            ISnmpData data = null;

            switch (type)
            {
            case SnmpType.EndMarker:
                //Non geré
                break;

            case SnmpType.Integer32:
                data = new Integer32(Int32.Parse(strValeur));
                break;

            case SnmpType.OctetString:
                data = new OctetString(strValeur);
                break;

            case SnmpType.Null:
                data = new Null();
                break;

            case SnmpType.ObjectIdentifier:
                data = new ObjectIdentifier(strValeur);
                break;

            case SnmpType.Sequence:
                //Non geré
                break;

            case SnmpType.IPAddress:
                data = new IP(IPAddress.Parse(strValeur));
                break;

            case SnmpType.Counter32:
                data = new Counter32(uint.Parse(strValeur));
                break;

            case SnmpType.Gauge32:
                data = new Gauge32(uint.Parse(strValeur));
                break;

            case SnmpType.TimeTicks:
                data = new TimeTicks(uint.Parse(strValeur));
                break;

            case SnmpType.Opaque:
                //Non geré
                break;

            case SnmpType.NetAddress:
                //Non geré
                break;

            case SnmpType.Counter64:
                data = new Counter64(ulong.Parse(strValeur));
                break;

            case SnmpType.UInt32:
                //Non geré
                break;

            case SnmpType.NoSuchObject:
                //Non geré
                break;

            case SnmpType.NoSuchInstance:
                //Non geré
                break;

            case SnmpType.EndOfMibView:
                //Non geré
                break;

            case SnmpType.GetRequestPdu:
                //Non geré
                break;

            case SnmpType.GetNextRequestPdu:
                //Non geré
                break;

            case SnmpType.ResponsePdu:
                //Non geré
                break;

            case SnmpType.SetRequestPdu:
                //Non geré
                break;

            case SnmpType.TrapV1Pdu:
                //Non geré
                break;

            case SnmpType.GetBulkRequestPdu:
                //Non geré
                break;

            case SnmpType.InformRequestPdu:
                //Non geré
                break;

            case SnmpType.TrapV2Pdu:
                //Non geré
                break;

            case SnmpType.ReportPdu:
                //Non geré
                break;

            case SnmpType.Unknown:
                //Non geré
                break;

            default:
                break;
            }

            return(data);
        }