]> git.ipfire.org Git - thirdparty/squid.git/blob - src/snmp/Inquirer.h
Merged from parent (trunk r11623, v3.2.0.10+).
[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 "comm/forward.h"
12 #include "ipc/Inquirer.h"
13 #include "snmp/forward.h"
14 #include "snmp/Pdu.h"
15
16
17 class CommCloseCbParams;
18
19 namespace Snmp
20 {
21
22 /// Coordinator's job that sends a PDU request to each strand,
23 /// aggregates strand responses and send back the result to client
24 class Inquirer: public Ipc::Inquirer
25 {
26 public:
27 Inquirer(const Request& aRequest, const Ipc::StrandCoords& coords);
28
29 protected:
30 /* AsyncJob API */
31 virtual void start();
32 virtual bool doneAll() const;
33
34 /* Ipc::Inquirer API */
35 virtual void cleanup();
36 virtual void handleException(const std::exception& e);
37 virtual void sendResponse();
38 virtual bool aggregate(Ipc::Response::Pointer aResponse);
39
40 private:
41 void noteCommClosed(const CommCloseCbParams& params);
42
43 private:
44 Pdu aggrPdu; ///< aggregated pdu
45 Comm::ConnectionPointer conn; ///< client connection descriptor
46
47 AsyncCall::Pointer writer; ///< comm_write callback
48 AsyncCall::Pointer closer; ///< comm_close handler
49
50 CBDATA_CLASS2(Inquirer);
51 };
52
53 } // namespace Snmp
54
55 #endif /* SQUID_SNMPX_INQUIRER_H */