#include <Var.h>
Public Member Functions | |
Var () | |
Var (const Var &var) | |
Var & | operator= (const Var &var) |
~Var () | |
Var & | operator+= (const Var &var) |
Var & | operator/= (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_list * | next_variable |
oid * | name |
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
Constructor & Destructor Documentation
◆ Var() [1/2]
◆ Var() [2/2]
◆ ~Var()
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()
◆ assign()
|
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()
◆ clearName()
◆ clearValue()
◆ copyValue()
void Snmp::Var::copyValue | ( | const Var & | var | ) |
Definition at line 297 of file Var.cc.
References variable_list::string, variable_list::type, variable_list::val, and variable_list::val_len.
Referenced by Snmp::Pdu::aggregate().
◆ getName()
Definition at line 165 of file Var.cc.
Referenced by Snmp::Pdu::aggregate(), and assign().
◆ init()
◆ isNull()
bool Snmp::Var::isNull | ( | ) | const |
Definition at line 191 of file Var.cc.
References SMI_NULLOBJ.
Referenced by Snmp::Pdu::aggregate().
◆ operator+=()
Definition at line 51 of file Var.cc.
References asCounter(), asCounter64(), asGauge(), asInt(), asTimeTicks(), DBG_CRITICAL, debugs, SMI_COUNTER32, SMI_COUNTER64, SMI_GAUGE32, SMI_INTEGER, SMI_TIMETICKS, and TexcHere.
◆ operator/=()
Definition at line 78 of file Var.cc.
References DBG_CRITICAL, debugs, Must, SMI_COUNTER32, SMI_COUNTER64, SMI_GAUGE32, SMI_INTEGER, SMI_TIMETICKS, and TexcHere.
◆ operator<()
bool Snmp::Var::operator< | ( | const Var & | var | ) | const |
Definition at line 105 of file Var.cc.
References asCounter(), asCounter64(), asGauge(), asInt(), asTimeTicks(), DBG_CRITICAL, debugs, SMI_COUNTER32, SMI_COUNTER64, SMI_GAUGE32, SMI_INTEGER, SMI_TIMETICKS, and TexcHere.
◆ operator=()
◆ operator>()
bool Snmp::Var::operator> | ( | const Var & | var | ) | const |
Definition at line 128 of file Var.cc.
References asCounter(), asCounter64(), asGauge(), asInt(), asTimeTicks(), DBG_CRITICAL, debugs, SMI_COUNTER32, SMI_COUNTER64, SMI_GAUGE32, SMI_INTEGER, SMI_TIMETICKS, and TexcHere.
◆ pack()
void Snmp::Var::pack | ( | Ipc::TypedMsgHdr & | msg | ) | const |
Definition at line 324 of file Var.cc.
References Must, Ipc::TypedMsgHdr::putFixed(), Ipc::TypedMsgHdr::putInt(), and Ipc::TypedMsgHdr::putPod().
Referenced by Snmp::Pdu::pack().
◆ 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()
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()
◆ 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()
◆ unpack()
void Snmp::Var::unpack | ( | const Ipc::TypedMsgHdr & | msg | ) |
Definition at line 340 of file Var.cc.
References Ipc::TypedMsgHdr::getFixed(), Ipc::TypedMsgHdr::getInt(), Ipc::TypedMsgHdr::getPod(), Must, and xmalloc.
Referenced by Snmp::Pdu::unpack().
Member Data Documentation
◆ integer
|
inherited |
Definition at line 50 of file snmp_vars.h.
Referenced by snmp_var_DecodeVarBind(), snmp_var_EncodeVarBind(), snmp_var_free(), and snmp_var_new_integer().
◆ name
|
inherited |
Definition at line 46 of file snmp_vars.h.
Referenced by Snmp::Pdu::aggregate(), Snmp::Pdu::fixAggregate(), snmp_add_null_var(), snmp_confFn(), snmp_meshCtblFn(), snmp_meshPtblFn(), snmp_netDnsFn(), snmp_netFqdnFn(), snmp_netIpFn(), snmp_prfProtoFn(), snmp_prfSysFn(), snmp_sysFn(), snmp_var_clone(), snmp_var_DecodeVarBind(), snmp_var_EncodeVarBind(), snmp_var_free(), snmp_var_new(), and snmpAgentResponse().
◆ name_length
|
inherited |
Definition at line 47 of file snmp_vars.h.
Referenced by Snmp::Pdu::aggregate(), Snmp::Pdu::fixAggregate(), snmp_add_null_var(), snmp_confFn(), snmp_meshCtblFn(), snmp_meshPtblFn(), snmp_netDnsFn(), snmp_netFqdnFn(), snmp_netIpFn(), snmp_prfProtoFn(), snmp_prfSysFn(), snmp_sysFn(), snmp_var_clone(), snmp_var_DecodeVarBind(), snmp_var_EncodeVarBind(), snmp_var_new(), and snmpAgentResponse().
◆ next_variable
|
inherited |
Definition at line 45 of file snmp_vars.h.
Referenced by Snmp::Pdu::aggregate(), Snmp::Pdu::clearVars(), Snmp::Pdu::fixAggregate(), Snmp::Pdu::pack(), Snmp::Pdu::setVars(), snmp_add_null_var(), snmp_fix_pdu(), snmp_free_pdu(), snmp_var_DecodeVarBind(), snmp_var_EncodeVarBind(), snmpAgentResponse(), Snmp::Pdu::unpack(), and Snmp::Pdu::varCount().
◆ objid
|
inherited |
Definition at line 52 of file snmp_vars.h.
Referenced by snmp_pdu_decode(), snmp_var_DecodeVarBind(), and snmp_var_EncodeVarBind().
◆ string
|
inherited |
Definition at line 51 of file snmp_vars.h.
Referenced by copyValue(), snmp_confFn(), snmp_meshCtblFn(), snmp_meshPtblFn(), snmp_var_clone(), snmp_var_DecodeVarBind(), snmp_var_EncodeVarBind(), and snmp_var_free().
◆ type
|
inherited |
Definition at line 48 of file snmp_vars.h.
Referenced by copyValue(), snmp_confFn(), snmp_meshCtblFn(), snmp_meshPtblFn(), snmp_var_DecodeVarBind(), snmp_var_EncodeVarBind(), snmp_var_new(), and snmp_var_new_integer().
◆
union { ... } variable_list::val |
◆ val_len
|
inherited |
Definition at line 54 of file snmp_vars.h.
Referenced by copyValue(), snmp_confFn(), snmp_meshCtblFn(), snmp_meshPtblFn(), snmp_var_clone(), snmp_var_DecodeVarBind(), snmp_var_EncodeVarBind(), and snmp_var_new_integer().
The documentation for this class was generated from the following files: