33 #ifndef __HTTPD_STRUCTS_H__
34 #define __HTTPD_STRUCTS_H__
47 #ifndef HTTPD_SERVER_AGENT
48 #define HTTPD_SERVER_AGENT "lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip)"
55 #ifndef LWIP_HTTPD_DYNAMIC_HEADERS
56 #define LWIP_HTTPD_DYNAMIC_HEADERS 0
60 #if LWIP_HTTPD_DYNAMIC_HEADERS
64 const char *extension;
69 static const char *
const g_psHTTPHeaderStrings[] =
71 "Content-type: text/html\r\n\r\n",
72 "Content-type: text/html\r\nExpires: Fri, 10 Apr 2008 14:00:00 GMT\r\nPragma: no-cache\r\n\r\n",
73 "Content-type: image/gif\r\n\r\n",
74 "Content-type: image/png\r\n\r\n",
75 "Content-type: image/jpeg\r\n\r\n",
76 "Content-type: image/bmp\r\n\r\n",
77 "Content-type: image/x-icon\r\n\r\n",
78 "Content-type: application/octet-stream\r\n\r\n",
79 "Content-type: application/x-javascript\r\n\r\n",
80 "Content-type: application/x-javascript\r\n\r\n",
81 "Content-type: text/css\r\n\r\n",
82 "Content-type: application/x-shockwave-flash\r\n\r\n",
83 "Content-type: text/xml\r\n\r\n",
84 "Content-type: text/plain\r\n\r\n",
85 "HTTP/1.0 200 OK\r\n",
86 "HTTP/1.0 404 File not found\r\n",
87 "HTTP/1.0 400 Bad Request\r\n",
88 "HTTP/1.0 501 Not Implemented\r\n",
89 "HTTP/1.1 200 OK\r\n",
90 "HTTP/1.1 404 File not found\r\n",
91 "HTTP/1.1 400 Bad Request\r\n",
92 "HTTP/1.1 501 Not Implemented\r\n",
94 "Connection: Close\r\n",
95 "Connection: keep-alive\r\n",
97 "\r\n<html><body><h2>404: The requested file cannot be found.</h2></body></html>\r\n"
101 #define HTTP_HDR_HTML 0 // text/html
102 #define HTTP_HDR_SSI 1 // text/html Expires...
103 #define HTTP_HDR_GIF 2 // image/gif
104 #define HTTP_HDR_PNG 3 // image/png
105 #define HTTP_HDR_JPG 4 // image/jpeg
106 #define HTTP_HDR_BMP 5 // image/bmp
107 #define HTTP_HDR_ICO 6 // image/x-icon
108 #define HTTP_HDR_APP 7 // application/octet-stream
109 #define HTTP_HDR_JS 8 // application/x-javascript
110 #define HTTP_HDR_RA 9 // application/x-javascript
111 #define HTTP_HDR_CSS 10 // text/css
112 #define HTTP_HDR_SWF 11 // application/x-shockwave-flash
113 #define HTTP_HDR_XML 12 // text/xml
114 #define HTTP_HDR_DEFAULT_TYPE 13 // text/plain
115 #define HTTP_HDR_OK 14 // 200 OK */
116 #define HTTP_HDR_NOT_FOUND 15 // 404 File not found
117 #define HTTP_HDR_BAD_REQUEST 16 // 400 Bad request
118 #define HTTP_HDR_NOT_IMPL 17 // 501 Not Implemented
119 #define HTTP_HDR_OK_11 18 // 200 OK
120 #define HTTP_HDR_NOT_FOUND_11 19 // 404 File not found
121 #define HTTP_HDR_BAD_REQUEST_11 20 // 400 Bad request
122 #define HTTP_HDR_NOT_IMPL_11 21 // 501 Not Implemented
123 #define HTTP_HDR_CONTENT_LENGTH 22 // Content-Length: (HTTP 1.1)
124 #define HTTP_HDR_CONN_CLOSE 23 // Connection: Close (HTTP 1.1)
125 #define HTTP_HDR_CONN_KEEPALIVE 24 // Connection: keep-alive (HTTP 1.1)
126 #define HTTP_HDR_SERVER 25 // Server: HTTPD_SERVER_AGENT
127 #define DEFAULT_404_HTML 26 // default 404 body
130 const static tHTTPHeader g_psHTTPHeaders[] =
132 {
"html", HTTP_HDR_HTML},
133 {
"htm", HTTP_HDR_HTML},
134 {
"shtml",HTTP_HDR_SSI},
135 {
"shtm", HTTP_HDR_SSI},
136 {
"ssi", HTTP_HDR_SSI},
137 {
"gif", HTTP_HDR_GIF},
138 {
"png", HTTP_HDR_PNG},
139 {
"jpg", HTTP_HDR_JPG},
140 {
"bmp", HTTP_HDR_BMP},
141 {
"ico", HTTP_HDR_ICO},
142 {
"class",HTTP_HDR_APP},
143 {
"cls", HTTP_HDR_APP},
144 {
"js", HTTP_HDR_JS},
145 {
"ram", HTTP_HDR_RA},
146 {
"css", HTTP_HDR_CSS},
147 {
"swf", HTTP_HDR_SWF},
148 {
"xml", HTTP_HDR_XML},
149 {
"xsl", HTTP_HDR_XML}
152 #define NUM_HTTP_HEADERS (sizeof(g_psHTTPHeaders) / sizeof(tHTTPHeader))
154 #endif // LWIP_HTTPD_DYNAMIC_HEADERS
157 static const char *
const g_pcSSIExtensions[] = {
158 ".shtml",
".shtm",
".ssi",
".xml"
160 #define NUM_SHTML_EXTENSIONS (sizeof(g_pcSSIExtensions) / sizeof(const char *))
161 #endif // LWIP_HTTPD_SSI
163 #endif // __HTTPD_STRUCTS_H__
#define HTTPD_SERVER_AGENT
Definition: httpd_structs.h:48