24 #include <agent_pp/agent++.h>
33 #define AGENTX_UNIX_SOCKET_STALE 30
36 #define AX_UNIX_SOCKET
44 #ifdef AGENTPP_NAMESPACE
56 #if !defined (AGENTXPP_DECL_TEMPL_LIST_AGENTXPEER)
57 #define AGENTXPP_DECL_TEMPL_LIST_AGENTXPEER
103 void set_unix_port_loc(
const NS_SNMP OctetStr&);
113 void set_tcp_port(
int);
121 virtual bool quit() {
return stopit; }
128 virtual void reinit() { stopit = FALSE; }
142 virtual int send_agentx(
int,
const AgentXPdu&);
155 virtual int receive_agentx(
int,
AgentXPdu&);
163 virtual ListCursor<AgentXPeer> peers();
177 #ifdef AX_UNIX_SOCKET
184 virtual bool bind_unix() = 0;
192 int get_unix_socket();
202 virtual bool bind_tcp() = 0;
210 int get_tcp_socket();
214 int set_file_descriptors(fd_set*);
215 bool check_peer_closed(fd_set*);
218 void unlock_socket();
240 virtual bool is_response(
const AgentXPdu&,
280 static time_t compute_timeout(u_int, u_int = 0);
291 #ifdef AX_UNIX_SOCKET
321 #ifdef AX_UNIX_SOCKET
322 virtual bool bind_unix();
326 virtual bool bind_tcp();
337 virtual void connect_request(fd_set*,
int*);
350 virtual bool is_response(
const AgentXPdu&,
362 #ifdef AX_UNIX_SOCKET
363 virtual int accept_unix();
373 virtual bool validate_address(
const NS_SNMP OctetStr&)
const;
385 #ifdef AX_UNIX_SOCKET
386 virtual bool bind_unix();
397 void set_master_address(
const NS_SNMP UdpAddress& addr)
398 { masterAddress = addr; }
400 virtual bool bind_tcp();
416 virtual AgentXPdu* receive(
const u_int,
int&);
462 virtual bool is_response(
const AgentXPdu&,
465 void lock_rcv_socket();
466 void unlock_rcv_socket();
481 typedef enum { UNCONNECTED,
UNIX, TCP } ConnectionType;
491 #ifdef AGENTPP_NAMESPACE