AGENT++  4.0.3
agentpp_config_mib.h
Go to the documentation of this file.
1 /*_############################################################################
2  _##
3  _## AGENT++ 4.0 - agentpp_config_mib.h
4  _##
5  _## Copyright (C) 2000-2013 Frank Fock and Jochen Katz (agentpp.com)
6  _##
7  _## Licensed under the Apache License, Version 2.0 (the "License");
8  _## you may not use this file except in compliance with the License.
9  _## You may obtain a copy of the License at
10  _##
11  _## http://www.apache.org/licenses/LICENSE-2.0
12  _##
13  _## Unless required by applicable law or agreed to in writing, software
14  _## distributed under the License is distributed on an "AS IS" BASIS,
15  _## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  _## See the License for the specific language governing permissions and
17  _## limitations under the License.
18  _##
19  _##########################################################################*/
20 
21 
22 //--AgentGen BEGIN=_BEGIN
23 //--AgentGen END
24 
25 #ifndef _agentpp_config_mib_h
26 #define _agentpp_config_mib_h
27 
28 #include <agent_pp/mib.h>
32 
33 
34 // Scalars
35 #define oidAgentppCfgLogLevelError "1.3.6.1.4.1.4976.3.3.1.1.1.0"
36 #define oidAgentppCfgLogLevelWarning "1.3.6.1.4.1.4976.3.3.1.1.2.0"
37 #define oidAgentppCfgLogLevelEvent "1.3.6.1.4.1.4976.3.3.1.1.3.0"
38 #define oidAgentppCfgLogLevelInfo "1.3.6.1.4.1.4976.3.3.1.1.4.0"
39 #define oidAgentppCfgLogLevelDebug "1.3.6.1.4.1.4976.3.3.1.1.5.0"
40 #define oidAgentppCfgSecSrcAddrValidation "1.3.6.1.4.1.4976.3.3.1.2.1.0"
41 
42 // Columns
43 #define oidAgentppCfgStoragePath "1.3.6.1.4.1.4976.3.3.1.3.1.1.2"
44 #define colAgentppCfgStoragePath "2"
45 #define oidAgentppCfgStorageFormat "1.3.6.1.4.1.4976.3.3.1.3.1.1.3"
46 #define colAgentppCfgStorageFormat "3"
47 #define oidAgentppCfgStorageLastStore "1.3.6.1.4.1.4976.3.3.1.3.1.1.4"
48 #define colAgentppCfgStorageLastStore "4"
49 #define oidAgentppCfgStorageLastRestore "1.3.6.1.4.1.4976.3.3.1.3.1.1.5"
50 #define colAgentppCfgStorageLastRestore "5"
51 #define oidAgentppCfgStorageOperation "1.3.6.1.4.1.4976.3.3.1.3.1.1.6"
52 #define colAgentppCfgStorageOperation "6"
53 #define oidAgentppCfgStorageStorageType "1.3.6.1.4.1.4976.3.3.1.3.1.1.7"
54 #define colAgentppCfgStorageStorageType "7"
55 #define oidAgentppCfgStorageStatus "1.3.6.1.4.1.4976.3.3.1.3.1.1.8"
56 #define colAgentppCfgStorageStatus "8"
57 
58 
59 // Tables
60 #define oidAgentppCfgStorageEntry "1.3.6.1.4.1.4976.3.3.1.3.1.1"
61 #define nAgentppCfgStoragePath 0
62 #define cAgentppCfgStoragePath 2
63 #define nAgentppCfgStorageFormat 1
64 #define cAgentppCfgStorageFormat 3
65 #define nAgentppCfgStorageLastStore 2
66 #define cAgentppCfgStorageLastStore 4
67 #define nAgentppCfgStorageLastRestore 3
68 #define cAgentppCfgStorageLastRestore 5
69 #define nAgentppCfgStorageOperation 4
70 #define cAgentppCfgStorageOperation 6
71 #define nAgentppCfgStorageStorageType 5
72 #define cAgentppCfgStorageStorageType 7
73 #define nAgentppCfgStorageStatus 6
74 #define cAgentppCfgStorageStatus 8
75 
76 // Notifications
77 
78 //--AgentGen BEGIN=_INCLUDE
79 #ifdef _SNMPv3
80 //--AgentGen END
81 
82 #ifdef AGENTPP_NAMESPACE
83 namespace Agentpp {
84 #endif
85 
86 //--AgentGen BEGIN=_UTIL_CLASSES
87 
88 class AGENTPP_DECL agentppCfgStorageOperation;
89 
90 #ifndef _NO_THREADS
91 class AGENTPP_DECL OperationTask: public Thread
92 {
93  public:
94  OperationTask(int op, agentppCfgStorageOperation* source) {
95  operation = op;
96  initiator = source;
97  }
98  virtual ~OperationTask() { }
99  virtual void run();
100 
101  private:
102  int operation;
103  agentppCfgStorageOperation* initiator;
104 };
105 #endif
106 
107 //--AgentGen END
108 
109 // Scalar Objects
110 
111 
112 
127 class AGENTPP_DECL agentppCfgSecSrcAddrValidation: public MibLeaf
128 {
129 
130 public:
131  agentppCfgSecSrcAddrValidation();
132  virtual ~agentppCfgSecSrcAddrValidation();
133 
134  static agentppCfgSecSrcAddrValidation* instance;
135 
136  virtual void get_request(Request*, int);
137  virtual long get_state();
138  virtual void set_state(long);
139  virtual int set(const Vbx&);
140  virtual bool value_ok(const Vbx&);
141  enum labels {
142  e_enabled = 1,
143  e_disabled = 2,
144  e_notAvailable = 3 };
145 
146 //--AgentGen BEGIN=agentppCfgSecSrcAddrValidation
147 //--AgentGen END
148 };
149 
150 
151 // Columnar Objects
152 
153 // Tables
154 
155 // Notifications
156 #ifdef _SNMPv3
157 #endif
158 
159 // Group
160 
161 class AGENTPP_DECL agentpp_config_mib: public MibGroup
162 {
163  public:
167  agentpp_config_mib();
168  virtual ~agentpp_config_mib() { }
169 //--AgentGen BEGIN=agentpp_config_mib
170 #ifndef _NO_THREADS
171 
176  agentpp_config_mib(Mib*);
177 #endif
178 //--AgentGen END
179 };
180 
181 //--AgentGen BEGIN=_CLASSES
182 class AGENTPP_DECL agentppCfgLogLevel: public MibLeaf
183 {
184 
185 public:
186  agentppCfgLogLevel(int, const Oidx&);
187  virtual ~agentppCfgLogLevel();
188 
189  virtual long get_state();
190  virtual void set_state(long);
191  virtual void get_request(Request*, int);
192  virtual bool value_ok(const Vbx&);
193  virtual int commit_set_request(Request*, int);
194  virtual int undo_set_request(Request*, int&);
195 
196  protected:
197  int logClass;
198 };
199 //--AgentGen END
200 
201 // Columnar Objects
202 
203 
204 
213 class AGENTPP_DECL agentppCfgStoragePath: public SnmpDisplayString
214 {
215 
216 public:
217  agentppCfgStoragePath(const Oidx&);
218  virtual ~agentppCfgStoragePath();
219 
220  virtual MibEntryPtr clone();
221  virtual void get_request(Request*, int);
222  virtual NS_SNMP OctetStr get_state();
223  virtual void set_state(const NS_SNMP OctetStr&);
224  virtual int prepare_set_request(Request*, int&);
225 
226 //--AgentGen BEGIN=agentppCfgStoragePath
227  virtual int commit_set_request(Request*, int);
228 //--AgentGen END
229 };
230 
231 
232 
233 
243 class AGENTPP_DECL agentppCfgStorageFormat: public MibLeaf
244 {
245 
246 public:
247  agentppCfgStorageFormat(const Oidx&);
248  virtual ~agentppCfgStorageFormat();
249 
250  virtual MibEntryPtr clone();
251  virtual void get_request(Request*, int);
252  virtual long get_state();
253  virtual void set_state(long);
254  virtual int prepare_set_request(Request*, int&);
255  virtual bool value_ok(const Vbx&);
256  enum labels {
257  e_agentppBER = 1 };
258 
259 //--AgentGen BEGIN=agentppCfgStorageFormat
260 //--AgentGen END
261 };
262 
263 
264 
265 
286 class AGENTPP_DECL agentppCfgStorageOperation: public MibLeaf
287 {
288 friend class OperationTask;
289 public:
290  agentppCfgStorageOperation(const Oidx&);
291  virtual ~agentppCfgStorageOperation();
292 
293  virtual MibEntryPtr clone();
294  virtual void get_request(Request*, int);
295  virtual long get_state();
296  virtual void set_state(long);
297  virtual int set(const Vbx&);
298  virtual int prepare_set_request(Request*, int&);
299  virtual bool value_ok(const Vbx&);
300  enum labels {
301  e_idle = 1,
302  e_inProgress = 2,
303  e_store = 3,
304  e_restore = 4 };
305 
306 //--AgentGen BEGIN=agentppCfgStorageOperation
307  virtual bool is_volatile() { return TRUE; }
308 #ifndef _NO_THREADS
309  private:
310  OperationTask* operationTask;
311 #endif
312 //--AgentGen END
313 };
314 
315 
316 
317 
325 class AGENTPP_DECL agentppCfgStorageStorageType: public StorageType
326 {
327 
328 public:
329  agentppCfgStorageStorageType(const Oidx&);
330  virtual ~agentppCfgStorageStorageType();
331 
332  virtual MibEntryPtr clone();
333  virtual void get_request(Request*, int);
334  virtual long get_state();
335  virtual void set_state(long);
336  virtual int set(const Vbx&);
337  virtual int prepare_set_request(Request*, int&);
338  enum labels {
339  e_other = 1,
340  e_volatile = 2,
341  e_nonVolatile = 3,
342  e_permanent = 4,
343  e_readOnly = 5 };
344 
345 //--AgentGen BEGIN=agentppCfgStorageStorageType
346 //--AgentGen END
347 };
348 
349 
350 
351 
359 class AGENTPP_DECL agentppCfgStorageStatus: public snmpRowStatus
360 {
361 
362 public:
363  agentppCfgStorageStatus(const Oidx&);
364  virtual ~agentppCfgStorageStatus();
365 
366  virtual MibEntryPtr clone();
367  virtual long get_state();
368  virtual void set_state(long);
369  virtual int set(const Vbx&);
370  virtual int prepare_set_request(Request*, int&);
371  enum labels {
372  e_active = 1,
373  e_notInService = 2,
374  e_notReady = 3,
375  e_createAndGo = 4,
376  e_createAndWait = 5,
377  e_destroy = 6 };
378 
379 //--AgentGen BEGIN=agentppCfgStorageStatus
380 //--AgentGen END
381 };
382 
383 
384 // Tables
385 
386 
394 class AGENTPP_DECL agentppCfgStorageEntry: public StorageTable
395 {
396 
397 public:
398  agentppCfgStorageEntry();
399  virtual ~agentppCfgStorageEntry();
400 
401  static agentppCfgStorageEntry* instance;
402 
403  virtual void get_request(Request*, int);
404  virtual int prepare_set_request(Request*, int&);
405  virtual int is_transition_ok(MibTable*,
406  MibTableRow*,
407  const Oidx&, int, int);
408  virtual void set_row(MibTableRow* r,
409  const NS_SNMP OctetStr& p1,
410  long p2,
411  unsigned long p3,
412  unsigned long p4,
413  long p5,
414  long p6,
415  long p7);
416 //--AgentGen BEGIN=agentppCfgStorageEntry
417  void set_mib(Mib* m);
418  Mib* get_mib() { return mib; }
419 
424  virtual void reset() { }
425 
432  void set_secure_paths(bool b) { securePaths = b;}
433 
440  bool is_secure_paths() { return securePaths; }
441 
442  private:
443  bool securePaths;
444  Mib* mib;
445 //--AgentGen END
446 };
447 
448 
449 #ifdef AGENTPP_NAMESPACE
450 }
451 #endif
452 
453 
454 //--AgentGen BEGIN=_END
455 #endif
456 //--AgentGen END
457 
458 #endif