Represents an GetBulk-PDU. More...
#include <GetBulkPDU.hpp>
Public Member Functions | |
GetBulkPDU (binary::const_iterator &pos, const binary::const_iterator &end, bool big_endian) | |
Parse constructor. More... | |
GetBulkPDU () | |
Default Constructor. More... | |
vector< pair< Oid, Oid > > & | get_sr () |
Get the SearchRange list. More... | |
quint16 | get_non_repeaters () |
Get non_repeaters field. More... | |
void | set_non_repeaters (quint16 value) |
Set non_repeaters field. More... | |
quint16 | get_max_repititions () |
Get max_repititions field. More... | |
void | set_max_repititions (quint16 value) |
Set max_repititions field. More... | |
virtual binary | serialize () const |
Serialize the PDU. More... | |
![]() | |
bool | has_context () |
Whether the PDU has a context. More... | |
OctetStringVariable | get_context () |
Get context. More... | |
void | set_context (OctetStringVariable value) |
Set the PDU's context. More... | |
void | remove_context () |
Removes the context from the PDU. More... | |
![]() | |
virtual | ~PDU () |
Destructor. More... | |
bool | get_new_index () |
Get new_index flag. More... | |
void | set_new_index (bool new_index) |
Set new_index flag. More... | |
bool | get_any_index () |
Get any_index flag. More... | |
void | set_any_index (bool any_index) |
Set any_index flag. More... | |
quint32 | get_sessionID () |
Get sessionID. More... | |
void | set_sessionID (quint32 id) |
Set sessionID. More... | |
quint32 | get_transactionID () |
Get transactionID. More... | |
void | set_transactionID (quint32 id) |
Set transactionID. More... | |
quint32 | get_packetID () |
Get packetID. More... | |
void | set_packetID (quint32 packetID) |
Set packetID. More... | |
Private Attributes | |
vector< pair< Oid, Oid > > | sr |
The SearchRange list. More... | |
quint16 | non_repeaters |
The number of variables in the SearchRangeList that are not repeaters. More... | |
quint16 | max_repititions |
The maximum number of repetitions requested for repeating variables. More... | |
Additional Inherited Members | |
![]() | |
static QSharedPointer< PDU > | parse_pdu (binary buf) |
Parse a PDU from a buffer. More... | |
![]() | |
enum | type_t { agentxOpenPDU = 1, agentxClosePDU = 2, agentxRegisterPDU = 3, agentxUnregisterPDU = 4, agentxGetPDU = 5, agentxGetNextPDU = 6, agentxGetBulkPDU = 7, agentxTestSetPDU = 8, agentxCommitSetPDU = 9, agentxUndoSetPDU = 10, agentxCleanupSetPDU = 11, agentxNotifyPDU = 12, agentxPingPDU = 13, agentxIndexAllocatePDU = 14, agentxIndexDeallocatePDU = 15, agentxAddAgentCapsPDU = 16, agentxRemoveAgentCapsPDU = 17, agentxResponsePDU = 18 } |
The PDU types. More... | |
![]() | |
PDUwithContext (binary::const_iterator &pos, const binary::const_iterator &end, bool big_endian) | |
Parse constructor. More... | |
void | add_header (type_t type, binary &payload) const |
Add PDU header and context field to the payload. More... | |
PDUwithContext () | |
Default Constructor. More... | |
![]() | |
PDU (binary::const_iterator &pos, const binary::const_iterator &end, bool big_endian) | |
Parse constructor. More... | |
void | add_header (type_t type, binary &payload) const |
Construct the PDU header and add it to the payload. More... | |
PDU () | |
Default constructor. More... | |
![]() | |
bool | instance_registration |
the instance_registration flag More... | |
bool | non_default_context |
Whether the PDU has a non-default context. More... | |
quint32 | packetID |
h.packetID field according to RFC 2741, 6.1. "AgentX PDU
Header". More... | |
Represents an GetBulk-PDU.
Definition at line 40 of file GetBulkPDU.hpp.
GetBulkPDU::GetBulkPDU | ( | binary::const_iterator & | pos, |
const binary::const_iterator & | end, | ||
bool | big_endian | ||
) |
Parse constructor.
Construct the object by parsing a stream. See Parsing incoming PDUs for details about PDU parsing.
pos | Iterator pointing to the current stream position. The iterator is advanced while reading the header. |
end | Iterator pointing one element past the end of the current stream. This is needed to mark the end of the buffer. |
big_endian | Whether the serialized form of the PDU is in big_endian format. |
parse_error | If parsing fails, for example because reading the stream fails or the PDU is malformed. |
Definition at line 27 of file GetBulkPDU.cpp.
References max_repititions, non_repeaters, agentxcpp::read16(), sr, and agentxcpp::OidVariable::value().
|
inline |
Default Constructor.
Sets the state of the object to the defaults as set by the PDU::PDU() constructor, sets non_repeaters to 0, max_repititions to 0 and initializes sr to be empty.
Definition at line 96 of file GetBulkPDU.hpp.
|
inline |
Get max_repititions field.
Definition at line 134 of file GetBulkPDU.hpp.
References max_repititions.
|
inline |
Get the SearchRange list.
This function returns a reference to the internal SearchRange list, which can then be modified in place.
Definition at line 110 of file GetBulkPDU.hpp.
References sr.
|
virtual |
Serialize the PDU.
Implements agentxcpp::PDU.
Definition at line 60 of file GetBulkPDU.cpp.
References agentxcpp::PDUwithContext::add_header(), agentxcpp::PDU::agentxGetNextPDU, max_repititions, non_repeaters, agentxcpp::OidVariable::serialize(), sr, and agentxcpp::write16().
|
inline |
Set max_repititions field.
Definition at line 142 of file GetBulkPDU.hpp.
|
inline |
Set non_repeaters field.
Definition at line 126 of file GetBulkPDU.hpp.
|
private |
The maximum number of repetitions requested for repeating variables.
Definition at line 62 of file GetBulkPDU.hpp.
Referenced by get_max_repititions(), GetBulkPDU(), and serialize().
|
private |
The number of variables in the SearchRangeList that are not repeaters.
Definition at line 56 of file GetBulkPDU.hpp.
Referenced by get_non_repeaters(), GetBulkPDU(), and serialize().
The SearchRange list.
A GetBulk PDU can have multiple SearchRanges. A SearchRange consists of two Oid's. We store them in a pair<>, and store the pais<>'s in a vector< pair<> >.
Definition at line 50 of file GetBulkPDU.hpp.
Referenced by get_sr(), GetBulkPDU(), and serialize().