Search in sources :

Example 1 with SnmpCommunityEntryRow

use of org.snmp4j.agent.mo.snmp.SnmpCommunityMIB.SnmpCommunityEntryRow in project opennms by OpenNMS.

the class MockSnmpAgent method addCommunities.

/** {@inheritDoc} */
@Override
protected void addCommunities(SnmpCommunityMIB communityMIB) {
    Variable[] com2sec = new Variable[] { // community name
    new OctetString("public"), // security name
    new OctetString("public"), // local engine ID
    getAgent().getContextEngineID(), // default context name
    new OctetString(), // transport tag
    new OctetString(), // storage type
    new Integer32(StorageType.nonVolatile), // row status
    new Integer32(RowStatus.active) };
    SnmpCommunityEntryRow row = communityMIB.getSnmpCommunityEntry().createRow(new OctetString("public2public").toSubIndex(true), com2sec);
    communityMIB.getSnmpCommunityEntry().addRow(row);
}
Also used : OctetString(org.snmp4j.smi.OctetString) SnmpCommunityEntryRow(org.snmp4j.agent.mo.snmp.SnmpCommunityMIB.SnmpCommunityEntryRow) Integer32(org.snmp4j.smi.Integer32) Variable(org.snmp4j.smi.Variable)

Aggregations

SnmpCommunityEntryRow (org.snmp4j.agent.mo.snmp.SnmpCommunityMIB.SnmpCommunityEntryRow)1 Integer32 (org.snmp4j.smi.Integer32)1 OctetString (org.snmp4j.smi.OctetString)1 Variable (org.snmp4j.smi.Variable)1