1
///////////////////////////////////////////////////////////////////////////
3
// Copyright (c) 2000-2003 Intel Corporation
4
// All rights reserved.
6
// Redistribution and use in source and binary forms, with or without
7
// modification, are permitted provided that the following conditions are met:
9
// * Redistributions of source code must retain the above copyright notice,
10
// this list of conditions and the following disclaimer.
11
// * Redistributions in binary form must reproduce the above copyright notice,
12
// this list of conditions and the following disclaimer in the documentation
13
// and/or other materials provided with the distribution.
14
// * Neither name of Intel Corporation nor the names of its contributors
15
// may be used to endorse or promote products derived from this software
16
// without specific prior written permission.
18
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
22
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
///////////////////////////////////////////////////////////////////////////
1
/**************************************************************************
3
* Copyright (c) 2000-2003 Intel Corporation
6
* Redistribution and use in source and binary forms, with or without
7
* modification, are permitted provided that the following conditions are met:
9
* - Redistributions of source code must retain the above copyright notice,
10
* this list of conditions and the following disclaimer.
11
* - Redistributions in binary form must reproduce the above copyright notice,
12
* this list of conditions and the following disclaimer in the documentation
13
* and/or other materials provided with the distribution.
14
* - Neither name of Intel Corporation nor the names of its contributors
15
* may be used to endorse or promote products derived from this software
16
* without specific prior written permission.
18
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
22
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
**************************************************************************/
32
33
#ifndef INTERNAL_CONFIG_H
33
34
#define INTERNAL_CONFIG_H
36
37
#include "autoconfig.h"
39
/** @name Compile time configuration options
41
* \name Compile time configuration options
40
43
* The Linux SDK for UPnP Devices contains some compile-time parameters
41
44
* that effect the behavior of the SDK. All configuration options are
42
45
* located in {\tt src/inc/config.h}.
47
/** @name THREAD_IDLE_TIME
52
* \name THREAD_IDLE_TIME
48
54
* The {\tt THREAD_IDLE_TIME} constant determines when a thread will be
49
55
* removed from the thread pool and returned to the operating system. When
50
56
* a thread in the thread pool has been idle for this number of milliseconds
51
57
* the thread will be released from the thread pool. The default value is
52
58
* 5000 milliseconds (5 seconds).
56
62
#define THREAD_IDLE_TIME 5000
59
/** @name JOBS_PER_THREAD
60
* The {\tt JOBS_PER_THREAD} constant determines when a new thread will be
61
* allocated to the thread pool inside the SDK. The thread pool will
62
* try and maintain this jobs/thread ratio. When the jobs/thread ratio
63
* becomes greater than this, then a new thread (up to the max) will be
64
* allocated to the thread pool. The default ratio is 10 jobs/thread.
67
* \name JOBS_PER_THREAD
69
* The {\tt JOBS_PER_THREAD} constant determines when a new thread will be
70
* allocated to the thread pool inside the SDK. The thread pool will
71
* try and maintain this jobs/thread ratio. When the jobs/thread ratio
72
* becomes greater than this, then a new thread (up to the max) will be
73
* allocated to the thread pool. The default ratio is 10 jobs/thread.
68
77
#define JOBS_PER_THREAD 10
72
* The {\tt MIN_THREADS} constant defines the minimum number of threads the
73
* thread pool inside the SDK will create. The thread pool will
74
* always have this number of threads. These threads are used
75
* for both callbacks into applications built on top of the SDK and also
76
* for making connections to other control points and devices. This number
77
* includes persistent threads. The default value is two threads.
84
* The {\tt MIN_THREADS} constant defines the minimum number of threads the
85
* thread pool inside the SDK will create. The thread pool will
86
* always have this number of threads. These threads are used
87
* for both callbacks into applications built on top of the SDK and also
88
* for making connections to other control points and devices. This number
89
* includes persistent threads. The default value is two threads.
81
93
#define MIN_THREADS 2
85
* The {\tt MAX_THREADS} constant defines the maximum number of threads the
86
* thread pool inside the SDK will create. These threads are used
87
* for both callbacks into applications built on top of the library and also
88
* for making connections to other control points and devices. It is not
89
* recommended that this value be below 10, since the threads are
90
* necessary for correct operation. This value can be increased for greater
91
* performance in operation at the expense of greater memory overhead. The
92
* default value is 12.
100
* The {\tt MAX_THREADS} constant defines the maximum number of threads the
101
* thread pool inside the SDK will create. These threads are used
102
* for both callbacks into applications built on top of the library and also
103
* for making connections to other control points and devices. It is not
104
* recommended that this value be below 10, since the threads are
105
* necessary for correct operation. This value can be increased for greater
106
* performance in operation at the expense of greater memory overhead. The
107
* default value is 12.
96
111
#define MAX_THREADS 12
99
/** @name MAX_JOBS_TOTAL
115
/*! \name MAX_JOBS_TOTAL
100
117
* The {\tt MAX_JOBS_TOTAL} constant determines the maximum number of jobs
101
118
* that can be queued. If this limit is reached further jobs will be thrown
102
119
* to avoid memory exhaustion. The default value 100.
103
120
* (Added by Axis.)
107
124
#define MAX_JOBS_TOTAL 100
110
/** @name DEFAULT_SOAP_CONTENT_LENGTH
129
* \name DEFAULT_SOAP_CONTENT_LENGTH
111
131
* SOAP messages will read at most {\tt DEFAULT_SOAP_CONTENT_LENGTH} bytes.
112
132
* This prevents devices that have a misbehaving web server to send
113
133
* a large amount of data to the control point causing it to crash.
114
134
* This can be adjusted dynamically with {\tt UpnpSetMaxContentLength}.
117
138
#define DEFAULT_SOAP_CONTENT_LENGTH 16000
120
/** @name NUM_SSDP_COPY
143
* \name NUM_SSDP_COPY
121
145
* This configuration parameter determines how many copies of each SSDP
122
146
* advertisement and search packets will be sent. By default it will send two
123
147
* copies of every packet.
126
151
#define NUM_SSDP_COPY 2
130
158
* This configuration parameter determines the pause between identical SSDP
131
159
* advertisement and search packets. The pause is measured in milliseconds
132
160
* and defaults to 100.
135
164
#define SSDP_PAUSE 100
138
/** @name WEB_SERVER_BUF_SIZE
168
* \name WEB_SERVER_BUF_SIZE
139
170
* This configuration parameter sets the maximum buffer size for the
140
* webserver. The default value is 1MB.
171
* webserver. The default value is 1MB.
143
175
#define WEB_SERVER_BUF_SIZE (1024*1024)
146
/** @name AUTO_RENEW_TIME
179
* \name AUTO_RENEW_TIME
147
181
* The {\tt AUTO_RENEW_TIME} is the time, in seconds, before a subscription
148
182
* expires that the SDK automatically resubscribes. The default
149
183
* value is 10 seconds. Setting this value too low can result in the
151
185
* subscription to timeout. In order to avoid continually resubscribing
152
186
* the minimum subscription time is five seconds more than the auto renew
157
191
#define AUTO_RENEW_TIME 10
160
/** @name CP_MINIMUM_SUBSCRIPTION_TIME
195
* \name CP_MINIMUM_SUBSCRIPTION_TIME
161
197
* The {\tt CP_MINIMUM_SUBSCRIPTION_TIME} is the minimum subscription time
162
198
* allowed for a control point using the SDK. Subscribing for less than
163
199
* this time automatically results in a subscription for this amount. The
164
200
* default value is 5 seconds more than the {\tt AUTO_RENEW_TIME}, or 15
169
205
#define CP_MINIMUM_SUBSCRIPTION_TIME (AUTO_RENEW_TIME + 5)
172
/** @name MAX_SEARCH_TIME
210
* \name MAX_SEARCH_TIME
173
212
* The {\tt MAX_SEARCH_TIME} is the maximum time
174
213
* allowed for an SSDP search by a control point. Searching for greater than
175
214
* this time automatically results in a search for this amount. The default
176
215
* value is 80 seconds.
180
219
#define MAX_SEARCH_TIME 80
183
/** @name MIN_SEARCH_TIME
224
* \name MIN_SEARCH_TIME
184
226
* The {\tt MIN_SEARCH_TIME} is the minimumm time
185
227
* allowed for an SSDP search by a control point. Searching for less than
186
228
* this time automatically results in a search for this amount. The default
187
229
* value is 2 seconds.
191
233
#define MIN_SEARCH_TIME 2
195
/** @name AUTO_ADVERTISEMENT_TIME
196
* The {\tt AUTO_ADVERTISEMENT_TIME} is the time, in seconds, before an
197
* device advertisements expires before a renewed advertisement is sent.
198
* The default time is 30 seconds.
238
* \name AUTO_ADVERTISEMENT_TIME
240
* The {\tt AUTO_ADVERTISEMENT_TIME} is the time, in seconds, before an
241
* device advertisements expires before a renewed advertisement is sent.
242
* The default time is 30 seconds.
202
246
#define AUTO_ADVERTISEMENT_TIME 30
205
/** @name SSDP_PACKET_DISTRIBUTE
206
* The {\tt SSDP_PACKET_DISTRIBUTE} enables the SSDP packets to be sent
207
* at an interval equal to half of the expiration time of SSDP packets
208
* minus the AUTO_ADVERTISEMENT_TIME. This is used to increase
209
* the probability of SSDP packets reaching to control points.
210
* It is recommended that this flag be turned on for embedded wireless
251
* \name SSDP_PACKET_DISTRIBUTE
253
* The {\tt SSDP_PACKET_DISTRIBUTE} enables the SSDP packets to be sent
254
* at an interval equal to half of the expiration time of SSDP packets
255
* minus the AUTO_ADVERTISEMENT_TIME. This is used to increase
256
* the probability of SSDP packets reaching to control points.
257
* It is recommended that this flag be turned on for embedded wireless
215
262
#define SSDP_PACKET_DISTRIBUTE 1
218
/** @name Module Exclusion
219
* Depending on the requirements, the user can selectively discard any of
220
* the major modules like SOAP, GENA, SSDP or the Internal web server. By
221
* default everything is included inside the SDK. By setting any of
222
* the values below to 0, that component will not be included in the final
225
* \item {\tt EXCLUDE_SOAP[0,1]}
226
* \item {\tt EXCLUDE_GENA[0,1]}
227
* \item {\tt EXCLUDE_SSDP[0,1]}
228
* \item {\tt EXCLUDE_DOM [0,1]}
229
* \item {\tt EXCLUDE_MINISERVER[0,1]}
230
* \item {\tt EXCLUDE_WEB_SERVER[0,1]}
231
* \item {\tt EXCLUDE_JNI[0,1]}
267
* \name Module Exclusion
269
* Depending on the requirements, the user can selectively discard any of
270
* the major modules like SOAP, GENA, SSDP or the Internal web server. By
271
* default everything is included inside the SDK. By setting any of
272
* the values below to 0, that component will not be included in the final
275
* \item {\tt EXCLUDE_SOAP[0,1]}
276
* \item {\tt EXCLUDE_GENA[0,1]}
277
* \item {\tt EXCLUDE_SSDP[0,1]}
278
* \item {\tt EXCLUDE_DOM [0,1]}
279
* \item {\tt EXCLUDE_MINISERVER[0,1]}
280
* \item {\tt EXCLUDE_WEB_SERVER[0,1]}
281
* \item {\tt EXCLUDE_JNI[0,1]}
237
286
#define EXCLUDE_SSDP 0
238
287
#define EXCLUDE_SOAP 0
239
288
#define EXCLUDE_GENA 0
246
295
# define EXCLUDE_JNI 1
251
/** @name DEBUG_TARGET
252
* The user has the option to redirect the library output debug messages
253
* to either the screen or to a log file. All the output messages with
254
* debug level 0 will go to {\tt upnp.err} and messages with debug level
255
* greater than zero will be redirected to {\tt upnp.out}.
303
* The user has the option to redirect the library output debug messages
304
* to either the screen or to a log file. All the output messages with
305
* debug level 0 will go to {\tt upnp.err} and messages with debug level
306
* greater than zero will be redirected to {\tt upnp.out}.
259
310
#define DEBUG_TARGET 1
263
/** @name Other debugging features
264
The UPnP SDK contains other features to aid in debugging:
265
see <upnp/inc/upnpdebug.h>
315
* \name Other debugging features
317
* The UPnP SDK contains other features to aid in debugging:
318
* see <upnp/inc/upnpdebug.h>
268
321
#define DEBUG_ALL 1
275
328
#define DEBUG_HTTP 0
276
329
#define DEBUG_API 0
278
//@} // Compile time configuration options
333
* @} Compile time configuration options
281
337
/***************************************************************************
282
* Do not change, Internal purpose only!!!
338
* Do not change, Internal purpose only!!!
283
339
***************************************************************************/
288
347
* Set additional defines based on requested configuration
291
// configure --enable-client
351
/* configure --enable-client */
292
352
#if UPNP_HAVE_CLIENT
293
353
# define INCLUDE_CLIENT_APIS 1
296
// configure --enable-device
357
/* configure --enable-device */
297
358
#if UPNP_HAVE_DEVICE
298
359
# define INCLUDE_DEVICE_APIS 1
301
// configure --enable-webserver --enable-device
363
/* configure --enable-webserver --enable-device */
302
364
#if UPNP_HAVE_WEBSERVER
303
365
# define INTERNAL_WEB_SERVER 1
308
#undef EXCLUDE_WEB_SERVER
309
#undef EXCLUDE_MINISERVER
369
#undef EXCLUDE_WEB_SERVER
370
#undef EXCLUDE_MINISERVER
310
371
#ifdef INTERNAL_WEB_SERVER
311
372
# define EXCLUDE_WEB_SERVER 0
312
373
# define EXCLUDE_MINISERVER 0