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 } |
| The type of the error field of the Response-PDU. More... | |
Public Member Functions | |
| ResponsePDU (data_t::const_iterator &pos, const data_t::const_iterator &end, bool big_endian) | |
| Parse constructor. | |
| ResponsePDU () | |
| Default Constructor. | |
| void | set_error (error_t error) |
| Set the error status. | |
| error_t | get_error () |
| Get the error status. | |
| void | set_sysUpTime (uint32_t time) |
| Set the sysUpTime. | |
| uint32_t | get_sysUpTime () |
| Get the sysUpTime. | |
| void | set_index (uint16_t i) |
| set the index value. | |
| uint16_t | get_index () |
| Get the index value. | |
| void | set_varbindlist (vector< varbind > varbindlist) |
| Set the VarBindList. | |
| vector< varbind > | get_varbindlist () |
| Get the VarBindList. | |
| data_t | serialize () const |
| Serialize the PDU. | |
Private Attributes | |
| uint32_t | sysUpTime |
| the sysUpTime field. | |
| uint16_t | index |
| the index field. | |
| error_t | error |
| the error field. | |
| vector< varbind > | varbindlist |
| The VarBindList, if any. | |
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 43 of file ResponsePDU.hpp.
The type of the error field of the Response-PDU.
Definition at line 49 of file ResponsePDU.hpp.
| ResponsePDU::ResponsePDU | ( | data_t::const_iterator & | pos, |
| const data_t::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 45 of file ResponsePDU.cpp.
References duplicateRegistration, error, index, indexAlreadyAllocated, indexNoneAvailable, indexNotAllocated, indexWrongType, noAgentXError, notOpen, openFailed, parseError, processingError, read16(), read32(), requestDenied, sysUpTime, unknownAgentCaps, unknownRegistration, unsupportedContext, and varbindlist.
Default Constructor.
Sets the state of the object to the defaults as set by the PDU::PDU() constructor, plus the following:
Definition at line 35 of file ResponsePDU.cpp.
References error, index, noAgentXError, and sysUpTime.
| error_t agentxcpp::ResponsePDU::get_error | ( | ) | [inline] |
| uint16_t agentxcpp::ResponsePDU::get_index | ( | ) | [inline] |
| uint32_t agentxcpp::ResponsePDU::get_sysUpTime | ( | ) | [inline] |
| vector<varbind> agentxcpp::ResponsePDU::get_varbindlist | ( | ) | [inline] |
| data_t ResponsePDU::serialize | ( | ) | const [virtual] |
Serialize the PDU.
Implements agentxcpp::PDU.
Definition at line 92 of file ResponsePDU.cpp.
References agentxcpp::PDU::add_header(), agentxcpp::PDU::agentxClosePDU, error, index, sysUpTime, varbindlist, write16(), and write32().
| void ResponsePDU::set_error | ( | error_t | error | ) |
Set the error status.
| error | The new error status. |
| inval_param | If the error value is not allowed. |
Definition at line 7 of file ResponsePDU.cpp.
References duplicateRegistration, error, indexAlreadyAllocated, indexNoneAvailable, indexNotAllocated, indexWrongType, noAgentXError, notOpen, openFailed, parseError, processingError, requestDenied, unknownAgentCaps, unknownRegistration, and unsupportedContext.
| void agentxcpp::ResponsePDU::set_index | ( | uint16_t | i | ) | [inline] |
| void agentxcpp::ResponsePDU::set_sysUpTime | ( | uint32_t | time | ) | [inline] |
| void agentxcpp::ResponsePDU::set_varbindlist | ( | vector< varbind > | varbindlist | ) | [inline] |
error_t agentxcpp::ResponsePDU::error [private] |
the error field.
See RFC 2741, section 6.2.16 "The agentx-Response-PDU" for an explanation.
Definition at line 90 of file ResponsePDU.hpp.
Referenced by get_error(), ResponsePDU(), serialize(), and set_error().
uint16_t agentxcpp::ResponsePDU::index [private] |
the index field.
See RFC 2741, section 6.2.16 "The agentx-Response-PDU" for an explanation.
Definition at line 82 of file ResponsePDU.hpp.
Referenced by get_index(), ResponsePDU(), serialize(), and set_index().
uint32_t agentxcpp::ResponsePDU::sysUpTime [private] |
the sysUpTime field.
See RFC 2741, section 6.2.16 "The agentx-Response-PDU" for an explanation.
Definition at line 74 of file ResponsePDU.hpp.
Referenced by get_sysUpTime(), ResponsePDU(), serialize(), and set_sysUpTime().
vector<varbind> agentxcpp::ResponsePDU::varbindlist [private] |
The VarBindList, if any.
This vector may be empty if the PDU has no VarBinds.
Definition at line 97 of file ResponsePDU.hpp.
Referenced by get_varbindlist(), ResponsePDU(), serialize(), and set_varbindlist().