#include <request.h>
Public Member Functions | |
Request (const Pdux &, const NS_SNMP CTarget &) | |
Construct a Request (only available without _SNMPv3). | |
Request (const Request &) | |
Copy constructor. | |
virtual | ~Request () |
Destructor. | |
virtual boolean | contains (const Vbx &) |
Check whether the receiver contains a specified variable binding. | |
virtual int | position (const Vbx &) |
Return the position of a specified variable binding in the receiver request. | |
virtual boolean | finished () const |
Check whether the receiver request is finished (all variable bindings have been processed). | |
virtual boolean | is_done (int) const |
Check whether a specified variable binding (sub-request) has been processed. | |
virtual void | finish (int, const Vbx &) |
Finish a sub-request by setting the receiverīs variable binding at the given sub-request index to a specified value and marking the sub-request as done. | |
virtual void | finish (int) |
Mark a subrequest as done, without changing its value. | |
virtual void | set_ready (int) |
Set a sub-request ready for commit. | |
virtual void | unset_ready (int) |
Set a sub-request not-ready for commit. | |
virtual boolean | is_ready (int) const |
Check whether a specified variable binding (sub-request) is ready to commit (applies only for SET-Requests). | |
virtual int | first_pending () const |
Return the index of the first pending (done == FALSE) subrequest. | |
virtual void | error (int, int) |
Set the error status of the receiver request. | |
virtual Vbx | get_value (int) |
Return the variable binding of the specified sub-request. | |
Vbx * | search_value (const Oidx &) const |
Get the value for a given OID if the request contains such an instance. | |
Vbx | get_original_value (unsigned int i) |
Gets the original variable binding of the specified sub-request. | |
virtual NS_SNMP SnmpInt32 | get_syntax (int) |
Return the syntax of the specified sub-request (variable binding). | |
virtual Oidx | get_oid (int) |
Return the object identifier of the specified sub-request. | |
virtual void | set_oid (const Oidx &, int) |
Set the object identifier of a specified sub-request. | |
unsigned short | get_type () |
Return the request type. | |
unsigned long | get_request_id () |
Return the request id of the receiver. | |
unsigned long | get_transaction_id () |
Return the agent wide unique transaction id of the receiver. | |
int | get_error_status () |
Return the error status of the receiver request. | |
int | get_error_index () |
Return the index of the sub-request that failed with an error condition. | |
void | set_error_status (int s) |
Set the error status of the receiver request. | |
void | set_error_index (int i) |
Set the error index of the receiver request. | |
void | set_transaction_id (unsigned long id) |
Set the transaction id of the receiver sub-request. | |
int | subrequests () |
Return the count of sub-requests in the receiver request. | |
int | get_non_rep () |
Return the count of non repetition variable bindings of a GETBULK request. | |
int | get_rep () |
Return the count of repetition variable bindings of a GETBULK request. | |
int | get_max_rep () |
Return the maximum repetition of repetition variable bindings of a GETBULK request. | |
virtual boolean | add_rep_row () |
Add a repetition row to the GETBULK request PDU. | |
virtual boolean | init_rep_row (int) |
Initialize a repetition row of a GETBULK request PDU. | |
virtual void | trim_request (int) |
Trim the request's variable bindings to a given number of elements. | |
void | inc_outstanding () |
Increment the number of variable bindings to be processed by one. | |
void | dec_outstanding () |
Decrement the number of variable bindings to be processed by one. | |
void | no_outstanding () |
Set the number of variable bindings to be processed to 0. | |
Pdux * | get_pdu () |
Return a pointer to the receiver's PDU. | |
NS_SNMP CTarget * | get_address () |
Return a pointer to the request's originator address. | |
NS_SNMP snmp_version | get_snmp_version () |
Get the request's version. | |
MibEntry * | get_locked (int) |
Get a pointer to the MibEntry object that has been locked for the given subrequest. | |
void | set_locked (int, MibEntry *) |
Set the locked MibEntry for the given subrequest id. | |
void | set_unlocked (int) |
Set the given subrequest as unlocked. | |
int | lock_index (MibEntry *) |
Determine the lock index of a MibEntry. | |
void | trim_bulk_response () |
Trim BULK response PDU to N+M*R variables and set OIDs of variables with END OF MIB VIEW syntax to either the corresponding request OID (R == 0) or to the last successor found. | |
Public Attributes | |
u_char | phase |
Protected Member Functions | |
Request () | |
virtual void | init_from_pdu () |
void | check_exception (int, Vbx &) |
int | get_max_response_length () |
Protected Attributes | |
Pdux * | pdu |
Vbx * | originalVbs |
int | originalSize |
NS_SNMP UdpAddress | from |
boolean * | done |
boolean * | ready |
int | outstanding |
int | size |
int | non_rep |
int | max_rep |
int | repeater |
NS_SNMP snmp_version | version |
unsigned long | transaction_id |
Array< MibEntry > | locks |
NS_SNMP CTarget | target |
Friends | |
class | RequestList |
class | Mib |
Request::Request | ( | const Pdux & | , | |
const NS_SNMP CTarget & | ||||
) |
virtual Request::~Request | ( | ) | [virtual] |
Destructor.
Request::Request | ( | ) | [protected] |
virtual boolean Request::contains | ( | const Vbx & | ) | [virtual] |
Check whether the receiver contains a specified variable binding.
vb | - A variable binding. |
virtual int Request::position | ( | const Vbx & | ) | [virtual] |
Return the position of a specified variable binding in the receiver request.
vb | - A variable binding. |
virtual boolean Request::finished | ( | ) | const [virtual] |
Check whether the receiver request is finished (all variable bindings have been processed).
virtual boolean Request::is_done | ( | int | ) | const [virtual] |
Check whether a specified variable binding (sub-request) has been processed.
i | - The index (starting from 0) of the variable binding to check. |
virtual void Request::finish | ( | int | , | |
const Vbx & | ||||
) | [virtual] |
Finish a sub-request by setting the receiverīs variable binding at the given sub-request index to a specified value and marking the sub-request as done.
i | - The index of the sub-request to finish. | |
vb | - A variable binding. |
virtual void Request::finish | ( | int | ) | [virtual] |
Mark a subrequest as done, without changing its value.
index | the index of the sub-request to finish. |
virtual void Request::set_ready | ( | int | ) | [virtual] |
Set a sub-request ready for commit.
i | - The index of the sub-request to be set ready for commit. |
virtual void Request::unset_ready | ( | int | ) | [virtual] |
Set a sub-request not-ready for commit.
i | - The index of the sub-request to be set not-ready for commit. |
virtual boolean Request::is_ready | ( | int | ) | const [virtual] |
Check whether a specified variable binding (sub-request) is ready to commit (applies only for SET-Requests).
i | - The index (starting from 0) of the variable binding to check. |
virtual int Request::first_pending | ( | ) | const [virtual] |
Return the index of the first pending (done == FALSE) subrequest.
virtual void Request::error | ( | int | , | |
int | ||||
) | [virtual] |
Set the error status of the receiver request.
index | - The index of the sub-request that failed. | |
error | - An error code describing the error condition. |
virtual Vbx Request::get_value | ( | int | ) | [virtual] |
Return the variable binding of the specified sub-request.
index | - An index of a sub-request (starting from 0). |
Vbx Request::get_original_value | ( | unsigned int | i | ) | [inline] |
Gets the original variable binding of the specified sub-request.
index | the zero-based index of the sub-request. |
virtual NS_SNMP SnmpInt32 Request::get_syntax | ( | int | ) | [virtual] |
Return the syntax of the specified sub-request (variable binding).
index | - An index of a sub-request (starting from 0). |
virtual Oidx Request::get_oid | ( | int | ) | [virtual] |
Return the object identifier of the specified sub-request.
index | - An index of a sub-request (starting from 0). |
virtual void Request::set_oid | ( | const Oidx & | , | |
int | ||||
) | [virtual] |
Set the object identifier of a specified sub-request.
oid | - An object identifier. | |
index | - An index of a sub-request (starting from 0). |
unsigned short Request::get_type | ( | ) | [inline] |
Return the request type.
unsigned long Request::get_request_id | ( | ) | [inline] |
Return the request id of the receiver.
unsigned long Request::get_transaction_id | ( | ) | [inline] |
Return the agent wide unique transaction id of the receiver.
int Request::get_error_status | ( | ) | [inline] |
Return the error status of the receiver request.
int Request::get_error_index | ( | ) | [inline] |
Return the index of the sub-request that failed with an error condition.
void Request::set_error_status | ( | int | s | ) | [inline] |
Set the error status of the receiver request.
s | - An error status. |
void Request::set_error_index | ( | int | i | ) | [inline] |
Set the error index of the receiver request.
s | - The sub-request index of a failed sub-request. |
void Request::set_transaction_id | ( | unsigned long | id | ) | [inline] |
Set the transaction id of the receiver sub-request.
id | - An unique transaction id. |
int Request::subrequests | ( | ) | [inline] |
Return the count of sub-requests in the receiver request.
int Request::get_non_rep | ( | ) | [inline] |
Return the count of non repetition variable bindings of a GETBULK request.
int Request::get_rep | ( | ) | [inline] |
Return the count of repetition variable bindings of a GETBULK request.
int Request::get_max_rep | ( | ) | [inline] |
Return the maximum repetition of repetition variable bindings of a GETBULK request.
virtual boolean Request::add_rep_row | ( | ) | [virtual] |
Add a repetition row to the GETBULK request PDU.
virtual boolean Request::init_rep_row | ( | int | ) | [virtual] |
Initialize a repetition row of a GETBULK request PDU.
row | the repetition row to be initialized (counted from 1, row 0 is the non-repeated first row) |
virtual void Request::trim_request | ( | int | ) | [virtual] |
Trim the request's variable bindings to a given number of elements.
Elements are removed starting from the end.
count | the count of variable bindings that should remain. |
void Request::inc_outstanding | ( | ) |
Increment the number of variable bindings to be processed by one.
void Request::dec_outstanding | ( | ) |
Decrement the number of variable bindings to be processed by one.
void Request::no_outstanding | ( | ) |
Set the number of variable bindings to be processed to 0.
Pdux* Request::get_pdu | ( | ) | [inline] |
NS_SNMP CTarget* Request::get_address | ( | ) | [inline] |
Return a pointer to the request's originator address.
(only available without _SNMPv3)
NS_SNMP snmp_version Request::get_snmp_version | ( | ) | [inline] |
Get the request's version.
MibEntry* Request::get_locked | ( | int | ) |
void Request::set_locked | ( | int | , | |
MibEntry * | ||||
) |
void Request::set_unlocked | ( | int | ) |
Set the given subrequest as unlocked.
ind | a subrequest index. |
int Request::lock_index | ( | MibEntry * | ) |
Determine the lock index of a MibEntry.
The lock index is the index of the subrequest that acquired a lock for the given MibEntry.
entry | a pointer to a MibEntry object. |
void Request::trim_bulk_response | ( | ) |
Trim BULK response PDU to N+M*R variables and set OIDs of variables with END OF MIB VIEW syntax to either the corresponding request OID (R == 0) or to the last successor found.
N = nonrep, M = maxrep, R = rep.
This method does is a NOP when called on a request type other than GETBULK.
virtual void Request::init_from_pdu | ( | ) | [protected, virtual] |
void Request::check_exception | ( | int | , | |
Vbx & | ||||
) | [protected] |
int Request::get_max_response_length | ( | ) | [protected] |
friend class RequestList [friend] |
friend class Mib [friend] |
u_char Request::phase |
Pdux* Request::pdu [protected] |
Vbx* Request::originalVbs [protected] |
int Request::originalSize [protected] |
NS_SNMP UdpAddress Request::from [protected] |
boolean* Request::done [protected] |
boolean* Request::ready [protected] |
int Request::outstanding [protected] |
int Request::size [protected] |
int Request::non_rep [protected] |
int Request::max_rep [protected] |
int Request::repeater [protected] |
NS_SNMP snmp_version Request::version [protected] |
unsigned long Request::transaction_id [protected] |
Array<MibEntry> Request::locks [protected] |
NS_SNMP CTarget Request::target [protected] |