00001 /*_############################################################################ 00002 _## 00003 _## agent++.h 00004 _## 00005 _## 00006 _## AGENT++ API Version 3.5.30 00007 _## ----------------------------------------------- 00008 _## Copyright (C) 2000-2009 Frank Fock, Jochen Katz 00009 _## 00010 _## LICENSE AGREEMENT 00011 _## 00012 _## WHEREAS, Frank Fock and Jochen Katz are the owners of valuable 00013 _## intellectual property rights relating to the AGENT++ API and wish to 00014 _## license AGENT++ subject to the terms and conditions set forth below; 00015 _## and 00016 _## 00017 _## WHEREAS, you ("Licensee") acknowledge that Frank Fock and Jochen Katz 00018 _## have the right to grant licenses to the intellectual property rights 00019 _## relating to AGENT++, and that you desire to obtain a license to use 00020 _## AGENT++ subject to the terms and conditions set forth below; 00021 _## 00022 _## Frank Fock and Jochen Katz grants Licensee a non-exclusive, 00023 _## non-transferable, royalty-free license to use AGENT++ and related 00024 _## materials without charge provided the Licensee adheres to all of the 00025 _## terms and conditions of this Agreement. 00026 _## 00027 _## By downloading, using, or copying AGENT++ or any portion thereof, 00028 _## Licensee agrees to abide by the intellectual property laws and all 00029 _## other applicable laws of Germany, and to all of the terms and 00030 _## conditions of this Agreement, and agrees to take all necessary steps 00031 _## to ensure that the terms and conditions of this Agreement are not 00032 _## violated by any person or entity under the Licensee's control or in 00033 _## the Licensee's service. 00034 _## 00035 _## Licensee shall maintain the copyright and trademark notices on the 00036 _## materials within or otherwise related to AGENT++, and not alter, 00037 _## erase, deface or overprint any such notice. 00038 _## 00039 _## Except as specifically provided in this Agreement, Licensee is 00040 _## expressly prohibited from copying, merging, selling, leasing, 00041 _## assigning, or transferring in any manner, AGENT++ or any portion 00042 _## thereof. 00043 _## 00044 _## Licensee may copy materials within or otherwise related to AGENT++ 00045 _## that bear the author's copyright only as required for backup purposes 00046 _## or for use solely by the Licensee. 00047 _## 00048 _## Licensee may not distribute in any form of electronic or printed 00049 _## communication the materials within or otherwise related to AGENT++ 00050 _## that bear the author's copyright, including but not limited to the 00051 _## source code, documentation, help files, examples, and benchmarks, 00052 _## without prior written consent from the authors. Send any requests for 00053 _## limited distribution rights to fock@agentpp.com. 00054 _## 00055 _## Licensee hereby grants a royalty-free license to any and all 00056 _## derivatives based upon this software code base, that may be used 00057 _## as a SNMP agent development environment or a SNMP agent development 00058 _## tool. 00059 _## 00060 _## Licensee may modify the sources of AGENT++ for the Licensee's own 00061 _## purposes. Thus, Licensee may not distribute modified sources of 00062 _## AGENT++ without prior written consent from the authors. 00063 _## 00064 _## The Licensee may distribute binaries derived from or contained within 00065 _## AGENT++ provided that: 00066 _## 00067 _## 1) The Binaries are not integrated, bundled, combined, or otherwise 00068 _## associated with a SNMP agent development environment or SNMP agent 00069 _## development tool; and 00070 _## 00071 _## 2) The Binaries are not a documented part of any distribution material. 00072 _## 00073 _## 00074 _## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 00075 _## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00076 _## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00077 _## IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 00078 _## INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00079 _## (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00080 _## SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00081 _## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 00082 _## STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 00083 _## IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00084 _## POSSIBILITY OF SUCH DAMAGE. 00085 _## 00086 _## 00087 _## Stuttgart, Germany, Fri May 29 22:36:02 CEST 2009 00088 _## 00089 _##########################################################################*/ 00090 00091 #ifndef _agentpp_h_ 00092 #define _agentpp_h_ 00093 00094 #define AGENTPP_VERSION_STRING "3.5.30" 00095 #define AGENTPP_VERSION 3 00096 #define AGENTPP_RELEASE 5 00097 #define AGENTPP_PATCHLEVEL 30 00098 00099 // system dependend witches 00100 #ifndef NO_NANOSLEEP 00101 #define nanosleep nanosleep 00102 #endif 00103 00104 // Agent++ configuration options 00105 // 00106 // (Note that Agent++ and SNMP++ should be built with the same settings!) 00107 00108 // define _NO_LOGGING in snmp++/include/config_snmp_pp.h if you do not 00109 // want any logging output (increases performance drastically and 00110 // minimizes memory consumption) 00111 00112 // define _NO_THREADS in snmp++/include/config_snmp_pp.h if you do not 00113 // want thread support 00114 00115 // define _NO_SNMPv3 in snmp++/include/config_snmp_pp.h if you do not 00116 // want v3 support 00117 00118 // snmp_pp.h includes config_snmp_pp.h, which checks whether _SNMPv3 and 00119 // thread support are defined 00120 #include <snmp_pp/snmp_pp.h> 00121 00122 00123 // define _PROXY_FORWARDER for v1/v2c/v3 proxy agents 00124 #define _PROXY_FORWARDER 00125 00126 #include <snmp_pp/smi.h> 00127 00128 #define GENERIC_CLASS_SUCCESS 0 00129 #define GENERIC_CLASS_ERROR 1 00130 00131 #define GENERIC_CLASS_TYPE_MISMATCH -1 00132 00133 #ifndef TRUE 00134 #define TRUE 1 00135 #endif 00136 00137 #ifndef FALSE 00138 #define FALSE 0 00139 #endif 00140 00141 #ifndef boolean 00142 #define boolean int 00143 #endif 00144 00145 // internal "snmp" pdu types, used for internal mib updates 00146 // update: update one or more managed objects 00147 // NOTE: if the target object is a table object and 00148 // if the target object does not exist an new row is created 00149 // remove: remove one or more managed objects 00150 // NOTE: if the target object is a table object 00151 // the complete row is removed 00152 00153 #define MIB_UPDATE (aSN_UNIVERSAL | aSN_CONSTRUCTOR | 0x0A ) 00154 #define MIB_REMOVE (aSN_UNIVERSAL | aSN_CONSTRUCTOR | 0x0B ) 00155 00156 typedef enum { READING, WRITING } access_types; 00157 00158 #ifndef AGENTPP_DECL 00159 #if defined (WIN32) && defined (AGENT_PP_DLL) 00160 #ifdef AGENT_PP_EXPORTS 00161 #define AGENTPP_DECL __declspec(dllexport) 00162 #define AGENTPP_DECL_TEMPL 00163 #pragma warning (disable : 4018) // signed/unsigned mismatch when exporting templates 00164 #else 00165 #define AGENTPP_DECL __declspec(dllimport) 00166 #define AGENTPP_DECL_TEMPL extern 00167 #pragma warning (disable : 4231) // disable warnings on extern before template instantiation 00168 #endif 00169 #else 00170 #define AGENTPP_DECL 00171 // Seems that a eplicit extern declaration is needed on some 00172 // systems. If you encounter linking problems you may uncomment 00173 // the following: 00174 //#ifdef WIN32 00175 #define AGENTPP_DECL_TEMPL 00176 //#else 00177 // #define AGENTPP_DECL_TEMPL extern 00178 //#endif 00179 #endif 00180 #endif 00181 00182 #ifdef WIN32 00183 #define WIN32_LEAN_AND_MEAN 00184 // already included by config_snmp_pp.h: #include <winsock.h> 00185 #include <time.h> 00186 #include <process.h> 00187 #endif 00188 00189 // Options about program code alternatives 00190 00191 // undef this if you want to use OrderedList instead OrderedArray 00192 #define USE_ARRAY_TEMPLATE 00193 00194 // Define STATIC_REQUEST_LIST if you need a static RequestList in 00195 // Mib. 00196 //#define STATIC_REQUEST_LIST 00197 00198 // ThreadPool may not work on any system so disable it if you encounter 00199 // problems 00200 #ifdef _THREADS 00201 #define AGENTPP_USE_THREAD_POOL 00202 00203 // Use NO_FAST_MUTEXES on systems that do not allow a thread to unlock 00204 // a mutex it does not own. This has to be defined on WIN32 systems! 00205 #ifdef WIN32 00206 #define NO_FAST_MUTEXES 00207 #endif 00208 #endif //_THREADS 00209 00210 // SnmpRequest and SnmpRequestV3 use temporary Snmpx objects for sending 00211 // traps, informs and requests. The default is to create these objects 00212 // with listen address 0.0.0.0. If you define this, they are created 00213 // using the listen address of the RequestList. 00214 #define USE_LISTEN_ADDRESS_FOR_SENDING_TRAPS 00215 00216 00217 #ifdef __GNUC__ 00218 #if (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 91)) 00219 #define AGENTPP_NAMESPACE 00220 #endif 00221 #endif 00222 00223 #ifdef AGENTPP_NAMESPACE 00224 #define NS_AGENT Agentpp:: 00225 #else 00226 #define NS_AGENT 00227 #endif 00228 00229 #define DEFAULT_ENGINE_BOOTS_FILE "snmpv3_boot_counter" 00230 00231 #ifdef __APPLE__ 00232 // g++ 4.0.1 of MacOS X 10.5.6 does not like the template declarations 00233 #define AGENTPP_DECL_TEMPL_OIDLIST_MIBSTATICENTRY 00234 #define AGENTPP_DECL_TEMPL_LIST_MIBENTRY 00235 #define AGENTPP_DECL_TEMPL_OIDLIST_MIBENTRY 00236 #define AGENTPP_DECL_TEMPL_OIDLIST_MIBGROUP 00237 #define AGENTPP_DECL_TEMPL_LIST_MIBENTRY 00238 #define AGENTPP_DECL_TEMPL_LIST_MIBLEAF 00239 #define AGENTPP_DECL_TEMPL_ORDEREDLIST_MIBLEAF 00240 #define AGENTPP_DECL_TEMPL_ORDEREDARRAY_MIBLEAF 00241 #define AGENTPP_DECL_TEMPL_LIST_MIBTABLE 00242 #define AGENTPP_DECL_TEMPL_LIST_MIBTABLEROW 00243 #define AGENTPP_DECL_TEMPL_LIST_MIBTABLEVOTER 00244 #define AGENTPP_DECL_TEMPL_OIDLIST_MIBTABLEROW 00245 #define AGENTPP_DECL_TEMPL_ORDEREDLIST_MIBTABLEROW 00246 #define AGENTPP_DECL_TEMPL_ARRAY_MIBCONFIGFORMAT 00247 #define AGENTPP_DECL_TEMPL_OIDLIST_MIBCONTEXT 00248 #define AGENTPP_DECL_TEMPL_OIDLIST_PROXYFORWARDER 00249 #define AGENTPP_DECL_TEMPL_ARRAY_MIBENTRY 00250 #define AGENTPP_DECL_TEMPL_ARRAY_THREAD 00251 #define AGENTPP_DECL_TEMPL_ARRAY_TASKMANAGER 00252 #define AGENTPP_DECL_TEMPL_LIST_RUNNABLE 00253 #define AGENTPP_DECL_TEMPL_LIST_LOCKREQUEST 00254 #define AGENTPP_DECL_TEMPL_LIST_VIEWNAMEINDEX 00255 #endif 00256 00257 #endif // _agentpp_h_