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

Classes

class  AbstractVariable
 Base class for SNMP variables. More...
 
class  AddAgentCapsPDU
 Represents an AddAgentCaps-PDU. More...
 
class  binary
 A type representing a contigous byte stream. More...
 
class  CleanupSetPDU
 Represents an CleanupSet-PDU. More...
 
class  ClosePDU
 This class represents a Close-PDU. More...
 
class  CommitSetPDU
 Represents an CommitSet-PDU. More...
 
class  Counter32Variable
 Represents an Counter32 as described in RFC 2741. More...
 
class  Counter64Variable
 Represents an Counter64 as described in RFC 2741. More...
 
class  disconnected
 Exception to indicate a disconnected state. More...
 
class  DisplayStringVariable
 A DisplayString variable. More...
 
class  duplicate_registration
 Exception to indicate that a MIB region was registered twice with the same priority. More...
 
class  Gauge32Variable
 Represents a Gauge32 as described in RFC 2741. More...
 
class  generic_error
 Exception to indicate that obtaining the value of an SNMP variable failed. More...
 
class  GetBulkPDU
 Represents an GetBulk-PDU. More...
 
class  GetNextPDU
 Represents an GetNext-PDU. More...
 
class  GetPDU
 Represents an Get-PDU. More...
 
class  IndexAllocatePDU
 Represents a IndexAllocate-PDU. More...
 
class  IndexDeallocatePDU
 Represents a IndexDeallocate-PDU. More...
 
class  IntegerVariable
 This class represents an Integer variable as described in RFC 2741. More...
 
class  internal_error
 Exception to indicate an internal error. More...
 
class  inval_param
 Exception for invalid parameter. More...
 
class  IpAddressVariable
 Represents an IP address as described in RFC 2741, section 5.4. More...
 
class  master_is_unable
 Exception to indicate that the master agent was unable to process a request. More...
 
class  master_is_unwilling
 Exception to indicate that the master agent was not willing to process a request. More...
 
class  MasterProxy
 This class represents the master agent in a subagent program. More...
 
class  network_error
 Exception to indicate a network error. More...
 
class  NotifyPDU
 Represents an Notify-PDU. More...
 
class  OctetStringVariable
 Represents an OctetSting as described in RFC 2741. More...
 
class  Oid
 Represents an SNMP object identifier (OID). More...
 
class  OidVariable
 Represents an SNMP OBJECT-IDENTENTIFIER variable. More...
 
class  OpaqueVariable
 Represents an Opaque object as described in RFC 2741, section 5.4. More...
 
class  OpenPDU
 Represents an Open-PDU. More...
 
class  parse_error
 Exception for parse errors. More...
 
class  PDU
 The base class of all PDU's. More...
 
class  PDUwithContext
 
class  PingPDU
 Represents a Ping-PDU. More...
 
class  RegisterPDU
 This class represents a Register-PDU. More...
 
class  RemoveAgentCapsPDU
 Represents an RemoveAgentCaps-PDU. More...
 
class  ResponsePDU
 Represents an Response-PDU. More...
 
class  Table
 Manage an SNMP table. More...
 
class  TableEntry
 Base class for table entries. More...
 
class  TestSetPDU
 Represents an TestSet-PDU. More...
 
class  timeout_error
 Exception to indicate a timeout. More...
 
class  TimeTicksVariable
 Represents a TimeTicks as described in RFC 2741. More...
 
class  UndoSetPDU
 Represents an UndoSet-PDU. More...
 
class  UnixDomainConnector
 Connect to a unix domain socket. More...
 
class  unknown_registration
 Exception to indicate that a MIB region registration was not found. More...
 
class  UnregisterPDU
 This class represents an Unregister-PDU. More...
 
class  unsupported_context
 Exception to indicate that the master agent does not support the context. More...
 
class  Varbind
 Represents a VarBind according to RFC 2741, section 5.4. More...
 
class  version_error
 Exception for reception of PDU with invalid version number. More...
 

Enumerations

enum  generic_trap_t {
  coldStart =0, warmStart =1, linkDown =2, linkUp =3,
  authenticationFailure =4, egpNeighborLoss =5, enterpriseSpecific =6
}
 The allowed values for specific-trap (SNMPv1 trap). More...
 

Functions

std::ostream & operator<< (std::ostream &out, const binary &data)
 Output operator for binary. More...
 
TimeTicksVariable processUpTime ()
 Calculate the uptime of the current process. More...
 
Oid generate_v1_snmpTrapOID (generic_trap_t generic_trap, quint32 specific_trap=0)
 Create snmpTrapOID.0 value from SNMPv1 trap data. More...
 
std::ostream & operator<< (std::ostream &out, const agentxcpp::Oid &o)
 The output operator for the Oid class. More...
 
quint64 read64 (binary::const_iterator &pos, bool big_endian)
 
void write64 (binary &serialized, quint64 value)
 Write a 64-bit value into a string. More...
 
quint32 read32 (binary::const_iterator &pos, bool big_endian)
 
void write32 (binary &serialized, quint32 value)
 Write a 32-bit value into a string. More...
 
quint16 read16 (binary::const_iterator &pos, bool big_endian)
 
void write16 (binary &serialized, quint16 value)
 Write a 16-bit value into a string. More...
 

Enumeration Type Documentation

The allowed values for specific-trap (SNMPv1 trap).

According to RFC 1157, these values can be used for the generic-trap field in SNMPv1 Traps.

Enumerator
coldStart 
warmStart 
linkDown 
linkUp 
authenticationFailure 
egpNeighborLoss 
enterpriseSpecific 

Definition at line 51 of file helpers.hpp.

Function Documentation

Oid agentxcpp::generate_v1_snmpTrapOID ( generic_trap_t  generic_trap,
quint32  specific_trap = 0 
)

Create snmpTrapOID.0 value from SNMPv1 trap data.

Each notification must have an snmpTrapOID.0 object. In SNMPv1 no notifications were available; traps were used instead. This function takes parameters which would be present in an SNMPv1 trap and converts them to the corresponding an snmpTrapOID.0 value, which can be included in a notification. The master agent extracts the SNMPv1 trap information while generating a trap (only if sending an SNMPv1 trap, of course).

The conversion is done according to RFC 1908, 3.1.2 "SNMPv1 -> SNMPv2".

Parameters
generic_trapThe type of trap. If it is enterpriseSpecific, then the parameter specific_trap must also be given.
specific_trapOnly used if generic_trap is enterpriseSpecific. It can be any value specific to the subagent.
Returns
The value of the snmpTrapOID.0 object.
Exceptions
inval_paramIf the generic_trap parameter has an invalid value.

Definition at line 51 of file helpers.cpp.

References authenticationFailure, coldStart, egpNeighborLoss, enterpriseSpecific, linkDown, linkUp, and warmStart.

std::ostream& agentxcpp::operator<< ( std::ostream &  out,
const binary &  data 
)
inline

Output operator for binary.

Definition at line 42 of file binary.hpp.

std::ostream & agentxcpp::operator<< ( std::ostream &  out,
const agentxcpp::Oid o 
)

The output operator for the Oid class.

Object identifiers (Oid objects) can be output as follows:

Oid led_state(enterprises_oid, "1.3.3.1");
cout << "LED state OID: " << led_state << endl;

The last line will output "LED state OID: .1.3.6.1.4.1.3.3.1".

Parameters
outThe stream to which to write the output.
oThe OID to output.
Returns
The 'out' parameter.

Definition at line 94 of file Oid.cpp.

TimeTicksVariable agentxcpp::processUpTime ( )

Calculate the uptime of the current process.

This function calculates the uptime of the current process, in hundreths of a second. The result may be given as sysUpTime.0. parameter to agentxcpp::MasterProxy::send_notification( const OidVariable&, TimeTicksVariable*, const vector<varbind>&).

The time is measured using a global variable which is initialized to the current time just be before main() starts.

Returns
The current uptime, in hundreths of a second.

Definition at line 39 of file helpers.cpp.

quint16 agentxcpp::read16 ( binary::const_iterator &  pos,
bool  big_endian 
)
inline
quint64 agentxcpp::read64 ( binary::const_iterator &  pos,
bool  big_endian 
)
inline

Definition at line 31 of file util.hpp.

Referenced by agentxcpp::Counter64Variable::Counter64Variable().

void agentxcpp::write16 ( binary &  serialized,
quint16  value 
)
inline

Write a 16-bit value into a string.

Parameters
serializedThe string to which the value is appended.
valueThe value which is appended to the string.

Definition at line 143 of file util.hpp.

Referenced by agentxcpp::GetBulkPDU::serialize(), and agentxcpp::ResponsePDU::serialize().

void agentxcpp::write32 ( binary &  serialized,
quint32  value 
)
inline
void agentxcpp::write64 ( binary &  serialized,
quint64  value 
)
inline

Write a 64-bit value into a string.

Parameters
serializedThe string to which the value is appended.
valueThe value which is appended to the string.

Definition at line 67 of file util.hpp.

Referenced by agentxcpp::Counter64Variable::serialize().