00001 /* Portions of this file are subject to the following copyright(s). See 00002 * the Net-SNMP's COPYING file for more details and other copyrights 00003 * that may apply: 00004 */ 00005 /* 00006 * Portions of this file are copyrighted by: 00007 * Copyright © 2003 Sun Microsystems, Inc. All rights reserved. 00008 * Use is subject to license terms specified in the COPYING file 00009 * distributed with the Net-SNMP package. 00010 */ 00011 #ifndef SNMP_API_H 00012 #define SNMP_API_H 00013 00014 /* 00015 * @file snmp_api.h - API for access to snmp. 00016 * 00017 * @addtogroup library 00018 * 00019 * Caution: when using this library in a multi-threaded application, 00020 * the values of global variables "snmp_errno" and "snmp_detail" 00021 * cannot be reliably determined. Suggest using snmp_error() 00022 * to obtain the library error codes. 00023 * 00024 * @{ 00025 */ 00026 00027 #include <net-snmp/types.h> 00028 #include <net-snmp/varbind_api.h> 00029 #include <net-snmp/pdu_api.h> 00030 #include <net-snmp/session_api.h> 00031 00032 #ifndef DONT_SHARE_ERROR_WITH_OTHER_THREADS 00033 #define SET_SNMP_ERROR(x) snmp_errno=(x) 00034 #else 00035 #define SET_SNMP_ERROR(x) 00036 #endif 00037 00038 00039 #ifdef __cplusplus 00040 extern "C" { 00041 #endif 00042 00043 /*********************************************************** 00044 Copyright 1989 by Carnegie Mellon University 00045 00046 All Rights Reserved 00047 00048 Permission to use, copy, modify, and distribute this software and its 00049 documentation for any purpose and without fee is hereby granted, 00050 provided that the above copyright notice appear in all copies and that 00051 both that copyright notice and this permission notice appear in 00052 supporting documentation, and that the name of CMU not be 00053 used in advertising or publicity pertaining to distribution of the 00054 software without specific, written prior permission. 00055 00056 CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 00057 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 00058 CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 00059 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 00060 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 00061 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 00062 SOFTWARE. 00063 ******************************************************************/ 00064 00065 struct timeval; 00066 /* 00067 * A list of all the outstanding requests for a particular session. 00068 */ 00069 #ifdef SNMP_NEED_REQUEST_LIST 00070 typedef struct request_list { 00071 struct request_list *next_request; 00072 long request_id; /* request id */ 00073 long message_id; /* message id */ 00074 netsnmp_callback callback; /* user callback per request (NULL if unused) */ 00075 void *cb_data; /* user callback data per request (NULL if unused) */ 00076 int retries; /* Number of retries */ 00077 u_long timeout; /* length to wait for timeout */ 00078 struct timeval time; /* Time this request was made */ 00079 struct timeval expire; /* time this request is due to expire */ 00080 struct snmp_session *session; 00081 netsnmp_pdu *pdu; /* The pdu for this request 00082 * (saved so it can be retransmitted */ 00083 } netsnmp_request_list; 00084 #endif /* SNMP_NEED_REQUEST_LIST */ 00085 00086 /* 00087 * Set fields in session and pdu to the following to get a default or unconfigured value. 00088 */ 00089 #define SNMP_DEFAULT_COMMUNITY_LEN 0 /* to get a default community name */ 00090 #define SNMP_DEFAULT_RETRIES -1 00091 #define SNMP_DEFAULT_TIMEOUT -1 00092 #define SNMP_DEFAULT_REMPORT 0 00093 #define SNMP_DEFAULT_REQID -1 00094 #define SNMP_DEFAULT_MSGID -1 00095 #define SNMP_DEFAULT_ERRSTAT -1 00096 #define SNMP_DEFAULT_ERRINDEX -1 00097 #define SNMP_DEFAULT_ADDRESS 0 00098 #define SNMP_DEFAULT_PEERNAME NULL 00099 #define SNMP_DEFAULT_ENTERPRISE_LENGTH 0 00100 #define SNMP_DEFAULT_TIME 0 00101 #define SNMP_DEFAULT_VERSION -1 00102 #define SNMP_DEFAULT_SECMODEL -1 00103 #define SNMP_DEFAULT_CONTEXT "" 00104 #ifndef NETSNMP_DISABLE_MD5 00105 #define SNMP_DEFAULT_AUTH_PROTO usmHMACMD5AuthProtocol 00106 #else 00107 #define SNMP_DEFAULT_AUTH_PROTO usmHMACSHA1AuthProtocol 00108 #endif 00109 #define SNMP_DEFAULT_AUTH_PROTOLEN USM_LENGTH_OID_TRANSFORM 00110 #ifndef NETSNMP_DISABLE_DES 00111 #define SNMP_DEFAULT_PRIV_PROTO usmDESPrivProtocol 00112 #else 00113 #define SNMP_DEFAULT_PRIV_PROTO usmAESPrivProtocol 00114 #endif 00115 #define SNMP_DEFAULT_PRIV_PROTOLEN USM_LENGTH_OID_TRANSFORM 00116 00117 NETSNMP_IMPORT const char *snmp_api_errstring(int); 00118 NETSNMP_IMPORT void snmp_perror(const char *); 00119 NETSNMP_IMPORT void snmp_set_detail(const char *); 00120 00121 #define SNMP_MAX_MSG_SIZE 1472 /* ethernet MTU minus IP/UDP header */ 00122 #define SNMP_MAX_MSG_V3_HDRS (4+3+4+7+7+3+7+16) /* fudge factor=16 */ 00123 #define SNMP_MAX_ENG_SIZE 32 00124 #define SNMP_MAX_SEC_NAME_SIZE 256 00125 #define SNMP_MAX_CONTEXT_SIZE 256 00126 #define SNMP_SEC_PARAM_BUF_SIZE 256 00127 00128 /* 00129 * set to one to ignore unauthenticated Reports 00130 */ 00131 #define SNMPV3_IGNORE_UNAUTH_REPORTS 0 00132 00133 /* 00134 * authoritative engine definitions 00135 */ 00136 #define SNMP_SESS_NONAUTHORITATIVE 0 /* should be 0 to default to this */ 00137 #define SNMP_SESS_AUTHORITATIVE 1 /* don't learn engineIDs */ 00138 #define SNMP_SESS_UNKNOWNAUTH 2 /* sometimes (like NRs) */ 00139 00140 /* 00141 * to determine type of Report from varbind_list 00142 */ 00143 #define REPORT_STATS_LEN 9 00144 #define REPORT_snmpUnknownSecurityModels_NUM 1 00145 #define REPORT_snmpInvalidMsgs_NUM 2 00146 #define REPORT_usmStatsUnsupportedSecLevels_NUM 1 00147 #define REPORT_usmStatsNotInTimeWindows_NUM 2 00148 #define REPORT_usmStatsUnknownUserNames_NUM 3 00149 #define REPORT_usmStatsUnknownEngineIDs_NUM 4 00150 #define REPORT_usmStatsWrongDigests_NUM 5 00151 #define REPORT_usmStatsDecryptionErrors_NUM 6 00152 00153 #define SNMP_DETAIL_SIZE 512 00154 00155 #define SNMP_FLAGS_UDP_BROADCAST 0x800 00156 #define SNMP_FLAGS_RESP_CALLBACK 0x400 /* Additional callback on response */ 00157 #define SNMP_FLAGS_USER_CREATED 0x200 /* USM user has been created */ 00158 #define SNMP_FLAGS_DONT_PROBE 0x100 /* don't probe for an engineID */ 00159 #define SNMP_FLAGS_STREAM_SOCKET 0x80 00160 #define SNMP_FLAGS_LISTENING 0x40 /* Server stream sockets only */ 00161 #define SNMP_FLAGS_SUBSESSION 0x20 00162 #define SNMP_FLAGS_STRIKE2 0x02 00163 #define SNMP_FLAGS_STRIKE1 0x01 00164 00165 #define CLEAR_SNMP_STRIKE_FLAGS(x) \ 00166 x &= ~(SNMP_FLAGS_STRIKE2|SNMP_FLAGS_STRIKE1) 00167 00168 /* 00169 * returns '1' if the session is to be regarded as dead, 00170 * otherwise set the strike flags appropriately, and return 0 00171 */ 00172 #define SET_SNMP_STRIKE_FLAGS(x) \ 00173 (( x & SNMP_FLAGS_STRIKE2 ) ? 1 : \ 00174 ((( x & SNMP_FLAGS_STRIKE1 ) ? ( x |= SNMP_FLAGS_STRIKE2 ) : \ 00175 ( x |= SNMP_FLAGS_STRIKE1 )), \ 00176 0)) 00177 00178 /* 00179 * Error return values. 00180 * 00181 * SNMPERR_SUCCESS is the non-PDU "success" code. 00182 * 00183 * XXX These should be merged with SNMP_ERR_* defines and confined 00184 * to values < 0. ??? 00185 */ 00186 #define SNMPERR_SUCCESS (0) /* XXX Non-PDU "success" code. */ 00187 #define SNMPERR_GENERR (-1) 00188 #define SNMPERR_BAD_LOCPORT (-2) 00189 #define SNMPERR_BAD_ADDRESS (-3) 00190 #define SNMPERR_BAD_SESSION (-4) 00191 #define SNMPERR_TOO_LONG (-5) 00192 #define SNMPERR_NO_SOCKET (-6) 00193 #define SNMPERR_V2_IN_V1 (-7) 00194 #define SNMPERR_V1_IN_V2 (-8) 00195 #define SNMPERR_BAD_REPEATERS (-9) 00196 #define SNMPERR_BAD_REPETITIONS (-10) 00197 #define SNMPERR_BAD_ASN1_BUILD (-11) 00198 #define SNMPERR_BAD_SENDTO (-12) 00199 #define SNMPERR_BAD_PARSE (-13) 00200 #define SNMPERR_BAD_VERSION (-14) 00201 #define SNMPERR_BAD_SRC_PARTY (-15) 00202 #define SNMPERR_BAD_DST_PARTY (-16) 00203 #define SNMPERR_BAD_CONTEXT (-17) 00204 #define SNMPERR_BAD_COMMUNITY (-18) 00205 #define SNMPERR_NOAUTH_DESPRIV (-19) 00206 #define SNMPERR_BAD_ACL (-20) 00207 #define SNMPERR_BAD_PARTY (-21) 00208 #define SNMPERR_ABORT (-22) 00209 #define SNMPERR_UNKNOWN_PDU (-23) 00210 #define SNMPERR_TIMEOUT (-24) 00211 #define SNMPERR_BAD_RECVFROM (-25) 00212 #define SNMPERR_BAD_ENG_ID (-26) 00213 #define SNMPERR_BAD_SEC_NAME (-27) 00214 #define SNMPERR_BAD_SEC_LEVEL (-28) 00215 #define SNMPERR_ASN_PARSE_ERR (-29) 00216 #define SNMPERR_UNKNOWN_SEC_MODEL (-30) 00217 #define SNMPERR_INVALID_MSG (-31) 00218 #define SNMPERR_UNKNOWN_ENG_ID (-32) 00219 #define SNMPERR_UNKNOWN_USER_NAME (-33) 00220 #define SNMPERR_UNSUPPORTED_SEC_LEVEL (-34) 00221 #define SNMPERR_AUTHENTICATION_FAILURE (-35) 00222 #define SNMPERR_NOT_IN_TIME_WINDOW (-36) 00223 #define SNMPERR_DECRYPTION_ERR (-37) 00224 #define SNMPERR_SC_GENERAL_FAILURE (-38) 00225 #define SNMPERR_SC_NOT_CONFIGURED (-39) 00226 #define SNMPERR_KT_NOT_AVAILABLE (-40) 00227 #define SNMPERR_UNKNOWN_REPORT (-41) 00228 #define SNMPERR_USM_GENERICERROR (-42) 00229 #define SNMPERR_USM_UNKNOWNSECURITYNAME (-43) 00230 #define SNMPERR_USM_UNSUPPORTEDSECURITYLEVEL (-44) 00231 #define SNMPERR_USM_ENCRYPTIONERROR (-45) 00232 #define SNMPERR_USM_AUTHENTICATIONFAILURE (-46) 00233 #define SNMPERR_USM_PARSEERROR (-47) 00234 #define SNMPERR_USM_UNKNOWNENGINEID (-48) 00235 #define SNMPERR_USM_NOTINTIMEWINDOW (-49) 00236 #define SNMPERR_USM_DECRYPTIONERROR (-50) 00237 #define SNMPERR_NOMIB (-51) 00238 #define SNMPERR_RANGE (-52) 00239 #define SNMPERR_MAX_SUBID (-53) 00240 #define SNMPERR_BAD_SUBID (-54) 00241 #define SNMPERR_LONG_OID (-55) 00242 #define SNMPERR_BAD_NAME (-56) 00243 #define SNMPERR_VALUE (-57) 00244 #define SNMPERR_UNKNOWN_OBJID (-58) 00245 #define SNMPERR_NULL_PDU (-59) 00246 #define SNMPERR_NO_VARS (-60) 00247 #define SNMPERR_VAR_TYPE (-61) 00248 #define SNMPERR_MALLOC (-62) 00249 #define SNMPERR_KRB5 (-63) 00250 #define SNMPERR_PROTOCOL (-64) 00251 #define SNMPERR_OID_NONINCREASING (-65) 00252 #define SNMPERR_JUST_A_CONTEXT_PROBE (-66) 00253 00254 #define SNMPERR_MAX (-66) 00255 00256 00257 /* 00258 * void 00259 * snmp_free_pdu(pdu) 00260 * netsnmp_pdu *pdu; 00261 * 00262 * Frees the pdu and any malloc'd data associated with it. 00263 */ 00264 00265 void snmp_free_var_internals(netsnmp_variable_list *); /* frees contents only */ 00266 00267 00268 /* 00269 * This routine must be supplied by the application: 00270 * 00271 * u_char *authenticator(pdu, length, community, community_len) 00272 * u_char *pdu; The rest of the PDU to be authenticated 00273 * int *length; The length of the PDU (updated by the authenticator) 00274 * u_char *community; The community name to authenticate under. 00275 * int community_len The length of the community name. 00276 * 00277 * Returns the authenticated pdu, or NULL if authentication failed. 00278 * If null authentication is used, the authenticator in snmp_session can be 00279 * set to NULL(0). 00280 */ 00281 00282 00283 00284 /* 00285 * This routine must be supplied by the application: 00286 * 00287 * int callback(operation, session, reqid, pdu, magic) 00288 * int operation; 00289 * netsnmp_session *session; The session authenticated under. 00290 * int reqid; The request id of this pdu (0 for TRAP) 00291 * netsnmp_pdu *pdu; The pdu information. 00292 * void *magic A link to the data for this routine. 00293 * 00294 * Returns 1 if request was successful, 0 if it should be kept pending. 00295 * Any data in the pdu must be copied because it will be freed elsewhere. 00296 * Operations are defined below: 00297 */ 00298 00299 #define NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE 1 00300 #define NETSNMP_CALLBACK_OP_TIMED_OUT 2 00301 #define NETSNMP_CALLBACK_OP_SEND_FAILED 3 00302 #define NETSNMP_CALLBACK_OP_CONNECT 4 00303 #define NETSNMP_CALLBACK_OP_DISCONNECT 5 00304 00305 long snmp_get_next_msgid(void); 00306 long snmp_get_next_reqid(void); 00307 long snmp_get_next_sessid(void); 00308 long snmp_get_next_transid(void); 00309 00310 int snmp_oid_compare(const oid *, size_t, const oid *, 00311 size_t); 00312 int snmp_oid_ncompare(const oid *, size_t, const oid *, 00313 size_t, size_t); 00314 int snmp_oidtree_compare(const oid *, size_t, const oid *, 00315 size_t); 00316 int snmp_oidsubtree_compare(const oid *, size_t, const oid *, 00317 size_t); 00318 int netsnmp_oid_compare_ll(const oid * in_name1, 00319 size_t len1, const oid * in_name2, 00320 size_t len2, size_t *offpt); 00321 int netsnmp_oid_equals(const oid *, size_t, const oid *, 00322 size_t); 00323 int netsnmp_oid_tree_equals(const oid *, size_t, const oid *, 00324 size_t); 00325 int netsnmp_oid_is_subtree(const oid *, size_t, const oid *, 00326 size_t); 00327 int netsnmp_oid_find_prefix(const oid * in_name1, size_t len1, 00328 const oid * in_name2, size_t len2); 00329 void init_snmp(const char *); 00330 u_char *snmp_pdu_build(netsnmp_pdu *, u_char *, size_t *); 00331 #ifdef NETSNMP_USE_REVERSE_ASNENCODING 00332 u_char *snmp_pdu_rbuild(netsnmp_pdu *, u_char *, size_t *); 00333 #endif 00334 int snmpv3_parse(netsnmp_pdu *, u_char *, size_t *, 00335 u_char **, netsnmp_session *); 00336 int snmpv3_packet_build(netsnmp_session *, 00337 netsnmp_pdu *pdu, u_char * packet, 00338 size_t * out_length, 00339 u_char * pdu_data, 00340 size_t pdu_data_len); 00341 int snmpv3_packet_rbuild(netsnmp_session *, 00342 netsnmp_pdu *pdu, u_char * packet, 00343 size_t * out_length, 00344 u_char * pdu_data, 00345 size_t pdu_data_len); 00346 int snmpv3_make_report(netsnmp_pdu *pdu, int error); 00347 int snmpv3_get_report_type(netsnmp_pdu *pdu); 00348 int snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, 00349 size_t * length); 00350 u_char *snmpv3_scopedPDU_parse(netsnmp_pdu *pdu, u_char * cp, 00351 size_t * length); 00352 void snmp_store(const char *type); 00353 void snmp_shutdown(const char *type); 00354 int snmp_add_var(netsnmp_pdu *, const oid *, size_t, char, 00355 const char *); 00356 oid *snmp_duplicate_objid(const oid * objToCopy, size_t); 00357 u_int snmp_increment_statistic(int which); 00358 u_int snmp_increment_statistic_by(int which, int count); 00359 u_int snmp_get_statistic(int which); 00360 void snmp_init_statistics(void); 00361 int create_user_from_session(netsnmp_session * session); 00362 int snmp_get_fd_for_session(struct snmp_session *sessp); 00363 int snmpv3_probe_contextEngineID_rfc5343(void *slp, 00364 netsnmp_session *session); 00365 00366 /* 00367 * New re-allocating reverse encoding functions. 00368 */ 00369 #ifdef NETSNMP_USE_REVERSE_ASNENCODING 00370 00371 int snmpv3_packet_realloc_rbuild(u_char ** pkt, size_t * pkt_len, 00372 size_t * offset, 00373 netsnmp_session * session, 00374 netsnmp_pdu *pdu, u_char * pdu_data, 00375 size_t pdu_data_len); 00376 00377 int snmp_pdu_realloc_rbuild(u_char ** pkt, size_t * pkt_len, 00378 size_t * offset, netsnmp_pdu *pdu); 00379 #endif 00380 00381 00382 00383 struct netsnmp_transport_s; 00384 00385 /* 00386 * Extended open; fpre_parse has changed. 00387 */ 00388 00389 netsnmp_session *snmp_open_ex(netsnmp_session *, 00390 int (*fpre_parse) (netsnmp_session *, 00391 struct 00392 netsnmp_transport_s *, 00393 void *, int), 00394 int (*fparse) (netsnmp_session *, 00395 netsnmp_pdu *, u_char *, 00396 size_t), 00397 int (*fpost_parse) (netsnmp_session *, 00398 netsnmp_pdu *, int), 00399 int (*fbuild) (netsnmp_session *, 00400 netsnmp_pdu *, u_char *, 00401 size_t *), 00402 int (*frbuild) (netsnmp_session *, 00403 netsnmp_pdu *, u_char **, 00404 size_t *, size_t *), 00405 int (*fcheck) (u_char *, size_t)); 00406 00407 /* 00408 * provided for backwards compatability. Don't use these functions. 00409 * See snmp_debug.h and snmp_debug.c instead. 00410 */ 00411 00412 void snmp_set_do_debugging(int); 00413 int snmp_get_do_debugging(void); 00414 00415 00416 00417 void snmp_sess_error(void *, int *, int *, char **); 00418 void netsnmp_sess_log_error(int priority, 00419 const char *prog_string, 00420 netsnmp_session * ss); 00421 void snmp_sess_perror(const char *prog_string, 00422 netsnmp_session * ss); 00423 const char * snmp_pdu_type(int type); 00424 00425 /* 00426 * Return the netsnmp_transport structure associated with the given opaque 00427 * pointer. 00428 */ 00429 00430 struct netsnmp_transport_s *snmp_sess_transport(void *); 00431 void snmp_sess_transport_set(void *, 00432 struct netsnmp_transport_s *); 00433 00434 /* 00435 * EXPERIMENTAL API EXTENSIONS ------------------------------------------ 00436 * 00437 * snmp_sess_add_ex, snmp_sess_add, snmp_add 00438 * 00439 * Analogous to snmp_open family of functions, but taking an 00440 * netsnmp_transport pointer as an extra argument. Unlike snmp_open et 00441 * al. it doesn't attempt to interpret the in_session->peername as a 00442 * transport endpoint specifier, but instead uses the supplied transport. 00443 * JBPN 00444 * 00445 */ 00446 00447 void *snmp_sess_add_ex(netsnmp_session *, 00448 struct netsnmp_transport_s *, 00449 int (*fpre_parse) (netsnmp_session *, 00450 struct 00451 netsnmp_transport_s 00452 *, void *, int), 00453 int (*fparse) (netsnmp_session *, 00454 struct snmp_pdu *, 00455 u_char *, size_t), 00456 int (*fpost_parse) (netsnmp_session *, 00457 struct snmp_pdu *, 00458 int), 00459 int (*fbuild) (netsnmp_session *, 00460 struct snmp_pdu *, 00461 u_char *, size_t *), 00462 int (*frbuild) (netsnmp_session *, 00463 struct snmp_pdu *, 00464 u_char **, size_t *, 00465 size_t *), 00466 int (*fcheck) (u_char *, size_t), 00467 netsnmp_pdu *(*fcreate_pdu) (struct 00468 netsnmp_transport_s 00469 *, 00470 void *, 00471 size_t)); 00472 00473 void *snmp_sess_add(netsnmp_session *, 00474 struct netsnmp_transport_s *, 00475 int (*fpre_parse) (netsnmp_session *, 00476 struct 00477 netsnmp_transport_s *, 00478 void *, int), 00479 int (*fpost_parse) (netsnmp_session *, 00480 netsnmp_pdu *, int)); 00481 00482 netsnmp_session *snmp_add(netsnmp_session *, 00483 struct netsnmp_transport_s *, 00484 int (*fpre_parse) (netsnmp_session *, 00485 struct netsnmp_transport_s 00486 *, void *, int), 00487 int (*fpost_parse) (netsnmp_session *, 00488 netsnmp_pdu *, int)); 00489 netsnmp_session *snmp_add_full(netsnmp_session * in_session, 00490 struct netsnmp_transport_s *transport, 00491 int (*fpre_parse) (netsnmp_session *, 00492 struct 00493 netsnmp_transport_s 00494 *, void *, int), 00495 int (*fparse) (netsnmp_session *, 00496 netsnmp_pdu *, u_char *, 00497 size_t), 00498 int (*fpost_parse) (netsnmp_session *, 00499 netsnmp_pdu *, int), 00500 int (*fbuild) (netsnmp_session *, 00501 netsnmp_pdu *, u_char *, 00502 size_t *), 00503 int (*frbuild) (netsnmp_session *, 00504 netsnmp_pdu *, 00505 u_char **, size_t *, 00506 size_t *), 00507 int (*fcheck) (u_char *, size_t), 00508 netsnmp_pdu *(*fcreate_pdu) (struct 00509 netsnmp_transport_s 00510 *, void *, 00511 size_t) 00512 ); 00513 /* 00514 * end single session API 00515 */ 00516 00517 /* 00518 * generic statistic counters 00519 */ 00520 00521 /* 00522 * snmpv3 statistics 00523 */ 00524 00525 /* 00526 * mpd stats 00527 */ 00528 #define STAT_SNMPUNKNOWNSECURITYMODELS 0 00529 #define STAT_SNMPINVALIDMSGS 1 00530 #define STAT_SNMPUNKNOWNPDUHANDLERS 2 00531 #define STAT_MPD_STATS_START STAT_SNMPUNKNOWNSECURITYMODELS 00532 #define STAT_MPD_STATS_END STAT_SNMPUNKNOWNPDUHANDLERS 00533 00534 /* 00535 * usm stats 00536 */ 00537 #define STAT_USMSTATSUNSUPPORTEDSECLEVELS 3 00538 #define STAT_USMSTATSNOTINTIMEWINDOWS 4 00539 #define STAT_USMSTATSUNKNOWNUSERNAMES 5 00540 #define STAT_USMSTATSUNKNOWNENGINEIDS 6 00541 #define STAT_USMSTATSWRONGDIGESTS 7 00542 #define STAT_USMSTATSDECRYPTIONERRORS 8 00543 #define STAT_USM_STATS_START STAT_USMSTATSUNSUPPORTEDSECLEVELS 00544 #define STAT_USM_STATS_END STAT_USMSTATSDECRYPTIONERRORS 00545 00546 /* 00547 * snmp counters 00548 */ 00549 #define STAT_SNMPINPKTS 9 00550 #define STAT_SNMPOUTPKTS 10 00551 #define STAT_SNMPINBADVERSIONS 11 00552 #define STAT_SNMPINBADCOMMUNITYNAMES 12 00553 #define STAT_SNMPINBADCOMMUNITYUSES 13 00554 #define STAT_SNMPINASNPARSEERRS 14 00555 /* 00556 * #define STAT_SNMPINBADTYPES 15 00557 */ 00558 #define STAT_SNMPINTOOBIGS 16 00559 #define STAT_SNMPINNOSUCHNAMES 17 00560 #define STAT_SNMPINBADVALUES 18 00561 #define STAT_SNMPINREADONLYS 19 00562 #define STAT_SNMPINGENERRS 20 00563 #define STAT_SNMPINTOTALREQVARS 21 00564 #define STAT_SNMPINTOTALSETVARS 22 00565 #define STAT_SNMPINGETREQUESTS 23 00566 #define STAT_SNMPINGETNEXTS 24 00567 #define STAT_SNMPINSETREQUESTS 25 00568 #define STAT_SNMPINGETRESPONSES 26 00569 #define STAT_SNMPINTRAPS 27 00570 #define STAT_SNMPOUTTOOBIGS 28 00571 #define STAT_SNMPOUTNOSUCHNAMES 29 00572 #define STAT_SNMPOUTBADVALUES 30 00573 /* 00574 * #define STAT_SNMPOUTREADONLYS 31 00575 */ 00576 #define STAT_SNMPOUTGENERRS 32 00577 #define STAT_SNMPOUTGETREQUESTS 33 00578 #define STAT_SNMPOUTGETNEXTS 34 00579 #define STAT_SNMPOUTSETREQUESTS 35 00580 #define STAT_SNMPOUTGETRESPONSES 36 00581 #define STAT_SNMPOUTTRAPS 37 00582 /* 00583 * AUTHTRAPENABLE 38 00584 */ 00585 #define STAT_SNMPSILENTDROPS 39 00586 #define STAT_SNMPPROXYDROPS 40 00587 #define STAT_SNMP_STATS_START STAT_SNMPINPKTS 00588 #define STAT_SNMP_STATS_END STAT_SNMPPROXYDROPS 00589 00590 /* 00591 * target mib counters 00592 */ 00593 #define STAT_SNMPUNAVAILABLECONTEXTS 41 00594 #define STAT_SNMPUNKNOWNCONTEXTS 42 00595 #define STAT_TARGET_STATS_START STAT_SNMPUNAVAILABLECONTEXTS 00596 #define STAT_TARGET_STATS_END STAT_SNMPUNKNOWNCONTEXTS 00597 00598 #define MAX_STATS 43 00599 00600 #ifdef __cplusplus 00601 } 00602 #endif 00603 #endif /* SNMP_API_H */
Last modified: Wednesday, 01-Aug-2018 04:41:28 UTC
For questions regarding web content and site functionality, please write to the net-snmp-users mail list.