]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/snmp/Request.cc
2 * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
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.
9 /* DEBUG: section 49 SNMP Interface */
12 #include "ipc/Messages.h"
13 #include "ipc/TypedMsgHdr.h"
14 #include "snmp/Request.h"
16 Snmp::Request::Request(const int aRequestorId
, const Ipc::RequestId aRequestId
,
17 const Pdu
& aPdu
, const Session
& aSession
,
18 int aFd
, const Ip::Address
& anAddress
):
19 Ipc::Request(aRequestorId
, aRequestId
),
20 pdu(aPdu
), session(aSession
), fd(aFd
), address(anAddress
)
24 Snmp::Request::Request(const Ipc::TypedMsgHdr
&msg
)
26 msg
.checkType(Ipc::mtSnmpRequest
);
27 msg
.getPod(requestorId
);
28 msg
.getPod(requestId
);
33 // Requests from strands have FDs. Requests from Coordinator do not.
34 fd
= msg
.hasFd() ? msg
.getFd() : -1;
38 Snmp::Request::pack(Ipc::TypedMsgHdr
& msg
) const
40 msg
.setType(Ipc::mtSnmpRequest
);
41 msg
.putPod(requestorId
);
42 msg
.putPod(requestId
);
47 // Requests sent to Coordinator have FDs. Requests sent to strands do not.
53 Snmp::Request::clone() const
55 return new Request(*this);