Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

snmperrs.h

Go to the documentation of this file.
00001 /*_############################################################################
00002   _## 
00003   _##  snmperrs.h  
00004   _##
00005   _##  SNMP++v3.2.15
00006   _##  -----------------------------------------------
00007   _##  Copyright (c) 2001-2004 Jochen Katz, Frank Fock
00008   _##
00009   _##  This software is based on SNMP++2.6 from Hewlett Packard:
00010   _##  
00011   _##    Copyright (c) 1996
00012   _##    Hewlett-Packard Company
00013   _##  
00014   _##  ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS.
00015   _##  Permission to use, copy, modify, distribute and/or sell this software 
00016   _##  and/or its documentation is hereby granted without fee. User agrees 
00017   _##  to display the above copyright notice and this license notice in all 
00018   _##  copies of the software and any documentation of the software. User 
00019   _##  agrees to assume all liability for the use of the software; 
00020   _##  Hewlett-Packard and Jochen Katz make no representations about the 
00021   _##  suitability of this software for any purpose. It is provided 
00022   _##  "AS-IS" without warranty of any kind, either express or implied. User 
00023   _##  hereby grants a royalty-free license to any and all derivatives based
00024   _##  upon this software code base. 
00025   _##  
00026   _##  Stuttgart, Germany, Tue Jan  4 21:42:42 CET 2005 
00027   _##  
00028   _##########################################################################*/
00029 /*===================================================================
00030 
00031   Copyright (c) 1999
00032   Hewlett-Packard Company
00033 
00034   ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS.
00035   Permission to use, copy, modify, distribute and/or sell this software
00036   and/or its documentation is hereby granted without fee. User agrees
00037   to display the above copyright notice and this license notice in all
00038   copies of the software and any documentation of the software. User
00039   agrees to assume all liability for the use of the software; Hewlett-Packard
00040   makes no representations about the suitability of this software for any
00041   purpose. It is provided "AS-IS without warranty of any kind,either express
00042   or implied. User hereby grants a royalty-free license to any and all
00043   derivatives based upon this software code base.
00044 
00045 
00046   SNMP++ S N M P E R R S. H
00047 
00048   SNMP++ ERROR CODE AND STRING DEFINITIONS
00049 
00050   DESCRIPTION:
00051   Definition of error macros and error strings
00052 
00053   DESIGN + AUTHOR:
00054   Jeff Meyer
00055 
00056   LANGUAGE:
00057   ANSI C++
00058 
00059   OPERATING SYSTEMS:
00060   WIN32
00061   BSD UNIX
00062 
00063 ============================================================================*/
00064 // $Id: snmperrs.h,v 1.5 2004/03/03 23:11:21 katz Exp $
00065 
00066 #ifndef _SNMPERRS_H
00067 #define _SNMPERRS_H
00068 
00069 #include "snmp_pp/config_snmp_pp.h"
00070 
00071 #ifdef SNMP_PP_NAMESPACE
00072 namespace Snmp_pp {
00073 #endif
00074 
00075 //-------[ Positive SNMP ++ Error Return Codes ]------------------------------
00076 /** @name Pdu error codes
00077  * These values are error status values from RFC 1905
00078  *
00079  * The values can be returned via Pdu::get_error_status()
00080  */
00081 //@{
00082 #define SNMP_ERROR_SUCCESS           0 //!< Success Status
00083 #define SNMP_ERROR_TOO_BIG           1 //!< Pdu encoding too big
00084 #define SNMP_ERROR_NO_SUCH_NAME      2 //!< No such VB name, see error index
00085 #define SNMP_ERROR_BAD_VALUE         3 //!< Bad Vb
00086 #define SNMP_ERROR_READ_ONLY         4 //!< VB is read only, see error index
00087 #define SNMP_ERROR_GENERAL_VB_ERR    5 //!< General VB error, see error index
00088 #define SNMP_ERROR_NO_ACCESS         6 //!< No access to MIBs data
00089 #define SNMP_ERROR_WRONG_TYPE        7 //!< Requested type was incorrect
00090 #define SNMP_ERROR_WRONG_LENGTH      8 //!< Request Pdu has inccorect length
00091 #define SNMP_ERROR_WRONG_ENCODING    9 //!< Request Pdu has wrong encoding
00092 #define SNMP_ERROR_WRONG_VALUE      10 //!< Request Pdu has wrong value
00093 #define SNMP_ERROR_NO_CREATION      11 //!< Unable to create object specified
00094 #define SNMP_ERROR_INCONSIST_VAL    12 //!< Inconsistent value in request
00095 #define SNMP_ERROR_RESOURCE_UNAVAIL 13 //!< Resources unavailable
00096 #define SNMP_ERROR_COMITFAIL        14 //!< Unable to comit
00097 #define SNMP_ERROR_UNDO_FAIL        15 //!< Unable to undo
00098 #define SNMP_ERROR_AUTH_ERR         16 //!< Authorization error
00099 #define SNMP_ERROR_NOT_WRITEABLE    17 //!< Mib Object not writeable
00100 #define SNMP_ERROR_INCONSIS_NAME    18 //!< Inconsistent naming used
00101 //@}
00102 
00103 //-------[ Negative SNMP ++ Result/Error Return Codes ]-------------------
00104 
00105 /** @name Snmp class return codes
00106  */
00107 //@{
00108 
00109 // General
00110 #define SNMP_CLASS_SUCCESS             0 //!< success
00111 #define SNMP_CLASS_ERROR              -1 //!< general error
00112 #define SNMP_CLASS_RESOURCE_UNAVAIL   -2 //!< e.g., malloc failed
00113 #define SNMP_CLASS_INTERNAL_ERROR     -3 //!< unexpected / internal error
00114 #define SNMP_CLASS_UNSUPPORTED        -4 //!< unsupported function
00115 
00116 // Callback reasons:
00117 #define SNMP_CLASS_TIMEOUT           -5 //!< outstanding request timed out
00118 #define SNMP_CLASS_ASYNC_RESPONSE    -6 //!< received response for outstd request
00119 #define SNMP_CLASS_NOTIFICATION      -7 //!< received notification (trap/inform)
00120 #define SNMP_CLASS_SESSION_DESTROYED -8 //!< snmp::destroyed with oustanding reqs pending
00121                                         
00122 // Snmp Class:
00123 #define SNMP_CLASS_INVALID           -10 //!< snmp::mf called on invalid instance
00124 #define SNMP_CLASS_INVALID_PDU       -11 //!< invalid pdu passed to mf
00125 #define SNMP_CLASS_INVALID_TARGET    -12 //!< invalid target passed to mf
00126 #define SNMP_CLASS_INVALID_CALLBACK  -13 //!< invalid callback to mf
00127 #define SNMP_CLASS_INVALID_REQID     -14 //!< invalid request id to cancel
00128 #define SNMP_CLASS_INVALID_NOTIFYID  -15 //!< missing trap/inform oid
00129 #define SNMP_CLASS_INVALID_OPERATION -16 //!< snmp operation not allowed for specified target
00130 #define SNMP_CLASS_INVALID_OID       -17 //!< invalid oid passed to mf
00131 #define SNMP_CLASS_INVALID_ADDRESS   -18 //!< invalid address passed to mf
00132 #define SNMP_CLASS_ERR_STATUS_SET    -19 //!< agent returned response pdu with error_status set
00133 
00134 // Transport Errors:
00135 #define SNMP_CLASS_TL_UNSUPPORTED    -20 //!< transport unsupported
00136 #define SNMP_CLASS_TL_IN_USE         -21 //!< transport in use
00137 #define SNMP_CLASS_TL_FAILED         -22 //!< transport operation failed
00138 
00139 // extras
00140 #define SNMP_CLASS_SHUTDOWN          -23 //!< used for back door shutdown
00141 
00142 // ASN.1 parse errors
00143 #define SNMP_CLASS_BADVERSION        -50 //!< unsupported version
00144 #define SNMP_CLASS_ASN1ERROR         -51 //!< used for ASN.1 parse errors
00145 //@}
00146 
00147 #define MAX_POS_ERROR                    SNMP_ERROR_INCONSIS_NAME
00148 #define MAX_NEG_ERROR                    SNMP_CLASS_SHUTDOWN
00149 
00150 
00151 #ifdef _INCLUDE_SNMP_ERR_STRINGS
00152 
00153 /**
00154  * ASCII strings returned through Snmp::error() function.
00155  *
00156  * @note altering the strings in this header file will not affect the
00157  *       return values of Snmp::error(), unless you rebuild the SNMP++
00158  *       library from source.
00159  */
00160 //@{
00161 static const char * pErrs[] = {
00162   "Success",                                                  // 0
00163   "SNMP: Response PDU Too Big",                               // 1
00164   "SNMP: Variable does not exist",                            // 2
00165   "SNMP: Cannot modify variable: Bad Value",                  // 3
00166   "SNMP: Cannot modify object, Read Only",                    // 4
00167   "SNMP: Cannot perform operation, General Error",            // 5
00168   "SNMP: Cannot access variable, No Access",                  // 6
00169   "SNMP: Cannot create/modify variable, Wrong Type",          // 7
00170   "SNMP: Cannot create/set variable, Wrong Length",           // 8
00171   "SNMP: Cannot create/set variable, Wrong Encoding",         // 9
00172   "SNMP: Cannot create/set variable, Wrong Value",            // 10
00173   "SNMP: Cannot create variable, Creation Not Allowed",       // 11
00174   "SNMP: Cannot create/set variable, Inconsistent Value",     // 12
00175   "SNMP: Cannot create/set variable, Resource Unavailable",   // 13
00176   "SNMP: Cannot create/set variable, Commit Failed",          // 14
00177   "SNMP: Cannot create/set variable, Undo Failed",            // 15
00178   "SNMP: Cannot perform operation, Authorization Error",      // 16
00179   "SNMP: Cannot create/set variable, Not Writable",           // 17
00180   "SNMP: Cannot create variable, Inconsistent Name",          // 18
00181   "SNMP: Unknown Error Status"                                // 19
00182 };
00183 
00184 #ifdef _SNMPv3
00185 static const char * nv3Errs[] = {
00186   "SNMPv3: v3MP error",                 // -1400
00187   "SNMPv3: v3MP ok",                    // -1401
00188   "SNMPv3: Unsupported Security Model", // -1402
00189   "SNMPv3: Message not in Time Window", // -1403
00190   "SNMPv3: received same Message twice",// -1404
00191   "SNMPv3: Invalid Message",            // -1405
00192   "SNMPv3: Invalid EngineID",           // -1406
00193   "SNMPv3: v3MP not initialized",       // -1407
00194   "SNMPv3: Parse Error",                // -1408
00195   "SNMPv3: Received Message with unknown MsgID",  // -1409
00196   "SNMPv3: Message does not match known message", // -1410
00197   "SNMPv3: Community format error",     // -1411
00198   "SNMPv3: Unknown UserName",           //-1412
00199   "SNMPv3: Build error",                //-1413
00200   "SNMPv3: USM: error",                 //-1414
00201   "SNMPv3: Unknown pdu handlers",       //-1415
00202   "SNMPv3: Unavailable Context",        //-1416
00203   "SNMPv3: Unknown Context",            //-1417
00204   "SNMPv3: Report sent",                //-1418
00205   "SNMPv3: Unknown errorcode"
00206 };
00207 
00208 static const char * pv3Errs[] = {
00209   "SNMPv3: USM: ok",                          // 1400
00210   "SNMPv3: USM: error",                       // 1401
00211   "SNMPv3: USM: Configfile write error",      // 1402
00212   "SNMPv3: USM: Unsupported SecurityLevel",   // 1403
00213   "SNMPv3: USM: Unknown SecurityName",        // 1404
00214   "SNMPv3: USM: Encryption error",            // 1405
00215   "SNMPv3: USM: Decryption error",            // 1406
00216   "SNMPv3: USM: Authentication error",        // 1407
00217   "SNMPv3: USM: Authentication failure",      // 1408
00218   "SNMPv3: USM: Parse error",                 // 1409
00219   "SNMPv3: USM: Unknown EngineID",            // 1410
00220   "SNMPv3: USM: Message not in TimeWindow",   // 1411
00221   "SNMPv3: USM: Unsupported AuthProtocol",    // 1412
00222   "SNMPv3: USM: Unsupported PrivProtocol"     // 1413
00223   "SNMPv3: USM: Address error",               // 1414
00224   "SNMPv3: USM: Could not create file",       // 1415
00225   "SNMPv3: USM: Could not open file",         // 1416
00226   "SNMPv3: USM: Could not rename file",       // 1417
00227   "SNMPv3: USM: Could not delete file",       // 1418
00228   "SNMPv3: USM: Could not write into file",   // 1419
00229   "SNMPv3: USM: Could not read from file",    // 1420
00230   "SNMPv3: USM: unknown errorcode"
00231 };
00232 #endif
00233 
00234 static const char * nErrs[] =
00235 {
00236   // General:
00237   "SNMP++: Success",                 // 0  SNMP_CLASS_SUCCESS
00238   "SNMP++: Operation failed",        // 1  SNMP_CLASS_ERROR
00239   "SNMP++: Resource unavailable",    // 2  SNMP_CLASS_RESOURCE_UNAVAIL
00240   "SNMP++: Internal error",          // 3  SNMP_CLASS_INTERNAL_ERROR
00241   "SNMP++: Unsupported function",    // 4  SNMP_CLASS_UNSUPPORTED
00242 
00243   // Callback reasons:
00244   "SNMP++: SNMP request timed out",  // 5  SNMP_CLASS_TIMEOUT
00245   "SNMP++: Received SNMP Response",  // 6  SNMP_CLASS_ASYNC_RESPONSE
00246                                      // 7  SNMP_CLASS_NOTIFICATION      
00247   "SNMP++: Received SNMP Notification (trap or inform)",
00248                                      // 8  SNMP_CLASS_SESSION_DESTROYED
00249   "SNMP++: Closing session with outstanding requests",
00250   "Unknown error code",              // 9  reserved for future
00251 
00252   // Snmp Class errors:
00253   "SNMP++: Class not valid",           // 10 SNMP_CLASS_INVALID
00254   "SNMP++: Invalid Pdu",               // 11 SNMP_CLASS_INVALID_PDU
00255   "SNMP++: Invalid Target",            // 12 SNMP_CLASS_INVALID_TARGET
00256   "SNMP++: Invalid (null) Callback Function", // 13 SNMP_CLASS_INVALID_CALLBACK
00257   "SNMP++: Invalid Request Id",        // 14 SNMP_CLASS_INVALID_REQID
00258   "SNMP++: Invalid Notification Id",   // 15 SNMP_CLASS_INVALID_NOTIFYID
00259                                        // 16 SNMP_CLASS_INVALID_OPERATION
00260   "SNMP++: SNMP Operation not supported on specified Target",
00261   "SNMP++: Invalid Object Identifier", // 17 SNMP_CLASS_INVALID_OID
00262   "SNMP++: Invalid Address",           // 18 SNMP_CLASS_INVALID_ADDRESS
00263                                        // 19 SNMP_CLASS_ERR_STATUS_SET
00264   "SNMP++: Agent indicates error in SNMP request",
00265 
00266   // Transport Errors:
00267   "SNMP++: Transport is not supported",  // 20 SNMP_CLASS_TL_UNSUPPORTED
00268   "SNMP++: Transport is in use",         // 21 SNMP_CLASS_TL_IN_USE
00269   "SNMP++: Transport operation failed",  // 22 SNMP_CLASS_TL_FAILED
00270   "SNMP++: Blocked Mode Shutdown",       // 23 SNMP_CLASS_SHUTDOWN
00271 
00272   "Unknown error code",  // unknown error code
00273 };
00274 //@}
00275 #endif //_INCLUDE_SNMP_ERR_STRINGS
00276 
00277 #ifdef SNMP_PP_NAMESPACE
00278 }; // end of namespace Snmp_pp
00279 #endif 
00280 
00281 #endif //_SNMPERRS_H

Generated on Tue Jan 4 22:42:14 2005 for SNMP++ by doxygen 1.3.2