AGENT++  4.0.3
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
MibEntry Class Reference

#include <mib_entry.h>

Inheritance diagram for MibEntry:
ThreadManager Synchronized MibComplexEntry MibGroup MibLeaf MibProxy MibTable MibStaticTable agentpp_simulation_mib simSysGroup snmp_notification_mib snmp_proxy_mib snmp_target_mib snmpGroup sysGroup VacmMIB agentppSimDeleteRow agentppSimDeleteTableContents agentppSimMode DateAndTime OctetStrMinMax SimMibLeaf SnmpDisplayString snmpEnableAuthenTraps SnmpEngineID snmpInASNParseErrs snmpInBadCommunityNames snmpInBadCommunityUses snmpInBadValues snmpInBadVersions snmpInGenErrs snmpInGetNexts snmpInGetRequests snmpInGetResponses snmpInNoSuchNames snmpInPkts snmpInReadOnlys snmpInSetRequests SnmpInt32MinMax snmpInTooBigs snmpInTotalReqVars snmpInTotalSetVars snmpInTraps snmpOutBadValues snmpOutGenErrs snmpOutGetNexts snmpOutGetRequests snmpOutGetResponses snmpOutNoSuchNames snmpOutPkts snmpOutSetRequests snmpOutTooBigs snmpOutTraps snmpProxyDrops snmpRowStatus snmpSilentDrops SnmpTagList SnmpTagValue snmpTargetAddrParams snmpTargetAddrTAddress snmpTargetAddrTDomain SnmpUnavailableContexts SnmpUnknownContexts StorageType sysObjectID sysORLastChange sysServices sysUpTime TestAndIncr TimeStamp SimMibTable StorageTable TimeStampTable VacmContextTable

Public Member Functions

 MibEntry ()
 Default constructor.
 
 MibEntry (const Oidx &, mib_access)
 Construct a MibEntry instance with a given object identifier and maximum access rights.
 
 MibEntry (const MibEntry &)
 Copy constructor.
 
virtual ~MibEntry ()
 Destructor.
 
virtual mib_type type () const
 Return the type of the receiver MIB node.
 
virtual MibEntryclone ()
 Return a clone of the receiver.
 
virtual Oidx find_succ (const Oidx &, Request *req=0)
 Return the successor of a given object identifier within the receiver's scope and the context of a given Request.
 
virtual void get_request (Request *, int)
 Let the receiver process a SNMP GET subrequest.
 
virtual void get_next_request (Request *, int)
 Let the receiver process a SNMP GETNEXT subrequest.
 
virtual int commit_set_request (Request *, int)
 Let the receiver commit a SNMP SET subrequest.
 
virtual int prepare_set_request (Request *, int &)
 Let the receiver prepare a SNMP SET subrequest.
 
virtual int undo_set_request (Request *, int &)
 Clean up resources used for performing (or undoing) set requests.
 
virtual void cleanup_set_request (Request *, int &)
 Set the receiver's value and backup its old value for a later undo.
 
virtual void load_from_file (const char *)
 Load the value(s) of the receiver node from a file.
 
virtual void save_to_file (const char *)
 Save the value(s) of the receiver node to a file.
 
virtual bool serialize (char *&, int &)
 Serialize the value of the receiver.
 
virtual bool deserialize (char *, int &)
 Read the value of the receiver from a byte stream.
 
virtual bool is_empty ()
 Check whether the receiver node contains any instance of a managed object.
 
virtual void notify_change (const Oidx &, mib_change)
 Notify all registered nodes of changes to an object managed by the receiver node.
 
virtual void register_for_notifications (MibEntry *)
 Register an MibEntry object to receive notifications about changes of the receiver node.
 
virtual void add_change_notification (MibEntry *e)
 Wrapper function for register_for_notifications.
 
virtual void change_notification (const Oidx &, mib_change)
 Receive a notification about changes to a managed object.
 
OidxPtr key ()
 Return a pointer to the key (object identifier) of the receiver.
 
virtual OidxPtr max_key ()
 Return the immediate successor of the greatest object identifier within the receiver's scope.
 
virtual mib_access get_access ()
 Return the maximum access rights for the managed object represented by the receiver node.
 
virtual bool is_volatile ()
 Check whether the entry is volatile or not.
 
virtual void reset ()
 Resets (clears) the content of this entry.
 
comparison operators
int operator< (const MibEntry &) const
 
int operator> (const MibEntry &) const
 
int operator== (const MibEntry &) const
 
int operator< (const Oidx &) const
 
int operator> (const Oidx &) const
 
int operator<= (const Oidx &) const
 
int operator>= (const Oidx &) const
 
int operator== (const Oidx &) const
 
- Public Member Functions inherited from ThreadManager
 ThreadManager ()
 Default constructor.
 
virtual ~ThreadManager ()
 Destructor.
 
void start_synch ()
 Start synchronized execution.
 
void end_synch ()
 End synchronized execution.
 
- Public Member Functions inherited from Synchronized
 Synchronized ()
 
 ~Synchronized ()
 
void wait ()
 Causes current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object.
 
bool wait (unsigned long timeout)
 Causes current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed.
 
void notify ()
 Wakes up a single thread that is waiting on this object's monitor.
 
void notify_all ()
 Wakes up all threads that are waiting on this object's monitor.
 
bool lock ()
 Enter a critical section.
 
TryLockResult trylock ()
 Try to enter a critical section.
 
bool unlock ()
 Leave a critical section.
 

Protected Member Functions

void set_oid (const Oidx &)
 Set the object identifier of the receiver node.
 

Protected Attributes

Oidx oid
 
mib_access access
 
List< MibEntrynotifies
 

Friends

class Mib
 

Additional Inherited Members

- Public Types inherited from Synchronized
enum  TryLockResult { LOCKED = 1, BUSY = 0, OWNED = -1 }
 
- Static Public Member Functions inherited from ThreadManager
static void start_global_synch ()
 Start global synchronized execution.
 
static void end_global_synch ()
 End global synchronized execution.
 

Constructor & Destructor Documentation

MibEntry::MibEntry ( )

Default constructor.

MibEntry::MibEntry ( const Oidx ,
mib_access   
)

Construct a MibEntry instance with a given object identifier and maximum access rights.

Parameters
o- An object identifier.
a- The maximum access of the receiver.
MibEntry::MibEntry ( const MibEntry )

Copy constructor.

Parameters
other- A MibEntry object.
virtual MibEntry::~MibEntry ( )
virtual

Destructor.

Member Function Documentation

virtual void MibEntry::add_change_notification ( MibEntry e)
inlinevirtual

Wrapper function for register_for_notifications.

virtual void MibEntry::change_notification ( const Oidx ,
mib_change   
)
inlinevirtual

Receive a notification about changes to a managed object.

This method will be called for all registered objects of an object that called notify_change().

Parameters
o- The object identifier of the object changed.
change- The type of the change (REMOVE, CREATE, CHANGE, or UPDATE)
virtual void MibEntry::cleanup_set_request ( Request ,
int &   
)
inlinevirtual

Set the receiver's value and backup its old value for a later undo.

Parameters
vb- The variable binding that holds the new value.
Returns
SNMP_ERROR_SUCCESS if the new value has been set, SNMP_ERROR_WRONG_TYPE or SNMP_ERROR_BAD_VALUE otherwise.

Reimplemented in MibTable, MibLeaf, and MibComplexEntry.

virtual MibEntry* MibEntry::clone ( )
virtual
virtual int MibEntry::commit_set_request ( Request ,
int   
)
inlinevirtual

Let the receiver commit a SNMP SET subrequest.

Parameters
req- A pointer to the whole SNMP SET request.
ind- The index of the subrequest to be processed.
Returns
SNMP_ERROR_SUCCESS on success and SNMP_ERROR_COMITFAIL on failure.

Reimplemented in MibTable, MibLeaf, MibProxy, MibComplexEntry, agentppSimDeleteTableContents, and agentppSimDeleteRow.

virtual bool MibEntry::deserialize ( char *  ,
int &   
)
virtual

Read the value of the receiver from a byte stream.

Parameters
bufa pointer to the input byte stream.
szthe size of the input buffer. On output it contains the size remaining unread in the input buffer.
Returns
TRUE if deserialization was successful, FALSE otherwise.

Reimplemented in MibTable, MibLeaf, and MibComplexEntry.

virtual Oidx MibEntry::find_succ ( const Oidx ,
Request req = 0 
)
inlinevirtual

Return the successor of a given object identifier within the receiver's scope and the context of a given Request.

Parameters
oidan object identifier
requesta pointer to a Request instance.
Returns
an object identifier if a successor could be found, otherwise (if no successor exists or is out of scope) a zero length oid is returned

Reimplemented in MibTable, MibStaticTable, MibProxy, and MibComplexEntry.

virtual mib_access MibEntry::get_access ( )
virtual

Return the maximum access rights for the managed object represented by the receiver node.

Returns
The maximum access (one of the following values: NOACCESS, READONLY, READWRITE, or READCREATE)

Reimplemented in SimRowStatus, and SimMibLeaf.

virtual void MibEntry::get_next_request ( Request ,
int   
)
inlinevirtual

Let the receiver process a SNMP GETNEXT subrequest.

The OID of the subrequest identified by the given index is already set to the next OID found. In other words, the OID of the current subrequest is different from the OID in the original request. So the implementation of this method does not need to search the appropriate "next" OID.

Parameters
req- A pointer to the whole SNMP GETNEXT request.
ind- The index of the subrequest to be processed.

Reimplemented in MibTable, MibStaticTable, MibLeaf, MibProxy, and MibComplexEntry.

virtual void MibEntry::get_request ( Request ,
int   
)
inlinevirtual
virtual bool MibEntry::is_empty ( )
inlinevirtual

Check whether the receiver node contains any instance of a managed object.

Returns
TRUE if the node currently manages an instance.

Reimplemented in MibTable, MibComplexEntry, and MibProxy.

virtual bool MibEntry::is_volatile ( )
virtual
OidxPtr MibEntry::key ( )

Return a pointer to the key (object identifier) of the receiver.

Returns
A pointer to an object identifier.
virtual void MibEntry::load_from_file ( const char *  )
virtual

Load the value(s) of the receiver node from a file.

Parameters
fname- A file name.

Reimplemented in MibGroup.

virtual OidxPtr MibEntry::max_key ( )
virtual

Return the immediate successor of the greatest object identifier within the receiver's scope.

Returns
a pointer to the non including upper bound of the receiver's scope

Reimplemented in MibTable, MibLeaf, MibComplexEntry, and MibProxy.

virtual void MibEntry::notify_change ( const Oidx ,
mib_change   
)
virtual

Notify all registered nodes of changes to an object managed by the receiver node.

Parameters
o- The object identifier of the object changed.
change- The type of the change (REMOVE, CREATE, CHANGE, or UPDATE)
int MibEntry::operator< ( const MibEntry ) const
int MibEntry::operator< ( const Oidx ) const
int MibEntry::operator<= ( const Oidx ) const
int MibEntry::operator== ( const MibEntry ) const
int MibEntry::operator== ( const Oidx ) const
int MibEntry::operator> ( const MibEntry ) const
int MibEntry::operator> ( const Oidx ) const
int MibEntry::operator>= ( const Oidx ) const
virtual int MibEntry::prepare_set_request ( Request ,
int &   
)
inlinevirtual

Let the receiver prepare a SNMP SET subrequest.

Parameters
req- A pointer to the whole SNMP SET request.
ind- The index of the subrequest to be processed.
Returns
SNMP_ERROR_SUCCESS on success and SNMP_ERROR_WRONG_VALUE, SNMP_ERROR_WRONG_TYPE, or SNMP_ERROR_NOT_WRITEABLE on failure.

Reimplemented in MibTable, OctetStrMinMax, snmpRowStatus, TestAndIncr, MibLeaf, SnmpTagValue, SnmpEngineID, MibProxy, MibComplexEntry, snmpTargetAddrParams, agentppSimDeleteTableContents, SnmpDisplayString, agentppSimDeleteRow, and snmpTargetAddrTAddress.

virtual void MibEntry::register_for_notifications ( MibEntry )
virtual

Register an MibEntry object to receive notifications about changes of the receiver node.

Parameters
entry- A MibEntry to receive notifications.
virtual void MibEntry::reset ( )
inlinevirtual

Resets (clears) the content of this entry.

Since
3.5.22

Reimplemented in MibTable, StorageTable, and VacmViewTreeFamilyTable.

virtual void MibEntry::save_to_file ( const char *  )
virtual

Save the value(s) of the receiver node to a file.

Parameters
fname- A file name.

Reimplemented in MibGroup.

virtual bool MibEntry::serialize ( char *&  ,
int &   
)
virtual

Serialize the value of the receiver.

Parameters
buf- A pointer to byte stream buffer returned.
sz- The size of the buffer returned.
Returns
TRUE if serialization was successful, FALSE otherwise.

Reimplemented in MibTable, MibLeaf, and MibComplexEntry.

void MibEntry::set_oid ( const Oidx )
protected

Set the object identifier of the receiver node.

Parameters
o- An object identifier.
virtual mib_type MibEntry::type ( ) const
virtual

Return the type of the receiver MIB node.

Returns
One of the following types: AGENTPP_NONE, AGENTPP_PROXY, AGENTPP_LEAF, AGENTPP_TABLE, AGENTPP_GROUP, or AGENTPP_COMPLEX.

Reimplemented in MibTable, MibLeaf, MibProxy, MibGroup, and MibComplexEntry.

virtual int MibEntry::undo_set_request ( Request ,
int &   
)
inlinevirtual

Clean up resources used for performing (or undoing) set requests.

Parameters
req- A pointer to the whole SNMP SET request.
ind- The index of the subrequest to be processed.

Reimplemented in MibTable, MibLeaf, and MibComplexEntry.

Friends And Related Function Documentation

friend class Mib
friend

Member Data Documentation

mib_access MibEntry::access
protected
List<MibEntry> MibEntry::notifies
protected
Oidx MibEntry::oid
protected

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