SNMP4J-CONFIG-MIB DEFINITIONS ::= BEGIN

IMPORTS
	snmp4jAgentModules
		FROM SNMP4J-AGENT-REG
	DisplayString,
	RowStatus,
	StorageType,
	TimeStamp
		FROM SNMPv2-TC
	SnmpAdminString
		FROM SNMP-FRAMEWORK-MIB
	MODULE-IDENTITY,
	OBJECT-TYPE,
	TimeTicks,
	Unsigned32
		FROM SNMPv2-SMI
	OBJECT-GROUP
		FROM SNMPv2-CONF;

snmp4jCfgMIB MODULE-IDENTITY
	LAST-UPDATED "202104132358Z"	-- Apr 13, 2021, 11:58:00 PM
	ORGANIZATION "SNMP4J.ORG"
	CONTACT-INFO
		"Frank Fock
		http://www.snmp4j.org
		fock@snmp4j.org"
	DESCRIPTION
		"This MIB module defines managed objects for the
		configuration of a SNMP4J agent."
	REVISION "202104132358Z"	-- Apr 13, 2021, 11:58:00 PM
	DESCRIPTION
		"Added snmp4jCfgStorageSeqGroup
		and objects for defining a restore order 
		to allow cascaded initialization of object
		dependencies."
	REVISION "202009242228Z"	-- Sep 24, 2020, 10:28:00 PM
	DESCRIPTION
		"Added snmp4jCfgReset"
	REVISION "200608311905Z"	-- Aug 31, 2006, 7:05:00 PM
	DESCRIPTION
		"Added error(5) state to snmp4jCfgStorageOperation."
	REVISION "200601301947Z"	-- Jan 30, 2006, 7:47:00 PM
	DESCRIPTION
		"Initial version."
	-- 1.3.6.1.4.1.4976.10.1.1.2
	::= { snmp4jAgentModules 2 }


snmp4jCfgActions OBJECT IDENTIFIER 
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.3
	::= { snmp4jCfgObjects 3 }

snmp4jCfgLastReset OBJECT-TYPE
	SYNTAX  TimeStamp
	MAX-ACCESS read-only
	STATUS  current
	DESCRIPTION
		"If greater than zero, this value specifies the sysUpTime when
		the configuration was last reset using the snmp4jCsnmp4jCfgReset
		action factoryReset(2)."
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.3.2
	::= { snmp4jCfgActions 2 }


snmp4jCfgReset OBJECT-TYPE
	SYNTAX  INTEGER {
			idle(1),         	-- default value
			factoryReset(2), 	-- Resets the agent's config to factory default
			resetting(3),    	-- Returned while reset is being executed
			resetFailed(4),  	-- Reset failed, see log
			done(5)         	-- At least one reset has been done since last boot
			}
	MAX-ACCESS read-write
	STATUS  current
	DESCRIPTION
		"Reset the agent's configuration to the factory default by setting
		the enumerated value to factoryReset(2).
		Setting this object to idle(1) has not effect.
		Setting this value to any other value (3,4, and 5) returns an
		inconsistentValue error."
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.3.1
	::= { snmp4jCfgActions 1 }


-- Scalars and Tables
--

snmp4jCfgObjects OBJECT IDENTIFIER 
	-- 1.3.6.1.4.1.4976.10.1.1.2.1
	::= { snmp4jCfgMIB 1 }

snmp4jCfgSecurity OBJECT IDENTIFIER 
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.1
	::= { snmp4jCfgObjects 1 }

snmp4jCfgSecSrcAddrValidation OBJECT-TYPE
	SYNTAX  INTEGER {
			enabled(1),
			disabled(2),
			notAvailable(3) }
	MAX-ACCESS read-write
	STATUS  current
	DESCRIPTION
		"Specifies whether SNMPv1/v2c source address
		validation via the snmpTargetAddrExtTable and
		the snmpCommunityTable is enabled or disabled.

		If the value of this object is notAvailable(3), then at
		least one of the necessary MIB modules are not
		implemented for this agent instance and an attempt
		to set this object's value to enabled(1) or disabled(2)
		will result in a wrongValue error."
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.1.1
	::= { snmp4jCfgSecurity 1 }


snmp4jCfgStorage OBJECT IDENTIFIER 
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.2
	::= { snmp4jCfgObjects 2 }

snmp4jCfgStorageTable OBJECT-TYPE
	SYNTAX  SEQUENCE OF Snmp4jCfgStorageEntry
	MAX-ACCESS not-accessible
	STATUS  current
	DESCRIPTION
		"A table containing a list of SNMP4J-Agent persistent
		storage configurations. By default this table contains
		a single row with an snmp4jCfgStorageName of
		'primary' that represents the persistent storage
		configuration used to load the agent's configuration
		at boot time. This entry will have a storage type of
		'permanent' and thus it cannot be deleted.

		Other entries may be added to provide for
		experimental or backup storage.'"
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.2.1
	::= { snmp4jCfgStorage 1 }


snmp4jCfgStorageEntry OBJECT-TYPE
	SYNTAX  Snmp4jCfgStorageEntry
	MAX-ACCESS not-accessible
	STATUS  current
	DESCRIPTION
		"A row specifying the location and storage format
		of an SNMP4J-Agent agent configuration."
	INDEX {
		snmp4jCfgStorageName }
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.2.1.1
	::= { snmp4jCfgStorageTable 1 }


Snmp4jCfgStorageEntry ::= SEQUENCE {

	snmp4jCfgStorageName        SnmpAdminString,
	snmp4jCfgStoragePath        DisplayString,
	snmp4jCfgStorageFormat      INTEGER,
	snmp4jCfgStorageLastStore   TimeTicks,
	snmp4jCfgStorageLastRestore TimeTicks,
	snmp4jCfgStorageRestoreMode INTEGER,
	snmp4jCfgStorageOperation   INTEGER,
	snmp4jCfgStorageStorageType StorageType,
	snmp4jCfgStorageStatus      RowStatus }


snmp4jCfgStorageName OBJECT-TYPE
	SYNTAX  SnmpAdminString
	MAX-ACCESS not-accessible
	STATUS  current
	DESCRIPTION
		"The name of the configuration storage entry.
		A default SNMP4J-Agent agent implementation will
		always contain an entry (row) with the name
		'primary'. The 'primary' entry specifies the storage
		from which the agent reads its configuration after
		a restart.
		the"
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.2.1.1.1
	::= { snmp4jCfgStorageEntry 1 }


snmp4jCfgStoragePath OBJECT-TYPE
	SYNTAX  DisplayString
	MAX-ACCESS read-create
	STATUS  current
	DESCRIPTION
		"The path to the configuration on the agent's file
		system. Depending on the persistent storage type,
		the path can be a directory or a file.

		If the path is a directory, the last character of the
		path has to be the file separation character (on
		UNIX '/') of the platform the agent is running on."
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.2.1.1.2
	::= { snmp4jCfgStorageEntry 2 }


snmp4jCfgStorageFormat OBJECT-TYPE
	SYNTAX  INTEGER {
			binary(1), 	-- Default format
			xml(2) }
	MAX-ACCESS read-create
	STATUS  obsolete
	DESCRIPTION
		"The storage format specifies the format of the persistent
		configuration storage associated with this row.
		Currently only SNMP4J-Agent's binary encoded MIB object
		serialization 'binary(1)' is supported."
	DEFVAL { binary }
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.2.1.1.3
	::= { snmp4jCfgStorageEntry 3 }


snmp4jCfgStorageLastStore OBJECT-TYPE
	SYNTAX  TimeTicks
	MAX-ACCESS read-only
	STATUS  current
	DESCRIPTION
		"The time stamp of the last store operation on the
		configuration persistent storage represented by
		this entry. A zero value is returned when this
		configuration have not been written since the last
		agent restart.

		This object will be reset to 0 if snmp4jCfgStoragePath
		is altered for this row."
	DEFVAL { 0 }
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.2.1.1.4
	::= { snmp4jCfgStorageEntry 4 }


snmp4jCfgStorageLastRestore OBJECT-TYPE
	SYNTAX  TimeTicks
	MAX-ACCESS read-only
	STATUS  current
	DESCRIPTION
		"The time stamp when the configuration of this
		persistent storage has been restored for the last time.
		A zero value is returned, when this configuration has not
		been read since the last restart of the agent.

		This object will be reset to 0 if snmp4jCfgStoragePath
		is altered for this row."
	DEFVAL { 0 }
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.2.1.1.5
	::= { snmp4jCfgStorageEntry 5 }


snmp4jCfgStorageRestoreMode OBJECT-TYPE
	SYNTAX  INTEGER {
			replaceAndCreate(1),
			updateAndCreate(2),
			updateOnly(3),
			createOnly(4) }
	MAX-ACCESS read-create
	STATUS  current
	DESCRIPTION
		"The restore mode defines how the configuration
		should be restored and optionally merged with the
		current running configuration."
	DEFVAL { replaceAndCreate }
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.2.1.1.6
	::= { snmp4jCfgStorageEntry 6 }


snmp4jCfgStorageOperation OBJECT-TYPE
	SYNTAX  INTEGER {
			idle(1),       	-- no action
			inProgress(2), 	-- (re)store operation in progress
			store(3),      	-- store current configuration
			restore(4),    	-- restore configuration
			error(5)      	-- last operation failed
			}
	MAX-ACCESS read-create
	STATUS  current
	DESCRIPTION
		"The states 'idle(1)', 'inProgress(2)', and 'error(5)' can
		only be read, whereas the states 'store(3)' and 'restore(4)'
		can only be written.

		Setting this object to 'store(3)' will save the agent's
		configuration to the location identified by
		snmp4jCfgStoragePath. Setting this object to
		'restore(4)' resets the agent to the configuration
		read from location snmp4jCfgStoragePath.
		While the two operations above are in progress,
		this object returns 'inProgress(2)' on get requests.
		Otherwise 'idle(1)' is returned on get requests.
		If the last operation failed with an error, error(5) is
		is returned. An operation may fail because an IO
		exception occurred while accessing persistent
		storage, for example.

		While its state is 'inProgress' any set request returns
		a 'resourceUnavailable(13)' error."
	DEFVAL { idle }
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.2.1.1.7
	::= { snmp4jCfgStorageEntry 7 }


snmp4jCfgStorageStorageType OBJECT-TYPE
	SYNTAX  StorageType
	MAX-ACCESS read-create
	STATUS  current
	DESCRIPTION
		"The storage type of the entry in the SNMP4J-Agent persistent
		storage table."
	DEFVAL { nonVolatile }
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.2.1.1.8
	::= { snmp4jCfgStorageEntry 8 }


snmp4jCfgStorageStatus OBJECT-TYPE
	SYNTAX  RowStatus
	MAX-ACCESS read-create
	STATUS  current
	DESCRIPTION
		"Control for creating and deleting entries.  Entries may
		not be modified while active."
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.2.1.1.9
	::= { snmp4jCfgStorageEntry 9 }


snmp4jCfgStorageSeqTable OBJECT-TYPE
	SYNTAX  SEQUENCE OF Snmp4jCfgStorageSeqEntry
	MAX-ACCESS not-accessible
	STATUS  current
	DESCRIPTION
		"This table defines the sequence (i.e. order) that is
		used to store and restore persistent objects.
		This order can be used to define dependencies 
		between managed objects in order to make sure
		that dependent objects are restored after their
		parent objects."
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.2.2
	::= { snmp4jCfgStorage 2 }


snmp4jCfgStorageSeqEntry OBJECT-TYPE
	SYNTAX  Snmp4jCfgStorageSeqEntry
	MAX-ACCESS not-accessible
	STATUS  current
	DESCRIPTION
		"A row in this table has a numeric index, where
		each row represents a managed object. Tabular
		objects are represented as a single row that
		points to the Table object identifier."
	INDEX {
		snmp4jCfgStorageSeqIndex }
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.2.2.1
	::= { snmp4jCfgStorageSeqTable 1 }


Snmp4jCfgStorageSeqEntry ::= SEQUENCE {

	snmp4jCfgStorageSeqIndex       Unsigned32,
	snmp4jCfgStorageSeqSubtree     OBJECT IDENTIFIER,
	snmp4jCfgStorageSeqStorageType StorageType,
	snmp4jCfgStorageSeqRowStatus   RowStatus }


snmp4jCfgStorageSeqIndex OBJECT-TYPE
	SYNTAX  Unsigned32
	MAX-ACCESS not-accessible
	STATUS  current
	DESCRIPTION
		"A numeric index where lower values are stored and restored before higher
		numbers. "
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.2.2.1.1
	::= { snmp4jCfgStorageSeqEntry 1 }


snmp4jCfgStorageSeqSubtree OBJECT-TYPE
	SYNTAX  OBJECT IDENTIFIER
	MAX-ACCESS read-create
	STATUS  current
	DESCRIPTION
		"This OID is the object identifier of a scalar, tabular OBJECT-TYPE or a sub-tree.
		Specifying an OID of an object instance will have no effect!

		If there is any object instance or group of object instances within that defined
		sub-tree or OBJECT-TYPE, then all of these objects will be stored in their
		lexicographic object instance ID order at the sequence position defined by
		snmp4jCfgStorageSeqIndex."
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.2.2.1.2
::= { snmp4jCfgStorageSeqEntry 2 }


snmp4jCfgStorageSeqStorageType OBJECT-TYPE
	SYNTAX  StorageType
	MAX-ACCESS read-create
	STATUS  current
	DESCRIPTION
		"The storage type of this row."
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.2.2.1.3
	::= { snmp4jCfgStorageSeqEntry 3 }


snmp4jCfgStorageSeqRowStatus OBJECT-TYPE
	SYNTAX  RowStatus
	MAX-ACCESS read-create
	STATUS  current
	DESCRIPTION
		"The row status of this row."
	-- 1.3.6.1.4.1.4976.10.1.1.2.1.2.2.1.4
	::= { snmp4jCfgStorageSeqEntry 4 }


-- Notification Types
--

snmp4jCfgEvents OBJECT IDENTIFIER 
	-- 1.3.6.1.4.1.4976.10.1.1.2.2
	::= { snmp4jCfgMIB 2 }

-- Conformance
--

snmp4jCfgConf OBJECT IDENTIFIER 
	-- 1.3.6.1.4.1.4976.10.1.1.2.3
	::= { snmp4jCfgMIB 3 }

-- Groups
--

snmp4jCfgGroups OBJECT IDENTIFIER 
	-- 1.3.6.1.4.1.4976.10.1.1.2.3.1
	::= { snmp4jCfgConf 1 }

-- Compliance
--

snmp4jCfgCompls OBJECT IDENTIFIER 
	-- 1.3.6.1.4.1.4976.10.1.1.2.3.2
	::= { snmp4jCfgConf 2 }

snmp4jCfgBasicGroup OBJECT-GROUP
	OBJECTS {
		snmp4jCfgSecSrcAddrValidation,
		snmp4jCfgStorageFormat,
		snmp4jCfgStorageLastRestore,
		snmp4jCfgStorageLastStore,
		snmp4jCfgStorageOperation,
		snmp4jCfgStoragePath,
		snmp4jCfgStorageRestoreMode,
		snmp4jCfgStorageStatus,
		snmp4jCfgStorageStorageType,
		snmp4jCfgReset,
		snmp4jCfgLastReset }
	STATUS  current
	DESCRIPTION
		"Basic objects."
	-- 1.3.6.1.4.1.4976.10.1.1.2.3.1.1
	::= { snmp4jCfgGroups 1 }

snmp4jCfgStorageSeqGroup OBJECT-GROUP
	OBJECTS {
		snmp4jCfgStorageSeqSubtree,
		snmp4jCfgStorageSeqStorageType,
		snmp4jCfgStorageSeqRowStatus }
	STATUS  current
	DESCRIPTION
		"This object group contains optional objects about configuring a sequence
		for storing and restoring persistent managed objects."
	-- 1.3.6.1.4.1.4976.10.1.1.2.3.1.2
	::= { snmp4jCfgGroups 2 }

END
