]> git.ipfire.org Git - thirdparty/squid.git/blob - src/snmp/Inquirer.h
-Rename snmplib/libsnmp.a to snmplib/libsnmplib.a
[thirdparty/squid.git] / src / snmp / Inquirer.h
1 /*
2 * $Id$
3 *
4 * DEBUG: section 49 SNMP Interface
5 *
6 */
7
8 #ifndef SQUID_SNMPX_INQUIRER_H
9 #define SQUID_SNMPX_INQUIRER_H
10
11 #include "ipc/Inquirer.h"
12 #include "snmp/forward.h"
13 #include "snmp/Pdu.h"
14
15
16 class CommCloseCbParams;
17
18 namespace Snmp
19 {
20
21 /// Coordinator's job that sends a PDU request to each strand,
22 /// aggregates strand responses and send back the result to client
23 class Inquirer: public Ipc::Inquirer
24 {
25 public:
26 Inquirer(const Request& aRequest, const Ipc::StrandCoords& coords);
27
28 protected:
29 /* AsyncJob API */
30 virtual void start();
31 virtual bool doneAll() const;
32
33 /* Ipc::Inquirer API */
34 virtual void cleanup();
35 virtual void handleException(const std::exception& e);
36 virtual void sendResponse();
37 virtual bool aggregate(Ipc::Response::Pointer aResponse);
38
39 private:
40 void noteCommClosed(const CommCloseCbParams& params);
41
42 private:
43 Pdu aggrPdu; ///< aggregated pdu
44 int fd; ///< client connection descriptor
45
46 AsyncCall::Pointer writer; ///< comm_write callback
47 AsyncCall::Pointer closer; ///< comm_close handler
48
49 CBDATA_CLASS2(Inquirer);
50 };
51
52 } // namespace Snmp
53
54 #endif /* SQUID_SNMPX_INQUIRER_H */