Examples of AsnOctets


Examples of uk.co.westhawk.snmp.stack.AsnOctets

        if (type.hasTag(MibTypeTag.UNIVERSAL_CATEGORY, 2)) {
            // INTEGER & Integer32
            return new AsnInteger(parseInteger(value));
        } else if (type.hasTag(MibTypeTag.UNIVERSAL_CATEGORY, 4)) {
            // OCTET STRING
            return new AsnOctets(value);
        } else if (type.hasTag(MibTypeTag.UNIVERSAL_CATEGORY, 6)) {
            // OBJECT IDENTIFIER
            return new AsnObjectId(value);
        } else if (type.hasTag(MibTypeTag.APPLICATION_CATEGORY, 0)) {
            // IPAddress
            return new AsnOctets(parseInetAddress(value));
        } else if (type.hasTag(MibTypeTag.APPLICATION_CATEGORY, 1)) {
            // Counter
            return new AsnUnsInteger(parseInteger(value),
                                     SnmpConstants.COUNTER);
        } else if (type.hasTag(MibTypeTag.APPLICATION_CATEGORY, 2)) {
            // Gauge
            return new AsnUnsInteger(parseInteger(value),
                                     SnmpConstants.GAUGE);
        } else if (type.hasTag(MibTypeTag.APPLICATION_CATEGORY, 3)) {
            // TimeTicks
            return new AsnUnsInteger(parseInteger(value),
                                     SnmpConstants.TIMETICKS);
        } else if (type.hasTag(MibTypeTag.APPLICATION_CATEGORY, 4)) {
            // Opaque
            return new AsnOctets(value);
        } else if (type.hasTag(MibTypeTag.APPLICATION_CATEGORY, 6)) {
            // Counter64
            return new AsnUnsInteger64(parseLong(value));
        } else {
            throw new SnmpException("Unsupported MIB type: " + type);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.