#include <agentx.h>
Public Member Functions | |
AgentX () | |
Create an AgentX session. | |
virtual | ~AgentX () |
Destructor. | |
void | set_connect_mode (int m) |
Set connection mode. | |
int | get_connect_mode () |
Get the connection mode. | |
void | set_unix_port_loc (const NS_SNMP OctetStr &) |
Set the unix port location. | |
void | set_tcp_port (int) |
Set TCP port. | |
virtual boolean | quit () |
Return whether the agentX should quit. | |
virtual void | reinit () |
(Re)initialize the AgentX protocol stack. | |
virtual int | send_agentx (int, const AgentXPdu &) |
Send an AgentX PDU. | |
virtual int | receive_agentx (int, AgentXPdu &) |
Receive an AgentX PDU. | |
virtual ListCursor< AgentXPeer > | peers () |
Get a cursor on the peer list. | |
virtual AgentXPeer * | remove_peer (const AgentXPeer &) |
Remove a peer rom the peer list. | |
virtual boolean | bind_unix ()=0 |
Bind unix domain socket. | |
int | get_unix_socket () |
Get the AgentX socket. | |
virtual boolean | bind_tcp ()=0 |
Bind TCP socket. | |
int | get_tcp_socket () |
Get the AgentX socket. | |
int | set_file_descriptors (fd_set *) |
boolean | check_peer_closed (fd_set *) |
void | lock_socket () |
void | unlock_socket () |
void | lock_queue () |
void | unlock_queue () |
void | lock_peers () |
void | unlock_peers () |
AgentXQueue * | get_queue () |
virtual boolean | is_response (const AgentXPdu &, const AgentXPdu &)=0 |
Check whether two PDUs are a request/response pair. | |
void | close_session (const AgentXSession &, u_int, u_char) |
Close a session. | |
void | ping_session (const AgentXSession &, u_int) |
Ping a session. | |
Static Public Member Functions | |
static time_t | compute_timeout (u_int, u_int=0) |
Compute the timeout (timestamp when a PDU/request times out). | |
Public Attributes | |
boolean | stopit |
Protected Attributes | |
int | axTCPSocket |
int | axTCPPort |
int | axSocket |
NS_SNMP OctetStr | axUnixSocketLocation |
AgentXQueue | axQueue |
List< AgentXPeer > | axPeers |
Synchronized | axPeersLock |
Synchronized | axSocketLock |
int | connectMode |
AgentX::AgentX | ( | ) |
Create an AgentX session.
virtual AgentX::~AgentX | ( | ) | [virtual] |
Destructor.
void AgentX::set_connect_mode | ( | int | m | ) | [inline] |
Set connection mode.
Currently UNIX domain sockets (AX_USE_UNIX_SOCKET) and TCP sockets (AX_USE_TCP_SOCKET) are supported.
mode | a possibly ored value of AX_USE_UNIX_SOCKET and AX_USE_TCP_SOCKET. |
int AgentX::get_connect_mode | ( | ) | [inline] |
Get the connection mode.
Thus, whether to use the UNIX domain socket, the TCP socket, or both.
void AgentX::set_unix_port_loc | ( | const NS_SNMP OctetStr & | ) |
Set the unix port location.
location | an AF_UNIX socket port location |
void AgentX::set_tcp_port | ( | int | ) |
Set TCP port.
port | a TCP port. |
virtual boolean AgentX::quit | ( | ) | [inline, virtual] |
Return whether the agentX should quit.
virtual void AgentX::reinit | ( | ) | [inline, virtual] |
virtual int AgentX::send_agentx | ( | int | , | |
const AgentXPdu & | ||||
) | [virtual] |
virtual int AgentX::receive_agentx | ( | int | , | |
AgentXPdu & | ||||
) | [virtual] |
virtual ListCursor<AgentXPeer> AgentX::peers | ( | ) | [virtual] |
Get a cursor on the peer list.
virtual AgentXPeer* AgentX::remove_peer | ( | const AgentXPeer & | ) | [virtual] |
Remove a peer rom the peer list.
victim | an example for an AgentXPeer instance that should be removed from the peer list. |
virtual boolean AgentX::bind_unix | ( | ) | [pure virtual] |
Bind unix domain socket.
Implemented in AgentXMaster, and AgentXSlave.
int AgentX::get_unix_socket | ( | ) |
virtual boolean AgentX::bind_tcp | ( | ) | [pure virtual] |
Bind TCP socket.
Implemented in AgentXMaster, and AgentXSlave.
int AgentX::get_tcp_socket | ( | ) |
int AgentX::set_file_descriptors | ( | fd_set * | ) |
boolean AgentX::check_peer_closed | ( | fd_set * | ) |
void AgentX::lock_socket | ( | ) |
void AgentX::unlock_socket | ( | ) |
void AgentX::lock_queue | ( | ) | [inline] |
void AgentX::unlock_queue | ( | ) | [inline] |
void AgentX::lock_peers | ( | ) | [inline] |
void AgentX::unlock_peers | ( | ) | [inline] |
AgentXQueue* AgentX::get_queue | ( | ) | [inline] |
Check whether two PDUs are a request/response pair.
request | the "request" PDU. | |
response | the "response" PDU. |
Implemented in AgentXMaster, and AgentXSlave.
void AgentX::close_session | ( | const AgentXSession & | , | |
u_int | , | |||
u_char | ||||
) |
Close a session.
session | a AgentXSession instance. | |
transactionID | the transcation id to be used. | |
reason | the reason. |
void AgentX::ping_session | ( | const AgentXSession & | , | |
u_int | ||||
) |
Ping a session.
session | a AgentXSession instance. | |
transactionID | the transcation id to be used. |
static time_t AgentX::compute_timeout | ( | u_int | , | |
u_int | = 0 | |||
) | [static] |
Compute the timeout (timestamp when a PDU/request times out).
sessionTimeout | the timeout value of the session. If sessionTimeout is 0 AGENTX_DEFAULT_TIMEOUT is used to compute the timestamp. | |
regionTimeout | the timeout value of the region. If regionTimeout is 0 or if it is not given, the sessionTimeout or AGENTX_DEFAULT_TIMEOUT value is used to compute the timestamp respectively. |
boolean AgentX::stopit |
int AgentX::axTCPSocket [protected] |
int AgentX::axTCPPort [protected] |
int AgentX::axSocket [protected] |
NS_SNMP OctetStr AgentX::axUnixSocketLocation [protected] |
AgentXQueue AgentX::axQueue [protected] |
List<AgentXPeer> AgentX::axPeers [protected] |
Synchronized AgentX::axPeersLock [protected] |
Synchronized AgentX::axSocketLock [protected] |
int AgentX::connectMode [protected] |