AgentXcpp  Version:0.3
Internals Documentation
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Pages
agentxcpp::OpenPDU Class Reference

Represents an Open-PDU. More...

#include <OpenPDU.hpp>

Inheritance diagram for agentxcpp::OpenPDU:
Collaboration diagram for agentxcpp::OpenPDU:

Public Member Functions

 OpenPDU (binary::const_iterator &pos, const binary::const_iterator &end, bool big_endian)
 Parse constructor. More...
 
 OpenPDU ()
 Default Constructor. More...
 
quint8 get_timeout ()
 Get timeout. More...
 
void set_timeout (quint8 timeout)
 Set timeout. More...
 
Oid get_id ()
 Get ID. More...
 
void set_id (Oid id)
 Set ID. More...
 
OctetStringVariable get_descr ()
 Get descr. More...
 
void set_descr (OctetStringVariable descr)
 Set descr. More...
 
binary serialize () const
 Serialize the PDU. More...
 
- Public Member Functions inherited from agentxcpp::PDU
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

quint8 timeout
 
Oid id
 
OctetStringVariable descr
 

Additional Inherited Members

- Static Public Member Functions inherited from agentxcpp::PDU
static QSharedPointer< PDUparse_pdu (binary buf)
 Parse a PDU from a buffer. More...
 
- Protected Types inherited from agentxcpp::PDU
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...
 
- Protected Member Functions inherited from agentxcpp::PDU
 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...
 
- Protected Attributes inherited from agentxcpp::PDU
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...
 

Detailed Description

Represents an Open-PDU.

Definition at line 33 of file OpenPDU.hpp.

Constructor & Destructor Documentation

OpenPDU::OpenPDU ( 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.

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 25 of file OpenPDU.cpp.

References descr, timeout, and agentxcpp::OidVariable::value().

OpenPDU::OpenPDU ( )

Default Constructor.

Sets the state of the object to the defaults as set by the PDU::PDU() constructor, plus the following:

  • timeout = 0
  • oid = null Object Identifier
  • descr = empty string

Definition at line 46 of file OpenPDU.cpp.

Member Function Documentation

OctetStringVariable agentxcpp::OpenPDU::get_descr ( )
inline

Get descr.

Definition at line 120 of file OpenPDU.hpp.

References descr.

Oid agentxcpp::OpenPDU::get_id ( )
inline

Get ID.

Definition at line 104 of file OpenPDU.hpp.

References id.

quint8 agentxcpp::OpenPDU::get_timeout ( )
inline

Get timeout.

Definition at line 79 of file OpenPDU.hpp.

References timeout.

binary OpenPDU::serialize ( ) const
virtual
void agentxcpp::OpenPDU::set_descr ( OctetStringVariable  descr)
inline

Set descr.

Definition at line 128 of file OpenPDU.hpp.

References descr.

void agentxcpp::OpenPDU::set_id ( Oid  id)
inline

Set ID.

Definition at line 112 of file OpenPDU.hpp.

References id.

void agentxcpp::OpenPDU::set_timeout ( quint8  timeout)
inline

Set timeout.

Parameters
timeoutThe length of time, in seconds, that a master agent should allow to elapse after dispatching a message on a session before it regards the subagent as not responding. This is the default value for the session, and may be overridden by values associated with specific registered MIB regions. The default value of 0 indicates that there is no session-wide default value.

Definition at line 96 of file OpenPDU.hpp.

References timeout.

Member Data Documentation

OctetStringVariable agentxcpp::OpenPDU::descr
private

Definition at line 38 of file OpenPDU.hpp.

Referenced by get_descr(), OpenPDU(), serialize(), and set_descr().

Oid agentxcpp::OpenPDU::id
private

Definition at line 37 of file OpenPDU.hpp.

Referenced by get_id(), and set_id().

quint8 agentxcpp::OpenPDU::timeout
private

Definition at line 36 of file OpenPDU.hpp.

Referenced by get_timeout(), OpenPDU(), serialize(), and set_timeout().


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