Fixed build on MacOSX
[pwlib.git] / include / ptclib / snmp.h
blobf71d79c5cdf6e8d317ae90cf1943d6b562101446
1 //
2 // snmp.h
3 //
4 // Code automatically generated by asnparse.
5 //
7 #ifdef P_SNMP
9 #ifndef __PSNMP_H
10 #define __PSNMP_H
12 #ifdef P_USE_PRAGMA
13 #pragma interface
14 #endif
16 #include <ptclib/asner.h>
17 #include <ptclib/rfc1155.h>
21 // Message
24 class PSNMP_Message : public PASN_Sequence
26 #ifndef PASN_LEANANDMEAN
27 PCLASSINFO(PSNMP_Message, PASN_Sequence);
28 #endif
29 public:
30 PSNMP_Message(unsigned tag = UniversalSequence, TagClass tagClass = UniversalTagClass);
32 PASN_Integer m_version;
33 PASN_OctetString m_community;
34 PASN_OctetString m_data;
36 PINDEX GetDataLength() const;
37 BOOL Decode(PASN_Stream & strm);
38 void Encode(PASN_Stream & strm) const;
39 #ifndef PASN_NOPRINTON
40 void PrintOn(ostream & strm) const;
41 #endif
42 Comparison Compare(const PObject & obj) const;
43 PObject * Clone() const;
48 // PDUs
51 class PSNMP_GetRequest_PDU;
52 class PSNMP_GetNextRequest_PDU;
53 class PSNMP_GetResponse_PDU;
54 class PSNMP_SetRequest_PDU;
55 class PSNMP_Trap_PDU;
57 class PSNMP_PDUs : public PASN_Choice
59 #ifndef PASN_LEANANDMEAN
60 PCLASSINFO(PSNMP_PDUs, PASN_Choice);
61 #endif
62 public:
63 PSNMP_PDUs(unsigned tag = 0, TagClass tagClass = UniversalTagClass);
65 enum Choices {
66 e_get_request,
67 e_get_next_request,
68 e_get_response,
69 e_set_request,
70 e_trap
73 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
74 operator PSNMP_GetRequest_PDU &() const;
75 #else
76 operator PSNMP_GetRequest_PDU &();
77 operator const PSNMP_GetRequest_PDU &() const;
78 #endif
79 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
80 operator PSNMP_GetNextRequest_PDU &() const;
81 #else
82 operator PSNMP_GetNextRequest_PDU &();
83 operator const PSNMP_GetNextRequest_PDU &() const;
84 #endif
85 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
86 operator PSNMP_GetResponse_PDU &() const;
87 #else
88 operator PSNMP_GetResponse_PDU &();
89 operator const PSNMP_GetResponse_PDU &() const;
90 #endif
91 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
92 operator PSNMP_SetRequest_PDU &() const;
93 #else
94 operator PSNMP_SetRequest_PDU &();
95 operator const PSNMP_SetRequest_PDU &() const;
96 #endif
97 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
98 operator PSNMP_Trap_PDU &() const;
99 #else
100 operator PSNMP_Trap_PDU &();
101 operator const PSNMP_Trap_PDU &() const;
102 #endif
104 BOOL CreateObject();
105 PObject * Clone() const;
110 // VarBind
113 class PSNMP_VarBind : public PASN_Sequence
115 #ifndef PASN_LEANANDMEAN
116 PCLASSINFO(PSNMP_VarBind, PASN_Sequence);
117 #endif
118 public:
119 PSNMP_VarBind(unsigned tag = UniversalSequence, TagClass tagClass = UniversalTagClass);
121 PRFC1155_ObjectName m_name;
122 PRFC1155_ObjectSyntax m_value;
124 PINDEX GetDataLength() const;
125 BOOL Decode(PASN_Stream & strm);
126 void Encode(PASN_Stream & strm) const;
127 #ifndef PASN_NOPRINTON
128 void PrintOn(ostream & strm) const;
129 #endif
130 Comparison Compare(const PObject & obj) const;
131 PObject * Clone() const;
136 // VarBindList
139 class PSNMP_VarBind;
141 class PSNMP_VarBindList : public PASN_Array
143 #ifndef PASN_LEANANDMEAN
144 PCLASSINFO(PSNMP_VarBindList, PASN_Array);
145 #endif
146 public:
147 PSNMP_VarBindList(unsigned tag = UniversalSequence, TagClass tagClass = UniversalTagClass);
149 PASN_Object * CreateObject() const;
150 PSNMP_VarBind & operator[](PINDEX i) const;
151 PObject * Clone() const;
156 // PDU
159 class PSNMP_PDU : public PASN_Sequence
161 #ifndef PASN_LEANANDMEAN
162 PCLASSINFO(PSNMP_PDU, PASN_Sequence);
163 #endif
164 public:
165 PSNMP_PDU(unsigned tag = UniversalSequence, TagClass tagClass = UniversalTagClass);
167 PASN_Integer m_request_id;
168 PASN_Integer m_error_status;
169 PASN_Integer m_error_index;
170 PSNMP_VarBindList m_variable_bindings;
172 PINDEX GetDataLength() const;
173 BOOL Decode(PASN_Stream & strm);
174 void Encode(PASN_Stream & strm) const;
175 #ifndef PASN_NOPRINTON
176 void PrintOn(ostream & strm) const;
177 #endif
178 Comparison Compare(const PObject & obj) const;
179 PObject * Clone() const;
184 // Trap-PDU
187 class PSNMP_Trap_PDU : public PASN_Sequence
189 #ifndef PASN_LEANANDMEAN
190 PCLASSINFO(PSNMP_Trap_PDU, PASN_Sequence);
191 #endif
192 public:
193 PSNMP_Trap_PDU(unsigned tag = 4, TagClass tagClass = ContextSpecificTagClass);
195 PASN_ObjectId m_enterprise;
196 PRFC1155_NetworkAddress m_agent_addr;
197 PASN_Integer m_generic_trap;
198 PASN_Integer m_specific_trap;
199 PRFC1155_TimeTicks m_time_stamp;
200 PSNMP_VarBindList m_variable_bindings;
202 PINDEX GetDataLength() const;
203 BOOL Decode(PASN_Stream & strm);
204 void Encode(PASN_Stream & strm) const;
205 #ifndef PASN_NOPRINTON
206 void PrintOn(ostream & strm) const;
207 #endif
208 Comparison Compare(const PObject & obj) const;
209 PObject * Clone() const;
214 // GetRequest-PDU
217 class PSNMP_GetRequest_PDU : public PSNMP_PDU
219 #ifndef PASN_LEANANDMEAN
220 PCLASSINFO(PSNMP_GetRequest_PDU, PSNMP_PDU);
221 #endif
222 public:
223 PSNMP_GetRequest_PDU(unsigned tag = 0, TagClass tagClass = ContextSpecificTagClass);
225 PObject * Clone() const;
230 // GetNextRequest-PDU
233 class PSNMP_GetNextRequest_PDU : public PSNMP_PDU
235 #ifndef PASN_LEANANDMEAN
236 PCLASSINFO(PSNMP_GetNextRequest_PDU, PSNMP_PDU);
237 #endif
238 public:
239 PSNMP_GetNextRequest_PDU(unsigned tag = 1, TagClass tagClass = ContextSpecificTagClass);
241 PObject * Clone() const;
246 // GetResponse-PDU
249 class PSNMP_GetResponse_PDU : public PSNMP_PDU
251 #ifndef PASN_LEANANDMEAN
252 PCLASSINFO(PSNMP_GetResponse_PDU, PSNMP_PDU);
253 #endif
254 public:
255 PSNMP_GetResponse_PDU(unsigned tag = 2, TagClass tagClass = ContextSpecificTagClass);
257 PObject * Clone() const;
262 // SetRequest-PDU
265 class PSNMP_SetRequest_PDU : public PSNMP_PDU
267 #ifndef PASN_LEANANDMEAN
268 PCLASSINFO(PSNMP_SetRequest_PDU, PSNMP_PDU);
269 #endif
270 public:
271 PSNMP_SetRequest_PDU(unsigned tag = 3, TagClass tagClass = ContextSpecificTagClass);
273 PObject * Clone() const;
277 #endif // __PSNMP_H
279 #endif // if ! H323_DISABLE_PSNMP
282 // End of snmp.h