]> git.stg.codes - ssmd.git/blob - 3rdparty/snmp++/include/snmp_pp/config_snmp_pp.h
Initial adding
[ssmd.git] / 3rdparty / snmp++ / include / snmp_pp / config_snmp_pp.h
1 /*_############################################################################
2   _## 
3   _##  config_snmp_pp.h  
4   _##
5   _##  SNMP++v3.2.25
6   _##  -----------------------------------------------
7   _##  Copyright (c) 2001-2010 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, Thu Sep  2 00:07:47 CEST 2010 
27   _##  
28   _##########################################################################*/
29
30 // $Id: config_snmp_pp.h 1823 2010-08-25 21:59:53Z fock $
31
32 #ifndef _CONFIG_SNMP_PP_H_
33 #define _CONFIG_SNMP_PP_H_
34
35 #define SNMP_PP_VERSION_STRING "3.2.25"
36 #define SNMP_PP_VERSION 3
37 #define SNMP_PP_RELEASE 2
38 #define SNMP_PP_PATCHLEVEL 25
39
40 //! The maximum size of a message that can be sent or received.
41 #define MAX_SNMP_PACKET 4096
42
43 #ifndef DLLOPT
44 #if defined (WIN32) && defined (SNMP_PP_DLL)
45 #ifdef SNMP_PP_EXPORTS
46 #define DLLOPT __declspec(dllexport)
47 #define DLLOPT_TEMPL
48 #else
49 #define DLLOPT __declspec(dllimport)    
50 #define DLLOPT_TEMPL extern
51 #endif
52 #else
53 #define DLLOPT
54 #define DLLOPT_TEMPL
55 #endif
56 #endif
57
58 // define SNMP_PP_IPv6 if you want to use IPv6
59 // #define SNMP_PP_IPv6
60
61 // define SNMP_PP_NAMESPACE to enclose all library names in Snmp_pp namespace
62 // #define SNMP_PP_NAMESPACE
63
64 // define _NO_SNMPv3 here or in the Makefile if you do not want to use SNMPv3
65 // (default is to use SNMPv3)
66 // #define _NO_SNMPv3
67
68 // If you have not disabled SNMPv3, snmp++ will use libdes
69 // (separate package) as default.
70 // define _USE_LIBTOMCRYPT if you want to use libtomcrypt instead
71 // Note that _USE_OPENSSL will override libtomcrypt for SHA1, MD5, DES and AES.
72 // #define _USE_LIBTOMCRYPT
73
74 // If you define _USE_OPENSSL, snmp++ will use OpenSSL for SHA1,
75 // MD5, DES and AES. Please note that you will have to change the Makefiles
76 // of the examples: Add -lssl to the link command
77 // #define _USE_OPENSSL
78
79 // If you do not use SNMP++ for commercial purposes or if you
80 // have licensed IDEA (read README.v3) you may define the following
81 // to enable IDEA support. (note this is not defined by a rfc)
82 // #define _USE_IDEA
83
84 // Enable 3DES Privacy (note this is not defined by a rfc)
85 // #define _USE_3DES_EDE
86
87 // define _NO_THREADS here or in the Makefile if you do not want thread support
88 // (default is to include thread support)
89 // #define _NO_THREADS
90
91 // define _NO_LOGGING if you do not want any logging output 
92 // (increases performance drastically and minimizes memory consumption)
93 //#define _NO_LOGGING
94
95 // define _IPX_ADDRESS and/or _MAC_ADDRESS if you want to use the
96 // classess IpxAddress/IpxSockAddress and/or MacAddress
97 // #define _IPX_ADDRESS
98 // #define _MAC_ADDRESS
99
100 // define this if you want to send out broadcasts
101 #define SNMP_BROADCAST
102
103
104 // Not fully tested!
105 //#define HAVE_POLL_SYSCALL
106
107 // Some older(?) compilers need a special declaration of
108 // template classes
109 // #define _OLD_TEMPLATE_COLLECTION
110
111 // We have inet_aton() function if not compiling with VC++ or Borland C++
112 #ifndef _MSC_VER
113 #ifndef __BCPLUSPLUS__
114 #define HAVE_INET_ATON
115 #endif
116 #endif
117
118 // If IPv6 is enabled assume that inet_pton() is available
119 // If IPv6 and gcc then assume gethostbyname2() is available
120 #ifdef SNMP_PP_IPv6
121 #define HAVE_INET_PTON
122 #ifdef __GNUC__
123 #define HAVE_GETHOSTBYNAME2
124 #endif
125 #endif
126
127 // can we use the reentrant version of these functions or
128 // are the standard functions thread safe
129 #ifdef __CYGWIN32__
130 #define HAVE_LOCALTIME_R
131 #define HAVE_REENTRANT_LOCALTIME
132 #define HAVE_REENTRANT_GETHOSTBYADDR
133 #define HAVE_REENTRANT_GETHOSTBYNAME
134 #undef  HAVE_GETHOSTBYNAME2
135 #elif __MINGW32__
136 //FIXME: snmp++/src/address.cpp:865: error: `inet_ntop' was not declared in this scope
137 //FIXME: snmp++/src/address.cpp:988: error: `inet_pton' was not declared in this scope
138 //FIXME: snmp++/src/notifyqueue.cpp:538: error: `inet_pton' was not declared in this scope
139 #undef  HAVE_INET_ATON
140 #undef  HAVE_GETHOSTBYNAME2
141 #define HAVE_REENTRANT_GETHOSTBYNAME
142 #define HAVE_REENTRANT_LOCALTIME
143 #define HAVE_REENTRANT_GETHOSTBYADDR
144 #elif __APPLE__
145 #define HAVE_LOCALTIME_R
146 #define HAVE_REENTRANT_LOCALTIME
147 #elif __GNUC__
148 #define HAVE_GETHOSTBYNAME_R
149 #define HAVE_LOCALTIME_R
150 #define HAVE_GETHOSTBYADDR_R
151 #elif __DECCXX
152 #define HAVE_REENTRANT_GETHOSTBYNAME
153 #define HAVE_LOCALTIME_R
154 #define HAVE_REENTRANT_GETHOSTBYADDR
155 #elif __sun
156 #define HAVE_GETHOSTBYNAME_R
157 #define HAVE_LOCALTIME_R
158 #define HAVE_GETHOSTBYADDR_R
159 #elif __HP_aCC
160 #define HAVE_REENTRANT_GETHOSTBYNAME
161 #define HAVE_LOCALTIME_R
162 #define HAVE_REENTRANT_GETHOSTBYADDR
163 #elif _MSC_VER
164 #define HAVE_REENTRANT_GETHOSTBYNAME
165 #define HAVE_REENTRANT_LOCALTIME
166 #define HAVE_REENTRANT_GETHOSTBYADDR
167 #elif _AIX
168 #define HAVE_REENTRANT_GETHOSTBYNAME
169 #define HAVE_LOCALTIME_R
170 #define HAVE_REENTRANT_GETHOSTBYADDR
171 #endif
172
173 // Define a unsigned 64 bit integer:
174 #ifdef WIN32
175 #ifdef SNMP_PP_IPv6
176 #include <winsock2.h>
177 #include <ws2tcpip.h>
178 #else
179 #include <windows.h>
180 #include <winsock.h>
181 #endif
182 #ifdef __BCPLUSPLUS__
183 typedef unsigned __int64 pp_uint64;
184 #else
185 typedef ULONGLONG pp_uint64;
186 #endif
187 #else // not WIN32
188 typedef unsigned long long pp_uint64;
189 #endif
190
191 // Define a type used for sockets
192 #ifdef _MSC_VER
193     typedef SOCKET SnmpSocket;
194 #else
195     typedef int SnmpSocket;
196 #endif
197
198 #ifdef HAVE_POLL_SYSCALL
199 #include <poll.h>
200 #endif
201
202 ///////////////////////////////////////////////////////////////////////
203 // Changes below this line should not be necessary
204 ///////////////////////////////////////////////////////////////////////
205
206
207 // Make use of mutable keyword
208 //#define SNMP_PP_MUTABLE mutable
209 #define SNMP_PP_MUTABLE
210
211 #define SAFE_INT_CAST(expr)  ((int)(expr))
212 #define SAFE_UINT_CAST(expr) ((unsigned int)(expr))
213
214 // Safe until 32 bit second counter wraps to zero (time functions)
215 #define SAFE_LONG_CAST(expr)  ((long)(expr))
216 #define SAFE_ULONG_CAST(expr) ((unsigned long)(expr))
217
218 #ifndef _NO_THREADS
219
220 #ifndef HAVE_REENTRANT_LOCALTIME
221 #ifndef HAVE_LOCALTIME_R
222 // If you see this warning, and your system has a reentrant localtime
223 // or localtime_r function report your compiler, OS,... to the authors
224 // of this library, so that these settings can be changed
225 #warning Threads_defined_but_no_reentrant_LOCALTIME_function
226 #endif
227 #endif
228
229 #ifndef HAVE_GETHOSTBYADDR_R
230 #ifndef HAVE_REENTRANT_GETHOSTBYADDR
231 // If you see this warning, and your system has a reentrant localtime
232 // or localtime_r function report your compiler, OS,... to the authors
233 // of this library, so that these settings can be changed
234 #warning Threads_defined_but_no_reentrant_GETHOSTBYADDR_function
235 #endif
236 #endif
237
238 #ifndef HAVE_GETHOSTBYNAME_R
239 #ifndef HAVE_REENTRANT_GETHOSTBYNAME
240 // If you see this warning, and your system has a reentrant localtime
241 // or localtime_r function report your compiler, OS,... to the authors
242 // of this library, so that these settings can be changed
243 #warning Threads_defined_but_no_reentrant_GETHOSTBYNAME_function
244 #endif
245 #endif
246
247 #endif // _NO_THREADS
248
249
250 #ifndef _NO_SNMPv3
251 #ifndef _SNMPv3
252 #define _SNMPv3
253 #endif
254 #endif
255
256 #ifndef _NO_THREADS
257 #ifdef WIN32
258
259 #ifndef _THREADS
260 #define _WIN32THREADS
261 #define VC_EXTRALEAN
262 #define _THREADS
263 #endif
264
265 #else  // !WIN32
266
267 #ifndef _THREADS
268 #define _THREADS
269 #endif
270
271 #ifdef __APPLE__
272 #define __unix
273 #endif
274
275 #ifndef POSIX_THREADS
276 #ifdef __unix
277 #define POSIX_THREADS
278 #endif
279 #endif
280
281 #endif // WIN32
282 #endif // !_NO_THREADS
283
284 #endif // _CONFIG_SNMP_PP_H_