Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

CTarget Class Reference

#include <target.h>

Inheritance diagram for CTarget:

[legend]
Collaboration diagram for CTarget:
[legend]
List of all members.

Detailed Description

Community based target object.

This target can be used for SNMPv1 and SNMPv2c messages.

Definition at line 289 of file target.h.

Public Member Functions

 CTarget ()
 Constructor with no args.

 CTarget (const Address &address, const char *read_community_name, const char *write_community_name)
 Constructor with all args.

 CTarget (const Address &address, const OctetStr &read_community_name, const OctetStr &write_community_name)
 Constructor with all args.

 CTarget (const Address &address)
 Constructor with only address.

 CTarget (const CTarget &target)
 Constructor from existing CTarget.

 ~CTarget ()
 Destructor, that has nothing to do.

SnmpTargetclone () const
 Clone operator.

const char * get_readcommunity () const
 Get the read community name.

void get_readcommunity (OctetStr &oct) const
 Get the read community name.

void set_readcommunity (const char *str)
 Set the read community name.

void set_readcommunity (const OctetStr &oct)
 Set the read community name.

const char * get_writecommunity () const
 Get the write community name.

void get_writecommunity (OctetStr &oct) const
 Get the write community name.

void set_writecommunity (const char *str)
 Set the write community name.

void set_writecommunity (const OctetStr &oct)
 Set the write community name.

CTargetoperator= (const CTarget &target)
 Overloaded assignment operator.

int operator== (const CTarget &rhs) const
 Overloeaded compare operator.

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

void clear ()
 Reset the object.


Protected Attributes

OctetStr read_community
OctetStr write_community


Constructor & Destructor Documentation

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.

Parameters:
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.

Parameters:
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".

Parameters:
address - Address of the target host (cann be any address object)

CTarget::CTarget const CTarget target  ) 
 

Constructor from existing CTarget.

CTarget::~CTarget  )  [inline]
 

Destructor, that has nothing to do.

Definition at line 337 of file target.h.


Member Function Documentation

void CTarget::clear  ) 
 

Reset the object.

Reimplemented from SnmpTarget.

SnmpTarget* CTarget::clone  )  const [inline, virtual]
 

Clone operator.

Clone operation for creating a new CTarget from an existing CTarget.

Note:
The caller MUST use the delete operation on the return value when done.
Returns:
A pointer to the new object on success, 0 on failure.

Reimplemented from SnmpTarget.

Definition at line 350 of file target.h.

void CTarget::get_readcommunity OctetStr oct  )  const [inline]
 

Get the read community name.

Parameters:
oct - OctetStr that will be filled with the read community name.

Definition at line 365 of file target.h.

const char* CTarget::get_readcommunity  )  const [inline]
 

Get the read community name.

Returns:
C string of the read community.

Definition at line 357 of file target.h.

void CTarget::get_writecommunity OctetStr oct  )  const [inline]
 

Get the write community name.

Parameters:
oct - OctetStr that will be filled with the write community name.

Definition at line 394 of file target.h.

const char* CTarget::get_writecommunity  )  const [inline]
 

Get the write community name.

Returns:
C string of the write community.

Definition at line 386 of file target.h.

References OctetStr::get_printable().

CTarget& CTarget::operator= const CTarget target  ) 
 

Overloaded assignment operator.

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.

Returns:
1 if targets are equal, 0 if not.

int CTarget::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.

Parameters:
read_comm - Read community name
write_comm - Write community name
address - Address of the target
t - Timeout value
r - Retries value
v - The SNMP version of this target
Returns:
TRUE on success and FALSE on failure.

void CTarget::set_readcommunity const OctetStr oct  )  [inline]
 

Set the read community name.

Parameters:
oct - The new read community name

Definition at line 379 of file target.h.

void CTarget::set_readcommunity const char *  str  )  [inline]
 

Set the read community name.

Parameters:
str - The new read community name

Definition at line 372 of file target.h.

void CTarget::set_writecommunity const OctetStr oct  )  [inline]
 

Set the write community name.

Parameters:
oct - The new write community name

Definition at line 408 of file target.h.

void CTarget::set_writecommunity const char *  str  )  [inline]
 

Set the write community name.

Parameters:
str - The new write community name

Definition at line 401 of file target.h.


Member Data Documentation

OctetStr CTarget::read_community [protected]
 

Definition at line 450 of file target.h.

OctetStr CTarget::write_community [protected]
 

Definition at line 451 of file target.h.


The documentation for this class was generated from the following file:
Generated on Tue Jan 4 22:42:17 2005 for SNMP++ by doxygen 1.3.2