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 #ifndef v3_mib_h_
00091 #define v3_mib_h_
00092
00093 #include <agent_pp/agent++.h>
00094
00095 #ifdef _SNMPv3
00096
00097 #include <agent_pp/mib.h>
00098 #include <snmp_pp/usm_v3.h>
00099 #include <snmp_pp/v3.h>
00100 #include <agent_pp/snmp_textual_conventions.h>
00101
00102 #ifdef AGENTPP_NAMESPACE
00103 namespace Agentpp {
00104 #endif
00105
00106
00107
00108
00109
00110
00111
00112 class AGENTPP_DECL V3SnmpEngine: public MibGroup {
00113
00114 public:
00115
00116 V3SnmpEngine(void);
00117 };
00118
00119 class AGENTPP_DECL V3SnmpEngineID: public MibLeaf {
00120
00121 public:
00122 V3SnmpEngineID(const NS_SNMP v3MP *mp);
00123 void get_request(Request*, int);
00124 private:
00125 const NS_SNMP v3MP *v3mp;
00126 };
00127
00128 class AGENTPP_DECL V3SnmpEngineBoots: public MibLeaf {
00129
00130 public:
00131 V3SnmpEngineBoots(const NS_SNMP USM *u);
00132 void get_request(Request*, int);
00133 private:
00134 const NS_SNMP USM *usm;
00135 };
00136
00137 class AGENTPP_DECL V3SnmpEngineTime: public MibLeaf {
00138
00139 public:
00140 V3SnmpEngineTime(const NS_SNMP USM *u);
00141 void get_request(Request*, int);
00142 private:
00143 const NS_SNMP USM *usm;
00144 };
00145
00146 class AGENTPP_DECL V3SnmpEngineMaxMessageSize: public MibLeaf {
00147
00148 public:
00149 V3SnmpEngineMaxMessageSize();
00150 };
00151
00152
00153 class AGENTPP_DECL UsmUserTableStatus: public snmpRowStatus
00154 {
00155 public:
00156 UsmUserTableStatus(const Oidx&, int _base_len, NS_SNMP USM *usm);
00157 virtual ~UsmUserTableStatus();
00158
00159 virtual MibEntryPtr clone();
00160 virtual int set(const Vbx& vb);
00161 virtual int unset();
00162
00163 void deleteUsmUser();
00164 void addUsmUser();
00165
00166 private:
00167 int base_len;
00168 NS_SNMP USM *usm;
00169 };
00170
00194 class AGENTPP_DECL UsmUserTable: public StorageTable
00195 {
00196 public:
00197 UsmUserTable();
00198 virtual ~UsmUserTable();
00199
00200 virtual boolean ready_for_service(Vbx* pvbs, int sz);
00201 virtual void row_added(MibTableRow* new_row, const Oidx& ind, MibTable*);
00202 virtual void row_init(MibTableRow* new_row, const Oidx& ind, MibTable*);
00203
00212 MibTableRow *addNewRow(const NS_SNMP OctetStr& engineID,
00213 const NS_SNMP OctetStr& userName,
00214 const NS_SNMP OctetStr& securityName,
00215 int authProtocol, const NS_SNMP OctetStr& authKey,
00216 int privProtocol, const NS_SNMP OctetStr& privKey,
00217 const boolean add_to_usm = TRUE);
00218
00228 MibTableRow *addNewRow(const NS_SNMP OctetStr& engineID,
00229 const NS_SNMP OctetStr& userName,
00230 int authProtocol, const NS_SNMP OctetStr& authKey,
00231 int privProtocol, const NS_SNMP OctetStr& privKey,
00232 const boolean add_to_usm = TRUE)
00233 { return addNewRow(engineID, userName, userName, authProtocol, authKey,
00234 privProtocol, privKey, add_to_usm); };
00235
00249 MibTableRow *addNewRow(const NS_SNMP OctetStr& userName,
00250 const NS_SNMP OctetStr& securityName,
00251 int authProtocol,
00252 int privProtocol,
00253 const NS_SNMP OctetStr& authPassword,
00254 const NS_SNMP OctetStr& privPassword,
00255 const bool addPasswordsToUSM = true);
00256
00267 MibTableRow *addNewRow(const NS_SNMP OctetStr& userName,
00268 const NS_SNMP OctetStr& securityName,
00269 int authProtocol,
00270 int privProtocol,
00271 const NS_SNMP OctetStr& authPassword,
00272 const NS_SNMP OctetStr& privPassword,
00273 const NS_SNMP OctetStr& engineID,
00274 const bool addPassWordsToUSM = false);
00275
00284 MibTableRow *addNewRow(const NS_SNMP OctetStr& userName,
00285 int authProtocol,
00286 int privProtocol,
00287 const NS_SNMP OctetStr& authPassword,
00288 const NS_SNMP OctetStr& privPassword)
00289 { return addNewRow(userName, userName, authProtocol, privProtocol,
00290 authPassword, privPassword, true); };
00291
00300 MibTableRow *addNewRow(const NS_SNMP OctetStr& userName,
00301 int authProtocol,
00302 int privProtocol,
00303 const NS_SNMP OctetStr& authPassword,
00304 const NS_SNMP OctetStr& privPassword,
00305 const NS_SNMP OctetStr& engineID,
00306 const bool addPassWordsToUSM = false)
00307 { return addNewRow(userName, userName, authProtocol, privProtocol,
00308 authPassword, privPassword, engineID, addPassWordsToUSM); };
00309
00316 boolean deleteRow(const NS_SNMP OctetStr& engineID,
00317 const NS_SNMP OctetStr& userName);
00318
00328 void deleteRows(const NS_SNMP OctetStr& userName);
00329
00330 MibTableRow* get_row(Oidx o) { return find_index(o); };
00331
00332 static const Oidx auth_base;
00333 static const Oidx priv_base;
00334
00335 protected:
00336 void initialize_key_change(MibTableRow*);
00337
00338 private:
00339 NS_SNMP USM *usm;
00340 };
00341
00342
00343 class AGENTPP_DECL UsmCloneFrom: public MibLeaf
00344 {
00345 public:
00346 UsmCloneFrom(Oidx o);
00347 virtual ~UsmCloneFrom() {};
00348 virtual int prepare_set_request(Request* req, int& ind);
00349 virtual void get_request(Request* req, int ind);
00350 virtual int set(const Vbx& vb);
00351 virtual boolean value_ok(const Vbx& vb);
00352 virtual MibEntryPtr clone();
00353 private:
00354 NS_SNMP USM *usm;
00355 };
00356
00357 class AGENTPP_DECL UsmKeyChange: public MibLeaf
00358 {
00359 public:
00360 UsmKeyChange(Oidx o, int keylen, int hashfunction, int typeOfKey,
00361 UsmKeyChange* ukc, NS_SNMP USM *u);
00362 UsmKeyChange(Oidx o, NS_SNMP USM *u);
00363 virtual ~UsmKeyChange();
00364
00365 virtual int unset();
00366 void initialize(int keylen, int hashfunction, int typeOfKey, UsmKeyChange* ukc);
00367 virtual void get_request(Request* req, int ind);
00368 virtual int prepare_set_request(Request* req, int& ind);
00369 virtual int set(const Vbx& vb);
00370 virtual boolean value_ok(const Vbx& vb);
00371 virtual MibEntryPtr clone();
00372
00373 protected:
00374 boolean process_key_change(NS_SNMP OctetStr& os);
00375
00376 int type_of_key;
00377 int key_len;
00378 int hash_function;
00379 UsmKeyChange* otherKeyChangeObject;
00380 NS_SNMP USM *usm;
00381 };
00382
00383 class AGENTPP_DECL UsmOwnKeyChange: public UsmKeyChange
00384 {
00385 public:
00386 UsmOwnKeyChange(Oidx o, NS_SNMP USM *u) : UsmKeyChange(o, u) {};
00387 UsmOwnKeyChange(Oidx o, int keylen, int hashfunction, int typeOfKey,
00388 UsmKeyChange* ukc, NS_SNMP USM *u)
00389 : UsmKeyChange(o, keylen, hashfunction, typeOfKey, ukc, u){};
00390 virtual ~UsmOwnKeyChange();
00391
00392 virtual int prepare_set_request(Request* req, int& ind);
00393 virtual MibEntryPtr clone();
00394
00395 private:
00396
00397 };
00398
00399
00400
00401
00402
00403
00404
00405
00406 class AGENTPP_DECL UsmStatsUnsupportedSecLevels: public MibLeaf {
00407
00408 public:
00409 UsmStatsUnsupportedSecLevels(const NS_SNMP USM *u);
00410 void get_request(Request*, int);
00411 private:
00412 const NS_SNMP USM *usm;
00413 };
00414
00415
00416
00417
00418
00419
00420
00421 class AGENTPP_DECL UsmStatsNotInTimeWindows: public MibLeaf {
00422
00423 public:
00424 UsmStatsNotInTimeWindows(const NS_SNMP USM *u);
00425 void get_request(Request*, int);
00426 private:
00427 const NS_SNMP USM *usm;
00428 };
00429
00430
00431
00432
00433
00434
00435
00436 class AGENTPP_DECL UsmStatsUnknownUserNames: public MibLeaf {
00437
00438 public:
00439 UsmStatsUnknownUserNames(const NS_SNMP USM *u);
00440 void get_request(Request*, int);
00441 private:
00442 const NS_SNMP USM *usm;
00443 };
00444
00445
00446
00447
00448
00449
00450
00451 class AGENTPP_DECL UsmStatsUnknownEngineIDs: public MibLeaf {
00452
00453 public:
00454 UsmStatsUnknownEngineIDs(const NS_SNMP USM *u);
00455 void get_request(Request*, int);
00456 private:
00457 const NS_SNMP USM *usm;
00458 };
00459
00460
00461
00462
00463
00464
00465
00466 class AGENTPP_DECL UsmStatsWrongDigests: public MibLeaf {
00467
00468 public:
00469 UsmStatsWrongDigests(const NS_SNMP USM *u);
00470 void get_request(Request*, int);
00471 private:
00472 const NS_SNMP USM *usm;
00473 };
00474
00475
00476
00477
00478
00479
00480
00481 class AGENTPP_DECL UsmStatsDecryptionErrors: public MibLeaf {
00482
00483 public:
00484 UsmStatsDecryptionErrors(const NS_SNMP USM *u);
00485 void get_request(Request*, int);
00486 private:
00487 const NS_SNMP USM *usm;
00488 };
00489
00490
00491
00492
00493
00494
00495
00496
00497 class AGENTPP_DECL UsmStats: public MibGroup {
00498
00499 public:
00500
00501 UsmStats(void);
00502 };
00503
00504 class AGENTPP_DECL usm_mib: public MibGroup {
00505
00506 public:
00507
00508 usm_mib(UsmUserTable*);
00509 };
00510
00511
00512 class AGENTPP_DECL MPDGroup: public MibGroup {
00513
00514 public:
00515
00516 MPDGroup(void);
00517 };
00518
00519 class AGENTPP_DECL MPDGroupSnmpUnknownSecurityModels: public MibLeaf {
00520
00521 public:
00522 MPDGroupSnmpUnknownSecurityModels(const NS_SNMP v3MP *mp);
00523 void get_request(Request*, int);
00524 private:
00525 const NS_SNMP v3MP *v3mp;
00526 };
00527
00528 class AGENTPP_DECL MPDGroupSnmpInvalidMsgs: public MibLeaf {
00529
00530 public:
00531 MPDGroupSnmpInvalidMsgs(const NS_SNMP v3MP *mp);
00532 void get_request(Request*, int);
00533 private:
00534 const NS_SNMP v3MP *v3mp;
00535 };
00536
00537 class AGENTPP_DECL MPDGroupSnmpUnknownPDUHandlers: public MibLeaf {
00538
00539 public:
00540 MPDGroupSnmpUnknownPDUHandlers(const NS_SNMP v3MP *mp);
00541 void get_request(Request*, int);
00542 private:
00543 const NS_SNMP v3MP *v3mp;
00544 };
00545
00546
00547 class AGENTPP_DECL usmUserAuthProtocol: public MibLeaf {
00548
00549 public:
00550 usmUserAuthProtocol(const Oidx&, NS_SNMP USM *u);
00551 virtual boolean value_ok(const Vbx&);
00552 virtual MibEntryPtr clone();
00553 private:
00554 NS_SNMP USM *usm;
00555 };
00556
00557 class AGENTPP_DECL usmUserPrivProtocol: public MibLeaf {
00558
00559 public:
00560 usmUserPrivProtocol(const Oidx&, NS_SNMP USM *u);
00561 virtual boolean value_ok(const Vbx&);
00562 virtual int prepare_set_request(Request*, int&);
00563 virtual MibEntryPtr clone();
00564 private:
00565 NS_SNMP USM *usm;
00566 };
00567 #ifdef AGENTPP_NAMESPACE
00568 }
00569 #endif
00570 #endif
00571
00572 #endif
00573