TuyaOS
httpd_opts.h
浏览该文件的文档.
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
120#if !defined LWIP_HTTPD_SSI_BY_FILE_EXTENSION || defined __DOXYGEN__
121#define LWIP_HTTPD_SSI_BY_FILE_EXTENSION 1
122#endif
123
125#if !defined LWIP_HTTPD_SUPPORT_POST || defined __DOXYGEN__
126#define LWIP_HTTPD_SUPPORT_POST 0
127#endif
128
129/* The maximum number of parameters that the CGI handler can be sent. */
130#if !defined LWIP_HTTPD_MAX_CGI_PARAMETERS || defined __DOXYGEN__
131#define LWIP_HTTPD_MAX_CGI_PARAMETERS 16
132#endif
133
138#if !defined LWIP_HTTPD_SSI_MULTIPART || defined __DOXYGEN__
139#define LWIP_HTTPD_SSI_MULTIPART 0
140#endif
141
142/* The maximum length of the string comprising the SSI tag name
143 * ATTENTION: tags longer than this are ignored, not truncated!
144 */
145#if !defined LWIP_HTTPD_MAX_TAG_NAME_LEN || defined __DOXYGEN__
146#define LWIP_HTTPD_MAX_TAG_NAME_LEN 8
147#endif
148
149/* The maximum length of string that can be returned to replace any given tag
150 * If this buffer is not long enough, use LWIP_HTTPD_SSI_MULTIPART.
151 */
152#if !defined LWIP_HTTPD_MAX_TAG_INSERT_LEN || defined __DOXYGEN__
153#define LWIP_HTTPD_MAX_TAG_INSERT_LEN 192
154#endif
155
156#if !defined LWIP_HTTPD_POST_MANUAL_WND || defined __DOXYGEN__
157#define LWIP_HTTPD_POST_MANUAL_WND 0
158#endif
159
161#if !defined HTTPD_SERVER_AGENT || defined __DOXYGEN__
162#define HTTPD_SERVER_AGENT "lwIP/" LWIP_VERSION_STRING " (http://savannah.nongnu.org/projects/lwip)"
163#endif
164
170#if !defined LWIP_HTTPD_DYNAMIC_HEADERS || defined __DOXYGEN__
171#define LWIP_HTTPD_DYNAMIC_HEADERS 0
172#endif
173
174#if !defined HTTPD_DEBUG || defined __DOXYGEN__
175#define HTTPD_DEBUG LWIP_DBG_OFF
176#endif
177
184#if !defined HTTPD_USE_MEM_POOL || defined __DOXYGEN__
185#define HTTPD_USE_MEM_POOL 0
186#endif
187
189#if !defined HTTPD_SERVER_PORT || defined __DOXYGEN__
190#define HTTPD_SERVER_PORT LWIP_IANA_PORT_HTTP
191#endif
192
194#if !defined HTTPD_SERVER_PORT_HTTPS || defined __DOXYGEN__
195#define HTTPD_SERVER_PORT_HTTPS LWIP_IANA_PORT_HTTPS
196#endif
197
199#if !defined HTTPD_ENABLE_HTTPS || defined __DOXYGEN__
200#define HTTPD_ENABLE_HTTPS 0
201#endif
202
207#if !defined HTTPD_MAX_RETRIES || defined __DOXYGEN__
208#define HTTPD_MAX_RETRIES 4
209#endif
210
212#if !defined HTTPD_POLL_INTERVAL || defined __DOXYGEN__
213#define HTTPD_POLL_INTERVAL 4
214#endif
215
219#if !defined HTTPD_TCP_PRIO || defined __DOXYGEN__
220#define HTTPD_TCP_PRIO TCP_PRIO_MIN
221#endif
222
224#if !defined LWIP_HTTPD_TIMING || defined __DOXYGEN__
225#define LWIP_HTTPD_TIMING 0
226#endif
228#if !defined HTTPD_DEBUG_TIMING || defined __DOXYGEN__
229#define HTTPD_DEBUG_TIMING LWIP_DBG_OFF
230#endif
231
234#if !defined LWIP_HTTPD_SUPPORT_EXTSTATUS || defined __DOXYGEN__
235#define LWIP_HTTPD_SUPPORT_EXTSTATUS 0
236#endif
237
239#if !defined LWIP_HTTPD_SUPPORT_V09 || defined __DOXYGEN__
240#define LWIP_HTTPD_SUPPORT_V09 1
241#endif
242
247#if !defined LWIP_HTTPD_SUPPORT_11_KEEPALIVE || defined __DOXYGEN__
248#define LWIP_HTTPD_SUPPORT_11_KEEPALIVE 0
249#endif
250
252#if !defined LWIP_HTTPD_SUPPORT_REQUESTLIST || defined __DOXYGEN__
253#define LWIP_HTTPD_SUPPORT_REQUESTLIST 1
254#endif
255
256#if LWIP_HTTPD_SUPPORT_REQUESTLIST
259#if !defined LWIP_HTTPD_REQ_QUEUELEN || defined __DOXYGEN__
260#define LWIP_HTTPD_REQ_QUEUELEN 5
261#endif
262
265#if !defined LWIP_HTTPD_REQ_BUFSIZE || defined __DOXYGEN__
266#define LWIP_HTTPD_REQ_BUFSIZE LWIP_HTTPD_MAX_REQ_LENGTH
267#endif
268
272#if !defined LWIP_HTTPD_MAX_REQ_LENGTH || defined __DOXYGEN__
273#define LWIP_HTTPD_MAX_REQ_LENGTH LWIP_MIN(1023, (LWIP_HTTPD_REQ_QUEUELEN * PBUF_POOL_BUFSIZE))
274#endif
275#endif /* LWIP_HTTPD_SUPPORT_REQUESTLIST */
276
282#if !defined LWIP_HTTPD_MAX_REQUEST_URI_LEN || defined __DOXYGEN__
283#define LWIP_HTTPD_MAX_REQUEST_URI_LEN 63
284#endif
285
289#if !defined LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN || defined __DOXYGEN__
290#define LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN 63
291#endif
292
295#if !defined LWIP_HTTPD_SSI_INCLUDE_TAG || defined __DOXYGEN__
296#define LWIP_HTTPD_SSI_INCLUDE_TAG 1
297#endif
298
302#if !defined LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR || defined __DOXYGEN__
303#define LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR 0
304#endif
305
310#if !defined LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED || defined __DOXYGEN__
311#define LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED 0
312#endif
313
316#if !defined LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI || defined __DOXYGEN__
317#define LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI 0
318#endif
319
321#if !defined HTTP_IS_TAG_VOLATILE || defined __DOXYGEN__
322#define HTTP_IS_TAG_VOLATILE(ptr) TCP_WRITE_FLAG_COPY
323#endif
324
325/* By default, the httpd is limited to send 2*pcb->mss to keep resource usage low
326 when http is not an important protocol in the device. */
327#if !defined HTTPD_LIMIT_SENDING_TO_2MSS || defined __DOXYGEN__
328#define HTTPD_LIMIT_SENDING_TO_2MSS 1
329#endif
330
331/* Define this to a function that returns the maximum amount of data to enqueue.
332 The function have this signature: u16_t fn(struct altcp_pcb* pcb);
333 The best place to define this is the hooks file (@see LWIP_HOOK_FILENAME) */
334#if !defined HTTPD_MAX_WRITE_LEN || defined __DOXYGEN__
335#if HTTPD_LIMIT_SENDING_TO_2MSS
336#define HTTPD_MAX_WRITE_LEN(pcb) ((u16_t)(2 * altcp_mss(pcb)))
337#endif
338#endif
339
340/*------------------- FS OPTIONS -------------------*/
341
349#if !defined LWIP_HTTPD_CUSTOM_FILES || defined __DOXYGEN__
350#define LWIP_HTTPD_CUSTOM_FILES 0
351#endif
352
357#if !defined LWIP_HTTPD_DYNAMIC_FILE_READ || defined __DOXYGEN__
358#define LWIP_HTTPD_DYNAMIC_FILE_READ 0
359#endif
360
364#if !defined LWIP_HTTPD_FILE_STATE || defined __DOXYGEN__
365#define LWIP_HTTPD_FILE_STATE 0
366#endif
367
371#if !defined HTTPD_PRECALCULATED_CHECKSUM || defined __DOXYGEN__
372#define HTTPD_PRECALCULATED_CHECKSUM 0
373#endif
374
378#if !defined LWIP_HTTPD_FS_ASYNC_READ || defined __DOXYGEN__
379#define LWIP_HTTPD_FS_ASYNC_READ 0
380#endif
381
383#if !defined HTTPD_FSDATA_FILE || defined __DOXYGEN__
384/* HTTPD_USE_CUSTOM_FSDATA: Compatibility with deprecated lwIP option */
385#if defined(HTTPD_USE_CUSTOM_FSDATA) && (HTTPD_USE_CUSTOM_FSDATA != 0)
386#define HTTPD_FSDATA_FILE "fsdata_custom.c"
387#else
388#define HTTPD_FSDATA_FILE "fsdata.c"
389#endif
390#endif
391
396#endif /* LWIP_HDR_APPS_HTTPD_OPTS_H */