AgentX++  2.0.5
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
AgentXNode Class Reference

#include <agentx_node.h>

Inheritance diagram for AgentXNode:

Public Member Functions

 AgentXNode (AgentXRegEntry *, const AgentXRegion &)
 Create an AgentX registration.
 
 AgentXNode (const AgentXNode &)
 Copy constructor.
 
virtual ~AgentXNode ()
 Destructor.
 
virtual void add_registration (AgentXRegEntry *)
 Add a registration for the same region but with different priority.
 
virtual bool remove_registration (const AgentXRegEntry &)
 Remove a registration for the same region but with different priority.
 
virtual bool shrink (const Oidx &)
 Shrink the registered region.
 
virtual bool expand (const Oidx &)
 Expand the registered region.
 
virtual mib_type type () const
 Return the type of the receiver MIB node.
 
virtual MibEntryPtr clone ()
 Return a clone of the receiver.
 
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 &)
 Let the receiver undo a SNMP SET subrequest.
 
virtual void cleanup_set_request (Request *, int &)
 Set the receiver's value and backup its old value for a later undo.
 
virtual bool is_empty ()
 Check whether the reciever node contains any instance of a managed object.
 
virtual OidxPtr max_key ()
 Return the maximum object identifier the receiver is responsible for.
 
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.
 
u_int registration_count ()
 Get the number of registrations for this region.
 
AgentXRegEntryactive_registration ()
 Get active registration.
 
AgentXRegion get_region ()
 Get the region registered by this node.
 

Static Public Member Functions

static bool is_agentx (const MibEntry &)
 Check whether a MibEntry is a AgentX entry or not.
 

Protected Member Functions

void set_region (const AgentXRegion &)
 Set the region of the receiver.
 
virtual void get_request (Request *, int, u_char)
 Let the receiver process a SNMP GET subrequest.
 
virtual void set_request (Request *, int, u_char)
 Let the receiver process a SNMP GET subrequest.
 
void set_back_reference (MasterAgentXMib *)
 Set back reference to MasterAgentXMib holding the receiver.
 

Protected Attributes

OrderedList< AgentXRegEntryorigReg
 
AgentXRegion region
 
bool singleInstance
 
MasterAgentXMibbackReference
 

Friends

class MasterAgentXMib
 

Constructor & Destructor Documentation

AgentXNode::AgentXNode ( AgentXRegEntry ,
const AgentXRegion  
)

Create an AgentX registration.

Parameters
regEntrythe first registration entry associated with this region (includes the session that registrates the region)
regionthe region to registrate - can differ from the original region registration contained in regEntry (region splitting)
AgentXNode::AgentXNode ( const AgentXNode )

Copy constructor.

Parameters
otheranother AgentXNode instane.
virtual AgentXNode::~AgentXNode ( )
virtual

Destructor.

Member Function Documentation

AgentXRegEntry* AgentXNode::active_registration ( )
inline

Get active registration.

Returns
the registration entry with the lowest priority value.
virtual void AgentXNode::add_registration ( AgentXRegEntry )
virtual

Add a registration for the same region but with different priority.

Parameters
regEntrya registration entry that also registrates exactly the receiver region
virtual void AgentXNode::cleanup_set_request ( Request *  ,
int &   
)
virtual

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.
virtual MibEntryPtr AgentXNode::clone ( )
virtual

Return a clone of the receiver.

Returns
A pointer to a clone of the MibEntry object.
virtual int AgentXNode::commit_set_request ( Request *  ,
int   
)
virtual

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.
virtual bool AgentXNode::expand ( const Oidx &  )
virtual

Expand the registered region.

Parameters
newUpperBoundan object identifier that denotes the new upper bound of the region
Returns
TRUE if (key() <= newUpperBound >= max_key()), FALSE otherwise
virtual Oidx AgentXNode::find_succ ( const Oidx &  ,
Request *  req = 0 
)
virtual

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
virtual void AgentXNode::get_next_request ( Request *  ,
int   
)
virtual

Let the receiver process a SNMP GETNEXT subrequest.

Parameters
req- A pointer to the whole SNMP GETNEXT request.
ind- The index of the subrequest to be processed.
AgentXRegion AgentXNode::get_region ( )
inline

Get the region registered by this node.

Returns
a AgentXRegion instance.
virtual void AgentXNode::get_request ( Request *  ,
int   
)
virtual

Let the receiver process a SNMP GET subrequest.

Parameters
req- A pointer to the whole SNMP GET request.
ind- The index of the subrequest to be processed.
virtual void AgentXNode::get_request ( Request *  ,
int  ,
u_char   
)
protectedvirtual

Let the receiver process a SNMP GET subrequest.

Parameters
req- A pointer to the whole SNMP GET request.
ind- The index of the subrequest to be processed.
getTypespecifies if a GET, GETNEXT, or GETBULK request is processed.
static bool AgentXNode::is_agentx ( const MibEntry &  )
static

Check whether a MibEntry is a AgentX entry or not.

Parameters
entrya MIB entry
Returns
TRUE if the given entry is an AgentX entry, FALSE otherwise
virtual bool AgentXNode::is_empty ( )
inlinevirtual

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

Returns
TRUE if the node currently manages an instance.
virtual OidxPtr AgentXNode::max_key ( )
virtual

Return the maximum object identifier the receiver is responsible for.

Returns
A pointer to the maximum object identifier this object is responsible for.
virtual int AgentXNode::prepare_set_request ( Request *  ,
int &   
)
virtual

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_NO_ACCESS on failure.
u_int AgentXNode::registration_count ( )
inline

Get the number of registrations for this region.

Returns
an unsigned integer.
virtual bool AgentXNode::remove_registration ( const AgentXRegEntry )
virtual

Remove a registration for the same region but with different priority.

Parameters
regEntrya registration entry
Returns
TRUE if there are no more registrations left for the receiver, FALSE otherwise.
void AgentXNode::set_back_reference ( MasterAgentXMib )
protected

Set back reference to MasterAgentXMib holding the receiver.

Parameters
backReferencea pointer to a MasterAgentXMib instance.
void AgentXNode::set_region ( const AgentXRegion )
protected

Set the region of the receiver.

Do not call this when the node has been registered within a MIB.

Parameters
regionthe new region
virtual void AgentXNode::set_request ( Request *  ,
int  ,
u_char   
)
protectedvirtual

Let the receiver process a SNMP GET subrequest.

Parameters
req- A pointer to the whole SNMP GET request.
ind- The index of the subrequest to be processed.
getTypespecifies if a TESTSET, COMMITSET, UNDOSET, or CLEANUPSET request is processed.
virtual bool AgentXNode::shrink ( const Oidx &  )
virtual

Shrink the registered region.

Parameters
newUpperBoundan object identifier that denotes the new upper bound of the region
Returns
TRUE if (key() <= newUpperBound <= max_key()), FALSE otherwise
virtual mib_type AgentXNode::type ( ) const
virtual

Return the type of the receiver MIB node.

Returns
One of the following types: NONE, SHADOW, PROXY, LEAF, TABLE, GROUP, or COMPLEX.
virtual int AgentXNode::undo_set_request ( Request *  ,
int &   
)
virtual

Let the receiver undo 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_UNDO_FAIL on failure.

Friends And Related Function Documentation

friend class MasterAgentXMib
friend

Member Data Documentation

MasterAgentXMib* AgentXNode::backReference
protected
OrderedList<AgentXRegEntry> AgentXNode::origReg
protected
AgentXRegion AgentXNode::region
protected
bool AgentXNode::singleInstance
protected

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