MibProxy Class Reference

The MibProxy class represents a sub-tree within an agents MIB whose nodes and their values are proxied (forwarded) from another SNMPv1/v2c agent. More...

#include <mib_proxy.h>

Inheritance diagram for MibProxy:

MibEntry ThreadManager Synchronized

List of all members.

Public Member Functions

 MibProxy ()
 Default constructor.
 MibProxy (const MibProxy &other)
 Copy constructor.
 MibProxy (const Oidx &, mib_access, const UdpAddress &)
 Simple proxy registration.
 MibProxy (const Oidx &, mib_access, const Oidx &, const UdpAddress &)
 Proxy registration with oid translation.
virtual ~MibProxy ()
 Destructor.
virtual mib_type type () const
 Return type of the MIB entry.
virtual MibEntryclone ()
 Clone.
virtual OidxPtr max_key ()
 Return the immediate successor of the greatest object identifier within the receiver's scope.
virtual Oidx find_succ (const Oidx &, Request *r=0)
 Find the successor of the given OID in the proxied MIB view and cache its value for a possibly following get_next_request call.
virtual boolean is_empty ()
 Check whether the reciever node contains any instance of a managed object.
virtual void get_request (Request *, int)
 Let the receiver process a SNMP GET 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 void get_next_request (Request *, int)
 Let the receiver process a SNMP GETNEXT subrequest.
void set_community (access_types a, const OctetStr &c)
 Set the READ and WRITE community for outgoing requests, respectively.

Protected Member Functions

virtual Oidx translate (const Oidx &)
virtual Oidx backward_translate (const Oidx &)
void determineDefaultRange (const Oidx &)

Protected Attributes

UdpAddress source
Oidx translation
boolean translating
OctetStr community [WRITING+1]
Oidx range
Vbx lastNext
int lastNextStatus


Detailed Description

The MibProxy class represents a sub-tree within an agents MIB whose nodes and their values are proxied (forwarded) from another SNMPv1/v2c agent.

The following figure displays a possible scenario:

    +--------------+        +----------+       +-----------+
    |    Manager   |        | AGENT++  |       | Any v1 or |
    |              |--------| MibProxy |-------| v2c agent |
    | v1/v2c or v3 |        |          |       |           |
    +--------------+        +----------+       +-----------+
 
SNMP v3 support for MibProxy can be easily added by sub-classing.

Author:
Frank Fock
Version:
3.02

Constructor & Destructor Documentation

MibProxy::MibProxy (  ) 

Default constructor.

MibProxy::MibProxy ( const MibProxy other  ) 

Copy constructor.

Parameters:
other another MibProxy instance

MibProxy::MibProxy ( const Oidx ,
mib_access  ,
const UdpAddress &   
)

Simple proxy registration.

Parameters:
root the oid of the root of the proxied MIB portion
access the max-access for the whole sub-tree
source the UDP address of the SNMP agent to whom requests for oids within this MibProxy sub-tree should be redirected

MibProxy::MibProxy ( const Oidx ,
mib_access  ,
const Oidx ,
const UdpAddress &   
)

Proxy registration with oid translation.

Parameters:
root the oid of the root of the proxied MIB portion
access the max-access for the whole sub-tree
translated_root root will be replaced by translated_root for requests sent out to the remote agent (for example if root="1.3.6.1.3" and translated_root="1.3.6.1.2" all oids of mgmt of the remote agent would become experimental objects of the proxy agent
source the UDP address of the SNMP agent to whom requests for oids within this MibProxy sub-tree should be redirected

virtual MibProxy::~MibProxy (  )  [inline, virtual]

Destructor.


Member Function Documentation

virtual mib_type MibProxy::type (  )  const [inline, virtual]

Return type of the MIB entry.

Returns:
AGENTPP_PROXY

Reimplemented from MibEntry.

virtual MibEntry* MibProxy::clone (  )  [inline, virtual]

Clone.

Returns:
a pointer to a clone of the receiver

Reimplemented from MibEntry.

virtual OidxPtr MibProxy::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 from MibEntry.

virtual Oidx MibProxy::find_succ ( const Oidx ,
Request r = 0 
) [virtual]

Find the successor of the given OID in the proxied MIB view and cache its value for a possibly following get_next_request call.

Parameters:
id an oid less or equal than max_key()
request a pointer to the Request instance for in whose context the find_next is issued.
Returns:
an oid greater than id or an empty oid (zero length) if an successor could not be determined or would be greater than max_key()

Reimplemented from MibEntry.

virtual boolean MibProxy::is_empty (  )  [inline, virtual]

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

Returns:
TRUE if the node currently manages an instance.

Reimplemented from MibEntry.

virtual void MibProxy::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.

Reimplemented from MibEntry.

virtual int MibProxy::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.

Reimplemented from MibEntry.

virtual int MibProxy::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_NOT_WRITEABLE on failure.

Reimplemented from MibEntry.

virtual void MibProxy::get_next_request ( Request ,
int   
) [virtual]

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 from MibEntry.

void MibProxy::set_community ( access_types  a,
const OctetStr &  c 
) [inline]

Set the READ and WRITE community for outgoing requests, respectively.

Parameters:
access_type the access type associated with the community - currently only READING and WRITING are supported
community the community to be used for the specified access type

virtual Oidx MibProxy::translate ( const Oidx  )  [protected, virtual]

virtual Oidx MibProxy::backward_translate ( const Oidx  )  [protected, virtual]

void MibProxy::determineDefaultRange ( const Oidx  )  [protected]


Member Data Documentation

UdpAddress MibProxy::source [protected]

boolean MibProxy::translating [protected]

OctetStr MibProxy::community[WRITING+1] [protected]

Oidx MibProxy::range [protected]

Vbx MibProxy::lastNext [protected]

int MibProxy::lastNextStatus [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