The MibTableSizePolicy class implements a policy for MibTable size limits.
More...
#include <mib_policy.h>
The MibTableSizePolicy class implements a policy for MibTable size limits.
- Author
- Frank Fock
- Version
- 3.5
MibTableSizePolicy::MibTableSizePolicy |
( |
| ) |
|
|
inline |
Create an empty MibTable size policy.
This will accept any table sizes for any tables.
MibTableSizePolicy::MibTableSizePolicy |
( |
const table_size_def * |
, |
|
|
unsigned |
int, |
|
|
unsigned |
int |
|
) |
| |
Create a MibTable size policy using the given size restriction array.
Tables with an OID not listed in the array will be restricted to the given default size.
- Parameters
-
tableSizeRestrictions | an array of table_size_def structures. Each entry defines the maximum number of rows that can be created for the specified table through SNMP requests. |
size | the size of the above table. |
defaultTableSize | the maximum table size for tables not explicitly listed in the above array. The value 0 will disable any default restriction. |
virtual MibTableSizePolicy::~MibTableSizePolicy |
( |
| ) |
|
|
inlinevirtual |
Check whether a transition from an old to a new RowStatus value is allowed.
Possible return values that will abort a transition are shown by the following table:
Requested transition | Posible return values
rowEmpty -> rowDestroy | SNMP_ERROR_INCONSIST_NAME
rowEmpty -> notReady | SNMP_ERROR_RESOURCE_UNAVAIL | SNMP_ERROR_INCONSIST_VAL | SNMP_ERROR_NO_CREATION
| SNMP_ERROR_INCONSIST_NAME
rowNotInService/ | SNMP_ERROR_RESOURCE_UNAVAIL rowNotReady -> | SNMP_ERROR_INCONSIST_VAL
rowActive |
rowActive -> notInService | SNMP_ERROR_INCONSIST_VAL rowDestroy |
By returning SNMP_ERROR_SUCCESS the MibTableVoter instance votes for the transition to be performed.
- Parameters
-
table | a pointer to a MibTable instance firing the event. The parameter 'table' can be 0 if the local table is source and target of the event. |
row | a pointer to the MibTableRow instance whose status is to be changed. |
index | the index of the row that is changed. |
currentStatus | the current status of the row. |
requestedStatus | the requested new status of the row. |
- Returns
- a SNMP error status or SNMP_ERROR_SUCCESS if the transition is acknowledged by the voter.
Reimplemented from MibTableVoter.
Register the given MibTableSizePolicy instance wiht all tables currently known by the given Mib instance.
- Parameters
-
mib | a pointer to a Mib instance that has already tables registered. |
sizePolicy | a pointer to a MibTableSizePolicy instance. |
virtual void MibTableSizePolicy::remove_policy |
( |
const Oidx & |
| ) |
|
|
virtual |
Remove a size restriction from the policy table.
- Parameters
-
virtual void MibTableSizePolicy::set_policy |
( |
const Oidx & |
, |
|
|
unsigned |
int |
|
) |
| |
|
virtual |
Set a MibTable size policy.
- Parameters
-
tableOID | the OID of a MibTable object. |
maxNumberOfRows | the upper limit for the number of rows that may exists in the specified table. If this limit is exceeded row creation SNMP requests will be rejected with a 'resourceUnavail' error. |
unsigned int MibTableSizePolicy::defaultLimit |
|
protected |
The documentation for this class was generated from the following file: