#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

Snmp::Var::Var ( )

Definition at line 20 of file Var.cc.

References init().

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

Definition at line 25 of file Var.cc.

Snmp::Var::~Var ( )

Definition at line 31 of file Var.cc.

Member Function Documentation

int Snmp::Var::asCounter ( ) const

Definition at line 213 of file Var.cc.

References Must, NULL, SMI_COUNTER32, and type.

Referenced by operator+=(), operator<(), and operator>().

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

Definition at line 221 of file Var.cc.

References Must, NULL, SMI_COUNTER64, and type.

Referenced by operator+=(), operator<(), and operator>().

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

Definition at line 205 of file Var.cc.

References Must, NULL, SMI_GAUGE32, and type.

Referenced by operator+=(), operator<(), and operator>().

int Snmp::Var::asInt ( ) const

Definition at line 197 of file Var.cc.

References Must, NULL, SMI_INTEGER, and type.

Referenced by operator+=(), operator<(), and operator>().

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

Definition at line 237 of file Var.cc.

References Must, NULL, SMI_OBJID, and type.

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

Definition at line 150 of file Var.cc.

References copyValue(), and getName().

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

Definition at line 247 of file Var.cc.

References Must, NULL, SMI_STRING, and type.

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

Definition at line 229 of file Var.cc.

References Must, NULL, SMI_TIMETICKS, and type.

Referenced by operator+=(), operator<(), and operator>().

void Snmp::Var::clear ( )

Definition at line 316 of file Var.cc.

void Snmp::Var::clearName ( )

Definition at line 157 of file Var.cc.

References xfree.

void Snmp::Var::clearValue ( )

Definition at line 182 of file Var.cc.

References type, and xfree.

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

Definition at line 165 of file Var.cc.

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

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

Definition at line 45 of file Var.cc.

Referenced by Var().

bool Snmp::Var::isNull ( ) const

Definition at line 191 of file Var.cc.

References SMI_NULLOBJ, and type.

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

Snmp::Var & Snmp::Var::operator+= ( const Var var)
Snmp::Var & Snmp::Var::operator/= ( int  num)
bool Snmp::Var::operator< ( const Var var) const
Snmp::Var & Snmp::Var::operator= ( const Var var)

Definition at line 37 of file Var.cc.

bool Snmp::Var::operator> ( const Var var) const
void Snmp::Var::pack ( Ipc::TypedMsgHdr msg) const
void Snmp::Var::setCounter ( int  value)

Definition at line 261 of file Var.cc.

References SMI_COUNTER32.

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

Definition at line 285 of file Var.cc.

References SMI_COUNTER64.

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

Definition at line 267 of file Var.cc.

References SMI_GAUGE32.

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

Definition at line 255 of file Var.cc.

References SMI_INTEGER.

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

Definition at line 171 of file Var.cc.

References Range< C, S >::end, NULL, Range< C, S >::size(), Range< C, S >::start, and xmalloc.

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

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

Definition at line 279 of file Var.cc.

References size, and SMI_OBJID.

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

Definition at line 273 of file Var.cc.

References size, and SMI_STRING.

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

Definition at line 291 of file Var.cc.

References SMI_TIMETICKS.

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

Definition at line 303 of file Var.cc.

References Must, NULL, type, and xmalloc.

void Snmp::Var::unpack ( const Ipc::TypedMsgHdr msg)

Member Data Documentation

int* variable_list::integer
inherited
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().

u_char* variable_list::string
inherited

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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors