00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095 #ifndef _agentpp_config_mib_h
00096 #define _agentpp_config_mib_h
00097
00098 #include <agent_pp/mib.h>
00099 #include <agent_pp/mib_complex_entry.h>
00100 #include <agent_pp/snmp_textual_conventions.h>
00101 #include <agent_pp/notification_originator.h>
00102
00103
00104
00105 #define oidAgentppCfgLogLevelError "1.3.6.1.4.1.4976.3.3.1.1.1.0"
00106 #define oidAgentppCfgLogLevelWarning "1.3.6.1.4.1.4976.3.3.1.1.2.0"
00107 #define oidAgentppCfgLogLevelEvent "1.3.6.1.4.1.4976.3.3.1.1.3.0"
00108 #define oidAgentppCfgLogLevelInfo "1.3.6.1.4.1.4976.3.3.1.1.4.0"
00109 #define oidAgentppCfgLogLevelDebug "1.3.6.1.4.1.4976.3.3.1.1.5.0"
00110 #define oidAgentppCfgSecSrcAddrValidation "1.3.6.1.4.1.4976.3.3.1.2.1.0"
00111
00112
00113 #define oidAgentppCfgStoragePath "1.3.6.1.4.1.4976.3.3.1.3.1.1.2"
00114 #define colAgentppCfgStoragePath "2"
00115 #define oidAgentppCfgStorageFormat "1.3.6.1.4.1.4976.3.3.1.3.1.1.3"
00116 #define colAgentppCfgStorageFormat "3"
00117 #define oidAgentppCfgStorageLastStore "1.3.6.1.4.1.4976.3.3.1.3.1.1.4"
00118 #define colAgentppCfgStorageLastStore "4"
00119 #define oidAgentppCfgStorageLastRestore "1.3.6.1.4.1.4976.3.3.1.3.1.1.5"
00120 #define colAgentppCfgStorageLastRestore "5"
00121 #define oidAgentppCfgStorageOperation "1.3.6.1.4.1.4976.3.3.1.3.1.1.6"
00122 #define colAgentppCfgStorageOperation "6"
00123 #define oidAgentppCfgStorageStorageType "1.3.6.1.4.1.4976.3.3.1.3.1.1.7"
00124 #define colAgentppCfgStorageStorageType "7"
00125 #define oidAgentppCfgStorageStatus "1.3.6.1.4.1.4976.3.3.1.3.1.1.8"
00126 #define colAgentppCfgStorageStatus "8"
00127
00128
00129
00130 #define oidAgentppCfgStorageEntry "1.3.6.1.4.1.4976.3.3.1.3.1.1"
00131 #define nAgentppCfgStoragePath 0
00132 #define cAgentppCfgStoragePath 2
00133 #define nAgentppCfgStorageFormat 1
00134 #define cAgentppCfgStorageFormat 3
00135 #define nAgentppCfgStorageLastStore 2
00136 #define cAgentppCfgStorageLastStore 4
00137 #define nAgentppCfgStorageLastRestore 3
00138 #define cAgentppCfgStorageLastRestore 5
00139 #define nAgentppCfgStorageOperation 4
00140 #define cAgentppCfgStorageOperation 6
00141 #define nAgentppCfgStorageStorageType 5
00142 #define cAgentppCfgStorageStorageType 7
00143 #define nAgentppCfgStorageStatus 6
00144 #define cAgentppCfgStorageStatus 8
00145
00146
00147
00148
00149 #ifdef _SNMPv3
00150
00151
00152 #ifdef AGENTPP_NAMESPACE
00153 namespace Agentpp {
00154 #endif
00155
00156
00157
00158 class AGENTPP_DECL agentppCfgStorageOperation;
00159
00160 #ifndef _NO_THREADS
00161 class AGENTPP_DECL OperationTask: public Thread
00162 {
00163 public:
00164 OperationTask(int op, agentppCfgStorageOperation* source) {
00165 operation = op;
00166 initiator = source;
00167 }
00168 virtual ~OperationTask() { }
00169 virtual void run();
00170
00171 private:
00172 int operation;
00173 agentppCfgStorageOperation* initiator;
00174 };
00175 #endif
00176
00177
00178
00179
00180
00181
00182
00197 class AGENTPP_DECL agentppCfgSecSrcAddrValidation: public MibLeaf
00198 {
00199
00200 public:
00201 agentppCfgSecSrcAddrValidation();
00202 virtual ~agentppCfgSecSrcAddrValidation();
00203
00204 static agentppCfgSecSrcAddrValidation* instance;
00205
00206 virtual void get_request(Request*, int);
00207 virtual long get_state();
00208 virtual void set_state(long);
00209 virtual int set(const Vbx&);
00210 virtual boolean value_ok(const Vbx&);
00211 enum labels {
00212 e_enabled = 1,
00213 e_disabled = 2,
00214 e_notAvailable = 3 };
00215
00216
00217
00218 };
00219
00220
00221
00222
00223
00224
00225
00226 #ifdef _SNMPv3
00227 #endif
00228
00229
00230
00231 class AGENTPP_DECL agentpp_config_mib: public MibGroup
00232 {
00233 public:
00237 agentpp_config_mib();
00238 virtual ~agentpp_config_mib() { }
00239
00240 #ifndef _NO_THREADS
00241
00246 agentpp_config_mib(Mib*);
00247 #endif
00248
00249 };
00250
00251
00252 class AGENTPP_DECL agentppCfgLogLevel: public MibLeaf
00253 {
00254
00255 public:
00256 agentppCfgLogLevel(int, const Oidx&);
00257 virtual ~agentppCfgLogLevel();
00258
00259 virtual long get_state();
00260 virtual void set_state(long);
00261 virtual void get_request(Request*, int);
00262 virtual boolean value_ok(const Vbx&);
00263 virtual int commit_set_request(Request*, int);
00264 virtual int undo_set_request(Request*, int&);
00265
00266 protected:
00267 int logClass;
00268 };
00269
00270
00271
00272
00273
00274
00283 class AGENTPP_DECL agentppCfgStoragePath: public SnmpDisplayString
00284 {
00285
00286 public:
00287 agentppCfgStoragePath(const Oidx&);
00288 virtual ~agentppCfgStoragePath();
00289
00290 virtual MibEntryPtr clone();
00291 virtual void get_request(Request*, int);
00292 virtual NS_SNMP OctetStr get_state();
00293 virtual void set_state(const NS_SNMP OctetStr&);
00294 virtual int prepare_set_request(Request*, int&);
00295
00296
00297 virtual int commit_set_request(Request*, int);
00298
00299 };
00300
00301
00302
00303
00313 class AGENTPP_DECL agentppCfgStorageFormat: public MibLeaf
00314 {
00315
00316 public:
00317 agentppCfgStorageFormat(const Oidx&);
00318 virtual ~agentppCfgStorageFormat();
00319
00320 virtual MibEntryPtr clone();
00321 virtual void get_request(Request*, int);
00322 virtual long get_state();
00323 virtual void set_state(long);
00324 virtual int prepare_set_request(Request*, int&);
00325 virtual boolean value_ok(const Vbx&);
00326 enum labels {
00327 e_agentppBER = 1 };
00328
00329
00330
00331 };
00332
00333
00334
00335
00356 class AGENTPP_DECL agentppCfgStorageOperation: public MibLeaf
00357 {
00358 friend class OperationTask;
00359 public:
00360 agentppCfgStorageOperation(const Oidx&);
00361 virtual ~agentppCfgStorageOperation();
00362
00363 virtual MibEntryPtr clone();
00364 virtual void get_request(Request*, int);
00365 virtual long get_state();
00366 virtual void set_state(long);
00367 virtual int set(const Vbx&);
00368 virtual int prepare_set_request(Request*, int&);
00369 virtual boolean value_ok(const Vbx&);
00370 enum labels {
00371 e_idle = 1,
00372 e_inProgress = 2,
00373 e_store = 3,
00374 e_restore = 4 };
00375
00376
00377 virtual boolean is_volatile() { return TRUE; }
00378 #ifndef _NO_THREADS
00379 private:
00380 OperationTask* operationTask;
00381 #endif
00382
00383 };
00384
00385
00386
00387
00395 class AGENTPP_DECL agentppCfgStorageStorageType: public StorageType
00396 {
00397
00398 public:
00399 agentppCfgStorageStorageType(const Oidx&);
00400 virtual ~agentppCfgStorageStorageType();
00401
00402 virtual MibEntryPtr clone();
00403 virtual void get_request(Request*, int);
00404 virtual long get_state();
00405 virtual void set_state(long);
00406 virtual int set(const Vbx&);
00407 virtual int prepare_set_request(Request*, int&);
00408 enum labels {
00409 e_other = 1,
00410 e_volatile = 2,
00411 e_nonVolatile = 3,
00412 e_permanent = 4,
00413 e_readOnly = 5 };
00414
00415
00416
00417 };
00418
00419
00420
00421
00429 class AGENTPP_DECL agentppCfgStorageStatus: public snmpRowStatus
00430 {
00431
00432 public:
00433 agentppCfgStorageStatus(const Oidx&);
00434 virtual ~agentppCfgStorageStatus();
00435
00436 virtual MibEntryPtr clone();
00437 virtual long get_state();
00438 virtual void set_state(long);
00439 virtual int set(const Vbx&);
00440 virtual int prepare_set_request(Request*, int&);
00441 enum labels {
00442 e_active = 1,
00443 e_notInService = 2,
00444 e_notReady = 3,
00445 e_createAndGo = 4,
00446 e_createAndWait = 5,
00447 e_destroy = 6 };
00448
00449
00450
00451 };
00452
00453
00454
00455
00456
00464 class AGENTPP_DECL agentppCfgStorageEntry: public StorageTable
00465 {
00466
00467 public:
00468 agentppCfgStorageEntry();
00469 virtual ~agentppCfgStorageEntry();
00470
00471 static agentppCfgStorageEntry* instance;
00472
00473 virtual void get_request(Request*, int);
00474 virtual int prepare_set_request(Request*, int&);
00475 virtual int is_transition_ok(MibTable*,
00476 MibTableRow*,
00477 const Oidx&, int, int);
00478 virtual void set_row(MibTableRow* r,
00479 const NS_SNMP OctetStr& p1,
00480 long p2,
00481 unsigned long p3,
00482 unsigned long p4,
00483 long p5,
00484 long p6,
00485 long p7);
00486
00487 void set_mib(Mib* m);
00488 Mib* get_mib() { return mib; }
00489
00494 virtual void reset() { }
00495
00502 void set_secure_paths(boolean b) { securePaths = b;}
00503
00510 boolean is_secure_paths() { return securePaths; }
00511
00512 private:
00513 boolean securePaths;
00514 Mib* mib;
00515
00516 };
00517
00518
00519 #ifdef AGENTPP_NAMESPACE
00520 }
00521 #endif
00522
00523
00524
00525 #endif
00526
00527
00528 #endif