]> git.ipfire.org Git - thirdparty/squid.git/blame - src/snmp/Inquirer.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / snmp / Inquirer.h
CommitLineData
51ea0904 1/*
4ac4a490 2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
51ea0904 3 *
bbc27441
AJ
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
51ea0904
CT
7 */
8
bbc27441
AJ
9/* DEBUG: section 49 SNMP Interface */
10
51ea0904
CT
11#ifndef SQUID_SNMPX_INQUIRER_H
12#define SQUID_SNMPX_INQUIRER_H
13
1b76e6c1 14#include "comm/forward.h"
51ea0904 15#include "ipc/Inquirer.h"
d6e3ad20
CT
16#include "snmp/forward.h"
17#include "snmp/Pdu.h"
51ea0904 18
51ea0904
CT
19class CommCloseCbParams;
20
21namespace Snmp
22{
23
24/// Coordinator's job that sends a PDU request to each strand,
25/// aggregates strand responses and send back the result to client
26class Inquirer: public Ipc::Inquirer
27{
5c2f68b7
AJ
28 CBDATA_CLASS(Inquirer);
29
51ea0904
CT
30public:
31 Inquirer(const Request& aRequest, const Ipc::StrandCoords& coords);
32
33protected:
34 /* AsyncJob API */
35 virtual void start();
36 virtual bool doneAll() const;
37
38 /* Ipc::Inquirer API */
39 virtual void cleanup();
40 virtual void handleException(const std::exception& e);
41 virtual void sendResponse();
42 virtual bool aggregate(Ipc::Response::Pointer aResponse);
43
44private:
45 void noteCommClosed(const CommCloseCbParams& params);
46
47private:
48 Pdu aggrPdu; ///< aggregated pdu
1b76e6c1 49 Comm::ConnectionPointer conn; ///< client connection descriptor
51ea0904
CT
50
51 AsyncCall::Pointer writer; ///< comm_write callback
52 AsyncCall::Pointer closer; ///< comm_close handler
51ea0904
CT
53};
54
55} // namespace Snmp
56
57#endif /* SQUID_SNMPX_INQUIRER_H */
f53969cc 58