Forwarder.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3  *
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.
7  */
8 
9 /* DEBUG: section 49 SNMP Interface */
10 
11 #ifndef SQUID_SRC_SNMP_FORWARDER_H
12 #define SQUID_SRC_SNMP_FORWARDER_H
13 
14 #include "ip/forward.h"
15 #include "ipc/Forwarder.h"
16 #include "snmp/Pdu.h"
17 #include "snmp/Session.h"
18 
19 class CommCloseCbParams;
20 
21 namespace Snmp
22 {
23 
29 {
31 
32 public:
33  Forwarder(const Pdu& aPdu, const Session& aSession, int aFd,
34  const Ip::Address& anAddress);
35 
36 protected:
37  /* Ipc::Forwarder API */
38  void swanSong() override;
39  void handleTimeout() override;
40  void handleException(const std::exception& e) override;
41 
42 private:
43  void noteCommClosed(const CommCloseCbParams& params);
44  void sendError(int error);
45 
46 private:
47  int fd;
49 };
50 
51 void SendResponse(Ipc::RequestId, const Pdu &);
52 
53 } // namespace Snmp
54 
55 #endif /* SQUID_SRC_SNMP_FORWARDER_H */
56 
void handleTimeout() override
Definition: Forwarder.cc:62
snmp_session wrapper add pack/unpack feature
Definition: Session.h:22
void error(char *format,...)
int fd
client connection descriptor
Definition: Forwarder.h:47
Definition: forward.h:14
void handleException(const std::exception &e) override
terminate with an error
Definition: Forwarder.cc:69
void swanSong() override
removes our cleanup handler of the client connection socket
Definition: Forwarder.cc:38
AsyncCall::Pointer closer
comm_close handler for the connection
Definition: Forwarder.h:48
Definition: Pdu.h:23
void sendError(int error)
send error SNMP response
Definition: Forwarder.cc:78
Forwarder(const Pdu &aPdu, const Session &aSession, int aFd, const Ip::Address &anAddress)
Definition: Forwarder.cc:24
void SendResponse(Ipc::RequestId, const Pdu &)
Definition: Forwarder.cc:95
CBDATA_CHILD(Forwarder)
void noteCommClosed(const CommCloseCbParams &params)
called when the client socket gets closed by some external force
Definition: Forwarder.cc:52

 

Introduction

Documentation

Support

Miscellaneous