]> git.ipfire.org Git - thirdparty/squid.git/blame - src/snmp/Pdu.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / snmp / Pdu.h
CommitLineData
51ea0904 1/*
bbc27441 2 * Copyright (C) 1996-2014 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
51ea0904
CT
11#ifndef SQUID_SNMPX_PDU_H
12#define SQUID_SNMPX_PDU_H
13
51ea0904
CT
14#include "ipc/forward.h"
15#include "Range.h"
16#include "snmp.h"
17
51ea0904
CT
18namespace Snmp
19{
20
21/// snmp_pdu wrapper introduce the feature
22/// to aggregate variables and to pack/unpack message
23class Pdu: public snmp_pdu
24{
25public:
26 Pdu();
27 Pdu(const Pdu& pdu);
28 Pdu& operator = (const Pdu& pdu);
29 ~Pdu();
30
31 void aggregate(const Pdu& pdu);
e26257b2 32 void fixAggregate();
51ea0904
CT
33 void pack(Ipc::TypedMsgHdr& msg) const; ///< prepare for sendmsg()
34 void unpack(const Ipc::TypedMsgHdr& msg); ///< restore struct from the message
35 int varCount() const; ///< size of variables list
36 void clear(); ///< clear all internal members
37 void setVars(variable_list* vars); ///< perform assignment of variables list
38 void clearVars(); ///< clear variables list
39 Range<const oid*> getSystemOid() const;
40 void setSystemOid(const Range<const oid*>& systemOid);
8fb5a96c 41 void clearSystemOid();
51ea0904
CT
42
43private:
44 void init(); ///< initialize members
45 void assign(const Pdu& pdu); ///< perform full assignment
f738d783 46 unsigned int aggrCount; ///< The number of other Pdus merged into
51ea0904
CT
47};
48
49} // namespace Snmp
50
51#endif /* SQUID_SNMPX_PDU_H */
f53969cc 52