Prusa MINI Firmware overview
|
Go to the documentation of this file. 1 #ifndef LWIP_HTTPD_STRUCTS_H
2 #define LWIP_HTTPD_STRUCTS_H
6 #if LWIP_HTTPD_DYNAMIC_HEADERS
11 const char *extension;
12 const char *content_type;
17 static const char *
const g_psHTTPHeaderStrings[] =
19 "HTTP/1.0 200 OK\r\n",
20 "HTTP/1.0 404 File not found\r\n",
21 "HTTP/1.0 400 Bad Request\r\n",
22 "HTTP/1.0 501 Not Implemented\r\n",
23 "HTTP/1.1 200 OK\r\n",
24 "HTTP/1.1 404 File not found\r\n",
25 "HTTP/1.1 400 Bad Request\r\n",
26 "HTTP/1.1 501 Not Implemented\r\n",
28 "Connection: Close\r\n",
29 "Connection: keep-alive\r\n",
30 "Connection: keep-alive\r\nContent-Length: ",
32 "\r\n<html><body><h2>404: The requested file cannot be found.</h2></body></html>\r\n"
33 #if LWIP_HTTPD_SUPPORT_11_KEEPALIVE
34 ,
"Connection: keep-alive\r\nContent-Length: 77\r\n\r\n<html><body><h2>404: The requested file cannot be found.</h2></body></html>\r\n"
40 #define HTTP_HDR_NOT_FOUND 1
41 #define HTTP_HDR_BAD_REQUEST 2
42 #define HTTP_HDR_NOT_IMPL 3
43 #define HTTP_HDR_OK_11 4
44 #define HTTP_HDR_NOT_FOUND_11 5
45 #define HTTP_HDR_BAD_REQUEST_11 6
46 #define HTTP_HDR_NOT_IMPL_11 7
47 #define HTTP_HDR_CONTENT_LENGTH 8
48 #define HTTP_HDR_CONN_CLOSE 9
49 #define HTTP_HDR_CONN_KEEPALIVE 10
50 #define HTTP_HDR_KEEPALIVE_LEN 11
51 #define HTTP_HDR_SERVER 12
52 #define DEFAULT_404_HTML 13
53 #if LWIP_HTTPD_SUPPORT_11_KEEPALIVE
54 #define DEFAULT_404_HTML_PERSISTENT 14
58 #define HTTP_HDR_HTML "Content-type: text/html\r\n\r\n"
59 #define HTTP_HDR_SSI "Content-type: text/html\r\nExpires: Fri, 10 Apr 2008 14:00:00 GMT\r\nPragma: no-cache\r\n\r\n"
60 #define HTTP_HDR_GIF "Content-type: image/gif\r\n\r\n"
61 #define HTTP_HDR_PNG "Content-type: image/png\r\n\r\n"
62 #define HTTP_HDR_JPG "Content-type: image/jpeg\r\n\r\n"
63 #define HTTP_HDR_BMP "Content-type: image/bmp\r\n\r\n"
64 #define HTTP_HDR_ICO "Content-type: image/x-icon\r\n\r\n"
65 #define HTTP_HDR_APP "Content-type: application/octet-stream\r\n\r\n"
66 #define HTTP_HDR_JS "Content-type: application/javascript\r\n\r\n"
67 #define HTTP_HDR_RA "Content-type: application/javascript\r\n\r\n"
68 #define HTTP_HDR_CSS "Content-type: text/css\r\n\r\n"
69 #define HTTP_HDR_SWF "Content-type: application/x-shockwave-flash\r\n\r\n"
70 #define HTTP_HDR_XML "Content-type: text/xml\r\n\r\n"
71 #define HTTP_HDR_PDF "Content-type: application/pdf\r\n\r\n"
72 #define HTTP_HDR_JSON "Content-type: application/json\r\n\r\n"
74 #define HTTP_HDR_DEFAULT_TYPE "Content-type: text/plain\r\n\r\n"
79 static const tHTTPHeader g_psHTTPHeaders[] =
81 {
"html", HTTP_HDR_HTML},
82 {
"htm", HTTP_HDR_HTML},
83 {
"shtml",HTTP_HDR_SSI},
84 {
"shtm", HTTP_HDR_SSI},
85 {
"ssi", HTTP_HDR_SSI},
86 {
"gif", HTTP_HDR_GIF},
87 {
"png", HTTP_HDR_PNG},
88 {
"jpg", HTTP_HDR_JPG},
89 {
"bmp", HTTP_HDR_BMP},
90 {
"ico", HTTP_HDR_ICO},
91 {
"class",HTTP_HDR_APP},
92 {
"cls", HTTP_HDR_APP},
94 {
"ram", HTTP_HDR_RA},
95 {
"css", HTTP_HDR_CSS},
96 {
"swf", HTTP_HDR_SWF},
97 {
"xml", HTTP_HDR_XML},
98 {
"xsl", HTTP_HDR_XML},
99 {
"pdf", HTTP_HDR_PDF},
100 {
"json", HTTP_HDR_JSON}
103 #define NUM_HTTP_HEADERS (sizeof(g_psHTTPHeaders) / sizeof(tHTTPHeader))
108 static const char *
const g_pcSSIExtensions[] = {
109 ".shtml",
".shtm",
".ssi",
".xml"
111 #define NUM_SHTML_EXTENSIONS (sizeof(g_pcSSIExtensions) / sizeof(const char *))
#define HTTPD_TCP_PRIO
Definition: httpd_opts.h:152
#define HTTPD_MAX_WRITE_LEN(pcb)
Definition: httpd_opts.h:266
u16_t len
Definition: pbuf.h:159
#define LWIP_HTTPD_REQ_BUFSIZE
Definition: httpd_opts.h:198
int len
Definition: fs.h:58
int16_t s16_t
Definition: arch.h:122
const struct fsdata_file file__status_prnflow_svg[]
Definition: fsdata_custom.c:5077
#define LWIP_ASSERT(message, assertion)
Definition: debug.h:116
const struct fsdata_file file__status_heatbed_svg[]
Definition: fsdata_custom.c:5061
#define HTTPD_MAX_RETRIES
Definition: httpd_opts.h:140
uint16_t u16_t
Definition: arch.h:121
err_t fs_open(struct fs_file *file, const char *name)
Definition: fs.c:62
const struct fsdata_file file__spool_color_svg[]
Definition: fsdata_custom.c:5045
u16_t tot_len
Definition: pbuf.h:156
const struct fsdata_file file__404_html[]
Definition: fsdata_custom.c:4981
#define IP_ANY_TYPE
Definition: ip_addr.h:400
#define LWIP_MEMPOOL_INIT(name)
Definition: memp.h:117
#define TCP_SND_QUEUELEN
Definition: opt.h:1212
uint8_t data[8]
Definition: masstorage.h:49
uint32_t u32_t
Definition: arch.h:123
#define LWIP_HTTPD_REQ_QUEUELEN
Definition: httpd_opts.h:192
uint8_t i
Definition: screen_test_graph.c:72
const struct fsdata_file file__heated_bed_color_svg[]
Definition: fsdata_custom.c:5005
struct pbuf * next
Definition: pbuf.h:144
u8_t pbuf_free(struct pbuf *p)
Definition: pbuf.c:715
static const unsigned char data__404_html[]
Definition: fsdata.c:79
#define LWIP_DBG_TRACE
Definition: debug.h:83
const struct fsdata_file file__connect_black_svg[]
Definition: fsdata_custom.c:4997
#define file_NULL
Definition: fsdata_custom.c:6
const struct fsdata_file file__z_axis_color_svg[]
Definition: fsdata_custom.c:5101
char * lwip_strnstr(const char *buffer, const char *token, size_t n)
Definition: def.c:105
#define FSDATA_ALIGN_PRE
Definition: fsdata_custom.c:20
#define CRLF
Definition: connection.hpp:7
#define S32_F
Definition: arch.h:155
#define NULL
Definition: usbd_def.h:53
#define LWIP_MIN(x, y)
Definition: def.h:55
const struct fsdata_file file__status_z_axis_svg[]
Definition: fsdata_custom.c:5093
const struct fsdata_file file__index_js[]
Definition: fsdata_custom.c:5029
#define HTTP_IS_TAG_VOLATILE(ptr)
Definition: httpd_opts.h:253
u16_t pbuf_copy_partial(const struct pbuf *buf, void *dataptr, u16_t len, u16_t offset)
Definition: pbuf.c:1015
const struct fsdata_file file__index_css[]
Definition: fsdata_custom.c:5013
void fs_close(struct fs_file *file)
Definition: fs.c:101
void loop(void)
Definition: Marlin.cpp:1127
struct pbuf * pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
Definition: pbuf.c:248
static const unsigned int dummy_align__404_html
Definition: fsdata.c:78
static const unsigned char data__index_html[]
Definition: fsdata.c:138
u16_t pbuf_clen(const struct pbuf *p)
Definition: pbuf.c:800
uint8_t u8_t
Definition: arch.h:119
#define FS_FILE_FLAGS_HEADER_PERSISTENT
Definition: fsdata_custom.c:13
const struct fsdata_file file__status_prnspeed_svg[]
Definition: fsdata_custom.c:5085
u32_t sys_now(void)
Returns the current time in milliseconds when LWIP_TIMERS == 1 and NO_SYS == 1.
Definition: ethernetif.c:616
const struct fsdata_file file__status_filament_svg[]
Definition: fsdata_custom.c:5053
#define LWIP_MAX(x, y)
Definition: def.h:54
#define LWIP_HTTPD_SSI_MULTIPART
Definition: httpd_opts.h:88
static const unsigned int dummy_align__index_html
Definition: fsdata.c:137
#define LWIP_UNUSED_ARG(x)
Definition: arch.h:308
const char * data
Definition: fs.h:57
#define LWIP_HTTPD_MAX_REQ_LENGTH
Definition: httpd_opts.h:205
if(size<=((png_alloc_size_t) -1) - ob)
Definition: pngwrite.c:2176
void pbuf_ref(struct pbuf *p)
Definition: pbuf.c:820
void pbuf_cat(struct pbuf *h, struct pbuf *t)
Definition: pbuf.c:840
#define LWIP_HTTPD_MAX_CGI_PARAMETERS
Definition: httpd_opts.h:80
#define MEMCPY(dst, src, len)
Definition: opt.h:137
#define U16_F
Definition: arch.h:143
#define HTTPD_DEBUG_TIMING
Definition: httpd_opts.h:161
#define HTTPD_SERVER_PORT
Definition: httpd_opts.h:132
s8_t err_t
Definition: err.h:57
#define FSDATA_ALIGN_POST
Definition: fsdata_custom.c:23
void lwip_itoa(char *result, size_t bufsize, int number)
Definition: def.c:198
#define LWIP_HTTPD_SSI_RAW
Definition: httpd_opts.h:70
#define HTTPD_SERVER_AGENT
Definition: httpd_opts.h:107
#define SMEMCPY(dst, src, len)
Definition: opt.h:145
const struct fsdata_file file__speed_color_svg[]
Definition: fsdata_custom.c:5037
const struct fsdata_file file__index_html[]
Definition: fsdata_custom.c:5021
#define HTTPD_DEBUG
Definition: httpd_opts.h:120
#define LWIP_HTTPD_MAX_TAG_INSERT_LEN
Definition: httpd_opts.h:98
#define FS_READ_DELAYED
Definition: fs.h:43
int lwip_stricmp(const char *str1, const char *str2)
Definition: def.c:128
#define LWIP_MEMPOOL_DECLARE(name, num, size, desc)
Definition: memp.h:95
#define LWIP_DBG_LEVEL_WARNING
Definition: debug.h:55
void * mem_malloc(mem_size_t size)
Definition: mem.c:603
u8_t pbuf_header(struct pbuf *p, s16_t header_size_increment)
Definition: pbuf.c:665
#define FS_FILE_FLAGS_HEADER_INCLUDED
Definition: fsdata_custom.c:10
u8_t is_custom_file
Definition: fs.h:67
#define U32_F
Definition: arch.h:152
u16_t mem_size_t
Definition: mem.h:67
const unsigned char * name
Definition: fsdata.h:40
int fs_bytes_left(struct fs_file *file)
Definition: fs.c:176
#define HTTPD_POLL_INTERVAL
Definition: httpd_opts.h:145
png_uint_32 length
Definition: png.c:2247
void mem_free(void *rmem)
Definition: mem.c:419
#define LWIP_DEBUGF(debug, message)
Definition: debug.h:164
#define LWIP_HTTPD_MAX_TAG_NAME_LEN
Definition: httpd_opts.h:93
#define LWIP_HTTPD_FILE_STATE
Definition: httpd_opts.h:295
#define LWIP_HTTPD_POST_MANUAL_WND
Definition: httpd_opts.h:102
const struct fsdata_file file__calibration_color_svg[]
Definition: fsdata_custom.c:4989
void * payload
Definition: pbuf.h:147
#define lwip_strerr(x)
Definition: err.h:108
const struct fsdata_file file__status_nozzle_svg[]
Definition: fsdata_custom.c:5069