#include <Var.h>

Inheritance diagram for Snmp::Var:
Collaboration diagram for Snmp::Var:

Public Member Functions

 Var ()
 
 Var (const Var &var)
 
Varoperator= (const Var &var)
 
 ~Var ()
 
Varoperator+= (const Var &var)
 
Varoperator/= (int num)
 
bool operator< (const Var &var) const
 
bool operator> (const Var &var) const
 
void pack (Ipc::TypedMsgHdr &msg) const
 prepare for sendmsg() More...
 
void unpack (const Ipc::TypedMsgHdr &msg)
 restore struct from the message More...
 
Range< const oid * > getName () const
 returns variable name More...
 
void setName (const Range< const oid *> &aName)
 set new variable name More...
 
void clearName ()
 clear variable name More...
 
bool isNull () const
 
int asInt () const
 returns variable value as integer More...
 
unsigned int asGauge () const
 returns variable value as unsigned int More...
 
int asCounter () const
 returns variable value as Counter32 More...
 
long long int asCounter64 () const
 returns variable value as Counter64 More...
 
unsigned int asTimeTicks () const
 returns variable value as time ticks More...
 
Range< const oid * > asObject () const
 returns variable value as object oid More...
 
Range< const u_char * > asString () const
 returns variable value as chars string More...
 
void setInt (int value)
 assign int value to variable More...
 
void setCounter (int value)
 assign Counter32 value to variable More...
 
void setGauge (unsigned int value)
 assign unsigned int value to variable More...
 
void setString (const Range< const u_char *> &string)
 assign string to variable More...
 
void setObject (const Range< const oid *> &object)
 assign object oid to variable More...
 
void setTimeTicks (unsigned int ticks)
 assign unsigned int (time) value to variable More...
 
void setCounter64 (long long int counter)
 assign Counter64 value to variable More...
 
void copyValue (const Var &var)
 copy variable from another one More...
 
void clearValue ()
 clear .val member More...
 
void clear ()
 clear all internal members More...
 

Public Attributes

struct variable_listnext_variable
 
oidname
 
int name_length
 
u_char type
 
union {
   int *   integer
 
   u_char *   string
 
   oid *   objid
 
val
 
int val_len
 

Private Member Functions

void init ()
 initialize members More...
 
void assign (const Var &var)
 perform full assignment More...
 
void setValue (const void *value, int length, int aType)
 set new variable value More...
 

Detailed Description

variable_list wrapper implement the feature to change the name/value of variable and to pack/unpack message

Definition at line 23 of file Var.h.

Constructor & Destructor Documentation

◆ Var() [1/2]

Snmp::Var::Var ( )

Definition at line 20 of file Var.cc.

References init().

◆ Var() [2/2]

Snmp::Var::Var ( const Var var)

Definition at line 25 of file Var.cc.

References assign(), and init().

◆ ~Var()

Snmp::Var::~Var ( )

Definition at line 31 of file Var.cc.

References clear().

Member Function Documentation

◆ asCounter()

int Snmp::Var::asCounter ( ) const

◆ asCounter64()

long long int Snmp::Var::asCounter64 ( ) const

◆ asGauge()

unsigned int Snmp::Var::asGauge ( ) const

◆ asInt()

int Snmp::Var::asInt ( ) const

◆ asObject()

Range< const oid * > Snmp::Var::asObject ( ) const

Definition at line 237 of file Var.cc.

References Must, NULL, SMI_OBJID, variable_list::type, variable_list::val, and variable_list::val_len.

◆ assign()

void Snmp::Var::assign ( const Var var)
private

Definition at line 150 of file Var.cc.

References copyValue(), getName(), and setName().

Referenced by operator=(), and Var().

◆ asString()

Range< const u_char * > Snmp::Var::asString ( ) const

Definition at line 247 of file Var.cc.

References Must, NULL, SMI_STRING, variable_list::type, variable_list::val, and variable_list::val_len.

◆ asTimeTicks()

unsigned int Snmp::Var::asTimeTicks ( ) const

◆ clear()

void Snmp::Var::clear ( )

Definition at line 316 of file Var.cc.

References clearName(), clearValue(), and init().

Referenced by operator=(), and ~Var().

◆ clearName()

void Snmp::Var::clearName ( )

Definition at line 157 of file Var.cc.

References variable_list::name, variable_list::name_length, and xfree.

Referenced by clear(), setName(), and unpack().

◆ clearValue()

void Snmp::Var::clearValue ( )

Definition at line 182 of file Var.cc.

References variable_list::type, variable_list::val, variable_list::val_len, and xfree.

Referenced by clear(), setValue(), and unpack().

◆ copyValue()

void Snmp::Var::copyValue ( const Var var)

◆ getName()

Range< const oid * > Snmp::Var::getName ( ) const

Definition at line 165 of file Var.cc.

References variable_list::name, and variable_list::name_length.

Referenced by Snmp::Pdu::aggregate(), and assign().

◆ init()

void Snmp::Var::init ( void  )
private

Definition at line 45 of file Var.cc.

Referenced by clear(), and Var().

◆ isNull()

bool Snmp::Var::isNull ( ) const

Definition at line 191 of file Var.cc.

References SMI_NULLOBJ, and variable_list::type.

Referenced by Snmp::Pdu::aggregate().

◆ operator+=()

◆ operator/=()

◆ operator<()

bool Snmp::Var::operator< ( const Var var) const

◆ operator=()

Snmp::Var & Snmp::Var::operator= ( const Var var)

Definition at line 37 of file Var.cc.

References assign(), and clear().

◆ operator>()

bool Snmp::Var::operator> ( const Var var) const

◆ pack()

◆ setCounter()

void Snmp::Var::setCounter ( int  value)

Definition at line 261 of file Var.cc.

References setValue(), and SMI_COUNTER32.

Referenced by operator+=(), and operator/=().

◆ setCounter64()

void Snmp::Var::setCounter64 ( long long int  counter)

Definition at line 285 of file Var.cc.

References setValue(), and SMI_COUNTER64.

Referenced by operator+=(), and operator/=().

◆ setGauge()

void Snmp::Var::setGauge ( unsigned int  value)

Definition at line 267 of file Var.cc.

References setValue(), and SMI_GAUGE32.

Referenced by operator+=(), and operator/=().

◆ setInt()

void Snmp::Var::setInt ( int  value)

Definition at line 255 of file Var.cc.

References setValue(), and SMI_INTEGER.

Referenced by operator+=(), and operator/=().

◆ setName()

void Snmp::Var::setName ( const Range< const oid *> &  aName)

◆ setObject()

void Snmp::Var::setObject ( const Range< const oid *> &  object)

Definition at line 279 of file Var.cc.

References setValue(), size, and SMI_OBJID.

◆ setString()

void Snmp::Var::setString ( const Range< const u_char *> &  string)

Definition at line 273 of file Var.cc.

References setValue(), size, and SMI_STRING.

◆ setTimeTicks()

void Snmp::Var::setTimeTicks ( unsigned int  ticks)

Definition at line 291 of file Var.cc.

References setValue(), and SMI_TIMETICKS.

Referenced by operator+=(), and operator/=().

◆ setValue()

void Snmp::Var::setValue ( const void *  value,
int  length,
int  aType 
)
private

◆ unpack()

Member Data Documentation

◆ integer

int* variable_list::integer
inherited

◆ name

◆ name_length

◆ next_variable

◆ objid

oid* variable_list::objid
inherited

Definition at line 52 of file snmp_vars.h.

Referenced by snmp_pdu_decode(), snmp_var_DecodeVarBind(), and snmp_var_EncodeVarBind().

◆ string

u_char* variable_list::string
inherited

◆ type

◆ val

◆ val_len


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors