1 /*_############################################################################
6 _## -----------------------------------------------
7 _## Copyright (c) 2001-2010 Jochen Katz, Frank Fock
9 _## This software is based on SNMP++2.6 from Hewlett Packard:
11 _## Copyright (c) 1996
12 _## Hewlett-Packard Company
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.
26 _## Stuttgart, Germany, Thu Sep 2 00:07:47 CEST 2010
28 _##########################################################################*/
30 // $Id: config_snmp_pp.h 1823 2010-08-25 21:59:53Z fock $
32 #ifndef _CONFIG_SNMP_PP_H_
33 #define _CONFIG_SNMP_PP_H_
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
40 //! The maximum size of a message that can be sent or received.
41 #define MAX_SNMP_PACKET 4096
44 #if defined (WIN32) && defined (SNMP_PP_DLL)
45 #ifdef SNMP_PP_EXPORTS
46 #define DLLOPT __declspec(dllexport)
49 #define DLLOPT __declspec(dllimport)
50 #define DLLOPT_TEMPL extern
58 // define SNMP_PP_IPv6 if you want to use IPv6
59 // #define SNMP_PP_IPv6
61 // define SNMP_PP_NAMESPACE to enclose all library names in Snmp_pp namespace
62 // #define SNMP_PP_NAMESPACE
64 // define _NO_SNMPv3 here or in the Makefile if you do not want to use SNMPv3
65 // (default is to use SNMPv3)
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
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
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)
84 // Enable 3DES Privacy (note this is not defined by a rfc)
85 // #define _USE_3DES_EDE
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
91 // define _NO_LOGGING if you do not want any logging output
92 // (increases performance drastically and minimizes memory consumption)
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
100 // define this if you want to send out broadcasts
101 #define SNMP_BROADCAST
105 //#define HAVE_POLL_SYSCALL
107 // Some older(?) compilers need a special declaration of
109 // #define _OLD_TEMPLATE_COLLECTION
111 // We have inet_aton() function if not compiling with VC++ or Borland C++
113 #ifndef __BCPLUSPLUS__
114 #define HAVE_INET_ATON
118 // If IPv6 is enabled assume that inet_pton() is available
119 // If IPv6 and gcc then assume gethostbyname2() is available
121 #define HAVE_INET_PTON
123 #define HAVE_GETHOSTBYNAME2
127 // can we use the reentrant version of these functions or
128 // are the standard functions thread safe
130 #define HAVE_LOCALTIME_R
131 #define HAVE_REENTRANT_LOCALTIME
132 #define HAVE_REENTRANT_GETHOSTBYADDR
133 #define HAVE_REENTRANT_GETHOSTBYNAME
134 #undef HAVE_GETHOSTBYNAME2
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
145 #define HAVE_LOCALTIME_R
146 #define HAVE_REENTRANT_LOCALTIME
148 #define HAVE_GETHOSTBYNAME_R
149 #define HAVE_LOCALTIME_R
150 #define HAVE_GETHOSTBYADDR_R
152 #define HAVE_REENTRANT_GETHOSTBYNAME
153 #define HAVE_LOCALTIME_R
154 #define HAVE_REENTRANT_GETHOSTBYADDR
156 #define HAVE_GETHOSTBYNAME_R
157 #define HAVE_LOCALTIME_R
158 #define HAVE_GETHOSTBYADDR_R
160 #define HAVE_REENTRANT_GETHOSTBYNAME
161 #define HAVE_LOCALTIME_R
162 #define HAVE_REENTRANT_GETHOSTBYADDR
164 #define HAVE_REENTRANT_GETHOSTBYNAME
165 #define HAVE_REENTRANT_LOCALTIME
166 #define HAVE_REENTRANT_GETHOSTBYADDR
168 #define HAVE_REENTRANT_GETHOSTBYNAME
169 #define HAVE_LOCALTIME_R
170 #define HAVE_REENTRANT_GETHOSTBYADDR
173 // Define a unsigned 64 bit integer:
176 #include <winsock2.h>
177 #include <ws2tcpip.h>
182 #ifdef __BCPLUSPLUS__
183 typedef unsigned __int64 pp_uint64;
185 typedef ULONGLONG pp_uint64;
188 typedef unsigned long long pp_uint64;
191 // Define a type used for sockets
193 typedef SOCKET SnmpSocket;
195 typedef int SnmpSocket;
198 #ifdef HAVE_POLL_SYSCALL
202 ///////////////////////////////////////////////////////////////////////
203 // Changes below this line should not be necessary
204 ///////////////////////////////////////////////////////////////////////
207 // Make use of mutable keyword
208 //#define SNMP_PP_MUTABLE mutable
209 #define SNMP_PP_MUTABLE
211 #define SAFE_INT_CAST(expr) ((int)(expr))
212 #define SAFE_UINT_CAST(expr) ((unsigned int)(expr))
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))
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
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
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
247 #endif // _NO_THREADS
260 #define _WIN32THREADS
275 #ifndef POSIX_THREADS
277 #define POSIX_THREADS
282 #endif // !_NO_THREADS
284 #endif // _CONFIG_SNMP_PP_H_