56 #ifndef _SNMP_TARGET_H_ 57 #define _SNMP_TARGET_H_ 67 #ifdef SNMP_PP_NAMESPACE 112 : validity(false), timeout(default_timeout), retries(default_retries),
113 version(
version1), ttype(type_base) {};
119 : validity(false), timeout(default_timeout), retries(default_retries),
120 version(
version1), ttype(type_base), my_address(address)
121 {
if (my_address.valid()) validity =
true; };
143 bool valid()
const {
return validity;};
185 { default_timeout = t; };
231 virtual bool set_address(
const Address &address);
261 virtual void clear();
297 const char *read_community_name,
298 const char *write_community_name);
308 const OctetStr &read_community_name,
309 const OctetStr &write_community_name);
349 {
return (
const char *) read_community.get_printable(); };
378 {
return (
const char *) write_community.get_printable(); };
414 int operator==(
const CTarget &rhs)
const;
428 bool resolve_to_C(
OctetStr& read_comm,
433 unsigned char &v)
const;
449 #define INITIAL_USER "initial" 451 #define INITIAL_USER "public" 477 const char *sec_name,
478 const int sec_model);
489 const int sec_model);
532 bool set_address(
const Address &address);
629 virtual int operator==(
const UTarget &rhs)
const;
643 bool resolve_to_U(
OctetStr& sec_name,
648 unsigned char &v)
const;
663 #ifdef SNMP_PP_NAMESPACE 667 #endif // _SNMP_TARGET_H_
int retries
number of retries
GenAddress my_address
Address object.
void set_engine_id(const char *str)
Set the engine id.
bool valid() const
Returns the validity of the target object.
void get_readcommunity(OctetStr &oct) const
Get the read community name.
target_type ttype
Type of the target.
SnmpTarget(const Address &address)
Create a SnmpTarget object with the given Address.
target_type
Enum to identify a target object through SnmpTarget::get_type() method.
SnmpTarget * clone() const
Clone operator.
unsigned long get_timeout() const
Get the timeout.
void set_writecommunity(const OctetStr &oct)
Set the write community name.
void set_security_name(const char *str)
Set the security name.
void set_version(const snmp_version v)
Set the SNMP version of this target.
bool validity
Validity of the object.
static void set_default_retries(const int r)
Change the default retries vlaue.
void set_timeout(const unsigned long t)
Set the timeout for requests.
void set_engine_id(const OctetStr &oct)
Set the engine id.
const char * get_writecommunity() const
Get the write community name.
SnmpTarget()
Create a SnmpTarget object with default values.
Community based target object.
const OctetStr & get_security_name() const
Get the security name.
static int default_retries
default retries for new objects
void get_security_name(OctetStr &oct) const
Get the security name.
static unsigned long default_timeout
default timeout for new objects
It is a SnmpTarget object.
void set_security_name(const OctetStr &oct)
Set the security name.
snmp_version get_version() const
Get the SNMP version for this target.
Base class of all Address classes.
~UTarget()
Destructor, that has nothing to do.
void set_readcommunity(const char *str)
Set the read community name.
void set_retry(const int r)
Set the retry value.
snmp_version
The SNMP version to use is passed with this enum.
snmp_version version
SNMP version to use.
int get_retry() const
Get the retry value.
~CTarget()
Destructor, that has nothing to do.
void set_writecommunity(const char *str)
Set the write community name.
target_type get_type() const
Return the type of the target object.
virtual ~SnmpTarget()
Destructor that has nothing to do.
void set_security_model(int sec_model)
Set the security_model.
unsigned long timeout
xmit timeout in 10 milli secs
void get_engine_id(OctetStr &oct) const
Get the engine id.
int get_security_model() const
Get the security_model.
void set_readcommunity(const OctetStr &oct)
Set the read community name.
const OctetStr & get_engine_id() const
Get the engine id.
const GenAddress & get_address() const
Get the address object.
SnmpCollection< SnmpTarget > TargetCollection
const char * get_readcommunity() const
Get the read community name.
Abstract class used to provide a virtual interface into Targets.
static void set_default_timeout(const unsigned long t)
Change the default timeout.
SnmpTarget * clone() const
Clone operator.
void get_writecommunity(OctetStr &oct) const
Get the write community name.