]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/snmp/Request.cc
2 * DEBUG: section 49 SNMP Interface
7 #include "ipc/Messages.h"
8 #include "ipc/TypedMsgHdr.h"
9 #include "snmp/Request.h"
11 Snmp::Request::Request(int aRequestorId
, unsigned int aRequestId
,
12 const Pdu
& aPdu
, const Session
& aSession
,
13 int aFd
, const Ip::Address
& anAddress
):
14 Ipc::Request(aRequestorId
, aRequestId
),
15 pdu(aPdu
), session(aSession
), fd(aFd
), address(anAddress
)
19 Snmp::Request::Request(const Request
& request
):
20 Ipc::Request(request
.requestorId
, request
.requestId
),
21 pdu(request
.pdu
), session(request
.session
),
22 fd(request
.fd
), address(request
.address
)
26 Snmp::Request::Request(const Ipc::TypedMsgHdr
& msg
):
29 msg
.checkType(Ipc::mtSnmpRequest
);
30 msg
.getPod(requestorId
);
31 msg
.getPod(requestId
);
36 // Requests from strands have FDs. Requests from Coordinator do not.
37 fd
= msg
.hasFd() ? msg
.getFd() : -1;
41 Snmp::Request::pack(Ipc::TypedMsgHdr
& msg
) const
43 msg
.setType(Ipc::mtSnmpRequest
);
44 msg
.putPod(requestorId
);
45 msg
.putPod(requestId
);
50 // Requests sent to Coordinator have FDs. Requests sent to strands do not.
56 Snmp::Request::clone() const
58 return new Request(*this);