Represents an Response-PDU. More...
#include <ResponsePDU.hpp>
Public Types | |
enum | error_t { noAgentXError = 0, openFailed = 256, notOpen = 257, indexWrongType = 258, indexAlreadyAllocated = 259, indexNoneAvailable = 260, indexNotAllocated = 261, unsupportedContext = 262, duplicateRegistration = 263, unknownRegistration = 264, unknownAgentCaps = 265, parseError = 266, requestDenied = 267, processingError = 268, tooBig = 1, noSuchName = 2, badValue = 3, readOnly = 4, genErr = 5, noAccess = 6, wrongType = 7, wrongLength = 8, wrongEncoding = 9, wrongValue = 10, noCreation = 11, inconsistentValue = 12, resourceUnavailable = 13, commitFailed = 14, undoFailed = 15, authorizationError = 16, notWritable = 17, inconsistentName = 18 } |
The type of the error field of the Response-PDU. More... | |
Public Member Functions | |
ResponsePDU (binary::const_iterator &pos, const binary::const_iterator &end, bool big_endian) | |
Parse constructor. More... | |
ResponsePDU () | |
Default Constructor. More... | |
void | set_error (error_t error) |
Set the error status. More... | |
error_t | get_error () |
Get the error status. More... | |
void | set_sysUpTime (quint32 time) |
Set the sysUpTime. More... | |
quint32 | get_sysUpTime () |
Get the sysUpTime. More... | |
void | set_index (quint16 i) |
set the index value. More... | |
quint16 | get_index () |
Get the index value. More... | |
binary | serialize () const |
Serialize 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... | |
Public Attributes | |
vector< Varbind > | varbindlist |
The VarBindList. More... | |
Private Attributes | |
quint32 | sysUpTime |
the sysUpTime field. More... | |
quint16 | index |
the index field. More... | |
error_t | error |
the error field. 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... | |
![]() | |
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 Response-PDU.
A Response-PDU is transmitted as a response to another PDU. The meaning of the individual fields of the Response-PDU depends on the PDU type to which the Response-PDU is sent. See RFC 2741 for details.
Definition at line 45 of file ResponsePDU.hpp.
The type of the error field of the Response-PDU.
Definition at line 51 of file ResponsePDU.hpp.
ResponsePDU::ResponsePDU | ( | 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 18 of file ResponsePDU.cpp.
References authorizationError, badValue, commitFailed, duplicateRegistration, error, genErr, inconsistentName, inconsistentValue, index, indexAlreadyAllocated, indexNoneAvailable, indexNotAllocated, indexWrongType, noAccess, noAgentXError, noCreation, noSuchName, notOpen, notWritable, openFailed, parseError, processingError, agentxcpp::read16(), agentxcpp::read32(), readOnly, requestDenied, resourceUnavailable, sysUpTime, tooBig, undoFailed, unknownAgentCaps, unknownRegistration, unsupportedContext, varbindlist, wrongEncoding, wrongLength, wrongType, and wrongValue.
ResponsePDU::ResponsePDU | ( | ) |
Default Constructor.
Sets the state of the object to the defaults as set by the PDU::PDU() constructor, plus the following:
Definition at line 8 of file ResponsePDU.cpp.
References error, index, noAgentXError, and sysUpTime.
|
inline |
|
inline |
|
inline |
|
virtual |
Serialize the PDU.
Implements agentxcpp::PDU.
Definition at line 85 of file ResponsePDU.cpp.
References agentxcpp::PDU::add_header(), agentxcpp::PDU::agentxResponsePDU, error, index, sysUpTime, varbindlist, agentxcpp::write16(), and agentxcpp::write32().
|
inline |
Set the error status.
error | The new error status. |
None. |
Definition at line 167 of file ResponsePDU.hpp.
References error.
|
inline |
set the index value.
Definition at line 198 of file ResponsePDU.hpp.
|
inline |
Set the sysUpTime.
Definition at line 183 of file ResponsePDU.hpp.
|
private |
the error field.
See RFC 2741, section 6.2.16 "The agentx-Response-PDU" for an explanation.
Definition at line 114 of file ResponsePDU.hpp.
Referenced by get_error(), ResponsePDU(), serialize(), and set_error().
|
private |
the index field.
See RFC 2741, section 6.2.16 "The agentx-Response-PDU" for an explanation.
Definition at line 106 of file ResponsePDU.hpp.
Referenced by get_index(), ResponsePDU(), and serialize().
|
private |
the sysUpTime field.
See RFC 2741, section 6.2.16 "The agentx-Response-PDU" for an explanation.
Definition at line 98 of file ResponsePDU.hpp.
Referenced by get_sysUpTime(), ResponsePDU(), and serialize().
vector<Varbind> agentxcpp::ResponsePDU::varbindlist |
The VarBindList.
This vector may be empty if the PDU has no VarBinds.
Definition at line 122 of file ResponsePDU.hpp.
Referenced by ResponsePDU(), and serialize().