AgentXcpp  Revision:0.1
Internals Documentation
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends
agentxcpp::ResponsePDU Class Reference

Represents an Response-PDU. More...

#include <ResponsePDU.hpp>

Inheritance diagram for agentxcpp::ResponsePDU:
[legend]
Collaboration diagram for agentxcpp::ResponsePDU:
[legend]

List of all members.

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 (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.
data_t serialize () const
 Serialize the PDU.

Public Attributes

vector< varbindvarbindlist
 The VarBindList.

Private Attributes

uint32_t sysUpTime
 the sysUpTime field.
uint16_t index
 the index field.
error_t error
 the error field.

Detailed Description

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.


Member Enumeration Documentation

The type of the error field of the Response-PDU.

Enumerator:
noAgentXError 
openFailed 
notOpen 
indexWrongType 
indexAlreadyAllocated 
indexNoneAvailable 
indexNotAllocated 
unsupportedContext 
duplicateRegistration 
unknownRegistration 
unknownAgentCaps 
parseError 
requestDenied 
processingError 
tooBig 
noSuchName 
badValue 
readOnly 
genErr 
noAccess 
wrongType 
wrongLength 
wrongEncoding 
wrongValue 
noCreation 
inconsistentValue 
resourceUnavailable 
commitFailed 
undoFailed 
authorizationError 
notWritable 
inconsistentName 

Definition at line 49 of file ResponsePDU.hpp.


Constructor & Destructor Documentation

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.

Parameters:
posIterator pointing to the current stream position. The iterator is advanced while reading the header.
endIterator pointing one element past the end of the current stream. This is needed to mark the end of the buffer.
big_endianWhether the serialized form of the PDU is in big_endian format.
Exceptions:
parse_errorIf 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:

  • sysUpTime = 0
  • error = noAgentXError
  • index = 0
  • varbindlist = <empty>

Definition at line 35 of file ResponsePDU.cpp.

References error, index, noAgentXError, and sysUpTime.


Member Function Documentation

Get the error status.

Definition at line 170 of file ResponsePDU.hpp.

References error.

Get the index value.

Definition at line 201 of file ResponsePDU.hpp.

References index.

Get the sysUpTime.

Definition at line 185 of file ResponsePDU.hpp.

References sysUpTime.

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::agentxResponsePDU, error, index, sysUpTime, varbindlist, write16(), and write32().

Set the error status.

Parameters:
errorThe new error status.
Exceptions:
inval_paramIf 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.

Referenced by agentxcpp::master_proxy::handle_pdu().

set the index value.

Definition at line 193 of file ResponsePDU.hpp.

References index.

Referenced by agentxcpp::master_proxy::handle_pdu().

Set the sysUpTime.

Definition at line 178 of file ResponsePDU.hpp.

References sysUpTime.


Member Data Documentation

the error field.

See RFC 2741, section 6.2.16 "The agentx-Response-PDU" for an explanation.

Definition at line 112 of file ResponsePDU.hpp.

Referenced by get_error(), ResponsePDU(), serialize(), and set_error().

the index field.

See RFC 2741, section 6.2.16 "The agentx-Response-PDU" for an explanation.

Definition at line 104 of file ResponsePDU.hpp.

Referenced by get_index(), ResponsePDU(), serialize(), and set_index().

the sysUpTime field.

See RFC 2741, section 6.2.16 "The agentx-Response-PDU" for an explanation.

Definition at line 96 of file ResponsePDU.hpp.

Referenced by get_sysUpTime(), ResponsePDU(), serialize(), and set_sysUpTime().

The VarBindList.

This vector may be empty if the PDU has no VarBinds.

Definition at line 120 of file ResponsePDU.hpp.

Referenced by agentxcpp::master_proxy::handle_pdu(), ResponsePDU(), and serialize().


The documentation for this class was generated from the following files: