uIP 1.0 based webserver for LPC1114 + ENC28J60

Dependencies:   mbed TMP102

apps/webserver/httpd-fs-data.h

Committer:
ban4jp
Date:
2014-06-30
Revision:
3:a2715e9c7737
Parent:
2:4da9ed411bdc

File content as of revision 3:a2715e9c7737:

static const unsigned char data_processes_shtml[] =
	/* /processes.shtml */
	"%!: /header.html\n"
	"<h1>System processes</h1><br><table width=\"100%\">\n"
	"<tr><th>ID</th><th>Name</th><th>Priority</th><th>Poll handler</th><th>Event handler</th><th>Procstate</th></tr>\n"
	"%! processes\n"
	"%!: /footer.html";

static const unsigned char data_404_html[] =
	/* /404.html */
	"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"
	"<html>\n"
	"  <head>\n"
	"    <title>Welcome to the uIP web server!</title>\n"
	"    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n"
	"  </head>\n"
	"  <body bgcolor=\"white\">\n"
	"    <center>\n"
	"      <h1>404 - file not found</h1>\n"
	"      <h3>Go <a href=\"/\">here</a> instead.</h3>\n"
	"    </center>\n"
	"  </body>\n"
	"</html>\n";

static const unsigned char data_files_shtml[] =
	/* /files.shtml */
	"%!: /header.html\n"
	"<h1>File statistics</h1>\n"
	"<center>\n"
	"<table width=\"300\">\n"
	"<tr><td><a href=\"/index.html\">/index.html</a></td>\n"
	"<td>%! file-stats /index.html\n"
	"</td><td><img src=\"/fade.png\" height=\"10\" width=\"%! file-stats /index.html\n"
	"\" alt=\"\"></td></tr>\n"
	"<tr><td><a href=\"/files.shtml\">/files.shtml</a></td>\n"
	"<td>%! file-stats /files.shtml\n"
	"</td><td><img src=\"/fade.png\" height=\"10\" width=\"%! file-stats /files.shtml\n"
	"\" alt=\"\"></td></tr>\n"
	"<tr><td><a href=\"/tcp.shtml\">/tcp.shtml</a></td>\n"
	"<td>%! file-stats /tcp.shtml\n"
	"</td><td><img src=\"/fade.png\" height=\"10\" width=\"%! file-stats /tcp.shtml\n"
	"\" alt=\"\"></td></tr>\n"
	"<tr><td><a href=\"/stats.shtml\">/stats.shtml</a></td>\n"
	"<td>%! file-stats /stats.shtml\n"
	"</td><td><img src=\"/fade.png\" height=\"10\" width=\"%! file-stats /stats.shtml\n"
	"\" alt=\"\"></td></tr>\n"
	"<tr><td><a href=\"/style.css\">/style.css</a></td>\n"
	"<td>%! file-stats /style.css\n"
	"</td><td><img src=\"/fade.png\" height=\"10\" width=\"%! file-stats /style.css\n"
	"\" alt=\"\"></td></tr>\n"
	"<tr><td><a href=\"/404.html\">/404.html</a></td>\n"
	"<td>%! file-stats /404.html\n"
	"</td><td><img src=\"/fade.png\" height=\"10\" width=\"%! file-stats /404.html\n"
	"\" alt=\"\"></td></tr>\n"
	"<tr><td><a href=\"/fade.png\">/fade.png</a></td>\n"
	"<td>%! file-stats /fade.png\n"
	"</td><td><img src=\"/fade.png\" height=\"10\" width=\"%! file-stats /fade.png\n"
	"\" alt=\"\"></td></tr>\n"
	"</table>\n"
	"</center>\n"
	"%!: /footer.html";

static const unsigned char data_footer_html[] =
	/* /footer.html */
	"  </div>\n"
	"\n"
	"  </body>\n"
	"</html>\n";

static const unsigned char data_header_html[] =
	/* /header.html */
	"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"
	"<html>\n"
	"  <head>\n"
	"    <title>Welcome to the uIP web server!</title>\n"
	"    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n"
	"  </head>\n"
	"  <body bgcolor=\"#fffeec\" text=\"black\">\n"
	"\n"
	"  <div class=\"menu\">\n"
	"  <div class=\"menubox\"><a href=\"/\">Front page</a></div>\n"
	"  <div class=\"menubox\"><a href=\"files.shtml\">File statistics</a></div>\n"
	"  <div class=\"menubox\"><a href=\"stats.shtml\">Network statistics</a></div>\n"
	"  <div class=\"menubox\"><a href=\"tcp.shtml\">Network connections</a></div>\n"
	"  <div class=\"menubox\"><a href=\"temp.shtml\">Temperature sensor</a></div>\n"
	"  <br>\n"
	"  </div>\n"
	"\n"
	"  <div class=\"contentblock\">\n";

static const unsigned char data_index_html[] =
	/* /index.html */
	"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"
	"<html>\n"
	"  <head>\n"
	"    <title>Welcome to the uIP web server!</title>\n"
	"    <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n"
	"  </head>\n"
	"  <body bgcolor=\"#fffeec\" text=\"black\">\n"
	"\n"
	"  <div class=\"menu\">\n"
	"  <div class=\"menubox\"><a href=\"/\">Front page</a></div>\n"
	"  <div class=\"menubox\"><a href=\"files.shtml\">File statistics</a></div>\n"
	"  <div class=\"menubox\"><a href=\"stats.shtml\">Network statistics</a></div>\n"
	"  <div class=\"menubox\"><a href=\"tcp.shtml\">Network connections</a></div>\n"
	"  <div class=\"menubox\"><a href=\"temp.shtml\">Temperature sensor</a></div>\n"
	"  <br>\n"
	"  </div>\n"
	"\n"
	"  <div class=\"contentblock\">\n"
	"  <p>\n"
	"  These web pages are served by a small web server running on top of\n"
	"  the <a href=\"http://www.sics.se/~adam/uip/\">uIP embedded TCP/IP stack</a>.\n"
	"  </p>\n"
	"  <p>\n"
	"  Click on the links above for web server statistics.\n"
	"  </p>\n"
	"  </div>\n"
	"\n"
	"  </body>\n"
	"</html>\n";

static const unsigned char data_style_css[] =
	/* /style.css */
	"h1\n"
	"{\n"
	"  text-align:center;\n"
	"  font-size:14pt;\n"
	"  font-family:arial,helvetica;\n"
	"  font-weight:bold;\n"
	"  padding:10px;\n"
	"}\n"
	"\n"
	"body\n"
	"{\n"
	"  background-color:#fffeec;\n"
	"  color:black;\n"
	"\n"
	"  font-size:8pt;\n"
	"  font-family:arial,helvetica;\n"
	"}\n"
	"\n"
	".menu\n"
	"{\n"
	"  margin:4px;\n"
	"  width:80%;\n"
	"  min-width:600px;\n"
	"\n"
	"  padding:2px;\n"
	"\n"
	"  border:solid 1px;\n"
	"  background-color:#fffcd2;\n"
	"  text-align:left;\n"
	"\n"
	"  font-size:9pt;\n"
	"  font-family:arial,helvetica;\n"
	"}\n"
	"\n"
	"div.menubox\n"
	"{\n"
	"  width:20%;\n"
	"  border:0;\n"
	"  float:left;\n"
	"  text-align:center;\n"
	"}\n"
	"\n"
	".contentblock\n"
	"{\n"
	"  margin:4px;\n"
	"  width:80%;\n"
	"  min-width:600px;\n"
	"\n"
	"  padding:2px;\n"
	"\n"
	"  border:1px dotted;\n"
	"  background-color:white;\n"
	"\n"
	"  font-size:8pt;\n"
	"  font-family:arial,helvetica;\n"
	"\n"
	"}\n"
	"\n"
	"p.intro\n"
	"{\n"
	"  margin-left:20px;\n"
	"  margin-right:20px;\n"
	"\n"
	"  font-size:10pt;\n"
	"/*  font-weight:bold; */\n"
	"  font-family:arial,helvetica;\n"
	"}\n"
	"\n"
	"p.clink\n"
	"{\n"
	"  font-size:12pt;\n"
	"  font-family:courier,monospace;\n"
	"  text-align:center;\n"
	"}\n"
	"\n"
	"p.clink9\n"
	"{\n"
	"  font-size:9pt;\n"
	"  font-family:courier,monospace;\n"
	"  text-align:center;\n"
	"}\n"
	"\n"
	"p\n"
	"{\n"
	"  padding-left:10px;\n"
	"}\n"
	"\n"
	"p.right\n"
	"{\n"
	"  text-align:right;\n"
	"}\n"
	"\n";

static const unsigned char data_tcp_shtml[] =
	/* /tcp.shtml */
	"%!: /header.html\n"
	"<h1>Current connections</h1><br>\n"
	"<table width=\"100%\">\n"
	"<tr><th>Local</th><th>Remote</th><th>State</th><th>Retransmissions</th><th>Timer</th><th>Flags</th></tr>\n"
	"%! tcp-connections\n"
	"</table>\n"
	"%!: /footer.html";

static const unsigned char data_fade_png[] = {
	/* /fade.png */
	0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 
	0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x04, 
	0x00, 0x00, 0x00, 0x0a, 0x08, 0x02, 0x00, 0x00, 0x00, 0x1c, 
	0x99, 0x68, 0x59, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 
	0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00, 0x0b, 0x13, 0x01, 
	0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, 0x07, 0x74, 0x49, 
	0x4d, 0x45, 0x07, 0xd6, 0x06, 0x08, 0x14, 0x1b, 0x39, 0xaf, 
	0x5b, 0xc0, 0xe3, 0x00, 0x00, 0x00, 0x1d, 0x74, 0x45, 0x58, 
	0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x00, 0x43, 
	0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 
	0x68, 0x20, 0x54, 0x68, 0x65, 0x20, 0x47, 0x49, 0x4d, 0x50, 
	0xef, 0x64, 0x25, 0x6e, 0x00, 0x00, 0x00, 0x3a, 0x49, 0x44, 
	0x41, 0x54, 0x08, 0xd7, 0x75, 0x8c, 0x31, 0x12, 0x00, 0x10, 
	0x10, 0xc4, 0x2e, 0x37, 0x9e, 0x40, 0x65, 0xfd, 0xff, 0x83, 
	0xf4, 0x0a, 0x1c, 0x8d, 0x54, 0x9b, 0xc9, 0xcc, 0x9a, 0x3d, 
	0x90, 0x73, 0x71, 0x67, 0x91, 0xd4, 0x74, 0x36, 0xa9, 0x55, 
	0x01, 0xf8, 0x29, 0x58, 0xc8, 0xbf, 0x48, 0xc4, 0x81, 0x74, 
	0x0b, 0xa3, 0x0f, 0x7c, 0xdb, 0x04, 0xe8, 0x40, 0x05, 0xdf, 
	0xa1, 0xf3, 0xfc, 0x73, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 
	0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, 0};

static const unsigned char data_stats_shtml[] =
	/* /stats.shtml */
	"%!: /header.html\n"
	"<h1>Network statistics</h1>\n"
	"<center>\n"
	"<table width=\"330\" border=\"0\">\n"
	"<tr><td><pre>\n"
	"IP           Packets received\n"
	"             Packets sent\n"
	"             Packets forwarded\n"
	"             Packets dropped\n"
	"IP errors    IP version/header length\n"
	"             IP length, high byte\n"
	"             IP length, low byte\n"
	"             IP fragments\n"
	"             Header checksum\n"
	"             Wrong protocol\n"
	"ICMP         Packets received\n"
	"             Packets sent\n"
	"             Packets dropped\n"
	"             Type errors\n"
	"             Checksum errors\n"
#if UIP_TCP
	"TCP          Packets received\n"
	"             Packets sent\n"
	"             Packets dropped\n"
	"             Checksum errors\n"
	"             Data packets without ACKs\n"
	"             Resets\n"
	"             Retransmissions\n"
	"             No connection avaliable\n"
	"             Connection attempts to closed ports\n"
#endif
#if UIP_UDP
	"UDP          Packets dropped\n"
	"             Packets received\n"
	"             Packets sent\n"
	"             Checksum errors\n"
#endif /* UIP_UDP */
#if UIP_CONF_IPV6
	"IPv6 ND6     Packets dropped\n"
	"             Packets received\n"
	"             Packets sent\n"
#endif /*UIP_CONF_IPV6*/
	"</pre></td><td><pre>%! net-stats\n"
	"</pre></td></tr></table>\n"
	"</center>\n"
	"%!: /footer.html";

static const unsigned char data_temp_shtml[] =
	/* /temp.shtml */
	"%!: /header.html\n"
	"<h1>Temperature sensor</h1>\n"
	"<center>\n"
	"<table width=\"230\" border=\"0\">\n"
	"<tr><td>TMP102</td>\n"
	"<td>%! tmp102-stats\n"
	"</td></tr>\n"
	"<tr><td>other format</td><td>\n"
	"<a href=\"temp.json\">temp.json</a><br>\n"
	"<a href=\"temp.xml\">temp.xml</a>\n"
	"</td></tr></table>\n"
	"</center>\n"
	"%!: /footer.html";

static const unsigned char data_temp_json[] =
	/* /temp.json */
	"{\"value\": "
	"%! tmp102-stats\n"
	"}\n";

static const unsigned char data_temp_xml[] =
	/* /temp.xml */
	"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
	"<tmp102>\n"
	"<value>%! tmp102-stats\n"
	"</value>\n"
	"</tmp102>\n";

const struct httpd_fsdata_file file_processes_shtml[] = {{NULL, "/processes.shtml", (const char *)data_processes_shtml, sizeof(data_processes_shtml)-1}};

const struct httpd_fsdata_file file_404_html[] = {{file_processes_shtml, "/404.html", (const char *)data_404_html, sizeof(data_404_html)-1}};

const struct httpd_fsdata_file file_files_shtml[] = {{file_404_html, "/files.shtml", (const char *)data_files_shtml, sizeof(data_files_shtml)-1}};

const struct httpd_fsdata_file file_footer_html[] = {{file_files_shtml, "/footer.html", (const char *)data_footer_html, sizeof(data_footer_html)-1}};

const struct httpd_fsdata_file file_header_html[] = {{file_footer_html, "/header.html", (const char *)data_header_html, sizeof(data_header_html)-1}};

const struct httpd_fsdata_file file_index_html[] = {{file_header_html, "/index.html", (const char *)data_index_html, sizeof(data_index_html)-1}};

const struct httpd_fsdata_file file_style_css[] = {{file_index_html, "/style.css", (const char *)data_style_css, sizeof(data_style_css)-1}};

const struct httpd_fsdata_file file_tcp_shtml[] = {{file_style_css, "/tcp.shtml", (const char *)data_tcp_shtml, sizeof(data_tcp_shtml)-1}};

const struct httpd_fsdata_file file_fade_png[] = {{file_tcp_shtml, "/fade.png", (const char *)data_fade_png, sizeof(data_fade_png)-1}};

const struct httpd_fsdata_file file_stats_shtml[] = {{file_fade_png, "/stats.shtml", (const char *)data_stats_shtml, sizeof(data_stats_shtml)-1}};

const struct httpd_fsdata_file file_temp_shtml[] = {{file_stats_shtml, "/temp.shtml", (const char *)data_temp_shtml, sizeof(data_temp_shtml)-1}};

const struct httpd_fsdata_file file_temp_json[] = {{file_temp_shtml, "/temp.json", (const char *)data_temp_json, sizeof(data_temp_json)-1}};

const struct httpd_fsdata_file file_temp_xml[] = {{file_temp_json, "/temp.xml", (const char *)data_temp_xml, sizeof(data_temp_xml)-1}};

#define HTTPD_FS_ROOT file_temp_xml

#define HTTPD_FS_NUMFILES 13