AGENT++  4.0.3
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
MibTableSizePolicy Class Reference

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

#include <mib_policy.h>

Inheritance diagram for MibTableSizePolicy:
MibTableVoter

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.
 
- Public Member Functions inherited from MibTableVoter
 MibTableVoter ()
 
virtual ~MibTableVoter ()
 

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
tableSizeRestrictionsan 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.
sizethe size of the above table.
defaultTableSizethe maximum table size for tables not explicitly listed in the above array. The value 0 will disable any default restriction.
virtual MibTableSizePolicy::~MibTableSizePolicy ( )
inlinevirtual

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
tablea 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.
rowa pointer to the MibTableRow instance whose status is to be changed.
indexthe index of the row that is changed.
currentStatusthe current status of the row.
requestedStatusthe 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.

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

Register the given MibTableSizePolicy instance wiht all tables currently known by the given Mib instance.

Parameters
miba pointer to a Mib instance that has already tables registered.
sizePolicya pointer to a MibTableSizePolicy instance.
virtual void MibTableSizePolicy::remove_policy ( const Oidx )
virtual

Remove a size restriction from the policy table.

Parameters
tableOIDthe OID of a MibTable object.
virtual void MibTableSizePolicy::set_policy ( const Oidx ,
unsigned  int 
)
virtual

Set a MibTable size policy.

Parameters
tableOIDthe OID of a MibTable object.
maxNumberOfRowsthe 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.

Member Data Documentation

unsigned int MibTableSizePolicy::defaultLimit
protected
OidList<MibStaticEntry> MibTableSizePolicy::policies
protected

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