Forwarder.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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_SNMPX_FORWARDER_H
12 #define SQUID_SNMPX_FORWARDER_H
13 
14 #include "ipc/Forwarder.h"
15 #include "snmp/Pdu.h"
16 #include "snmp/Session.h"
17 
18 class CommCloseCbParams;
19 
20 namespace Snmp
21 {
22 
28 {
30 
31 public:
32  Forwarder(const Pdu& aPdu, const Session& aSession, int aFd,
33  const Ip::Address& anAddress);
34 
35 protected:
36  /* Ipc::Forwarder API */
37  virtual void cleanup();
38  virtual void handleTimeout();
39  virtual void handleException(const std::exception& e);
40 
41 private:
42  void noteCommClosed(const CommCloseCbParams& params);
43  void sendError(int error);
44 
45 private:
46  int fd;
48 };
49 
50 void SendResponse(unsigned int requestId, const Pdu& pdu);
51 
52 } // namespace Snmp
53 
54 #endif /* SQUID_SNMPX_FORWARDER_H */
55 
snmp_session wrapper add pack/unpack feature
Definition: Session.h:22
int fd
client connection descriptor
Definition: Forwarder.h:46
virtual void handleException(const std::exception &e)
terminate with an error
Definition: Forwarder.cc:67
void error(char *format,...)
virtual void handleTimeout()
Definition: Forwarder.cc:60
void sendError(int error)
send error SNMP response
Definition: Forwarder.cc:77
void SendResponse(unsigned int requestId, const Pdu &pdu)
Definition: Forwarder.cc:90
Definition: Pdu.h:23
CBDATA_CLASS(Forwarder)
virtual void cleanup()
perform cleanup actions
Definition: Forwarder.cc:38
AsyncCall::Pointer closer
comm_close handler for the connection
Definition: Forwarder.h:47
void noteCommClosed(const CommCloseCbParams &params)
called when the client socket gets closed by some external force
Definition: Forwarder.cc:51
Forwarder(const Pdu &aPdu, const Session &aSession, int aFd, const Ip::Address &anAddress)
Definition: Forwarder.cc:24

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors