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
00209 MibTableRow *addNewRow(const NS_SNMP OctetStr& engineID,
00210 const NS_SNMP OctetStr& userName,
00211 const NS_SNMP OctetStr& securityName,
00212 int authProtocol, const NS_SNMP OctetStr& authKey,
00213 int privProtocol, const NS_SNMP OctetStr& privKey,
00214 const boolean add_to_usm = TRUE);
00215
00224 MibTableRow *addNewRow(const NS_SNMP OctetStr& engineID,
00225 const NS_SNMP OctetStr& userName,
00226 int authProtocol, const NS_SNMP OctetStr& authKey,
00227 int privProtocol, const NS_SNMP OctetStr& privKey,
00228 const boolean add_to_usm = TRUE)
00229 { return addNewRow(engineID, userName, userName, authProtocol, authKey,
00230 privProtocol, privKey, add_to_usm); };
00231
00244 MibTableRow *addNewRow(const NS_SNMP OctetStr& userName,
00245 const NS_SNMP OctetStr& securityName,
00246 int authProtocol,
00247 int privProtocol,
00248 const NS_SNMP OctetStr& authPassword,
00249 const NS_SNMP OctetStr& privPassword);
00250
00259 MibTableRow *addNewRow(const NS_SNMP OctetStr& userName,
00260 int authProtocol,
00261 int privProtocol,
00262 const NS_SNMP OctetStr& authPassword,
00263 const NS_SNMP OctetStr& privPassword)
00264 { return addNewRow(userName, userName, authProtocol, privProtocol,
00265 authPassword, privPassword); };
00266
00273 boolean deleteRow(const NS_SNMP OctetStr& engineID,
00274 const NS_SNMP OctetStr& userName);
00275
00276 MibTableRow* get_row(Oidx o) { return find_index(o); };
00277
00278 static const Oidx auth_base;
00279 static const Oidx priv_base;
00280
00281 protected:
00282 void initialize_key_change(MibTableRow*);
00283
00284 private:
00285 NS_SNMP USM *usm;
00286 };
00287
00288
00289 class AGENTPP_DECL UsmCloneFrom: public MibLeaf
00290 {
00291 public:
00292 UsmCloneFrom(Oidx o);
00293 virtual ~UsmCloneFrom() {};
00294 virtual int prepare_set_request(Request* req, int& ind);
00295 virtual void get_request(Request* req, int ind);
00296 virtual int set(const Vbx& vb);
00297 virtual boolean value_ok(const Vbx& vb);
00298 virtual MibEntryPtr clone();
00299 private:
00300 NS_SNMP USM *usm;
00301 };
00302
00303 class AGENTPP_DECL UsmKeyChange: public MibLeaf
00304 {
00305 public:
00306 UsmKeyChange(Oidx o, int keylen, int hashfunction, int typeOfKey,
00307 UsmKeyChange* ukc, NS_SNMP USM *u);
00308 UsmKeyChange(Oidx o, NS_SNMP USM *u);
00309 virtual ~UsmKeyChange();
00310
00311 virtual int unset();
00312 void initialize(int keylen, int hashfunction, int typeOfKey, UsmKeyChange* ukc);
00313 virtual void get_request(Request* req, int ind);
00314 virtual int prepare_set_request(Request* req, int& ind);
00315 virtual int set(const Vbx& vb);
00316 virtual boolean value_ok(const Vbx& vb);
00317 virtual MibEntryPtr clone();
00318
00319 protected:
00320 boolean process_key_change(NS_SNMP OctetStr& os);
00321
00322 int type_of_key;
00323 int key_len;
00324 int hash_function;
00325 UsmKeyChange* otherKeyChangeObject;
00326 NS_SNMP USM *usm;
00327 };
00328
00329 class AGENTPP_DECL UsmOwnKeyChange: public UsmKeyChange
00330 {
00331 public:
00332 UsmOwnKeyChange(Oidx o, NS_SNMP USM *u) : UsmKeyChange(o, u) {};
00333 UsmOwnKeyChange(Oidx o, int keylen, int hashfunction, int typeOfKey,
00334 UsmKeyChange* ukc, NS_SNMP USM *u)
00335 : UsmKeyChange(o, keylen, hashfunction, typeOfKey, ukc, u){};
00336 virtual ~UsmOwnKeyChange();
00337
00338 virtual int prepare_set_request(Request* req, int& ind);
00339 virtual MibEntryPtr clone();
00340
00341 private:
00342
00343 };
00344
00345
00346
00347
00348
00349
00350
00351
00352 class AGENTPP_DECL UsmStatsUnsupportedSecLevels: public MibLeaf {
00353
00354 public:
00355 UsmStatsUnsupportedSecLevels(const NS_SNMP USM *u);
00356 void get_request(Request*, int);
00357 private:
00358 const NS_SNMP USM *usm;
00359 };
00360
00361
00362
00363
00364
00365
00366
00367 class AGENTPP_DECL UsmStatsNotInTimeWindows: public MibLeaf {
00368
00369 public:
00370 UsmStatsNotInTimeWindows(const NS_SNMP USM *u);
00371 void get_request(Request*, int);
00372 private:
00373 const NS_SNMP USM *usm;
00374 };
00375
00376
00377
00378
00379
00380
00381
00382 class AGENTPP_DECL UsmStatsUnknownUserNames: public MibLeaf {
00383
00384 public:
00385 UsmStatsUnknownUserNames(const NS_SNMP USM *u);
00386 void get_request(Request*, int);
00387 private:
00388 const NS_SNMP USM *usm;
00389 };
00390
00391
00392
00393
00394
00395
00396
00397 class AGENTPP_DECL UsmStatsUnknownEngineIDs: public MibLeaf {
00398
00399 public:
00400 UsmStatsUnknownEngineIDs(const NS_SNMP USM *u);
00401 void get_request(Request*, int);
00402 private:
00403 const NS_SNMP USM *usm;
00404 };
00405
00406
00407
00408
00409
00410
00411
00412 class AGENTPP_DECL UsmStatsWrongDigests: public MibLeaf {
00413
00414 public:
00415 UsmStatsWrongDigests(const NS_SNMP USM *u);
00416 void get_request(Request*, int);
00417 private:
00418 const NS_SNMP USM *usm;
00419 };
00420
00421
00422
00423
00424
00425
00426
00427 class AGENTPP_DECL UsmStatsDecryptionErrors: public MibLeaf {
00428
00429 public:
00430 UsmStatsDecryptionErrors(const NS_SNMP USM *u);
00431 void get_request(Request*, int);
00432 private:
00433 const NS_SNMP USM *usm;
00434 };
00435
00436
00437
00438
00439
00440
00441
00442
00443 class AGENTPP_DECL UsmStats: public MibGroup {
00444
00445 public:
00446
00447 UsmStats(void);
00448 };
00449
00450 class AGENTPP_DECL usm_mib: public MibGroup {
00451
00452 public:
00453
00454 usm_mib(UsmUserTable*);
00455 };
00456
00457
00458 class AGENTPP_DECL MPDGroup: public MibGroup {
00459
00460 public:
00461
00462 MPDGroup(void);
00463 };
00464
00465 class AGENTPP_DECL MPDGroupSnmpUnknownSecurityModels: public MibLeaf {
00466
00467 public:
00468 MPDGroupSnmpUnknownSecurityModels(const NS_SNMP v3MP *mp);
00469 void get_request(Request*, int);
00470 private:
00471 const NS_SNMP v3MP *v3mp;
00472 };
00473
00474 class AGENTPP_DECL MPDGroupSnmpInvalidMsgs: public MibLeaf {
00475
00476 public:
00477 MPDGroupSnmpInvalidMsgs(const NS_SNMP v3MP *mp);
00478 void get_request(Request*, int);
00479 private:
00480 const NS_SNMP v3MP *v3mp;
00481 };
00482
00483 class AGENTPP_DECL MPDGroupSnmpUnknownPDUHandlers: public MibLeaf {
00484
00485 public:
00486 MPDGroupSnmpUnknownPDUHandlers(const NS_SNMP v3MP *mp);
00487 void get_request(Request*, int);
00488 private:
00489 const NS_SNMP v3MP *v3mp;
00490 };
00491
00492
00493 class AGENTPP_DECL usmUserAuthProtocol: public MibLeaf {
00494
00495 public:
00496 usmUserAuthProtocol(const Oidx&, NS_SNMP USM *u);
00497 virtual boolean value_ok(const Vbx&);
00498 virtual MibEntryPtr clone();
00499 private:
00500 NS_SNMP USM *usm;
00501 };
00502
00503 class AGENTPP_DECL usmUserPrivProtocol: public MibLeaf {
00504
00505 public:
00506 usmUserPrivProtocol(const Oidx&, NS_SNMP USM *u);
00507 virtual boolean value_ok(const Vbx&);
00508 virtual int prepare_set_request(Request*, int&);
00509 virtual MibEntryPtr clone();
00510 private:
00511 NS_SNMP USM *usm;
00512 };
00513 #ifdef AGENTPP_NAMESPACE
00514 }
00515 #endif
00516 #endif
00517
00518 #endif
00519