Dangerous SNMP
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
AgentX::OidRegistrationEntry Class Reference

An OidRegistrationEntry represents an OID that has been registered. More...

#include <agentx.hpp>

Public Types

enum  Type { OBJECT, INSTANCE, TREE }
 This represents the kind of OID that is being registered. More...
 
typedef std::function< bool(const
NumericOid &oid, Variant
&value)> 
GetFunction
 The GetFunction is called when the value of an OID is requested. More...
 
typedef std::function< bool(const
NumericOid &oid, NumericOid
&nextOid, Variant &value)> 
GetNextFunction
 The GetNextFunction is called when the next OID is requested. More...
 

Public Member Functions

 OidRegistrationEntry ()
 Constructor.
 

Public Attributes

uint8_t priority
 This is the priority of the OID. More...
 
Type type
 This is the type of registration TODO TODO TODO.
 
GetFunction getFunction
 This function will be called when the value of the OID is requested.
 
GetNextFunction getNextFunction
 This function will be called when the next OID is requested.
 

Detailed Description

An OidRegistrationEntry represents an OID that has been registered.

This contains:

  1. The function to call when the OID is requested, which fills out the value.
  2. The function to call when the next OID is requested, which fills out the next OID and its value.

The exact behavior depends on the Type:

  • OBJECT and INSTANCE
    • The OID passed to the GetFunction is the original registration OID.
    • The GetNextFunction is ignored.
  • TREE
    • The OID passed to the GetFunction is the full OID requested.
    • The GetNextFunction is used.

Member Typedef Documentation

typedef std::function<bool(const NumericOid& oid, Variant& value)> GetFunction

The GetFunction is called when the value of an OID is requested.

Template Parameters
oidThe OID whose value is requested.
valueThe value of the OID; this should be updated by the function.
Returns
true if value is valid; false otherwise.
typedef std::function<bool(const NumericOid& oid, NumericOid& nextOid, Variant& value)> GetNextFunction

The GetNextFunction is called when the next OID is requested.

Template Parameters
oidThe reference OID.
nextOidThe next OID after the reference OID; this should be updated by the function.
valueThe value of the next OID, if it is valid.
Returns
true if the next OID, and its value, are set; false if there is no next OID.

Member Enumeration Documentation

enum Type

This represents the kind of OID that is being registered.

Enumerator
OBJECT 

This registration is for an individual OID.

INSTANCE 

This registration is for an instance of a table-based OID.

TREE 

This registration is for a tree; it will handle all OIDs under the given one.

Member Data Documentation

uint8_t priority

This is the priority of the OID.

The range is from 1 - 255, with a lower value having a higher priority than a higher value. If this is set to zero, the the value will be AgentX::DEFAULT_PRIORITY.


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