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