public void fromSubIndex(OID subIndex, boolean impliedLength) { byte[] rawValue = new byte[4]; for (int i=0; i<rawValue.length; i++) { rawValue[i] = (byte)(subIndex.get(i) & 0xFF); } try { setAddress(rawValue); } catch (UnknownHostException ex) { throw new RuntimeException(ex); } }
public void fromSubIndex(OID subIndex, boolean impliedLength) { setValue(subIndex.get(0)); } }
public void fromSubIndex(OID subIndex, boolean impliedLength) { byte[] rawValue = new byte[4]; for (int i=0; i<rawValue.length; i++) { rawValue[i] = (byte)(subIndex.get(i) & 0xFF); } try { setAddress(rawValue); } catch (UnknownHostException ex) { throw new RuntimeException(ex); } }
public void fromSubIndex(OID subIndex, boolean impliedLength) { byte[] rawValue = new byte[4]; for (int i=0; i<rawValue.length; i++) { rawValue[i] = (byte)(subIndex.get(i) & 0xFF); } try { setAddress(rawValue); } catch (UnknownHostException ex) { throw new RuntimeException(ex); } }
public void fromSubIndex(OID subIndex, boolean impliedLength) { setValue(subIndex.get(0)); }
public void fromSubIndex(OID subIndex, boolean impliedLength) { setValue(subIndex.get(0)); }
public OID getUpperBound() { OID upperBound = new OID(oid); int lastID = oid.size() - 1; /** * This is not quite correct because we would have to search up the tree * if the last sub ID is 0xFFFFFFFF, but since a table OID must end on 1 * by SMI rules we should be on the safe side here. */ upperBound.set(lastID, oid.get(lastID) + 1); return upperBound; }
public OID getUpperBound() { OID upperBound = new OID(oid); int lastID = oid.size()-1; /** * This is not quite correct because we would have to search up the tree * if the last sub ID is 0xFFFFFFFF, but since a table OID must end on 1 * by SMI rules we should be on the safe side here. */ upperBound.set(lastID, oid.get(lastID)+1); return upperBound; }
public boolean isValidIndex(OID index) { boolean ok = super.isValidIndex(index); int securityModel = index.get(0); if (ok && (securityModel > SecurityModel.SECURITY_MODEL_SNMPv2c)) { SecurityModels secModels = SecurityModels.getInstance(); if (secModels.getSecurityModel(new Integer32(securityModel)) == null) { return false; } } return ok; } };
public boolean isValidIndex(OID index) { boolean ok = super.isValidIndex(index); if (ok) { SecurityModels secModels = SecurityModels.getInstance(); if (secModels.getSecurityModel(new Integer32(index.get(0))) == null) { return false; } } return ok; } };
public boolean isValidIndex(OID index) { boolean ok = super.isValidIndex(index); if (ok) { SecurityModels secModels = SecurityModels.getInstance(); Integer32 secModel = new Integer32(index.get(index.size()-2)); if ((secModel.getValue() != SecurityModel.SECURITY_MODEL_ANY) && (secModels.getSecurityModel(secModel) == null)) { return false; } int secLevel = index.get(index.size()-1); if ((secLevel < 1) || (secLevel > 3)) { return false; } } return ok; } };
public boolean isValidIndex(OID index) { boolean ok = super.isValidIndex(index); if (ok) { SecurityModels secModels = SecurityModels.getInstance(); Integer32 secModel = new Integer32(index.get(index.size()-2)); int secModelID = secModel.getValue(); if ((secModelID != SecurityModel.SECURITY_MODEL_ANY) && (secModelID > SecurityModel.SECURITY_MODEL_SNMPv2c) && (secModels.getSecurityModel(secModel) == null)) { return false; } int secLevel = index.get(index.size()-1); if ((secLevel < 1) || (secLevel > 3)) { return false; } } return ok; } };
public CellInfo(DefaultMOTable table, OID oid) { this.table = table; this.index = table.getIndexPart(oid); if ((oid.size() > table.oid.size()) && (oid.startsWith(table.oid))) { id = oid.get(table.oid.size()); } }
public CellInfo(OID oid) { this.index = getIndexPart(oid); if ((oid.size() > DefaultMOTable.this.oid.size()) && (oid.startsWith(DefaultMOTable.this.oid))) { id = oid.get(DefaultMOTable.this.oid.size()); } /* else { id = columns[0].getColumnID(); } */ }
/** * Gets the generic trap ID from a notification OID. * @param oid * an OID. * @return * -1 if the supplied OID is not a generic trap, otherwise a zero or positive value * will be returned that denotes the generic trap ID. */ public static int getGenericTrapID(OID oid) { if ((oid == null) || (oid.size() != snmpTraps.size()+1)) { return -1; } if (oid.leftMostCompare(snmpTraps.size(), snmpTraps) == 0) { return oid.get(oid.size() - 1) - 1; } return -1; }
/** * Gets the generic trap ID from a notification OID. * @param oid * an OID. * @return * -1 if the supplied OID is not a generic trap, otherwise a zero or positive value * will be returned that denotes the generic trap ID. */ public static int getGenericTrapID(OID oid) { if ((oid == null) || (oid.size() != snmpTraps.size()+1)) { return -1; } if (oid.leftMostCompare(snmpTraps.size(), snmpTraps) == 0) { return oid.get(oid.size() - 1) - 1; } return -1; }
/** * Gets the generic trap ID from a notification OID. * @param oid * an OID. * @return * -1 if the supplied OID is not a generic trap, otherwise a value >= 0 * will be returned that denotes the generic trap ID. */ public static int getGenericTrapID(OID oid) { if ((oid == null) || (oid.size() != snmpTraps.size()+1)) { return -1; } if (oid.leftMostCompare(snmpTraps.size(), snmpTraps) == 0) { return oid.get(oid.size() - 1) - 1; } return -1; }
public void incrementCounter(CounterEvent event) { if ((event.getOid().startsWith(usmStatsPrefix)) && (event.getOid().size() > usmStatsPrefix.size())) { Counter32 current = (Counter32) usmStats[event.getOid().get(usmStatsPrefix.size())-1].getValue(); current.increment(); event.setCurrentValue((Counter32)current.clone()); } }
public void incrementCounter(CounterEvent event) { if ((event.getOid().startsWith(usmStatsPrefix)) && (event.getOid().size() > usmStatsPrefix.size())) { Counter32 current = (Counter32) usmStats[event.getOid().get(usmStatsPrefix.size())-1].getValue(); current.increment(); event.setCurrentValue((Counter32)current.clone()); } }
public void incrementCounter(CounterEvent event) { if ((event.getOid().startsWith(snmpStatsPrefix)) && (event.getOid().size() > snmpStatsPrefix.size())) { int suffix = event.getOid().get(snmpStatsPrefix.size()); for (int i=0; i<snmpStatsOIDs.length; i++) { if (suffix == snmpStatsOIDs[i].get(snmpStatsPrefix.size())) { Counter32 current = (Counter32) snmpStats[i].getValue(); current.increment();