uIP 1.0 based webserver for LPC1114 + ENC28J60

Dependencies:   mbed TMP102

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers httpd-fs-data.h Source File

httpd-fs-data.h

00001 static const unsigned char data_processes_shtml[] =
00002     /* /processes.shtml */
00003     "%!: /header.html\n"
00004     "<h1>System processes</h1><br><table width=\"100%\">\n"
00005     "<tr><th>ID</th><th>Name</th><th>Priority</th><th>Poll handler</th><th>Event handler</th><th>Procstate</th></tr>\n"
00006     "%! processes\n"
00007     "%!: /footer.html";
00008 
00009 static const unsigned char data_404_html[] =
00010     /* /404.html */
00011     "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"
00012     "<html>\n"
00013     "  <head>\n"
00014     "    <title>Welcome to the uIP web server!</title>\n"
00015     "    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n"
00016     "  </head>\n"
00017     "  <body bgcolor=\"white\">\n"
00018     "    <center>\n"
00019     "      <h1>404 - file not found</h1>\n"
00020     "      <h3>Go <a href=\"/\">here</a> instead.</h3>\n"
00021     "    </center>\n"
00022     "  </body>\n"
00023     "</html>\n";
00024 
00025 static const unsigned char data_files_shtml[] =
00026     /* /files.shtml */
00027     "%!: /header.html\n"
00028     "<h1>File statistics</h1>\n"
00029     "<center>\n"
00030     "<table width=\"300\">\n"
00031     "<tr><td><a href=\"/index.html\">/index.html</a></td>\n"
00032     "<td>%! file-stats /index.html\n"
00033     "</td><td><img src=\"/fade.png\" height=\"10\" width=\"%! file-stats /index.html\n"
00034     "\" alt=\"\"></td></tr>\n"
00035     "<tr><td><a href=\"/files.shtml\">/files.shtml</a></td>\n"
00036     "<td>%! file-stats /files.shtml\n"
00037     "</td><td><img src=\"/fade.png\" height=\"10\" width=\"%! file-stats /files.shtml\n"
00038     "\" alt=\"\"></td></tr>\n"
00039     "<tr><td><a href=\"/tcp.shtml\">/tcp.shtml</a></td>\n"
00040     "<td>%! file-stats /tcp.shtml\n"
00041     "</td><td><img src=\"/fade.png\" height=\"10\" width=\"%! file-stats /tcp.shtml\n"
00042     "\" alt=\"\"></td></tr>\n"
00043     "<tr><td><a href=\"/stats.shtml\">/stats.shtml</a></td>\n"
00044     "<td>%! file-stats /stats.shtml\n"
00045     "</td><td><img src=\"/fade.png\" height=\"10\" width=\"%! file-stats /stats.shtml\n"
00046     "\" alt=\"\"></td></tr>\n"
00047     "<tr><td><a href=\"/style.css\">/style.css</a></td>\n"
00048     "<td>%! file-stats /style.css\n"
00049     "</td><td><img src=\"/fade.png\" height=\"10\" width=\"%! file-stats /style.css\n"
00050     "\" alt=\"\"></td></tr>\n"
00051     "<tr><td><a href=\"/404.html\">/404.html</a></td>\n"
00052     "<td>%! file-stats /404.html\n"
00053     "</td><td><img src=\"/fade.png\" height=\"10\" width=\"%! file-stats /404.html\n"
00054     "\" alt=\"\"></td></tr>\n"
00055     "<tr><td><a href=\"/fade.png\">/fade.png</a></td>\n"
00056     "<td>%! file-stats /fade.png\n"
00057     "</td><td><img src=\"/fade.png\" height=\"10\" width=\"%! file-stats /fade.png\n"
00058     "\" alt=\"\"></td></tr>\n"
00059     "</table>\n"
00060     "</center>\n"
00061     "%!: /footer.html";
00062 
00063 static const unsigned char data_footer_html[] =
00064     /* /footer.html */
00065     "  </div>\n"
00066     "\n"
00067     "  </body>\n"
00068     "</html>\n";
00069 
00070 static const unsigned char data_header_html[] =
00071     /* /header.html */
00072     "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"
00073     "<html>\n"
00074     "  <head>\n"
00075     "    <title>Welcome to the uIP web server!</title>\n"
00076     "    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n"
00077     "  </head>\n"
00078     "  <body bgcolor=\"#fffeec\" text=\"black\">\n"
00079     "\n"
00080     "  <div class=\"menu\">\n"
00081     "  <div class=\"menubox\"><a href=\"/\">Front page</a></div>\n"
00082     "  <div class=\"menubox\"><a href=\"files.shtml\">File statistics</a></div>\n"
00083     "  <div class=\"menubox\"><a href=\"stats.shtml\">Network statistics</a></div>\n"
00084     "  <div class=\"menubox\"><a href=\"tcp.shtml\">Network connections</a></div>\n"
00085     "  <div class=\"menubox\"><a href=\"temp.shtml\">Temperature sensor</a></div>\n"
00086     "  <br>\n"
00087     "  </div>\n"
00088     "\n"
00089     "  <div class=\"contentblock\">\n";
00090 
00091 static const unsigned char data_index_html[] =
00092     /* /index.html */
00093     "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"
00094     "<html>\n"
00095     "  <head>\n"
00096     "    <title>Welcome to the uIP web server!</title>\n"
00097     "    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n"
00098     "  </head>\n"
00099     "  <body bgcolor=\"#fffeec\" text=\"black\">\n"
00100     "\n"
00101     "  <div class=\"menu\">\n"
00102     "  <div class=\"menubox\"><a href=\"/\">Front page</a></div>\n"
00103     "  <div class=\"menubox\"><a href=\"files.shtml\">File statistics</a></div>\n"
00104     "  <div class=\"menubox\"><a href=\"stats.shtml\">Network statistics</a></div>\n"
00105     "  <div class=\"menubox\"><a href=\"tcp.shtml\">Network connections</a></div>\n"
00106     "  <div class=\"menubox\"><a href=\"temp.shtml\">Temperature sensor</a></div>\n"
00107     "  <br>\n"
00108     "  </div>\n"
00109     "\n"
00110     "  <div class=\"contentblock\">\n"
00111     "  <p>\n"
00112     "  These web pages are served by a small web server running on top of\n"
00113     "  the <a href=\"http://www.sics.se/~adam/uip/\">uIP embedded TCP/IP stack</a>.\n"
00114     "  </p>\n"
00115     "  <p>\n"
00116     "  Click on the links above for web server statistics.\n"
00117     "  </p>\n"
00118     "  </div>\n"
00119     "\n"
00120     "  </body>\n"
00121     "</html>\n";
00122 
00123 static const unsigned char data_style_css[] =
00124     /* /style.css */
00125     "h1\n"
00126     "{\n"
00127     "  text-align:center;\n"
00128     "  font-size:14pt;\n"
00129     "  font-family:arial,helvetica;\n"
00130     "  font-weight:bold;\n"
00131     "  padding:10px;\n"
00132     "}\n"
00133     "\n"
00134     "body\n"
00135     "{\n"
00136     "  background-color:#fffeec;\n"
00137     "  color:black;\n"
00138     "\n"
00139     "  font-size:8pt;\n"
00140     "  font-family:arial,helvetica;\n"
00141     "}\n"
00142     "\n"
00143     ".menu\n"
00144     "{\n"
00145     "  margin:4px;\n"
00146     "  width:80%;\n"
00147     "  min-width:600px;\n"
00148     "\n"
00149     "  padding:2px;\n"
00150     "\n"
00151     "  border:solid 1px;\n"
00152     "  background-color:#fffcd2;\n"
00153     "  text-align:left;\n"
00154     "\n"
00155     "  font-size:9pt;\n"
00156     "  font-family:arial,helvetica;\n"
00157     "}\n"
00158     "\n"
00159     "div.menubox\n"
00160     "{\n"
00161     "  width:20%;\n"
00162     "  border:0;\n"
00163     "  float:left;\n"
00164     "  text-align:center;\n"
00165     "}\n"
00166     "\n"
00167     ".contentblock\n"
00168     "{\n"
00169     "  margin:4px;\n"
00170     "  width:80%;\n"
00171     "  min-width:600px;\n"
00172     "\n"
00173     "  padding:2px;\n"
00174     "\n"
00175     "  border:1px dotted;\n"
00176     "  background-color:white;\n"
00177     "\n"
00178     "  font-size:8pt;\n"
00179     "  font-family:arial,helvetica;\n"
00180     "\n"
00181     "}\n"
00182     "\n"
00183     "p.intro\n"
00184     "{\n"
00185     "  margin-left:20px;\n"
00186     "  margin-right:20px;\n"
00187     "\n"
00188     "  font-size:10pt;\n"
00189     "/*  font-weight:bold; */\n"
00190     "  font-family:arial,helvetica;\n"
00191     "}\n"
00192     "\n"
00193     "p.clink\n"
00194     "{\n"
00195     "  font-size:12pt;\n"
00196     "  font-family:courier,monospace;\n"
00197     "  text-align:center;\n"
00198     "}\n"
00199     "\n"
00200     "p.clink9\n"
00201     "{\n"
00202     "  font-size:9pt;\n"
00203     "  font-family:courier,monospace;\n"
00204     "  text-align:center;\n"
00205     "}\n"
00206     "\n"
00207     "p\n"
00208     "{\n"
00209     "  padding-left:10px;\n"
00210     "}\n"
00211     "\n"
00212     "p.right\n"
00213     "{\n"
00214     "  text-align:right;\n"
00215     "}\n"
00216     "\n";
00217 
00218 static const unsigned char data_tcp_shtml[] =
00219     /* /tcp.shtml */
00220     "%!: /header.html\n"
00221     "<h1>Current connections</h1><br>\n"
00222     "<table width=\"100%\">\n"
00223     "<tr><th>Local</th><th>Remote</th><th>State</th><th>Retransmissions</th><th>Timer</th><th>Flags</th></tr>\n"
00224     "%! tcp-connections\n"
00225     "</table>\n"
00226     "%!: /footer.html";
00227 
00228 static const unsigned char data_fade_png[] = {
00229     /* /fade.png */
00230     0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 
00231     0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x04, 
00232     0x00, 0x00, 0x00, 0x0a, 0x08, 0x02, 0x00, 0x00, 0x00, 0x1c, 
00233     0x99, 0x68, 0x59, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 
00234     0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00, 0x0b, 0x13, 0x01, 
00235     0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, 0x07, 0x74, 0x49, 
00236     0x4d, 0x45, 0x07, 0xd6, 0x06, 0x08, 0x14, 0x1b, 0x39, 0xaf, 
00237     0x5b, 0xc0, 0xe3, 0x00, 0x00, 0x00, 0x1d, 0x74, 0x45, 0x58, 
00238     0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x00, 0x43, 
00239     0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 
00240     0x68, 0x20, 0x54, 0x68, 0x65, 0x20, 0x47, 0x49, 0x4d, 0x50, 
00241     0xef, 0x64, 0x25, 0x6e, 0x00, 0x00, 0x00, 0x3a, 0x49, 0x44, 
00242     0x41, 0x54, 0x08, 0xd7, 0x75, 0x8c, 0x31, 0x12, 0x00, 0x10, 
00243     0x10, 0xc4, 0x2e, 0x37, 0x9e, 0x40, 0x65, 0xfd, 0xff, 0x83, 
00244     0xf4, 0x0a, 0x1c, 0x8d, 0x54, 0x9b, 0xc9, 0xcc, 0x9a, 0x3d, 
00245     0x90, 0x73, 0x71, 0x67, 0x91, 0xd4, 0x74, 0x36, 0xa9, 0x55, 
00246     0x01, 0xf8, 0x29, 0x58, 0xc8, 0xbf, 0x48, 0xc4, 0x81, 0x74, 
00247     0x0b, 0xa3, 0x0f, 0x7c, 0xdb, 0x04, 0xe8, 0x40, 0x05, 0xdf, 
00248     0xa1, 0xf3, 0xfc, 0x73, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 
00249     0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, 0};
00250 
00251 static const unsigned char data_stats_shtml[] =
00252     /* /stats.shtml */
00253     "%!: /header.html\n"
00254     "<h1>Network statistics</h1>\n"
00255     "<center>\n"
00256     "<table width=\"330\" border=\"0\">\n"
00257     "<tr><td><pre>\n"
00258     "IP           Packets received\n"
00259     "             Packets sent\n"
00260     "             Packets forwarded\n"
00261     "             Packets dropped\n"
00262     "IP errors    IP version/header length\n"
00263     "             IP length, high byte\n"
00264     "             IP length, low byte\n"
00265     "             IP fragments\n"
00266     "             Header checksum\n"
00267     "             Wrong protocol\n"
00268     "ICMP         Packets received\n"
00269     "             Packets sent\n"
00270     "             Packets dropped\n"
00271     "             Type errors\n"
00272     "             Checksum errors\n"
00273 #if UIP_TCP
00274     "TCP          Packets received\n"
00275     "             Packets sent\n"
00276     "             Packets dropped\n"
00277     "             Checksum errors\n"
00278     "             Data packets without ACKs\n"
00279     "             Resets\n"
00280     "             Retransmissions\n"
00281     "             No connection avaliable\n"
00282     "             Connection attempts to closed ports\n"
00283 #endif
00284 #if UIP_UDP
00285     "UDP          Packets dropped\n"
00286     "             Packets received\n"
00287     "             Packets sent\n"
00288     "             Checksum errors\n"
00289 #endif /* UIP_UDP */
00290 #if UIP_CONF_IPV6
00291     "IPv6 ND6     Packets dropped\n"
00292     "             Packets received\n"
00293     "             Packets sent\n"
00294 #endif /*UIP_CONF_IPV6*/
00295     "</pre></td><td><pre>%! net-stats\n"
00296     "</pre></td></tr></table>\n"
00297     "</center>\n"
00298     "%!: /footer.html";
00299 
00300 static const unsigned char data_temp_shtml[] =
00301     /* /temp.shtml */
00302     "%!: /header.html\n"
00303     "<h1>Temperature sensor</h1>\n"
00304     "<center>\n"
00305     "<table width=\"230\" border=\"0\">\n"
00306     "<tr><td>TMP102</td>\n"
00307     "<td>%! tmp102-stats\n"
00308     "</td></tr>\n"
00309     "<tr><td>other format</td><td>\n"
00310     "<a href=\"temp.json\">temp.json</a><br>\n"
00311     "<a href=\"temp.xml\">temp.xml</a>\n"
00312     "</td></tr></table>\n"
00313     "</center>\n"
00314     "%!: /footer.html";
00315 
00316 static const unsigned char data_temp_json[] =
00317     /* /temp.json */
00318     "{\"value\": "
00319     "%! tmp102-stats\n"
00320     "}\n";
00321 
00322 static const unsigned char data_temp_xml[] =
00323     /* /temp.xml */
00324     "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
00325     "<tmp102>\n"
00326     "<value>%! tmp102-stats\n"
00327     "</value>\n"
00328     "</tmp102>\n";
00329 
00330 const struct httpd_fsdata_file file_processes_shtml[] = {{NULL, "/processes.shtml", (const char *)data_processes_shtml, sizeof(data_processes_shtml)-1}};
00331 
00332 const struct httpd_fsdata_file file_404_html[] = {{file_processes_shtml, "/404.html", (const char *)data_404_html, sizeof(data_404_html)-1}};
00333 
00334 const struct httpd_fsdata_file file_files_shtml[] = {{file_404_html, "/files.shtml", (const char *)data_files_shtml, sizeof(data_files_shtml)-1}};
00335 
00336 const struct httpd_fsdata_file file_footer_html[] = {{file_files_shtml, "/footer.html", (const char *)data_footer_html, sizeof(data_footer_html)-1}};
00337 
00338 const struct httpd_fsdata_file file_header_html[] = {{file_footer_html, "/header.html", (const char *)data_header_html, sizeof(data_header_html)-1}};
00339 
00340 const struct httpd_fsdata_file file_index_html[] = {{file_header_html, "/index.html", (const char *)data_index_html, sizeof(data_index_html)-1}};
00341 
00342 const struct httpd_fsdata_file file_style_css[] = {{file_index_html, "/style.css", (const char *)data_style_css, sizeof(data_style_css)-1}};
00343 
00344 const struct httpd_fsdata_file file_tcp_shtml[] = {{file_style_css, "/tcp.shtml", (const char *)data_tcp_shtml, sizeof(data_tcp_shtml)-1}};
00345 
00346 const struct httpd_fsdata_file file_fade_png[] = {{file_tcp_shtml, "/fade.png", (const char *)data_fade_png, sizeof(data_fade_png)-1}};
00347 
00348 const struct httpd_fsdata_file file_stats_shtml[] = {{file_fade_png, "/stats.shtml", (const char *)data_stats_shtml, sizeof(data_stats_shtml)-1}};
00349 
00350 const struct httpd_fsdata_file file_temp_shtml[] = {{file_stats_shtml, "/temp.shtml", (const char *)data_temp_shtml, sizeof(data_temp_shtml)-1}};
00351 
00352 const struct httpd_fsdata_file file_temp_json[] = {{file_temp_shtml, "/temp.json", (const char *)data_temp_json, sizeof(data_temp_json)-1}};
00353 
00354 const struct httpd_fsdata_file file_temp_xml[] = {{file_temp_json, "/temp.xml", (const char *)data_temp_xml, sizeof(data_temp_xml)-1}};
00355 
00356 #define HTTPD_FS_ROOT file_temp_xml
00357 
00358 #define HTTPD_FS_NUMFILES 13