MibTableSizePolicy Class Reference

The MibTableSizePolicy class implements a policy for MibTable size limits. More...

#include <mib_policy.h>

Inheritance diagram for MibTableSizePolicy:

MibTableVoter

List of all members.

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< MibStaticEntrypolicies
unsigned int defaultLimit


Detailed Description

The MibTableSizePolicy class implements a policy for MibTable size limits.

Author:
Frank Fock
Version:
3.5

Constructor & Destructor Documentation

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 (  )  [inline, virtual]


Member Function Documentation

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.

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.

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.

virtual void MibTableSizePolicy::remove_policy ( const Oidx  )  [virtual]

Remove a size restriction from the policy table.

Parameters:
tableOID the OID of a MibTable object.

static void MibTableSizePolicy::register_policy ( MibContext ,
MibTableSizePolicy  
) [static]

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.


Member Data Documentation

unsigned int MibTableSizePolicy::defaultLimit [protected]


The documentation for this class was generated from the following file:

Generated on Fri May 29 22:36:54 2009 for AGENT++ by  doxygen 1.5.6