ReactOS 0.4.16-dev-297-gc569aee
httpd.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_H
42#define LWIP_HDR_APPS_HTTPD_H
43
44#include "httpd_opts.h"
45#include "lwip/err.h"
46#include "lwip/pbuf.h"
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
52#if LWIP_HTTPD_CGI
53
84typedef const char *(*tCGIHandler)(int iIndex, int iNumParams, char *pcParam[],
85 char *pcValue[]);
86
92typedef struct
93{
94 const char *pcCGIName;
95 tCGIHandler pfnCGIHandler;
96} tCGI;
97
99void http_set_cgi_handlers(const tCGI *pCGIs, int iNumHandlers);
100
101#endif /* LWIP_HTTPD_CGI */
102
103#if LWIP_HTTPD_CGI || LWIP_HTTPD_CGI_SSI
104
105#if LWIP_HTTPD_CGI_SSI
106/* we have to prototype this struct here to make it available for the handler */
107struct fs_file;
108
115extern void httpd_cgi_handler(struct fs_file *file, const char* uri, int iNumParams,
116 char **pcParam, char **pcValue
118 , void *connection_state
119#endif /* LWIP_HTTPD_FILE_STATE */
120 );
121#endif /* LWIP_HTTPD_CGI_SSI */
122
123#endif /* LWIP_HTTPD_CGI || LWIP_HTTPD_CGI_SSI */
124
125#if LWIP_HTTPD_SSI
126
157typedef u16_t (*tSSIHandler)(
158#if LWIP_HTTPD_SSI_RAW
159 const char* ssi_tag_name,
160#else /* LWIP_HTTPD_SSI_RAW */
161 int iIndex,
162#endif /* LWIP_HTTPD_SSI_RAW */
163 char *pcInsert, int iInsertLen
164#if LWIP_HTTPD_SSI_MULTIPART
165 , u16_t current_tag_part, u16_t *next_tag_part
166#endif /* LWIP_HTTPD_SSI_MULTIPART */
167#if defined(LWIP_HTTPD_FILE_STATE) && LWIP_HTTPD_FILE_STATE
168 , void *connection_state
169#endif /* LWIP_HTTPD_FILE_STATE */
170 );
171
175void http_set_ssi_handler(tSSIHandler pfnSSIHandler,
176 const char **ppcTags, int iNumTags);
177
182#define HTTPD_SSI_TAG_UNKNOWN 0xFFFF
183
184#endif /* LWIP_HTTPD_SSI */
185
186#if LWIP_HTTPD_SUPPORT_POST
187
188/* These functions must be implemented by the application */
189
210err_t httpd_post_begin(void *connection, const char *uri, const char *http_request,
211 u16_t http_request_len, int content_len, char *response_uri,
212 u16_t response_uri_len, u8_t *post_auto_wnd);
213
224err_t httpd_post_receive_data(void *connection, struct pbuf *p);
225
237void httpd_post_finished(void *connection, char *response_uri, u16_t response_uri_len);
238
239#if LWIP_HTTPD_POST_MANUAL_WND
240void httpd_post_data_recved(void *connection, u16_t recved_len);
241#endif /* LWIP_HTTPD_POST_MANUAL_WND */
242
243#endif /* LWIP_HTTPD_SUPPORT_POST */
244
245void httpd_init(void);
246
247#if HTTPD_ENABLE_HTTPS
248struct altcp_tls_config;
249void httpd_inits(struct altcp_tls_config *conf);
250#endif
251
252#ifdef __cplusplus
253}
254#endif
255
256#endif /* LWIP_HDR_APPS_HTTPD_H */
void httpd_init(void)
GLfloat GLfloat p
Definition: glext.h:8902
uint8_t u8_t
Definition: arch.h:125
uint16_t u16_t
Definition: arch.h:127
#define LWIP_HTTPD_FILE_STATE
Definition: httpd_opts.h:375
s8_t err_t
Definition: err.h:96
const char * uri
Definition: sec_mgr.c:1588
static const char http_request[]
Definition: schannel.c:571
Definition: fci.c:127
Definition: fs.h:66
Definition: pbuf.h:186