00001 /*_############################################################################ 00002 _## 00003 _## agent++.h 00004 _## 00005 _## 00006 _## AGENT++ API Version 3.5.31 00007 _## ----------------------------------------------- 00008 _## Copyright (C) 2000-2010 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, Thu Sep 2 00:07:56 CEST 2010 00088 _## 00089 _##########################################################################*/ 00090 00091 #ifndef _agentpp_h_ 00092 #define _agentpp_h_ 00093 00094 #define AGENTPP_VERSION_STRING "3.5.31" 00095 #define AGENTPP_VERSION 3 00096 #define AGENTPP_RELEASE 5 00097 #define AGENTPP_PATCHLEVEL 31 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 #ifndef _PROXY_FORWARDER 00125 #define _PROXY_FORWARDER 00126 #endif 00127 00128 #include <snmp_pp/smi.h> 00129 00130 #ifndef GENERIC_CLASS_SUCCESS 00131 #define GENERIC_CLASS_SUCCESS 0 00132 #endif 00133 #ifndef GENERIC_CLASS_ERROR 00134 #define GENERIC_CLASS_ERROR 1 00135 #endif 00136 00137 #ifndef GENERIC_CLASS_TYPE_MISMATCH 00138 #define GENERIC_CLASS_TYPE_MISMATCH -1 00139 #endif 00140 00141 #ifndef TRUE 00142 #define TRUE 1 00143 #endif 00144 00145 #ifndef FALSE 00146 #define FALSE 0 00147 #endif 00148 00149 #ifndef boolean 00150 #define boolean int 00151 #endif 00152 00153 // internal "snmp" pdu types, used for internal mib updates 00154 // update: update one or more managed objects 00155 // NOTE: if the target object is a table object and 00156 // if the target object does not exist an new row is created 00157 // remove: remove one or more managed objects 00158 // NOTE: if the target object is a table object 00159 // the complete row is removed 00160 00161 #define MIB_UPDATE (aSN_UNIVERSAL | aSN_CONSTRUCTOR | 0x0A ) 00162 #define MIB_REMOVE (aSN_UNIVERSAL | aSN_CONSTRUCTOR | 0x0B ) 00163 00164 typedef enum { READING, WRITING } access_types; 00165 00166 #ifndef AGENTPP_DECL 00167 #if defined (WIN32) && defined (AGENT_PP_DLL) 00168 #ifdef AGENT_PP_EXPORTS 00169 #define AGENTPP_DECL __declspec(dllexport) 00170 #define AGENTPP_DECL_TEMPL 00171 #pragma warning (disable : 4018) // signed/unsigned mismatch when exporting templates 00172 #else 00173 #define AGENTPP_DECL __declspec(dllimport) 00174 #define AGENTPP_DECL_TEMPL extern 00175 #pragma warning (disable : 4231) // disable warnings on extern before template instantiation 00176 #endif 00177 #else 00178 #define AGENTPP_DECL 00179 // Seems that a eplicit extern declaration is needed on some 00180 // systems. If you encounter linking problems you may uncomment 00181 // the following: 00182 //#ifdef WIN32 00183 #define AGENTPP_DECL_TEMPL 00184 //#else 00185 // #define AGENTPP_DECL_TEMPL extern 00186 //#endif 00187 #endif 00188 #endif 00189 00190 #ifdef WIN32 00191 #define WIN32_LEAN_AND_MEAN 00192 // already included by config_snmp_pp.h: #include <winsock.h> 00193 #include <time.h> 00194 #include <process.h> 00195 #endif 00196 00197 // Options about program code alternatives 00198 00199 // undef this if you want to use OrderedList instead OrderedArray 00200 #define USE_ARRAY_TEMPLATE 00201 00202 // Define STATIC_REQUEST_LIST if you need a static RequestList in 00203 // Mib. 00204 //#define STATIC_REQUEST_LIST 00205 00206 // ThreadPool may not work on any system so disable it if you encounter 00207 // problems 00208 #ifdef _THREADS 00209 #define AGENTPP_USE_THREAD_POOL 00210 00211 // Use NO_FAST_MUTEXES on systems that do not allow a thread to unlock 00212 // a mutex it does not own. This has to be defined on WIN32 systems! 00213 #ifdef WIN32 00214 #define NO_FAST_MUTEXES 00215 #endif 00216 #endif //_THREADS 00217 00218 // SnmpRequest and SnmpRequestV3 use temporary Snmpx objects for sending 00219 // traps, informs and requests. The default is to create these objects 00220 // with listen address 0.0.0.0. If you define this, they are created 00221 // using the listen address of the RequestList. 00222 #define USE_LISTEN_ADDRESS_FOR_SENDING_TRAPS 00223 00224 00225 #ifdef __GNUC__ 00226 #if (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 91)) 00227 #ifndef AGENTPP_NAMESPACE 00228 #define AGENTPP_NAMESPACE 00229 #endif 00230 #endif 00231 #endif 00232 00233 #ifdef AGENTPP_NAMESPACE 00234 #define NS_AGENT Agentpp:: 00235 #else 00236 #define NS_AGENT 00237 #endif 00238 00239 #define DEFAULT_ENGINE_BOOTS_FILE "snmpv3_boot_counter" 00240 00241 #ifdef __APPLE__ 00242 // g++ 4.0.1 of MacOS X 10.5.6 does not like the template declarations 00243 #define AGENTPP_DECL_TEMPL_OIDLIST_MIBSTATICENTRY 00244 #define AGENTPP_DECL_TEMPL_LIST_MIBENTRY 00245 #define AGENTPP_DECL_TEMPL_OIDLIST_MIBENTRY 00246 #define AGENTPP_DECL_TEMPL_OIDLIST_MIBGROUP 00247 #define AGENTPP_DECL_TEMPL_LIST_MIBENTRY 00248 #define AGENTPP_DECL_TEMPL_LIST_MIBLEAF 00249 #define AGENTPP_DECL_TEMPL_ORDEREDLIST_MIBLEAF 00250 #define AGENTPP_DECL_TEMPL_ORDEREDARRAY_MIBLEAF 00251 #define AGENTPP_DECL_TEMPL_LIST_MIBTABLE 00252 #define AGENTPP_DECL_TEMPL_LIST_MIBTABLEROW 00253 #define AGENTPP_DECL_TEMPL_LIST_MIBTABLEVOTER 00254 #define AGENTPP_DECL_TEMPL_OIDLIST_MIBTABLEROW 00255 #define AGENTPP_DECL_TEMPL_ORDEREDLIST_MIBTABLEROW 00256 #define AGENTPP_DECL_TEMPL_ARRAY_MIBCONFIGFORMAT 00257 #define AGENTPP_DECL_TEMPL_OIDLIST_MIBCONTEXT 00258 #define AGENTPP_DECL_TEMPL_OIDLIST_PROXYFORWARDER 00259 #define AGENTPP_DECL_TEMPL_ARRAY_MIBENTRY 00260 #define AGENTPP_DECL_TEMPL_ARRAY_THREAD 00261 #define AGENTPP_DECL_TEMPL_ARRAY_TASKMANAGER 00262 #define AGENTPP_DECL_TEMPL_LIST_RUNNABLE 00263 #define AGENTPP_DECL_TEMPL_LIST_LOCKREQUEST 00264 #define AGENTPP_DECL_TEMPL_LIST_VIEWNAMEINDEX 00265 #endif 00266 00267 #endif // _agentpp_h_
1.5.6