Search in sources :

Example 1 with SnmpVarBindDTO

use of org.opennms.netmgt.snmp.SnmpVarBindDTO in project opennms by OpenNMS.

the class V1TrapInformation method getSnmpVarBindDTO.

@Override
public SnmpVarBindDTO getSnmpVarBindDTO(int i) {
    SnmpObjId name = SnmpObjId.get(getVarBindAt(i).getName().getIdentifiers());
    SnmpValue value = new JoeSnmpValue(getVarBindAt(i).getValue());
    return new SnmpVarBindDTO(name, value);
}
Also used : SnmpVarBindDTO(org.opennms.netmgt.snmp.SnmpVarBindDTO) SnmpValue(org.opennms.netmgt.snmp.SnmpValue) SnmpObjId(org.opennms.netmgt.snmp.SnmpObjId)

Example 2 with SnmpVarBindDTO

use of org.opennms.netmgt.snmp.SnmpVarBindDTO in project opennms by OpenNMS.

the class V2TrapInformation method getSnmpVarBindDTO.

@Override
public SnmpVarBindDTO getSnmpVarBindDTO(int i) {
    if (i < 2) {
        if (i == 0) {
            LOG.debug("Skipping processing of varbind it is the sysuptime and the first varbind, it is not processed as a parm per RFC2089");
        } else {
            LOG.debug("Skipping processing of varbind it is the trap OID and the second varbind, it is not processed as a parm per RFC2089");
        }
        return null;
    } else {
        SnmpObjId name = SnmpObjId.get(getVarBindAt(i).getName().getIdentifiers());
        SnmpValue value = new JoeSnmpValue(getVarBindAt(i).getValue());
        return new SnmpVarBindDTO(name, value);
    }
}
Also used : SnmpVarBindDTO(org.opennms.netmgt.snmp.SnmpVarBindDTO) SnmpValue(org.opennms.netmgt.snmp.SnmpValue) SnmpObjId(org.opennms.netmgt.snmp.SnmpObjId)

Aggregations

SnmpObjId (org.opennms.netmgt.snmp.SnmpObjId)2 SnmpValue (org.opennms.netmgt.snmp.SnmpValue)2 SnmpVarBindDTO (org.opennms.netmgt.snmp.SnmpVarBindDTO)2