]>
Commit | Line | Data |
---|---|---|
51ea0904 | 1 | /* |
5b74111a | 2 | * Copyright (C) 1996-2018 The Squid Software Foundation and contributors |
51ea0904 | 3 | * |
bbc27441 AJ |
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. | |
51ea0904 CT |
7 | */ |
8 | ||
bbc27441 AJ |
9 | /* DEBUG: section 49 SNMP Interface */ |
10 | ||
f7f3304a | 11 | #include "squid.h" |
51ea0904 CT |
12 | #include "base/TextException.h" |
13 | #include "ipc/Messages.h" | |
14 | #include "ipc/TypedMsgHdr.h" | |
d6e3ad20 | 15 | #include "snmp/Response.h" |
51ea0904 | 16 | |
51ea0904 CT |
17 | std::ostream& Snmp::operator << (std::ostream& os, const Response& response) |
18 | { | |
19 | os << "response: {requestId: " << response.requestId << '}'; | |
20 | return os; | |
21 | } | |
22 | ||
23 | Snmp::Response::Response(unsigned int aRequestId): | |
f53969cc | 24 | Ipc::Response(aRequestId), pdu() |
51ea0904 CT |
25 | { |
26 | } | |
27 | ||
28 | Snmp::Response::Response(const Response& response): | |
f53969cc | 29 | Ipc::Response(response.requestId), pdu(response.pdu) |
51ea0904 CT |
30 | { |
31 | } | |
32 | ||
33 | Snmp::Response::Response(const Ipc::TypedMsgHdr& msg): | |
f53969cc | 34 | Ipc::Response(0) |
51ea0904 CT |
35 | { |
36 | msg.checkType(Ipc::mtSnmpResponse); | |
37 | msg.getPod(requestId); | |
38 | pdu.unpack(msg); | |
39 | } | |
40 | ||
41 | void | |
42 | Snmp::Response::pack(Ipc::TypedMsgHdr& msg) const | |
43 | { | |
44 | msg.setType(Ipc::mtSnmpResponse); | |
45 | msg.putPod(requestId); | |
46 | pdu.pack(msg); | |
47 | } | |
48 | ||
49 | Ipc::Response::Pointer | |
50 | Snmp::Response::clone() const | |
51 | { | |
52 | return new Response(*this); | |
53 | } | |
f53969cc | 54 |