AgentXSlave Class Reference

#include <agentx.h>

Inheritance diagram for AgentXSlave:

AgentX

List of all members.

Public Member Functions

 AgentXSlave ()
virtual ~AgentXSlave ()
virtual boolean bind_unix ()
 Bind unix domain socket.
void set_master_address (const NS_SNMP UdpAddress &addr)
 Set the masters IP address.
virtual boolean bind_tcp ()
 Bind TCP socket.
virtual AgentXPdureceive (const u_int, int &)
 Wait a given time for an incoming request.
virtual int send (const AgentXPdu &)
 Send an AgentXPdu.
virtual int send_synch (AgentXPdu &, AgentXPdu &)
 Send an AgentXPdu as a synchronous request.
virtual int open_session (AgentXSession &)
 Initiates (opens) a AgentX session with the master agent.
virtual boolean is_response (const AgentXPdu &, const AgentXPdu &)
 Check whether two PDUs are a request/response pair.
void lock_rcv_socket ()
void unlock_rcv_socket ()
int get_socket ()
 Get the socket descriptor used to communicate with the AgentX master agent.

Protected Types

enum  ConnectionType { UNCONNECTED, UNIX, TCP }

Protected Attributes

int axSlaveSocket
ConnectionType connectionType
NS_SNMP UdpAddress masterAddress


Member Enumeration Documentation

enum AgentXSlave::ConnectionType [protected]

Enumerator:
UNCONNECTED 
UNIX 
TCP 


Constructor & Destructor Documentation

AgentXSlave::AgentXSlave (  ) 

virtual AgentXSlave::~AgentXSlave (  )  [virtual]


Member Function Documentation

virtual boolean AgentXSlave::bind_unix (  )  [virtual]

Bind unix domain socket.

Returns:
TRUE if the socket could be bound successfully.

Implements AgentX.

void AgentXSlave::set_master_address ( const NS_SNMP UdpAddress &  addr  )  [inline]

Set the masters IP address.

Default is localhost (127.0.0.1).

Parameters:
ipAddress the IP address of an AgentX master. If the port portion is not 0 it is used instead of the standard AgentX TCP port.

virtual boolean AgentXSlave::bind_tcp (  )  [virtual]

Bind TCP socket.

Returns:
TRUE if the socket could be bound successfully.

Implements AgentX.

virtual AgentXPdu* AgentXSlave::receive ( const   u_int,
int &   
) [virtual]

Wait a given time for an incoming request.

Parameters:
timeout the maximum time in milli seconds to wait for an incoming request.
status returns the current status of the connection with the master.
Returns:
a pointer to the received request, or 0, if within the timeout period no request has been received.

virtual int AgentXSlave::send ( const AgentXPdu  )  [virtual]

Send an AgentXPdu.

Parameters:
pdu the pdu to send.
Returns:
an error status.

virtual int AgentXSlave::send_synch ( AgentXPdu ,
AgentXPdu  
) [virtual]

Send an AgentXPdu as a synchronous request.

Parameters:
pdu the pdu to send. Packet id and send time are set.
response the pdu to hold the received response.
Returns:
an error status.

virtual int AgentXSlave::open_session ( AgentXSession  )  [virtual]

Initiates (opens) a AgentX session with the master agent.

Parameters:
session an AgentXSession instance.
Returns:
AGENTX_OK if session opened successfully, any other AGENTX error code on failure.

virtual boolean AgentXSlave::is_response ( const AgentXPdu ,
const AgentXPdu  
) [virtual]

Check whether two PDUs are a request/response pair.

Parameters:
request the "request" PDU.
response the "response" PDU.
Returns:
TRUE if response is a response to request, FALSE otherwise.

Implements AgentX.

void AgentXSlave::lock_rcv_socket (  ) 

void AgentXSlave::unlock_rcv_socket (  ) 

int AgentXSlave::get_socket (  )  [inline]

Get the socket descriptor used to communicate with the AgentX master agent.

Returns:
a socket descriptor of an UNIX socket or a TCP socket.


Member Data Documentation

int AgentXSlave::axSlaveSocket [protected]

NS_SNMP UdpAddress AgentXSlave::masterAddress [protected]


The documentation for this class was generated from the following file:

Generated on Tue May 26 23:32:15 2009 for AgentX++ by  doxygen 1.5.6