SNMP++
3.3.11
|
The Vb class is the encapsulation of the SNMP variable binding. More...
#include <vb.h>
Public Member Functions | |
Vb () | |
Constructor with no arguments. More... | |
Vb (const Oid &oid) | |
Constructor to initialize the oid. More... | |
Vb (const Vb &vb) | |
Copy constructor. More... | |
~Vb () | |
Destructor that frees all allocated memory. More... | |
Vb & | operator= (const Vb &vb) |
Overloaded assignment operator. More... | |
Vb * | clone () const |
Clone operator. More... | |
void | set_oid (const Oid &oid) |
Set the oid from another oid. More... | |
void | get_oid (Oid &oid) const |
Get the oid portion. More... | |
const Oid & | get_oid () const |
Get the oid portion as a const. More... | |
void | set_value (const SnmpSyntax &val) |
Set the value using any SnmpSyntax object. More... | |
void | set_value (const int i) |
Set the value with an int. More... | |
void | set_value (const unsigned int i) |
Set the value with an unsigned int. More... | |
void | set_value (const long i) |
Set the value with a long int. More... | |
void | set_value (const unsigned long i) |
Set the value with an unsigned long int. More... | |
void | set_value (const char *ptr) |
Set value using a null terminated string. More... | |
void | set_value (const unsigned char *ptr, const unsigned int len) |
Set value using a string and length. More... | |
void | set_null () |
Set the value portion of the vb to null, if its not already. More... | |
int | get_value (SnmpSyntax &val) const |
Get the value using a SnmpSyntax object. More... | |
int | get_value (int &i) const |
Get the value. More... | |
int | get_value (unsigned int &i) const |
Get the value. More... | |
int | get_value (long &i) const |
Get the value. More... | |
int | get_value (unsigned long &i) const |
Get the value. More... | |
int | get_value (pp_uint64 &i) const |
Get the value. More... | |
int | get_value (unsigned char *ptr, unsigned long &len) const |
Get the value. More... | |
int | get_value (unsigned char *ptr, unsigned long &len, const unsigned long maxlen, const bool add_null_byte=false) const |
Get the value. More... | |
int | get_value (char *ptr) const |
Get the value. More... | |
SnmpSyntax * | clone_value () const |
Clone the value portion of the variable binding. More... | |
SmiUINT32 | get_syntax () const |
Return the syntax or the exception status. More... | |
void | set_syntax (const SmiUINT32 syntax) |
Set the syntax. More... | |
void | set_exception_status (const SmiUINT32 status) |
Set the exception status. More... | |
SmiUINT32 | get_exception_status () const |
Get the exception status. More... | |
const char * | get_printable_value () const |
Return a formatted version of the value. More... | |
const char * | get_printable_oid () const |
Return a formatted version of the Oid. More... | |
bool | valid () const |
Return the validity of a Vb object. More... | |
int | get_asn1_length () const |
Return the space needed for serialization. More... | |
void | clear () |
Reset the object. More... | |
Protected Member Functions | |
void | free_vb () |
Free the value portion. More... | |
Protected Attributes | |
Oid | iv_vb_oid |
SnmpSyntax * | iv_vb_value |
SmiUINT32 | exception_status |
The Vb class is the encapsulation of the SNMP variable binding.
Variable binding lists in SNMP++ are represented as arrays of Vb objects. Vb objects are passed to and from SNMP objects to provide getting or setting MIB values. The vb class keeps its own memory for objects and does not utilize pointers to external data structures.
|
inline |
|
inline |
|
inline |
|
protected |
Free the value portion.
int Vb::get_asn1_length | ( | ) | const |
Return the space needed for serialization.
|
inline |
|
inline |
Get the oid portion.
|
inline |
Get the oid portion as a const.
|
inline |
const char* Vb::get_printable_value | ( | ) | const |
Return a formatted version of the value.
SmiUINT32 Vb::get_syntax | ( | ) | const |
Return the syntax or the exception status.
int Vb::get_value | ( | SnmpSyntax & | val | ) | const |
Get the value using a SnmpSyntax object.
val | - An object of a subclass of SnmpSyntax that will be assigned the value of the vb. |
int Vb::get_value | ( | int & | i | ) | const |
Get the value.
This method will only return success if the value of the vb is SMI INT32.
i | - returned value |
int Vb::get_value | ( | unsigned int & | i | ) | const |
Get the value.
This method will only return success if the value of the vb can be mapped to an unsigned long (SMI types uint32, counter32, gauge and timeticks).
i | - returned value |
int Vb::get_value | ( | long & | i | ) | const |
Get the value.
This method will only return success if the value of the vb is SMI INT32.
i | - returned value |
int Vb::get_value | ( | unsigned long & | i | ) | const |
Get the value.
This method will only return success if the value of the vb can be mapped to an unsigned long (SMI types uint32, counter32, gauge and timeticks).
i | - returned value |
int Vb::get_value | ( | pp_uint64 & | i | ) | const |
Get the value.
This method will only return success if the value of the vb can be mapped to an unsigned 64bit value (SMI type counter64).
i | - returned value |
int Vb::get_value | ( | unsigned char * | ptr, |
unsigned long & | len | ||
) | const |
Get the value.
This method will only return success if the value of the vb is SMI OCTET.
ptr | - Pointer to already allocated space to hold the vb value. The first char will be set to zero on failure. |
len | - Returned length of the string. Will be set to 0 on failure. |
int Vb::get_value | ( | unsigned char * | ptr, |
unsigned long & | len, | ||
const unsigned long | maxlen, | ||
const bool | add_null_byte = false |
||
) | const |
Get the value.
This method will only return success if the value of the vb is SMI OCTET.
ptr | - Pointer to already allocated space to hold the vb value. The first char will be set to zero on failure. |
len | - Returned length of the string. Will be set to 0 on failure. |
maxlen | - Maximum length of the space that ptr points to. |
add_null_byte | - Add a null byte at end of output string. |
int Vb::get_value | ( | char * | ptr | ) | const |
Get the value.
This method will only return success if the value of the vb is SMI OCTET.
ptr | - Pointer to already allocated space to hold the vb value. The first char will be set to zero on failure. |
|
inline |
|
inline |
|
inline |
void Vb::set_syntax | ( | const SmiUINT32 | syntax | ) |
Set the syntax.
The Value portion of the Vb will be deleted and a new value portion is allocated with it's default value (zero).
syntax | - The new syntax. |
|
inline |
Set the value using any SnmpSyntax object.
Definition at line 158 of file vb.h.
References SnmpSyntax::clone().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool Vb::valid | ( | ) | const |
Return the validity of a Vb object.
|
protected |