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