SNMP++
3.3.11
|
Community based target object. More...
#include <target.h>
Public Member Functions | |
CTarget () | |
Constructor with no args. More... | |
CTarget (const Address &address, const char *read_community_name, const char *write_community_name) | |
Constructor with all args. More... | |
CTarget (const Address &address, const OctetStr &read_community_name, const OctetStr &write_community_name) | |
Constructor with all args. More... | |
CTarget (const Address &address) | |
Constructor with only address. More... | |
CTarget (const CTarget &target) | |
Constructor from existing CTarget. More... | |
~CTarget () | |
Destructor, that has nothing to do. More... | |
SnmpTarget * | clone () const |
Clone operator. More... | |
const char * | get_readcommunity () const |
Get the read community name. More... | |
void | get_readcommunity (OctetStr &oct) const |
Get the read community name. More... | |
void | set_readcommunity (const char *str) |
Set the read community name. More... | |
void | set_readcommunity (const OctetStr &oct) |
Set the read community name. More... | |
const char * | get_writecommunity () const |
Get the write community name. More... | |
void | get_writecommunity (OctetStr &oct) const |
Get the write community name. More... | |
void | set_writecommunity (const char *str) |
Set the write community name. More... | |
void | set_writecommunity (const OctetStr &oct) |
Set the write community name. More... | |
CTarget & | operator= (const CTarget &target) |
Overloaded assignment operator. More... | |
int | operator== (const CTarget &rhs) const |
Overloeaded compare operator. More... | |
bool | resolve_to_C (OctetStr &read_comm, OctetStr &write_comm, GenAddress &address, unsigned long &t, int &r, unsigned char &v) const |
Get all values of a CTarget object. More... | |
void | clear () |
Reset the object. More... | |
Public Member Functions inherited from SnmpTarget | |
SnmpTarget () | |
Create a SnmpTarget object with default values. More... | |
SnmpTarget (const Address &address) | |
Create a SnmpTarget object with the given Address. More... | |
virtual | ~SnmpTarget () |
Destructor that has nothing to do. More... | |
target_type | get_type () const |
Return the type of the target object. More... | |
bool | valid () const |
Returns the validity of the target object. More... | |
void | set_retry (const int r) |
Set the retry value. More... | |
int | get_retry () const |
Get the retry value. More... | |
void | set_timeout (const unsigned long t) |
Set the timeout for requests. More... | |
unsigned long | get_timeout () const |
Get the timeout. More... | |
bool | get_address (GenAddress &address) const |
Get the address object. More... | |
const GenAddress & | get_address () const |
Get the address object. More... | |
virtual bool | set_address (const Address &address) |
Set the address object. More... | |
snmp_version | get_version () const |
Get the SNMP version for this target. More... | |
void | set_version (const snmp_version v) |
Set the SNMP version of this target. More... | |
int | operator== (const SnmpTarget &rhs) const |
Overloeaded compare operator. More... | |
Protected Attributes | |
OctetStr | read_community |
OctetStr | write_community |
Protected Attributes inherited from SnmpTarget | |
bool | validity |
Validity of the object. More... | |
unsigned long | timeout |
xmit timeout in 10 milli secs More... | |
int | retries |
number of retries More... | |
snmp_version | version |
SNMP version to use. More... | |
target_type | ttype |
Type of the target. More... | |
GenAddress | my_address |
Address object. More... | |
Additional Inherited Members | |
Public Types inherited from SnmpTarget | |
enum | target_type { type_base, type_ctarget, type_utarget } |
Enum to identify a target object through SnmpTarget::get_type() method. More... | |
Static Public Member Functions inherited from SnmpTarget | |
static void | set_default_timeout (const unsigned long t) |
Change the default timeout. More... | |
static void | set_default_retries (const int r) |
Change the default retries vlaue. More... | |
Static Protected Attributes inherited from SnmpTarget | |
static unsigned long | default_timeout |
default timeout for new objects More... | |
static int | default_retries |
default retries for new objects More... | |
Community based target object.
This target can be used for SNMPv1 and SNMPv2c messages.
CTarget::CTarget | ( | ) |
Constructor with no args.
The validity of the target will be false.
CTarget::CTarget | ( | const Address & | address, |
const char * | read_community_name, | ||
const char * | write_community_name | ||
) |
Constructor with all args.
address | - Address of the target host (cann be any address object) |
read_community_name | - Community for get requests |
write_community_name | - Community for set requests |
CTarget::CTarget | ( | const Address & | address, |
const OctetStr & | read_community_name, | ||
const OctetStr & | write_community_name | ||
) |
Constructor with all args.
address | - Address of the target host (cann be any address object) |
read_community_name | - Community for get requests |
write_community_name | - Community for set requests |
CTarget::CTarget | ( | const Address & | address | ) |
Constructor with only address.
The read and write community names will be set to "public".
address | - Address of the target host (cann be any address object) |
|
inline |
|
virtual |
Reset the object.
Reimplemented from SnmpTarget.
|
inlinevirtual |
Clone operator.
Clone operation for creating a new CTarget from an existing CTarget.
Reimplemented from SnmpTarget.
|
inline |
|
inline |
|
inline |
|
inline |
int CTarget::operator== | ( | const CTarget & | rhs | ) | const |
Overloeaded compare operator.
Two CTarget objects are considered equal, if all member variables and the base classes are equal.
bool CTarget::resolve_to_C | ( | OctetStr & | read_comm, |
OctetStr & | write_comm, | ||
GenAddress & | address, | ||
unsigned long & | t, | ||
int & | r, | ||
unsigned char & | v | ||
) | const |
|
inline |
|
inline |
|
inline |
|
inline |