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

Represents an Notify-PDU. More...

#include <NotifyPDU.hpp>

Inheritance diagram for agentxcpp::NotifyPDU:
Collaboration diagram for agentxcpp::NotifyPDU:

Public Member Functions

 NotifyPDU (binary::const_iterator &pos, const binary::const_iterator &end, bool big_endian)
 Parse constructor. More...
 
 NotifyPDU ()
 Default Constructor. More...
 
vector< Varbind > & get_vb ()
 Get the VarBind list. More...
 
virtual binary serialize () const
 Serialize the PDU. More...
 
- Public Member Functions inherited from agentxcpp::PDUwithContext
bool has_context ()
 Whether the PDU has a context. More...
 
OctetStringVariable get_context ()
 Get context. More...
 
void set_context (OctetStringVariable value)
 Set the PDU's context. More...
 
void remove_context ()
 Removes the context from 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

vector< Varbindvb
 The VarBind list. More...
 

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::PDUwithContext
 PDUwithContext (binary::const_iterator &pos, const binary::const_iterator &end, bool big_endian)
 Parse constructor. More...
 
void add_header (type_t type, binary &payload) const
 Add PDU header and context field to the payload. More...
 
 PDUwithContext ()
 Default Constructor. 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 Notify-PDU.

Definition at line 38 of file NotifyPDU.hpp.

Constructor & Destructor Documentation

NotifyPDU::NotifyPDU ( 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 NotifyPDU.cpp.

References vb.

agentxcpp::NotifyPDU::NotifyPDU ( )
inline

Default Constructor.

Sets the state of the object to the defaults as set by the PDU::PDUwithContext() constructor, and initializes vb to be empty.

Definition at line 78 of file NotifyPDU.hpp.

Member Function Documentation

vector<Varbind>& agentxcpp::NotifyPDU::get_vb ( )
inline

Get the VarBind list.

This function returns a reference to the internal VarBind list, which can then be modified in place.

Note
  • There is no set_vb() function, because the VarBind list can be modified in place.
  • The following restrictions are placed on the vb's contents according to RFC 2741, 6.2.10. "The agentx-Notify-PDU":
    • If the subagent supplies sysUpTime.0, it must be present as the first varbind
    • snmpTrapOID.0 must be present, as the second varbind if sysUpTime.0 was supplied, as the first if it was not.

Definition at line 98 of file NotifyPDU.hpp.

References vb.

binary NotifyPDU::serialize ( ) const
virtual

Serialize the PDU.

Implements agentxcpp::PDU.

Definition at line 40 of file NotifyPDU.cpp.

References agentxcpp::PDUwithContext::add_header(), agentxcpp::PDU::agentxNotifyPDU, and vb.

Member Data Documentation

vector<Varbind> agentxcpp::NotifyPDU::vb
private

The VarBind list.

Definition at line 44 of file NotifyPDU.hpp.

Referenced by get_vb(), NotifyPDU(), and serialize().


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