#include <mib_policy.h>

Public Member Functions | |
| MibTableSizePolicy () | |
| Create an empty MibTable size policy. | |
| MibTableSizePolicy (const table_size_def *, unsigned int, unsigned int) | |
| Create a MibTable size policy using the given size restriction array. | |
| virtual | ~MibTableSizePolicy () |
| virtual int | is_transition_ok (MibTable *, MibTableRow *, const Oidx &, int, int) |
| Check whether a transition from an old to a new RowStatus value is allowed. | |
| virtual void | set_policy (const Oidx &, unsigned int) |
| Set a MibTable size policy. | |
| virtual void | remove_policy (const Oidx &) |
| Remove a size restriction from the policy table. | |
Static Public Member Functions | |
| static void | register_policy (MibContext *, MibTableSizePolicy *) |
| Register the given MibTableSizePolicy instance wiht all tables currently known by the given Mib instance. | |
Protected Attributes | |
| OidList< MibStaticEntry > | policies |
| unsigned int | defaultLimit |
| 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.
| 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 | ( | ) | [inline, virtual] |
| virtual int MibTableSizePolicy::is_transition_ok | ( | MibTable * | , | |
| MibTableRow * | , | |||
| const Oidx & | , | |||
| int | , | |||
| int | ||||
| ) | [virtual] |
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.
| 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. |
Reimplemented from MibTableVoter.
| virtual void MibTableSizePolicy::set_policy | ( | const Oidx & | , | |
| unsigned | int | |||
| ) | [virtual] |
| virtual void MibTableSizePolicy::remove_policy | ( | const Oidx & | ) | [virtual] |
| static void MibTableSizePolicy::register_policy | ( | MibContext * | , | |
| MibTableSizePolicy * | ||||
| ) | [static] |
Register the given MibTableSizePolicy instance wiht all tables currently known by the given Mib instance.
| mib | a pointer to a Mib instance that has already tables registered. | |
| sizePolicy | a pointer to a MibTableSizePolicy instance. |
OidList<MibStaticEntry> MibTableSizePolicy::policies [protected] |
unsigned int MibTableSizePolicy::defaultLimit [protected] |
1.5.6