PTLib Version 2.12.9

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
snmp.h
Go to the documentation of this file.
1 //
2 // snmp.h
3 //
4 // Code automatically generated by asnparse.
5 //
6
7 #ifdef P_SNMP
8
9 #ifndef PTLIB_SNMP_H
10 #define PTLIB_SNMP_H
11
12 #ifdef P_USE_PRAGMA
13 #pragma interface
14 #endif
15
16 #include <ptclib/asner.h>
17 #include <ptclib/rfc1155.h>
18
19
20 //
21 // PDUs
22 //
23
24 class PSNMP_GetRequest_PDU;
25 class PSNMP_GetNextRequest_PDU;
26 class PSNMP_GetResponse_PDU;
27 class PSNMP_SetRequest_PDU;
28 class PSNMP_Trap_PDU;
29
30 class PSNMP_PDUs : public PASN_Choice
31 {
32 #ifndef PASN_LEANANDMEAN
33 PCLASSINFO(PSNMP_PDUs, PASN_Choice);
34 #endif
35 public:
36 PSNMP_PDUs(unsigned tag = 0, TagClass tagClass = UniversalTagClass);
37
38 enum Choices {
39 e_get_request,
40 e_get_next_request,
41 e_get_response,
42 e_set_request,
43 e_trap
44 };
45
46 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
47 operator PSNMP_GetRequest_PDU &() const;
48 #else
49 operator PSNMP_GetRequest_PDU &();
50 operator const PSNMP_GetRequest_PDU &() const;
51 #endif
52 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
53 operator PSNMP_GetNextRequest_PDU &() const;
54 #else
55 operator PSNMP_GetNextRequest_PDU &();
56 operator const PSNMP_GetNextRequest_PDU &() const;
57 #endif
58 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
59 operator PSNMP_GetResponse_PDU &() const;
60 #else
61 operator PSNMP_GetResponse_PDU &();
62 operator const PSNMP_GetResponse_PDU &() const;
63 #endif
64 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
65 operator PSNMP_SetRequest_PDU &() const;
66 #else
67 operator PSNMP_SetRequest_PDU &();
68 operator const PSNMP_SetRequest_PDU &() const;
69 #endif
70 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
71 operator PSNMP_Trap_PDU &() const;
72 #else
73 operator PSNMP_Trap_PDU &();
74 operator const PSNMP_Trap_PDU &() const;
75 #endif
76
77 virtual PBoolean Decode(PASN_Stream & strm);
78 virtual void Encode(PASN_Stream & strm) const;
79
80 PBoolean CreateObject();
81 PObject * Clone() const;
82 };
83
84
85 //
86 // VarBind
87 //
88
89 class PSNMP_VarBind : public PASN_Sequence
90 {
91 #ifndef PASN_LEANANDMEAN
92 PCLASSINFO(PSNMP_VarBind, PASN_Sequence);
93 #endif
94 public:
95 PSNMP_VarBind(unsigned tag = UniversalSequence, TagClass tagClass = UniversalTagClass);
96
97 PRFC1155_ObjectName m_name;
98 PRFC1155_ObjectSyntax m_value;
99
100 PINDEX GetDataLength() const;
101 PBoolean Decode(PASN_Stream & strm);
102 void Encode(PASN_Stream & strm) const;
103 #ifndef PASN_NOPRINTON
104 void PrintOn(ostream & strm) const;
105 #endif
106 Comparison Compare(const PObject & obj) const;
107 PObject * Clone() const;
108 };
109
110
111 //
112 // VarBindList
113 //
114
115 class PSNMP_VarBind;
116
117 class PSNMP_VarBindList : public PASN_Array
118 {
119 #ifndef PASN_LEANANDMEAN
120 PCLASSINFO(PSNMP_VarBindList, PASN_Array);
121 #endif
122 public:
123 PSNMP_VarBindList(unsigned tag = UniversalSequence, TagClass tagClass = UniversalTagClass);
124
125 PASN_Object * CreateObject() const;
126 PSNMP_VarBind & operator[](PINDEX i) const;
127 PObject * Clone() const;
128 };
129
130
131 //
132 // PDU
133 //
134
135 class PSNMP_PDU : public PASN_Sequence
136 {
137 #ifndef PASN_LEANANDMEAN
138 PCLASSINFO(PSNMP_PDU, PASN_Sequence);
139 #endif
140 public:
141 PSNMP_PDU(unsigned tag = UniversalSequence, TagClass tagClass = UniversalTagClass);
142
143 PASN_Integer m_request_id;
144 PASN_Integer m_error_status;
145 PASN_Integer m_error_index;
146 PSNMP_VarBindList m_variable_bindings;
147
148 PINDEX GetDataLength() const;
149 PBoolean Decode(PASN_Stream & strm);
150 void Encode(PASN_Stream & strm) const;
151 #ifndef PASN_NOPRINTON
152 void PrintOn(ostream & strm) const;
153 #endif
154 Comparison Compare(const PObject & obj) const;
155 PObject * Clone() const;
156 };
157
158
159 //
160 // Trap-PDU
161 //
162
163 class PSNMP_Trap_PDU : public PASN_Sequence
164 {
165 #ifndef PASN_LEANANDMEAN
166 PCLASSINFO(PSNMP_Trap_PDU, PASN_Sequence);
167 #endif
168 public:
169 PSNMP_Trap_PDU(unsigned tag = 4, TagClass tagClass = ContextSpecificTagClass);
170
171 PASN_ObjectId m_enterprise;
172 PRFC1155_NetworkAddress m_agent_addr;
173 PASN_Integer m_generic_trap;
174 PASN_Integer m_specific_trap;
175 PRFC1155_TimeTicks m_time_stamp;
176 PSNMP_VarBindList m_variable_bindings;
177
178 PINDEX GetDataLength() const;
179 PBoolean Decode(PASN_Stream & strm);
180 void Encode(PASN_Stream & strm) const;
181 #ifndef PASN_NOPRINTON
182 void PrintOn(ostream & strm) const;
183 #endif
184 Comparison Compare(const PObject & obj) const;
185 PObject * Clone() const;
186 };
187
188
189 //
190 // GetRequest-PDU
191 //
192
193 class PSNMP_GetRequest_PDU : public PSNMP_PDU
194 {
195 #ifndef PASN_LEANANDMEAN
196 PCLASSINFO(PSNMP_GetRequest_PDU, PSNMP_PDU);
197 #endif
198 public:
199 PSNMP_GetRequest_PDU(unsigned tag = 0, TagClass tagClass = ContextSpecificTagClass);
200
201 PObject * Clone() const;
202 };
203
204
205 //
206 // GetNextRequest-PDU
207 //
208
209 class PSNMP_GetNextRequest_PDU : public PSNMP_PDU
210 {
211 #ifndef PASN_LEANANDMEAN
212 PCLASSINFO(PSNMP_GetNextRequest_PDU, PSNMP_PDU);
213 #endif
214 public:
215 PSNMP_GetNextRequest_PDU(unsigned tag = 1, TagClass tagClass = ContextSpecificTagClass);
216
217 PObject * Clone() const;
218 };
219
220
221 //
222 // GetResponse-PDU
223 //
224
225 class PSNMP_GetResponse_PDU : public PSNMP_PDU
226 {
227 #ifndef PASN_LEANANDMEAN
228 PCLASSINFO(PSNMP_GetResponse_PDU, PSNMP_PDU);
229 #endif
230 public:
231 PSNMP_GetResponse_PDU(unsigned tag = 2, TagClass tagClass = ContextSpecificTagClass);
232
233 PObject * Clone() const;
234 };
235
236
237 //
238 // SetRequest-PDU
239 //
240
241 class PSNMP_SetRequest_PDU : public PSNMP_PDU
242 {
243 #ifndef PASN_LEANANDMEAN
244 PCLASSINFO(PSNMP_SetRequest_PDU, PSNMP_PDU);
245 #endif
246 public:
247 PSNMP_SetRequest_PDU(unsigned tag = 3, TagClass tagClass = ContextSpecificTagClass);
248
249 PObject * Clone() const;
250 };
251
252
253 //
254 // Message
255 //
256
257 class PSNMP_Message : public PASN_Sequence
258 {
259 #ifndef PASN_LEANANDMEAN
260 PCLASSINFO(PSNMP_Message, PASN_Sequence);
261 #endif
262 public:
263 PSNMP_Message(unsigned tag = UniversalSequence, TagClass tagClass = UniversalTagClass);
264
265 PASN_Integer m_version;
266 PASN_OctetString m_community;
267 PSNMP_PDUs m_pdu;
268 PASN_OctetString m_data;
269
270 PINDEX GetDataLength() const;
271 PBoolean Decode(PASN_Stream & strm);
272 void Encode(PASN_Stream & strm) const;
273 #ifndef PASN_NOPRINTON
274 void PrintOn(ostream & strm) const;
275 #endif
276 Comparison Compare(const PObject & obj) const;
277 PObject * Clone() const;
278 };
279
280
281 #endif // PTLIB_SNMP_H
282
283 #endif // if ! H323_DISABLE_PSNMP
284
285
286 // End Of File ///////////////////////////////////////////////////////////////