java.lang.Object
org.snmp4j.agent.mo.snmp.SnmpCommunityMIB
- All Implemented Interfaces:
CoexistenceInfoProvider
,MOGroup
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
class
class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final org.snmp4j.smi.OID
static final org.snmp4j.smi.OID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSnmpCommunityEntry
(org.snmp4j.smi.OctetString indexName, org.snmp4j.smi.OctetString community, org.snmp4j.smi.OctetString securityName, org.snmp4j.smi.OctetString contextEngineID, org.snmp4j.smi.OctetString contextName, org.snmp4j.smi.OctetString communityTransportTag, int storageType) Adds an entry to the SnmpCommunityTable and a corresponding coexistence information entry in the internal cache.getCoexistenceInfo
(org.snmp4j.smi.OctetString community) Gets the information needed for community based security protocols to coexistence with the SNMPv3 security model.org.snmp4j.smi.OctetString
getCommunity
(org.snmp4j.smi.OctetString securityName, org.snmp4j.smi.OctetString contextEngineID, org.snmp4j.smi.OctetString contextName) Returns the community associated with the supplied security name.MOTable
<SnmpCommunityMIB.SnmpCommunityEntryRow, MOColumn, MOMutableTableModel<SnmpCommunityMIB.SnmpCommunityEntryRow>> boolean
Returnstrue
if source address filtering is enabled.boolean
passesFilter
(org.snmp4j.smi.Address address, CoexistenceInfo coexistenceInfo) Checks whether the supplied address passes the source address filter configured for the supplied transport tag.void
registerMOs
(MOServer server, org.snmp4j.smi.OctetString context) Registers the managed objects of this group with the server for the supplied context.boolean
removeSnmpCommuntiyEntry
(org.snmp4j.smi.OctetString indexName) Removes a community entry from the SnmpCommunityTable and also removes the corresponding coexistence information from the cache.void
setBaseTableSnmpTargetAddrEntry
(MOTable<SnmpTargetMIB.SnmpTargetAddrEntryRow, ? extends MOColumn, ? extends MOTableModel<SnmpTargetMIB.SnmpTargetAddrEntryRow>> baseTable) void
setSourceAddressFiltering
(boolean sourceAddressFiltering) Enables or disables source address filtering for incoming SNMPv1 or SNMPv2c packets.void
unregisterMOs
(MOServer server, org.snmp4j.smi.OctetString context) Unregisters the managed objects of this group from the supplied server and from the supplied context.
-
Field Details
-
oidSnmpCommunityEntry
public static final org.snmp4j.smi.OID oidSnmpCommunityEntry -
colSnmpCommunityName
public static final int colSnmpCommunityName- See Also:
-
colSnmpCommunitySecurityName
public static final int colSnmpCommunitySecurityName- See Also:
-
colSnmpCommunityContextEngineID
public static final int colSnmpCommunityContextEngineID- See Also:
-
colSnmpCommunityContextName
public static final int colSnmpCommunityContextName- See Also:
-
colSnmpCommunityTransportTag
public static final int colSnmpCommunityTransportTag- See Also:
-
colSnmpCommunityStorageType
public static final int colSnmpCommunityStorageType- See Also:
-
colSnmpCommunityStatus
public static final int colSnmpCommunityStatus- See Also:
-
idxSnmpCommunityName
public static final int idxSnmpCommunityName- See Also:
-
idxSnmpCommunitySecurityName
public static final int idxSnmpCommunitySecurityName- See Also:
-
idxSnmpCommunityContextEngineID
public static final int idxSnmpCommunityContextEngineID- See Also:
-
idxSnmpCommunityContextName
public static final int idxSnmpCommunityContextName- See Also:
-
idxSnmpCommunityTransportTag
public static final int idxSnmpCommunityTransportTag- See Also:
-
idxSnmpCommunityStorageType
public static final int idxSnmpCommunityStorageType- See Also:
-
idxSnmpCommunityStatus
public static final int idxSnmpCommunityStatus- See Also:
-
oidSnmpTargetAddrExtEntry
public static final org.snmp4j.smi.OID oidSnmpTargetAddrExtEntry -
colSnmpTargetAddrTMask
public static final int colSnmpTargetAddrTMask- See Also:
-
colSnmpTargetAddrMMS
public static final int colSnmpTargetAddrMMS- See Also:
-
idxSnmpTargetAddrTMask
public static final int idxSnmpTargetAddrTMask- See Also:
-
idxSnmpTargetAddrMMS
public static final int idxSnmpTargetAddrMMS- See Also:
-
-
Constructor Details
-
SnmpCommunityMIB
-
-
Method Details
-
getSnmpCommunityEntry
public MOTable<SnmpCommunityMIB.SnmpCommunityEntryRow,MOColumn, getSnmpCommunityEntry()MOMutableTableModel<SnmpCommunityMIB.SnmpCommunityEntryRow>> -
getSnmpTargetAddrExtEntry
-
setBaseTableSnmpTargetAddrEntry
public void setBaseTableSnmpTargetAddrEntry(MOTable<SnmpTargetMIB.SnmpTargetAddrEntryRow, ? extends MOColumn, ? extends MOTableModel<SnmpTargetMIB.SnmpTargetAddrEntryRow>> baseTable) -
registerMOs
public void registerMOs(MOServer server, org.snmp4j.smi.OctetString context) throws DuplicateRegistrationException Description copied from interface:MOGroup
Registers the managed objects of this group with the server for the supplied context.- Specified by:
registerMOs
in interfaceMOGroup
- Parameters:
server
- theMOServer
where to register the managed objects.context
- the context to use (may benull
if no specific context is selected).- Throws:
DuplicateRegistrationException
- if a managed object's scope (i.e. lower bound) is already registered at the server.
-
unregisterMOs
Description copied from interface:MOGroup
Unregisters the managed objects of this group from the supplied server and from the supplied context.- Specified by:
unregisterMOs
in interfaceMOGroup
- Parameters:
server
- theMOServer
where to unregister the managed objects.context
- the context to use (may benull
if no specific context is selected).
-
getCoexistenceInfo
Description copied from interface:CoexistenceInfoProvider
Gets the information needed for community based security protocols to coexistence with the SNMPv3 security model.- Specified by:
getCoexistenceInfo
in interfaceCoexistenceInfoProvider
- Parameters:
community
- a community OctetString that identifies the coexistence information required.- Returns:
- the CoexistenceInfo instances with security name, context engine ID, context, and optionally a transport tag
-
passesFilter
Checks whether the supplied address passes the source address filter configured for the supplied transport tag. The tag identifies a set of addresses configured in the snmpTargetAddrTable which is extended by the snmpTargetAddrExtTable. The transport address mask allows entries in the snmpTargetAddrTable to define a set of addresses instead of just a single address.- Specified by:
passesFilter
in interfaceCoexistenceInfoProvider
- Parameters:
address
- the address of the incoming packet to check.coexistenceInfo
- a set of coexistence information that provides the transport tag that is used to identify allowed source addresses. On return, the maximum message size attribute of the coexistence info set will be set according to the values defined for the matched source address in the snmpTargetAddrExtTable.- Returns:
- boolean
-
setSourceAddressFiltering
public void setSourceAddressFiltering(boolean sourceAddressFiltering) Enables or disables source address filtering for incoming SNMPv1 or SNMPv2c packets. By default source address filtering is disabled! If enabled, only messages received for community based security models are processed, that match an address in the snmpTargetAddressTable with the transport tag associated with the community used.- Parameters:
sourceAddressFiltering
- iftrue
source address filtering is enabled, otherwise it is disabled.
-
isSourceAddressFiltering
public boolean isSourceAddressFiltering()Returnstrue
if source address filtering is enabled. In that case a call topassesFilter(org.snmp4j.smi.Address, org.snmp4j.agent.mo.snmp.CoexistenceInfo)
will always returntrue
.- Returns:
true
if source address filtering is enabled,false
otherwise.
-
getCommunity
public org.snmp4j.smi.OctetString getCommunity(org.snmp4j.smi.OctetString securityName, org.snmp4j.smi.OctetString contextEngineID, org.snmp4j.smi.OctetString contextName) Description copied from interface:CoexistenceInfoProvider
Returns the community associated with the supplied security name.- Specified by:
getCommunity
in interfaceCoexistenceInfoProvider
- Parameters:
securityName
- the security name.contextEngineID
- the context engine ID of the remote target (when proxying) otherwise the local engine ID.contextName
- the context name (default is an empty string).- Returns:
- OctetString
the associated community string or
null
if such an association does not exists.
-
addSnmpCommunityEntry
public void addSnmpCommunityEntry(org.snmp4j.smi.OctetString indexName, org.snmp4j.smi.OctetString community, org.snmp4j.smi.OctetString securityName, org.snmp4j.smi.OctetString contextEngineID, org.snmp4j.smi.OctetString contextName, org.snmp4j.smi.OctetString communityTransportTag, int storageType) Adds an entry to the SnmpCommunityTable and a corresponding coexistence information entry in the internal cache.- Parameters:
indexName
- the ID of the entry (max. 32 bytes long).community
- the community string for which a row in this table represents a configuration.securityName
- A human readable string representing the corresponding value of snmpCommunityName in a Security Model independent format.contextEngineID
- The contextEngineID indicating the location of the context in which management information is accessed when using the community string specified by the corresponding instance of snmpCommunityName.contextName
- The context in which management information is accessed when using the community string specified by the corresponding instance of snmpCommunityName.communityTransportTag
- This object specifies a set of transport endpoints from which a command responder application will accept management requests. If a management request containing this community is received on a transport endpoint other than the transport endpoints identified by this object, the request is deemed unauthentic. The transports identified by this object are specified in the snmpTargetAddrTable. Entries in that table whose snmpTargetAddrTagList contains this tag value are identified. If the value of this object has zero-length, transport endpoints are not checked when authenticating messages containing this community string.storageType
- The storage type for this conceptual row in the snmpCommunityTable. Conceptual rows having the value 'permanent' need not allow write-access to any columnar object in the row.- Since:
- 2.3.1
-
removeSnmpCommuntiyEntry
public boolean removeSnmpCommuntiyEntry(org.snmp4j.smi.OctetString indexName) Removes a community entry from the SnmpCommunityTable and also removes the corresponding coexistence information from the cache.- Parameters:
indexName
- the ID of the entry.- Returns:
true
if the row has been found and removed,false
otherwise.- Since:
- 2.3.1
-