]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/snmp/Request.cc
2 * Copyright (C) 1996-2014 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(int aRequestorId
, unsigned int 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 Request
& request
):
25 Ipc::Request(request
.requestorId
, request
.requestId
),
26 pdu(request
.pdu
), session(request
.session
),
27 fd(request
.fd
), address(request
.address
)
31 Snmp::Request::Request(const Ipc::TypedMsgHdr
& msg
):
34 msg
.checkType(Ipc::mtSnmpRequest
);
35 msg
.getPod(requestorId
);
36 msg
.getPod(requestId
);
41 // Requests from strands have FDs. Requests from Coordinator do not.
42 fd
= msg
.hasFd() ? msg
.getFd() : -1;
46 Snmp::Request::pack(Ipc::TypedMsgHdr
& msg
) const
48 msg
.setType(Ipc::mtSnmpRequest
);
49 msg
.putPod(requestorId
);
50 msg
.putPod(requestId
);
55 // Requests sent to Coordinator have FDs. Requests sent to strands do not.
61 Snmp::Request::clone() const
63 return new Request(*this);