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