#include <mib_proxy.h>
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 MibEntry * | clone () |
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 |
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.
MibProxy::MibProxy | ( | ) |
Default constructor.
MibProxy::MibProxy | ( | const MibProxy & | other | ) |
MibProxy::MibProxy | ( | const Oidx & | , | |
mib_access | , | |||
const UdpAddress & | ||||
) |
Simple proxy registration.
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.
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.
virtual mib_type MibProxy::type | ( | ) | const [inline, virtual] |
virtual MibEntry* MibProxy::clone | ( | ) | [inline, virtual] |
virtual OidxPtr MibProxy::max_key | ( | ) | [virtual] |
Return the immediate successor of the greatest object identifier within the receiver's scope.
Reimplemented from MibEntry.
Find the successor of the given OID in the proxied MIB view and cache its value for a possibly following get_next_request call.
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. |
Reimplemented from MibEntry.
virtual boolean MibProxy::is_empty | ( | ) | [inline, virtual] |
Check whether the reciever node contains any instance of a managed object.
Reimplemented from MibEntry.
virtual void MibProxy::get_request | ( | Request * | , | |
int | ||||
) | [virtual] |
Let the receiver process a SNMP GET subrequest.
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.
req | - A pointer to the whole SNMP SET request. | |
ind | - The index of the subrequest to be processed. |
Reimplemented from MibEntry.
virtual int MibProxy::prepare_set_request | ( | Request * | , | |
int & | ||||
) | [virtual] |
Let the receiver prepare a SNMP SET subrequest.
req | - A pointer to the whole SNMP SET request. | |
ind | - The index of the subrequest to be processed. |
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.
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.
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 |
void MibProxy::determineDefaultRange | ( | const Oidx & | ) | [protected] |
UdpAddress MibProxy::source [protected] |
Oidx MibProxy::translation [protected] |
boolean MibProxy::translating [protected] |
OctetStr MibProxy::community[WRITING+1] [protected] |
Oidx MibProxy::range [protected] |
Vbx MibProxy::lastNext [protected] |
int MibProxy::lastNextStatus [protected] |