#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.

◆ ~Var()

Snmp::Var::~Var ( )

Definition at line 31 of file Var.cc.

Member Function Documentation

◆ asCounter()

int Snmp::Var::asCounter ( ) const

Definition at line 213 of file Var.cc.

References Must, and SMI_COUNTER32.

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

◆ asCounter64()

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

Definition at line 221 of file Var.cc.

References Must, and SMI_COUNTER64.

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

◆ asGauge()

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

Definition at line 205 of file Var.cc.

References Must, and SMI_GAUGE32.

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

◆ asInt()

int Snmp::Var::asInt ( ) const

Definition at line 197 of file Var.cc.

References Must, and SMI_INTEGER.

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

◆ asObject()

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

Definition at line 237 of file Var.cc.

References Must, and SMI_OBJID.

◆ assign()

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

Definition at line 150 of file Var.cc.

References copyValue(), and getName().

◆ asString()

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

Definition at line 247 of file Var.cc.

References Must, and SMI_STRING.

◆ asTimeTicks()

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

Definition at line 229 of file Var.cc.

References Must, and SMI_TIMETICKS.

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

◆ clear()

void Snmp::Var::clear ( )

Definition at line 316 of file Var.cc.

◆ clearName()

void Snmp::Var::clearName ( )

Definition at line 157 of file Var.cc.

References xfree.

◆ clearValue()

void Snmp::Var::clearValue ( )

Definition at line 182 of file Var.cc.

References xfree.

◆ copyValue()

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

◆ getName()

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

Definition at line 165 of file Var.cc.

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

◆ init()

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

Definition at line 45 of file Var.cc.

Referenced by Var().

◆ isNull()

bool Snmp::Var::isNull ( ) const

Definition at line 191 of file Var.cc.

References SMI_NULLOBJ.

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

◆ operator+=()

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

◆ operator/=()

Snmp::Var & Snmp::Var::operator/= ( int  num)

◆ 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.

◆ operator>()

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

◆ pack()

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

◆ setCounter()

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

Definition at line 261 of file Var.cc.

References SMI_COUNTER32.

◆ setCounter64()

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

Definition at line 285 of file Var.cc.

References SMI_COUNTER64.

◆ setGauge()

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

Definition at line 267 of file Var.cc.

References SMI_GAUGE32.

◆ setInt()

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

Definition at line 255 of file Var.cc.

References SMI_INTEGER.

◆ setName()

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().

◆ setObject()

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

Definition at line 279 of file Var.cc.

References size, and SMI_OBJID.

◆ setString()

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

Definition at line 273 of file Var.cc.

References size, and SMI_STRING.

◆ setTimeTicks()

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

Definition at line 291 of file Var.cc.

References SMI_TIMETICKS.

◆ setValue()

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

Definition at line 303 of file Var.cc.

References Must, and xmalloc.

◆ unpack()

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

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_len


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors