]> git.ipfire.org Git - thirdparty/squid.git/blob - src/snmp/Pdu.h
Merged from parent (trunk r11379, v3.2.0.6+).
[thirdparty/squid.git] / src / snmp / Pdu.h
1 /*
2 * $Id$
3 *
4 * DEBUG: section 49 SNMP Interface
5 *
6 */
7
8 #ifndef SQUID_SNMPX_PDU_H
9 #define SQUID_SNMPX_PDU_H
10
11 #include "config.h"
12 #include "ipc/forward.h"
13 #include "Range.h"
14 #include "snmp.h"
15
16
17 namespace Snmp
18 {
19
20 /// snmp_pdu wrapper introduce the feature
21 /// to aggregate variables and to pack/unpack message
22 class Pdu: public snmp_pdu
23 {
24 public:
25 Pdu();
26 Pdu(const Pdu& pdu);
27 Pdu& operator = (const Pdu& pdu);
28 ~Pdu();
29
30 void aggregate(const Pdu& pdu);
31 void fixAggregate();
32 void pack(Ipc::TypedMsgHdr& msg) const; ///< prepare for sendmsg()
33 void unpack(const Ipc::TypedMsgHdr& msg); ///< restore struct from the message
34 int varCount() const; ///< size of variables list
35 void clear(); ///< clear all internal members
36 void setVars(variable_list* vars); ///< perform assignment of variables list
37 void clearVars(); ///< clear variables list
38 Range<const oid*> getSystemOid() const;
39 void setSystemOid(const Range<const oid*>& systemOid);
40 void clearSystemOid();
41
42 private:
43 void init(); ///< initialize members
44 void assign(const Pdu& pdu); ///< perform full assignment
45 unsigned int aggrCount; ///< The number of other Pdus merged into
46 };
47
48 } // namespace Snmp
49
50 #endif /* SQUID_SNMPX_PDU_H */