ReactOS 0.4.16-dev-470-g91b8923
httpd_opts.h
Go to the documentation of this file.
1
6/*
7 * Copyright (c) 2001-2003 Swedish Institute of Computer Science.
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without modification,
11 * are permitted provided that the following conditions are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright notice,
14 * this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 * 3. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
22 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
24 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
30 * OF SUCH DAMAGE.
31 *
32 * This file is part of the lwIP TCP/IP stack.
33 *
34 * Author: Adam Dunkels <adam@sics.se>
35 *
36 * This version of the file has been modified by Texas Instruments to offer
37 * simple server-side-include (SSI) and Common Gateway Interface (CGI)
38 * capability.
39 */
40
41#ifndef LWIP_HDR_APPS_HTTPD_OPTS_H
42#define LWIP_HDR_APPS_HTTPD_OPTS_H
43
44#include "lwip/opt.h"
45#include "lwip/prot/iana.h"
46
64#if !defined LWIP_HTTPD_CGI || defined __DOXYGEN__
65#define LWIP_HTTPD_CGI 0
66#endif
67
79#if !defined LWIP_HTTPD_CGI_SSI || defined __DOXYGEN__
80#define LWIP_HTTPD_CGI_SSI 0
81#endif
82
100#if !defined LWIP_HTTPD_SSI || defined __DOXYGEN__
101#define LWIP_HTTPD_SSI 0
102#endif
103
108#if !defined LWIP_HTTPD_SSI_RAW || defined __DOXYGEN__
109#define LWIP_HTTPD_SSI_RAW 0
110#endif
111
122#if !defined LWIP_HTTPD_SSI_BY_FILE_EXTENSION || defined __DOXYGEN__
123#define LWIP_HTTPD_SSI_BY_FILE_EXTENSION 1
124#endif
125
130#if !defined LWIP_HTTPD_SSI_EXTENSIONS || defined __DOXYGEN__
131#define LWIP_HTTPD_SSI_EXTENSIONS ".shtml", ".shtm", ".ssi", ".xml", ".json"
132#endif
133
135#if !defined LWIP_HTTPD_SUPPORT_POST || defined __DOXYGEN__
136#define LWIP_HTTPD_SUPPORT_POST 0
137#endif
138
139/* The maximum number of parameters that the CGI handler can be sent. */
140#if !defined LWIP_HTTPD_MAX_CGI_PARAMETERS || defined __DOXYGEN__
141#define LWIP_HTTPD_MAX_CGI_PARAMETERS 16
142#endif
143
148#if !defined LWIP_HTTPD_SSI_MULTIPART || defined __DOXYGEN__
149#define LWIP_HTTPD_SSI_MULTIPART 0
150#endif
151
152/* The maximum length of the string comprising the SSI tag name
153 * ATTENTION: tags longer than this are ignored, not truncated!
154 */
155#if !defined LWIP_HTTPD_MAX_TAG_NAME_LEN || defined __DOXYGEN__
156#define LWIP_HTTPD_MAX_TAG_NAME_LEN 8
157#endif
158
159/* The maximum length of string that can be returned to replace any given tag
160 * If this buffer is not long enough, use LWIP_HTTPD_SSI_MULTIPART.
161 */
162#if !defined LWIP_HTTPD_MAX_TAG_INSERT_LEN || defined __DOXYGEN__
163#define LWIP_HTTPD_MAX_TAG_INSERT_LEN 192
164#endif
165
166#if !defined LWIP_HTTPD_POST_MANUAL_WND || defined __DOXYGEN__
167#define LWIP_HTTPD_POST_MANUAL_WND 0
168#endif
169
171#if !defined HTTPD_SERVER_AGENT || defined __DOXYGEN__
172#define HTTPD_SERVER_AGENT "lwIP/" LWIP_VERSION_STRING " (http://savannah.nongnu.org/projects/lwip)"
173#endif
174
180#if !defined LWIP_HTTPD_DYNAMIC_HEADERS || defined __DOXYGEN__
181#define LWIP_HTTPD_DYNAMIC_HEADERS 0
182#endif
183
184#if !defined HTTPD_DEBUG || defined __DOXYGEN__
185#define HTTPD_DEBUG LWIP_DBG_OFF
186#endif
187
194#if !defined HTTPD_USE_MEM_POOL || defined __DOXYGEN__
195#define HTTPD_USE_MEM_POOL 0
196#endif
197
199#if !defined HTTPD_SERVER_PORT || defined __DOXYGEN__
200#define HTTPD_SERVER_PORT LWIP_IANA_PORT_HTTP
201#endif
202
204#if !defined HTTPD_SERVER_PORT_HTTPS || defined __DOXYGEN__
205#define HTTPD_SERVER_PORT_HTTPS LWIP_IANA_PORT_HTTPS
206#endif
207
209#if !defined HTTPD_ENABLE_HTTPS || defined __DOXYGEN__
210#define HTTPD_ENABLE_HTTPS 0
211#endif
212
217#if !defined HTTPD_MAX_RETRIES || defined __DOXYGEN__
218#define HTTPD_MAX_RETRIES 4
219#endif
220
222#if !defined HTTPD_POLL_INTERVAL || defined __DOXYGEN__
223#define HTTPD_POLL_INTERVAL 4
224#endif
225
229#if !defined HTTPD_TCP_PRIO || defined __DOXYGEN__
230#define HTTPD_TCP_PRIO TCP_PRIO_MIN
231#endif
232
234#if !defined LWIP_HTTPD_TIMING || defined __DOXYGEN__
235#define LWIP_HTTPD_TIMING 0
236#endif
238#if !defined HTTPD_DEBUG_TIMING || defined __DOXYGEN__
239#define HTTPD_DEBUG_TIMING LWIP_DBG_OFF
240#endif
241
244#if !defined LWIP_HTTPD_SUPPORT_EXTSTATUS || defined __DOXYGEN__
245#define LWIP_HTTPD_SUPPORT_EXTSTATUS 0
246#endif
247
249#if !defined LWIP_HTTPD_SUPPORT_V09 || defined __DOXYGEN__
250#define LWIP_HTTPD_SUPPORT_V09 1
251#endif
252
257#if !defined LWIP_HTTPD_SUPPORT_11_KEEPALIVE || defined __DOXYGEN__
258#define LWIP_HTTPD_SUPPORT_11_KEEPALIVE 0
259#endif
260
262#if !defined LWIP_HTTPD_SUPPORT_REQUESTLIST || defined __DOXYGEN__
263#define LWIP_HTTPD_SUPPORT_REQUESTLIST 1
264#endif
265
266#if LWIP_HTTPD_SUPPORT_REQUESTLIST
269#if !defined LWIP_HTTPD_REQ_QUEUELEN || defined __DOXYGEN__
270#define LWIP_HTTPD_REQ_QUEUELEN 5
271#endif
272
275#if !defined LWIP_HTTPD_REQ_BUFSIZE || defined __DOXYGEN__
276#define LWIP_HTTPD_REQ_BUFSIZE LWIP_HTTPD_MAX_REQ_LENGTH
277#endif
278
282#if !defined LWIP_HTTPD_MAX_REQ_LENGTH || defined __DOXYGEN__
283#define LWIP_HTTPD_MAX_REQ_LENGTH LWIP_MIN(1023, (LWIP_HTTPD_REQ_QUEUELEN * PBUF_POOL_BUFSIZE))
284#endif
285#endif /* LWIP_HTTPD_SUPPORT_REQUESTLIST */
286
292#if !defined LWIP_HTTPD_MAX_REQUEST_URI_LEN || defined __DOXYGEN__
293#define LWIP_HTTPD_MAX_REQUEST_URI_LEN 63
294#endif
295
299#if !defined LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN || defined __DOXYGEN__
300#define LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN 63
301#endif
302
305#if !defined LWIP_HTTPD_SSI_INCLUDE_TAG || defined __DOXYGEN__
306#define LWIP_HTTPD_SSI_INCLUDE_TAG 1
307#endif
308
312#if !defined LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR || defined __DOXYGEN__
313#define LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR 0
314#endif
315
320#if !defined LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED || defined __DOXYGEN__
321#define LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED 0
322#endif
323
326#if !defined LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI || defined __DOXYGEN__
327#define LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI 0
328#endif
329
331#if !defined HTTP_IS_TAG_VOLATILE || defined __DOXYGEN__
332#define HTTP_IS_TAG_VOLATILE(ptr) TCP_WRITE_FLAG_COPY
333#endif
334
335/* By default, the httpd is limited to send 2*pcb->mss to keep resource usage low
336 when http is not an important protocol in the device. */
337#if !defined HTTPD_LIMIT_SENDING_TO_2MSS || defined __DOXYGEN__
338#define HTTPD_LIMIT_SENDING_TO_2MSS 1
339#endif
340
341/* Define this to a function that returns the maximum amount of data to enqueue.
342 The function have this signature: u16_t fn(struct altcp_pcb* pcb);
343 The best place to define this is the hooks file (@see LWIP_HOOK_FILENAME) */
344#if !defined HTTPD_MAX_WRITE_LEN || defined __DOXYGEN__
345#if HTTPD_LIMIT_SENDING_TO_2MSS
346#define HTTPD_MAX_WRITE_LEN(pcb) ((u16_t)(2 * altcp_mss(pcb)))
347#endif
348#endif
349
350/*------------------- FS OPTIONS -------------------*/
351
359#if !defined LWIP_HTTPD_CUSTOM_FILES || defined __DOXYGEN__
360#define LWIP_HTTPD_CUSTOM_FILES 0
361#endif
362
367#if !defined LWIP_HTTPD_DYNAMIC_FILE_READ || defined __DOXYGEN__
368#define LWIP_HTTPD_DYNAMIC_FILE_READ 0
369#endif
370
374#if !defined LWIP_HTTPD_FILE_STATE || defined __DOXYGEN__
375#define LWIP_HTTPD_FILE_STATE 0
376#endif
377
384#if !defined LWIP_HTTPD_FILE_EXTENSION || defined __DOXYGEN__
385#define LWIP_HTTPD_FILE_EXTENSION 0
386#endif
387
391#if !defined HTTPD_PRECALCULATED_CHECKSUM || defined __DOXYGEN__
392#define HTTPD_PRECALCULATED_CHECKSUM 0
393#endif
394
398#if !defined LWIP_HTTPD_FS_ASYNC_READ || defined __DOXYGEN__
399#define LWIP_HTTPD_FS_ASYNC_READ 0
400#endif
401
403#if !defined HTTPD_FSDATA_FILE || defined __DOXYGEN__
404/* HTTPD_USE_CUSTOM_FSDATA: Compatibility with deprecated lwIP option */
405#if defined(HTTPD_USE_CUSTOM_FSDATA) && (HTTPD_USE_CUSTOM_FSDATA != 0)
406#define HTTPD_FSDATA_FILE "fsdata_custom.c"
407#else
408#define HTTPD_FSDATA_FILE "fsdata.c"
409#endif
410#endif
411
416#endif /* LWIP_HDR_APPS_HTTPD_OPTS_H */