AgentXcpp  Revision:4ac4848
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
}
 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< varbindget_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< varbindvarbindlist
 The VarBindList, if any.

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 

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 148 of file ResponsePDU.hpp.

References error.

Get the index value.

Definition at line 179 of file ResponsePDU.hpp.

References index.

Get the sysUpTime.

Definition at line 163 of file ResponsePDU.hpp.

References sysUpTime.

Get the VarBindList.

Definition at line 195 of file ResponsePDU.hpp.

References varbindlist.

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().

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.

set the index value.

Definition at line 171 of file ResponsePDU.hpp.

References index.

Set the sysUpTime.

Definition at line 156 of file ResponsePDU.hpp.

References sysUpTime.

void agentxcpp::ResponsePDU::set_varbindlist ( vector< varbind varbindlist) [inline]

Set the VarBindList.

Definition at line 187 of file ResponsePDU.hpp.

References varbindlist.


Member Data Documentation

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().

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().

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().

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().


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