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

UTarget Class Reference

#include <target.h>

Inheritance diagram for UTarget:

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

Detailed Description

User based Target.

This class is used for SNMPv3 targets.

Definition at line 469 of file target.h.

Public Member Functions

 UTarget ()
 Constructor with no args.

 UTarget (const Address &address, const char *sec_name, const int sec_model)
 Constructor with all args.

 UTarget (const Address &address, const OctetStr &sec_name, const int sec_model)
 Constructor with all args.

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

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

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

SnmpTargetclone () const
 Clone operator.

int set_address (const Address &address)
 Set the address object.

const OctetStrget_security_name () const
 Get the security name.

void get_security_name (OctetStr &oct) const
 Get the security name.

void set_security_name (const char *str)
 Set the security name.

void set_security_name (const OctetStr &oct)
 Set the security name.

void set_engine_id (const char *str)
 Set the engine id.

void set_engine_id (const OctetStr &oct)
 Set the engine id.

const OctetStrget_engine_id () const
 Get the engine id.

void get_engine_id (OctetStr &oct) const
 Get the engine id.

int get_security_model () const
 Get the security_model.

void set_security_model (int sec_model)
 Set the security_model.

UTargetoperator= (const UTarget &target)
 Overloaded assignment operator.

virtual int operator== (const UTarget &rhs) const
 Overloeaded compare operator.

int resolve_to_U (OctetStr &sec_name, int &sec_model, GenAddress &address, unsigned long &t, int &r, unsigned char &v) const
 Get all values of a UTarget object.

void clear ()
 Reset the object.


Protected Attributes

OctetStr security_name
int security_model
OctetStr engine_id


Constructor & Destructor Documentation

UTarget::UTarget  ) 
 

Constructor with no args.

The validity of the target will be false.

UTarget::UTarget const Address address,
const char *  sec_name,
const int  sec_model
 

Constructor with all args.

Parameters:
address - Address of the target host (cann be any address object)
sec_name - The security name
sec_model - The security model to use

UTarget::UTarget const Address address,
const OctetStr sec_name,
const int  sec_model
 

Constructor with all args.

Parameters:
address - Address of the target host (cann be any address object)
sec_name - The security name
sec_model - The security model to use

UTarget::UTarget const Address address  ) 
 

Constructor with only address.

Assumes the following defaults: security_name: initial, version: SNMPv3, security_model: v3MP.

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

UTarget::UTarget const UTarget target  ) 
 

Constructor from existing UTarget.

UTarget::~UTarget  )  [inline]
 

Destructor, that has nothing to do.

Definition at line 518 of file target.h.


Member Function Documentation

void UTarget::clear  ) 
 

Reset the object.

Reimplemented from SnmpTarget.

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

Clone operator.

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

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 531 of file target.h.

void UTarget::get_engine_id OctetStr oct  )  const [inline]
 

Get the engine id.

Parameters:
oct - OctetStr that will be filled with the engine id

Definition at line 608 of file target.h.

const OctetStr& UTarget::get_engine_id  )  const [inline]
 

Get the engine id.

Returns:
A const reference to the enigne id of this target.

Definition at line 601 of file target.h.

int UTarget::get_security_model  )  const [inline]
 

Get the security_model.

Returns:
An integer representing the security_model of this target.

Definition at line 616 of file target.h.

void UTarget::get_security_name OctetStr oct  )  const [inline]
 

Get the security name.

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

Definition at line 555 of file target.h.

const OctetStr& UTarget::get_security_name  )  const [inline]
 

Get the security name.

Returns:
A const reference to the security name.

Definition at line 548 of file target.h.

UTarget& UTarget::operator= const UTarget target  ) 
 

Overloaded assignment operator.

virtual int UTarget::operator== const UTarget rhs  )  const [virtual]
 

Overloeaded compare operator.

Two UTarget objects are considered equal, if all member variables (beside the engine id) and the base classes are equal.

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

int UTarget::resolve_to_U OctetStr sec_name,
int &  sec_model,
GenAddress address,
unsigned long &  t,
int &  r,
unsigned char &  v
const
 

Get all values of a UTarget object.

Parameters:
sec_name - security name
sec_model - security model
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.

int UTarget::set_address const Address address  )  [virtual]
 

Set the address object.

This method is the same as in SnmpTarget, but it deletes engine_id.

Parameters:
address - The address that this target should use.
Returns:
TRUE on success.

Reimplemented from SnmpTarget.

void UTarget::set_engine_id const OctetStr oct  )  [inline]
 

Set the engine id.

In most cases it is not necessary for the user to set the engine id as snmp++ performs engine id discovery. If the engine id is set by the user, no engine_id discovery is made, even if the engine id set by the user is wrong.

Parameters:
oct - The engine id to use

Definition at line 594 of file target.h.

void UTarget::set_engine_id const char *  str  )  [inline]
 

Set the engine id.

In most cases it is not necessary for the user to set the engine id as snmp++ performs engine id discovery. If the engine id is set by the user, no engine_id discovery is made, even if the engine id set by the user is wrong.

Parameters:
str - The engine id to use

Definition at line 582 of file target.h.

void UTarget::set_security_model int  sec_model  )  [inline]
 

Set the security_model.

Parameters:
sec_model - The security model to use.

Definition at line 623 of file target.h.

void UTarget::set_security_name const OctetStr oct  )  [inline]
 

Set the security name.

Parameters:
oct - The new security name

Definition at line 569 of file target.h.

void UTarget::set_security_name const char *  str  )  [inline]
 

Set the security name.

Parameters:
str - The new security name

Definition at line 562 of file target.h.


Member Data Documentation

OctetStr UTarget::engine_id [protected]
 

Definition at line 668 of file target.h.

int UTarget::security_model [protected]
 

Definition at line 666 of file target.h.

OctetStr UTarget::security_name [protected]
 

Definition at line 665 of file target.h.


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