29 debugs(49, 5,
"FD " << aFd);
41 if (closer !=
nullptr) {
58 mustStop(
"commClosed");
89 int len =
sizeof(buffer);
106 Must(response_pdu !=
nullptr);
107 response.
pdu =
static_cast<Pdu&
>(*response_pdu);
109 }
catch (
const std::exception& e) {
115 response.
pack(message);
RefCount< AsyncCallT< Dialer > > asyncCall(int aDebugSection, int aDebugLevel, const char *aName, const Dialer &aDialer)
void error(char *format,...)
#define CBDATA_NAMESPACED_CLASS_INIT(namespace, type)
int fd
FD which the call was about. Set by the async call creator.
virtual void handleTimeout()
virtual void handleException(const std::exception &e)
terminate with an error
static String CoordinatorAddr()
get the IPC message address for coordinator process
struct msghdr with a known type, fixed-size I/O and control buffers
void handleTimeout() override
int fd
client connection descriptor
void swanSong() override
removes our cleanup handler of the client connection socket
void noteCommClosed(const CommCloseCbParams ¶ms)
called when the client socket gets closed by some external force
void handleException(const std::exception &e) override
terminate with an error
AsyncCall::Pointer closer
comm_close handler for the connection
void sendError(int error)
send error SNMP response
Forwarder(const Pdu &aPdu, const Session &aSession, int aFd, const Ip::Address &anAddress)
Session session
SNMP session.
Ip::Address address
client address
Pdu pdu
SNMP protocol data unit.
Pdu pdu
SNMP protocol data unit.
void pack(Ipc::TypedMsgHdr &msg) const override
prepare for sendmsg()
snmp_session wrapper add pack/unpack feature
AsyncCall::Pointer comm_add_close_handler(int fd, CLCB *handler, void *data)
void comm_remove_close_handler(int fd, CLCB *handler, void *data)
int comm_udp_sendto(int fd, const Ip::Address &to_addr, const void *buf, int len)
#define debugs(SECTION, LEVEL, CONTENT)
void SendMessage(const String &toAddress, const TypedMsgHdr &message)
void SendResponse(Ipc::RequestId, const Pdu &)
int snmp_build(struct snmp_session *, struct snmp_pdu *, u_char *, int *)
struct snmp_pdu * snmpAgentResponse(struct snmp_pdu *PDU)
#define SNMP_REQUEST_SIZE
#define SNMP_ERR_RESOURCEUNAVAILABLE
#define SNMP_PDU_RESPONSE
void snmp_free_pdu(struct snmp_pdu *)