mp_v3.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. /*_############################################################################
  2. _##
  3. _## mp_v3.h
  4. _##
  5. _## SNMP++v3.2.23
  6. _## -----------------------------------------------
  7. _## Copyright (c) 2001-2007 Jochen Katz, Frank Fock
  8. _##
  9. _## This software is based on SNMP++2.6 from Hewlett Packard:
  10. _##
  11. _## Copyright (c) 1996
  12. _## Hewlett-Packard Company
  13. _##
  14. _## ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS.
  15. _## Permission to use, copy, modify, distribute and/or sell this software
  16. _## and/or its documentation is hereby granted without fee. User agrees
  17. _## to display the above copyright notice and this license notice in all
  18. _## copies of the software and any documentation of the software. User
  19. _## agrees to assume all liability for the use of the software;
  20. _## Hewlett-Packard and Jochen Katz make no representations about the
  21. _## suitability of this software for any purpose. It is provided
  22. _## "AS-IS" without warranty of any kind, either express or implied. User
  23. _## hereby grants a royalty-free license to any and all derivatives based
  24. _## upon this software code base.
  25. _##
  26. _## Stuttgart, Germany, Sun Nov 11 15:10:59 CET 2007
  27. _##
  28. _##########################################################################*/
  29. // $Id: mp_v3.h 319 2007-11-08 22:05:23Z katz $
  30. #ifndef _MP_V3
  31. #define _MP_V3
  32. #include "snmp_pp/config_snmp_pp.h"
  33. #ifdef _SNMPv3
  34. #include "snmp_pp/reentrant.h"
  35. #include "snmp_pp/target.h"
  36. #ifdef SNMP_PP_NAMESPACE
  37. namespace Snmp_pp {
  38. #endif
  39. class Pdu;
  40. class OctetStr;
  41. #define MAX_HOST_NAME_LENGTH 128
  42. #define oidMPDGroup "1.3.6.1.6.3.11.2.1"
  43. #define oidSnmpUnknownSecurityModels "1.3.6.1.6.3.11.2.1.1.0"
  44. #define oidSnmpInvalidMsgs "1.3.6.1.6.3.11.2.1.2.0"
  45. #define oidSnmpUnknownPDUHandlers "1.3.6.1.6.3.11.2.1.3.0"
  46. /** @name Error codes of the v3MP */
  47. //@{
  48. #define SNMPv3_MP_ERROR -1400
  49. #define SNMPv3_MP_OK -1401
  50. #define SNMPv3_MP_UNSUPPORTED_SECURITY_MODEL -1402
  51. #define SNMPv3_MP_NOT_IN_TIME_WINDOW -1403
  52. #define SNMPv3_MP_DOUBLED_MESSAGE -1404
  53. #define SNMPv3_MP_INVALID_MESSAGE -1405
  54. #define SNMPv3_MP_INVALID_ENGINEID -1406
  55. #define SNMPv3_MP_NOT_INITIALIZED -1407
  56. #define SNMPv3_MP_PARSE_ERROR -1408
  57. #define SNMPv3_MP_UNKNOWN_MSGID -1409
  58. #define SNMPv3_MP_MATCH_ERROR -1410
  59. #define SNMPv3_MP_COMMUNITY_ERROR -1411
  60. #define SNMPv3_MP_WRONG_USER_NAME -1412
  61. #define SNMPv3_MP_BUILD_ERROR -1413
  62. #define SNMPv3_MP_USM_ERROR -1414
  63. #define SNMPv3_MP_UNKNOWN_PDU_HANDLERS -1415
  64. #define SNMPv3_MP_UNAVAILABLE_CONTEXT -1416
  65. #define SNMPv3_MP_UNKNOWN_CONTEXT -1417
  66. #define SNMPv3_MP_REPORT_SENT -1418
  67. //@}
  68. /** @name Statistics on error codes. */
  69. //@{
  70. #define SNMPv3_MP_MAX_ERROR SNMPv3_MP_ERROR
  71. #define SNMPv3_MP_MIN_ERROR SNMPv3_MP_REPORT_SENT
  72. #define SNMPv3_MP_ERRORCOUNT SNMPv3_MP_MAX_ERROR - SNMPv3_MP_MIN_ERROR
  73. //@}
  74. class Snmp;
  75. class USM;
  76. /**
  77. * The SNMPv3 Message Processing Model (v3MP).
  78. *
  79. * If SNMPv3 is used, the application needs to create _one_ object of
  80. * this class. This object will automatically create an object of the
  81. * USM class. A pointer to this object is returned from the get_usm()
  82. * method. See the USM documentation for a description on how to create
  83. * and delete users.
  84. *
  85. * The only thing that may be configured after creation of the v3MP is
  86. * the engine id table of the v3MP. Entries for other SNMP entities
  87. * can be added through add_to_engine_id_table(). It is only required
  88. * to add entries to this table if you want to disable engine id
  89. * discovery and/or you don't want the delay caused by the automatic
  90. * engine id discovery of SNMPv3.
  91. */
  92. class DLLOPT v3MP
  93. {
  94. friend class SnmpMessage;
  95. friend class CSNMPMessageQueue;
  96. public:
  97. /**
  98. * Initialize the v3MP.
  99. *
  100. * Set the engineID of this SNMP entity and the Snmp object used to
  101. * send reports. This function creates a new USM object that can
  102. * be configured after getting a pointer to it through get_usm().
  103. *
  104. * The user is responsible to save and restore and increment the
  105. * snmpEngineBoots counter (The functions getBootCounter() and
  106. * saveBootCounter() can be used to do this.).
  107. *
  108. * @param engine_id - The locale engine id
  109. * @param engine_boots - The new value for the snmpEngineBoots counter
  110. * @param construct_status - OUT: SNMPv3_MP_OK or SNMPv3_MP_ERROR
  111. *
  112. */
  113. v3MP(const OctetStr& engine_id,
  114. unsigned int engine_boots, int &construct_status);
  115. /**
  116. * Get the engine id of this SNMP entity.
  117. *
  118. * @param id - OUT: The engineID of this SNMP entity
  119. *
  120. * @return - SNMPv3_MP_OK or SNMPv3_MP_ERROR
  121. */
  122. void get_local_engine_id(OctetStr &id) { id = own_engine_id_oct; };
  123. /**
  124. * Get the engine id of this SNMP entity as a OctetStr reference.
  125. *
  126. * @return Local engine id.
  127. */
  128. const OctetStr& get_local_engine_id() const
  129. { return own_engine_id_oct; };
  130. /**
  131. * Get a pointer to the USM object that is used by the v3MP.
  132. */
  133. USM *get_usm() { return usm; };
  134. /**
  135. * Free all allocated ressources of the v3MP and leave it in an
  136. * uninitialized state. After a call to this function, you can use
  137. * mpInit() to reinitialize the v3MP.
  138. *
  139. */
  140. ~v3MP();
  141. /**
  142. * Add an entry to the engine id table.
  143. *
  144. * In this table all known engine ids are stored. If the discovery
  145. * mode of the USM is enabled, snmp++ will add entries to this table
  146. * whenever a new engine id is dicovered.
  147. *
  148. * @param engine_id - The engine id
  149. * @param host - The numerical IP address
  150. * @param port - The port
  151. *
  152. * @return - SNMPv3_MP_ERROR, SNMPv3_MP_OK
  153. */
  154. int add_to_engine_id_table(const OctetStr &engine_id,
  155. const OctetStr &host, int port)
  156. { return engine_id_table.add_entry(engine_id, host, port); };
  157. /**
  158. * Remove an entry from the engine id table.
  159. *
  160. * @param host - The numerical IP address
  161. * @param port - The port
  162. *
  163. * @return - SNMPv3_MP_ERROR, SNMPv3_MP_OK
  164. */
  165. int remove_from_engine_id_table(const OctetStr &host, int port)
  166. { return engine_id_table.delete_entry(host, port); };
  167. /**
  168. * Remove an entry from the engine id table.
  169. *
  170. * @param engine_id - The engine id
  171. *
  172. * @return - SNMPv3_MP_ERROR, SNMPv3_MP_OK
  173. */
  174. int remove_from_engine_id_table(const OctetStr &engine_id)
  175. { return engine_id_table.delete_entry(engine_id); };
  176. /**
  177. * Get the engine id of the SNMP entity at the given host/port.
  178. *
  179. * @param engine_id - OUT: The engine id
  180. * @param hostport - The numerical IP address and port
  181. * (syntax: a.b.c.d/port)
  182. *
  183. * @return - SNMPv3_MP_NOT_INITIALIZED, SNMPv3_MP_ERROR,
  184. * SNMPv3_MP_OK
  185. */
  186. int get_from_engine_id_table(OctetStr &engine_id,
  187. const OctetStr &hostport) const
  188. { return engine_id_table.get_entry(engine_id, hostport); };
  189. /**
  190. * Get the engineID of the SNMP entity at the given host/port.
  191. *
  192. * @param engineID - OUT: The engineID
  193. * @param host - The numerical IP address
  194. * @param port - The port
  195. *
  196. * @return - SNMPv3_MP_NOT_INITIALIZED, SNMPv3_MP_ERROR,
  197. * SNMPv3_MP_OK
  198. */
  199. int get_from_engine_id_table(OctetStr &engineID,
  200. const OctetStr &host, int port) const
  201. { return engine_id_table.get_entry(engineID, host, port); };
  202. /**
  203. * Remove all entries from the engine id table.
  204. *
  205. * @return - SNMPv3_MP_NOT_INITIALIZED, SNMPv3_MP_ERROR,
  206. * SNMPv3_MP_OK
  207. */
  208. int reset_engine_id_table()
  209. { return engine_id_table.reset(); };
  210. /**
  211. * Remove all occurences of this engine id from v3MP and USM.
  212. *
  213. * @param engine_id - The engine id to remove
  214. *
  215. * @return - SNMPv3_MP_NOT_INITIALIZED, SNMPv3_MP_ERROR,
  216. * SNMPv3_MP_OK
  217. */
  218. int remove_engine_id(const OctetStr &engine_id);
  219. // ----------[ Access to status counters for agent++ ]--------------
  220. /**
  221. * Get the value of the status counter snmpUnknownSecurityModels.
  222. *
  223. * @return - The status counter
  224. */
  225. unsigned long get_stats_unknown_security_models() const
  226. { return snmpUnknownSecurityModels; };
  227. /**
  228. * Get the value of the status counter snmpInvalidMsgs.
  229. *
  230. * @return - The status counter
  231. */
  232. unsigned long get_stats_invalid_msgs() const
  233. { return snmpInvalidMsgs; };
  234. /**
  235. * Get the value of the status counter snmpUnknownPDUHandlers.
  236. *
  237. * @return - The status counter
  238. */
  239. unsigned long get_stats_unknown_pdu_handlers() const
  240. { return snmpUnknownPDUHandlers; };
  241. /**
  242. * Increment the value of the status counter snmpUnknownSecurityModels.
  243. */
  244. void inc_stats_unknown_security_models()
  245. { snmpUnknownSecurityModels++; };
  246. /**
  247. * Increment the value of the status counter snmpInvalidMsgs.
  248. */
  249. void inc_stats_invalid_msgs() { snmpInvalidMsgs++; };
  250. /**
  251. * Increment the value of the status counter snmpUnknownPDUHandlers.
  252. */
  253. void inc_stats_unknown_pdu_handlers() { snmpUnknownPDUHandlers++; };
  254. // temporary pointer will be removed...
  255. static v3MP *I;
  256. protected:
  257. /**
  258. * Parse the given buffer as a SNMPv3-Message.
  259. *
  260. * @param snmp_session - IN: The session used to receive the msg
  261. * @param pdu - OUT: Parsed values are put into this struct
  262. * @param inBuf - The buffer to parse
  263. * @param inBufLength - The length of the buffer
  264. * @param securityEngineID - OUT: The parsed securityEngineID
  265. * @param securityName - OUT: The parsed securityName
  266. * @param contextEngineID - OUT: The parsed contextEngineID
  267. * @param contextName - OUT: The parsed contextName
  268. * @param securityLevel - OUT: The parsed security level
  269. * @param msgSecurityModel - OUT: The security model used
  270. * @param spp_version - OUT: SNMP version (SNMPv3)
  271. * @param from_address - Where the message came from (used to send
  272. * a report if neccessary)
  273. *
  274. * @return - SNMPv3_MP_OK or any error listed in snmperr.h
  275. */
  276. int snmp_parse(Snmp *snmp_session,
  277. struct snmp_pdu *pdu,
  278. unsigned char *inBuf,
  279. int inBufLength,
  280. OctetStr &securityEngineID,
  281. OctetStr &securityName,
  282. OctetStr &contextEngineID,
  283. OctetStr &contextName,
  284. long &securityLevel,
  285. long &msgSecurityModel,
  286. snmp_version &spp_version,
  287. UdpAddress from_address);
  288. /**
  289. * Tests if the given buffer contains a SNMPv3-Message. The buffer is
  290. * only parsed to extract the version of the message, no other checks
  291. * are made.
  292. *
  293. * @param buffer - The message
  294. * @param length - The length of the message
  295. *
  296. * @return - TRUE if the version could be extracted and it
  297. * is a SNMPv3 message. On any error: FALSE.
  298. *
  299. */
  300. static bool is_v3_msg( unsigned char *buffer, int length);
  301. /**
  302. * Do the complete process of encoding the given values into the buffer
  303. * ready to send to the target.
  304. *
  305. * @param pdu - The pdu structure
  306. * @param packet - The buffer to store the serialized message
  307. * @param out_length - IN: Length of the buffer,
  308. * OUT: Length of the message
  309. * @param securityEngineID - The securityEngineID
  310. * @param securityNameIn - The securityName
  311. * @param securityModel - Use this security model
  312. * @param securityLevel - Use this security level
  313. * @param contextEngineID - The contextEngineID
  314. * @param contextName - The contextName
  315. *
  316. * @return - SNMPv3_MP_OK or any error listed in snmperr.h
  317. */
  318. int snmp_build(struct snmp_pdu *pdu,
  319. unsigned char *packet,
  320. int *out_length, // maximum Bytes in packet
  321. const OctetStr &securityEngineID,
  322. const OctetStr &securityNameIn,
  323. int securityModel, int securityLevel,
  324. const OctetStr &contextEngineID,
  325. const OctetStr &contextName);
  326. /**
  327. * Delete the entry with the given request id from the cache.
  328. * This function is used in eventlist.cpp when a request
  329. * has timed out.
  330. *
  331. * @param requestID - The request id.
  332. * @param local_request - Does the request id belong to a local or to
  333. * a remote request?
  334. */
  335. void delete_from_cache(unsigned long requestID,
  336. const bool local_request = true)
  337. { cache.delete_entry(requestID, local_request); };
  338. public:
  339. /**
  340. * Delete the entry with the given request id from the cache.
  341. * This function is used in agent++ RequestList.
  342. *
  343. * @param requestID - The request id.
  344. * @param messageID - The message id.
  345. * @param local_request - Does the request id belong to a local or to
  346. * a remote request?
  347. */
  348. void delete_from_cache(unsigned long requestID,
  349. unsigned long messageID,
  350. const bool local_request)
  351. { cache.delete_entry(requestID, messageID, local_request); };
  352. private:
  353. /**
  354. * Send a report message.
  355. *
  356. * @param scopedPDU - The scopedPDU as received. If the pdu is not
  357. * encrypted, the request id is extracted
  358. * @param scopedPDULength - The lkength of the scopedPDU
  359. * @param pdu - The pdu structure.
  360. * @param errorCode - The code of the error that occured.
  361. * @param sLevel - Send the report with this security level.
  362. * @param sModel - Use this security model.
  363. * @param sName - Use this security name
  364. * @param destination - Send the report to this address.
  365. * @param snmp_session - Snmp session to use for sending a report
  366. *
  367. * @return - SNMPv3_MP_ERROR, SNMPv3_MP_OK
  368. */
  369. int send_report(unsigned char* scopedPDU, int scopedPDULength,
  370. struct snmp_pdu *pdu, int errorCode, int sLevel,
  371. int sModel, OctetStr &sName,
  372. UdpAddress &destination, Snmp *snmp_session);
  373. // =====================[ member classes ]==============================
  374. /**
  375. * The engine id table is used to store known engine ids with
  376. * corresponding hostadress and port.
  377. */
  378. class DLLOPT EngineIdTable
  379. {
  380. public:
  381. EngineIdTable(int initial_size = 10);
  382. ~EngineIdTable();
  383. /**
  384. * Add an entry to the table.
  385. *
  386. * @param engine_id - The engineID
  387. * @param host - The numerical IP address
  388. * @param port - The port
  389. *
  390. * @return - SNMPv3_MP_ERROR, SNMPv3_MP_OK
  391. */
  392. int add_entry(const OctetStr &engine_id,
  393. const OctetStr &host, int port);
  394. /**
  395. * Get the engine_id of the SNMP entity at the given host/port.
  396. *
  397. * @param engine_id - OUT: The engineID
  398. * @param hostport - The numerical IP address and port
  399. * (syntax: a.b.c.d/port)
  400. *
  401. * @return - SNMPv3_MP_NOT_INITIALIZED, SNMPv3_MP_ERROR,
  402. * SNMPv3_MP_OK
  403. */
  404. int get_entry(OctetStr &engine_id, const OctetStr &hostport) const;
  405. /**
  406. * Get the engineID of the SNMP entity at the given host/port.
  407. *
  408. * @param engine_id - OUT: The engineID
  409. * @param host - The numerical IP address
  410. * @param port - The port
  411. *
  412. * @return - SNMPv3_MP_NOT_INITIALIZED, SNMPv3_MP_ERROR,
  413. * SNMPv3_MP_OK
  414. */
  415. int get_entry(OctetStr &engine_id, const OctetStr &host, int port) const;
  416. /**
  417. * Remove all entries from the engine id table.
  418. *
  419. * @return - SNMPv3_MP_NOT_INITIALIZED, SNMPv3_MP_ERROR,
  420. * SNMPv3_MP_OK
  421. */
  422. int reset();
  423. /**
  424. * Remove the given engine id from the table.
  425. *
  426. * @param engine_id - The engine id to remove
  427. *
  428. * @return - SNMPv3_MP_NOT_INITIALIZED, SNMPv3_MP_ERROR,
  429. * SNMPv3_MP_OK
  430. */
  431. int delete_entry(const OctetStr &engine_id);
  432. /**
  433. * Remove the entry for the given address/port from the table.
  434. *
  435. * @param host - Numeric IP address
  436. * @param port - listen port of the snmp entity
  437. *
  438. * @return - SNMPv3_MP_NOT_INITIALIZED, SNMPv3_MP_ERROR,
  439. * SNMPv3_MP_OK
  440. */
  441. int delete_entry(const OctetStr &host, int port);
  442. private:
  443. int initialize_table(const int size);
  444. struct Entry_T
  445. {
  446. OctetStr engine_id;
  447. OctetStr host;
  448. int port;
  449. };
  450. struct Entry_T *table;
  451. int max_entries; ///< the maximum number of entries
  452. int entries; ///< the current amount of entries
  453. SNMP_PP_MUTABLE SnmpSynchronized lock;
  454. };
  455. /**
  456. * Holds cache entries for currently processed requests.
  457. */
  458. class DLLOPT Cache
  459. {
  460. public:
  461. Cache();
  462. ~Cache();
  463. struct Entry_T
  464. {
  465. int msg_id;
  466. unsigned long req_id;
  467. OctetStr sec_engine_id;
  468. int sec_model;
  469. OctetStr sec_name;
  470. int sec_level;
  471. OctetStr context_engine_id;
  472. OctetStr context_name;
  473. struct SecurityStateReference *sec_state_ref;
  474. int error_code;
  475. bool local_request;
  476. };
  477. /**
  478. * Add an entry to the cache.
  479. *
  480. * @param msg_id - The message id of the message
  481. * @param req_id - The request id of the message
  482. * @param sec_engine_id - The authoritative engineID
  483. * @param sec_model - The security model used for this message
  484. * @param sec_name - The name of the user
  485. * @param sec_level - The security level used for this message
  486. * @param context_engine_id - The context_engine_id
  487. * @param context_name - The context_name
  488. * @param sec_state_ref - The reference of the USM
  489. * @param error_code - The code of the error that occured while
  490. * parsing the received message
  491. *
  492. * @return - SNMPv3_MP_OK, SNMPv3_MP_ERROR or SNMPv3_DOUBLED_MESSAGE
  493. * (an entry with the given values is already in the cache)
  494. */
  495. int add_entry(int msg_id, unsigned long req_id,
  496. const OctetStr &sec_engine_id,
  497. int sec_model,
  498. const OctetStr &sec_name,
  499. int sec_level,
  500. const OctetStr &context_engine_id,
  501. const OctetStr &context_name,
  502. struct SecurityStateReference *sec_state_ref,
  503. int error_code, bool local_request);
  504. /**
  505. * Search the cache for a message id, return the error code and
  506. * the sec_state_ref and delete the entry from the cache.
  507. *
  508. * @param msg_id - Search for this message id
  509. * @param error_code - OUT: The error code of the received message
  510. * @param sec_state_ref - IN: Pointer to a pointer of the structure
  511. * OUT: The structure as received by the USM when
  512. * the message was parsed.
  513. *
  514. * @return - SNMPv3_MP_ERROR, SNMPv3_MP_OK
  515. */
  516. int get_entry(int msg_id, bool local_request, int *error_code,
  517. struct SecurityStateReference **sec_state_ref);
  518. /**
  519. * Delete the entry with the given request id from the cache.
  520. * This function is used in eventlist.cpp when a request
  521. * has timed out.
  522. *
  523. * @param req_id - The request id.
  524. */
  525. void delete_entry(unsigned long req_id, bool local_request);
  526. /**
  527. * Delete the entry with the given request and message id from the cache.
  528. *
  529. * @param req_id - The request id.
  530. * @param msg_id - The message id.
  531. */
  532. void delete_entry(unsigned long req_id, int msg_id,
  533. bool local_request);
  534. /**
  535. * Search the cache for a message id, return the whole entry and
  536. * delete the entry from the cache.
  537. *
  538. * @param searchedID - Search for this message id
  539. * @param res - IN: Pointer to an empy structure
  540. * OUT: The filled structure
  541. *
  542. * @return - SNMPv3_MP_ERROR, SNMPv3_MP_OK
  543. */
  544. int get_entry(int searchedID, bool local_request,
  545. struct Cache::Entry_T *res);
  546. void delete_content(struct Cache::Entry_T &ce);
  547. void set_usm(USM *usm_to_use) { usm = usm_to_use; };
  548. private:
  549. #ifdef _THREADS
  550. SNMP_PP_MUTABLE SnmpSynchronized lock;
  551. #endif
  552. struct Entry_T *table; ///< whole table
  553. int max_entries; ///< the maximum number of entries
  554. int entries; ///< the current amount of entries
  555. USM *usm;
  556. };
  557. // =====================[ member variables ]==============================
  558. EngineIdTable engine_id_table;
  559. Cache cache;
  560. // the engineID of this SNMP entity
  561. unsigned char *own_engine_id;
  562. int own_engine_id_len;
  563. OctetStr own_engine_id_oct;
  564. unsigned int cur_msg_id; ///< msgID to use for next message
  565. SNMP_PP_MUTABLE SnmpSynchronized cur_msg_id_lock;
  566. USM *usm; ///< the USM object used
  567. // MIB Counters
  568. unsigned int snmpUnknownSecurityModels;
  569. unsigned int snmpInvalidMsgs;
  570. unsigned int snmpUnknownPDUHandlers;
  571. };
  572. #ifdef SNMP_PP_NAMESPACE
  573. } // end of namespace Snmp_pp
  574. #endif
  575. #endif // _SNMPv3
  576. #endif