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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors