This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Simple system monitor for ATHTTP


Hello,

This patch is a port of simple system monitor from HTTP server to ATHTTP. There is also added a page with CPU load.
This is my first thing I have written to eCos, so apologies for possibly crappy code :-) Any suggestions will be highly appreciated.



diff -r -u5 -N -x CVS -x '*~' -x '.#*' clean/ecos/packages/net/athttpd/current/cdl/httpd.cdl devo/ecos/packages/net/athttpd/current/cdl/httpd.cdl
--- clean/ecos/packages/net/athttpd/current/cdl/httpd.cdl 2007-01-03 23:15:33.000000000 +0000
+++ devo/ecos/packages/net/athttpd/current/cdl/httpd.cdl 2007-01-03 22:29:34.000000000 +0000
@@ -215,10 +215,19 @@
When a client issues a request that ends in '/' the server will
try to locate anyone of a number of index files. Failing to find
one, it will list the directory contents."
}


+ cdl_component CYGOPT_NET_ATHTTPD_MONITOR {
+ display "Simple Web System Monitor"
+ default_value 0
+ description "This enables a simple system monitor that displays the
+ status of an eCos system using a small number of HTML pages."
+
+ compile -library=libextras.a monitor.c
+ }
+
cdl_component CYGOPT_NET_ATHTTPD_CGIBIN {
display "Supported CGI Types"
flavor none
no_define
description "Options to select which CGI types are supported."
diff -r -u5 -N -x CVS -x '*~' -x '.#*' clean/ecos/packages/net/athttpd/current/src/monitor.c devo/ecos/packages/net/athttpd/current/src/monitor.c
--- clean/ecos/packages/net/athttpd/current/src/monitor.c 1970-01-01 01:00:00.000000000 +0100
+++ devo/ecos/packages/net/athttpd/current/src/monitor.c 2007-01-03 22:28:18.000000000 +0000
@@ -0,0 +1,1682 @@
+#include <math.h>
+#include <cyg/hal/hal_cache.h>
+#include <cyg/kernel/kapi.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h> // sprintf().
+
+#include <pkgconf/system.h>
+#include <pkgconf/isoinfra.h>
+#include <pkgconf/net.h>
+#include <pkgconf/hal.h>
+
+#include <cyg/hal/hal_arch.h> // HAL header
+#include <cyg/hal/hal_intr.h> // HAL header
+#include <cyg/hal/hal_intr.h>
+#ifdef CYGPKG_KERNEL
+# include <pkgconf/kernel.h>
+# include <cyg/kernel/instrmnt.h>
+# include <cyg/kernel/diag.h>
+#endif
+
+#include <cyg/infra/cyg_trac.h> /* tracing macros */
+#include <cyg/infra/cyg_ass.h> /* assertion macros */
+
+#ifdef CYGPKG_KERNEL_INSTRUMENT
+#include <cyg/kernel/instrmnt.h>
+#include <cyg/kernel/instrument_desc.h>
+#endif
+
+#include <unistd.h>
+#include <ctype.h>
+
+/* ================================================================= */
+/* Include all the necessary network headers by hand. We need to do
+ * this so that _KERNEL is correctly defined, or not, for specific
+ * headers so we can use both the external API and get at internal
+ * kernel structures.
+ */
+
+#define _KERNEL
+#include <sys/param.h>
+#undef _KERNEL
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <sys/errno.h>
+#include <sys/time.h>
+#include <netdb.h>
+#define _KERNEL
+
+#include <sys/sysctl.h>
+#include <net/if.h>
+#include <ifaddrs.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/ip_icmp.h>
+#include <net/route.h>
+#include <net/if_dl.h>
+
+#include <sys/protosw.h>
+#include <netinet/in_pcb.h>
+#include <netinet/udp.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_timer.h>
+#include <netinet/ip_var.h>
+#include <netinet/icmp_var.h>
+#include <netinet/udp_var.h>
+#include <netinet/tcp_var.h>
+#ifdef CYGPKG_NET_INET6
+#include <netinet/ip6.h>
+#include <net/if_var.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/in6_var.h>
+#include <netinet/icmp6.h>
+#endif
+
+#include <cyg/infra/diag.h> // For diagnostic printing.
+#include <network.h>
+#include <time.h>
+#include <cyg/hal/hal_tables.h>
+#include <cyg/fileio/fileio.h>
+
+#include <network.h>
+#include <time.h> // sprintf().
+#include <cyg/athttpd/http.h>
+#include <cyg/athttpd/socket.h>
+#include <cyg/athttpd/handler.h>
+#include <cyg/athttpd/forms.h>
+
+#ifndef CYGPKG_HTTPD_MONITOR
+#ifdef CYGPKG_CPULOAD
+#include <cyg/cpuload/cpuload.h>
+cyg_uint32 calibration;
+cyg_handle_t handle;
+cyg_cpuload_t cpuload;
+#endif
+#endif
+
+#include <sys/mbuf.h>
+
+#include <cyg/io/eth/eth_drv_stats.h>
+
+#define NULL_THREAD_NAME "----------"
+#define HTML_VAR_LEN 20
+
+char var_monitor_thread[HTML_VAR_LEN];
+char var_monitor_thread_update[HTML_VAR_LEN];
+char var_monitor_thread_pri[HTML_VAR_LEN];
+char var_monitor_thread_state[HTML_VAR_LEN];
+char var_monitor_thread_submit[HTML_VAR_LEN];
+char var_monitor_memory_base[HTML_VAR_LEN];
+char var_monitor_memory_datasize[HTML_VAR_LEN];
+char var_monitor_memory_prev[HTML_VAR_LEN];
+char var_monitor_memory_next[HTML_VAR_LEN];
+
+CYG_HTTPD_FVAR_TABLE_ENTRY(hal_form_entry_monitor_thread, "tid", var_monitor_thread, HTML_VAR_LEN);
+CYG_HTTPD_FVAR_TABLE_ENTRY(hal_form_entry_monitor_thread_update, "update", var_monitor_thread_update, HTML_VAR_LEN);
+CYG_HTTPD_FVAR_TABLE_ENTRY(hal_form_entry_monitor_thread_pri, "pri", var_monitor_thread_pri, HTML_VAR_LEN);
+
+CYG_HTTPD_FVAR_TABLE_ENTRY(hal_form_entry_monitor_thread_state, "state", var_monitor_thread_state, HTML_VAR_LEN);
+CYG_HTTPD_FVAR_TABLE_ENTRY(hal_form_entry_monitor_thread_submit, "submit", var_monitor_thread_submit, HTML_VAR_LEN);
+CYG_HTTPD_FVAR_TABLE_ENTRY(hal_form_entry_monitor_memory_base, "base", var_monitor_memory_base, HTML_VAR_LEN);
+CYG_HTTPD_FVAR_TABLE_ENTRY(hal_form_entry_monitor_memory_datasize, "datasize", var_monitor_memory_datasize, HTML_VAR_LEN);
+CYG_HTTPD_FVAR_TABLE_ENTRY(hal_form_entry_monitor_memory_prev, "prev", var_monitor_memory_prev, HTML_VAR_LEN);
+CYG_HTTPD_FVAR_TABLE_ENTRY(hal_form_entry_monitor_memory_next, "next", var_monitor_memory_next, HTML_VAR_LEN);
+
+
+
+void html_heading(char* buf, int size, char* content)
+{
+ char temp[256];
+ sprintf(temp, "<h%d>%s</h%d>\n",size,content,size);
+ strcat(buf,temp);
+
+}
+
+void html_table_row_begin(char* buf, char* content)
+{
+ char temp[256];
+ sprintf(temp, "<tr>%s",content);
+ strcat(buf,temp);
+
+}
+
+void html_table_row_end(char* buf)
+{
+ char temp[256];
+ sprintf(temp, "</tr>\n");
+ strcat(buf,temp);
+
+}
+
+void html_table_data_begin(char* buf, char *opts)
+{
+ char temp[256];
+ sprintf(temp, "<td %s>",opts);
+ strcat(buf,temp);
+
+}
+
+void html_table_data_end(char* buf)
+{
+ char temp[256];
+ sprintf(temp, "</td>\n");
+ strcat(buf,temp);
+
+}
+
+
+
+void html_table_begin(char* buf, char* opts)
+{
+ char temp[256];
+ sprintf(temp, "<table %s>",opts);
+ strcat(buf,temp);
+
+}
+
+void html_table_end(char* buf)
+{
+ char temp[256];
+ sprintf(temp, "</table>\n");
+ strcat(buf,temp);
+
+}
+
+void html_para_begin(char* buf, char* content)
+{
+ char temp[256];
+ sprintf(temp, "<p>%s\n",content);
+ strcat(buf,temp);
+
+}
+
+
+void html_table_header(char* buf, char* content, char* opts)
+{
+ char temp[256];
+ sprintf(temp, "<th>%s</th>\n",content);
+ strcat(buf,temp);
+
+}
+
+void html_body_end(char* buf)
+{
+ char temp[256];
+ sprintf(temp, "</body>\n");
+ strcat(buf,temp);
+
+}
+
+
+void html_body_begin(char* buf, char* opts)
+{
+ char temp[256];
+ sprintf(temp, "<body %s>\n",opts);
+ strcat(buf,temp);
+
+}
+
+void html_begin(char* buf)
+{
+ char temp[256];
+ sprintf(temp, "<html>\n");
+ strcat(buf,temp);
+
+}
+
+void html_end(char* buf)
+{
+ char temp[256];
+ sprintf(temp, "</html>\n");
+ strcat(buf,temp);
+
+}
+
+void html_url(char* buf, char* name, char* url)
+{
+ char temp[256];
+ sprintf(temp, "<a href=\"%s\">%s</a>\n",url,name);
+ strcat(buf,temp);
+
+}
+
+void html_image(char* buf, char* url, char* alt, char* opts)
+{
+ char temp[256];
+ sprintf(temp, "<image src=\"%s\" alt=\"%s\">\n",url,alt);
+ strcat(buf,temp);
+
+}
+
+void html_form_input(char* buf, char* type, char* name, char* value, char* opts)
+{
+ char temp[256];
+ sprintf(temp, "<input type=\"%s\" name=\"%s\" value=\"%s\" >\n",type,name, value);
+ strcat(buf,temp);
+
+}
+
+void html_form_input_hidden(char* buf, char* name, char* value)
+{
+ char temp[256];
+ sprintf(temp, "<input type=\"hidden\" name=\"%s\" value=\"%s\" >\n",name, value);
+ strcat(buf,temp);
+
+}
+
+void html_form_input_radio(char* buf, char* name, char* value, cyg_int16 checked)
+{
+ char temp[256];
+ if(checked)
+ sprintf(temp, "<input type=\"radio\" name=\"%s\" value=\"%s\" checked>\n",name, value);
+ else
+ sprintf(temp, "<input type=\"radio\" name=\"%s\" value=\"%s\">\n",name, value);
+ strcat(buf,temp);
+
+}
+
+void html_head(char* buf, char* title, char* opts)
+{
+ char temp[256];
+ sprintf(temp, "<head><title>%s</title>%s</head>\n",title,opts);
+ strcat(buf,temp);
+
+}
+
+void html_form_begin(char* buf, char* filename, char* opts)
+{
+ char temp[256];
+ sprintf(temp, "<form action=\"%s\" method=\"get\">\n",filename);
+ strcat(buf,temp);
+
+}
+
+void html_form_end(char* buf)
+{
+ char temp[256];
+ sprintf(temp, "</form>\n");
+ strcat(buf,temp);
+
+}
+
+void html_form_select_begin(char* buf, char* datasize, char* opts)
+{
+ char temp[256];
+ sprintf(temp, "<select name=\"%s\">\n",datasize);
+ strcat(buf,temp);
+
+}
+
+void html_form_select(char* buf, char* datasize, char* opts)
+{
+ char temp[256];
+ sprintf(temp, "<select name=\"%s\">\n",datasize);
+ strcat(buf,temp);
+
+}
+
+void html_form_select_end(char* buf)
+{
+ char temp[256];
+ sprintf(temp, "</select>\n");
+ strcat(buf,temp);
+
+}
+
+void cyg_html_tag_begin(char* buf, char* tag, char* value)
+{
+ char temp[256];
+ sprintf(temp, "<%s %s>\n",tag,value);
+ strcat(buf,temp);
+
+}
+
+void cyg_html_tag_end(char* buf, char* tag)
+{
+ char temp[256];
+ sprintf(temp, "</%s>\n",tag);
+ strcat(buf,temp);
+
+}
+
+
+void html_form_option(char* buf, char* datasize, char* unit, cyg_bool_t selected)
+{
+ char temp[256];
+ if(selected)
+ sprintf(temp, "<option value=\"%s\" selected=\"selected\">%s</option>\n",datasize,unit);
+ else
+ sprintf(temp, "<option value=\"%s\">%s</option>\n",datasize,unit);
+ strcat(buf,temp);
+
+}
+
+
+
+
+void draw_navbar( char *buf )
+{
+ html_para_begin( buf, "" );
+
+ html_table_begin( buf, "border cellpadding=\"4\"" );
+ {
+ html_table_row_begin(buf, "" );
+ {
+ html_table_data_begin( buf, "" );
+ html_image( buf, "/monitor/ecos.gif", "eCos logo", "" );
+ html_table_data_begin( buf, "" );
+ html_url( buf, "Threads", "/monitor/threads.html");
+ html_table_data_begin( buf, "" );
+ html_url( buf, "Interrupts", "/monitor/interrupts.html");
+ html_table_data_begin( buf, "" );
+ html_url( buf, "Memory", "/monitor/memory.html");
+ html_table_data_begin( buf, "" );
+ html_url( buf, "Network", "/monitor/network.html");
+ html_table_data_begin( buf, "" );
+ html_url( buf, "CPU load", "/monitor/load.html");
+ }
+ html_table_row_end( buf );
+ }
+ html_table_end( buf );
+}
+
+cyg_int32 monitor_network(CYG_HTTPD_STATE* p)
+{
+
+ char temp[512];
+ char buf[2048];
+
+ sprintf(buf," ");
+ cyg_httpd_start_chunked("html");
+
+
+ struct ifaddrs *iflist, *ifp;
+
+ if(getifaddrs(&iflist)!=0)
+ return 0;
+
+ html_begin(buf);
+
+ html_head(buf,"eCos Network Monitor", "");
+
+ html_body_begin(buf,"");
+ {
+ html_heading(buf, 2, "Network Monitor" );
+
+ html_heading(buf, 3, "Interfaces" );
+
+ html_table_begin( buf, "border" );
+ {
+ char addr[64];
+ int i;
+ ifp = iflist;
+
+ html_table_header( buf, "Interface", "" );
+ html_table_header( buf, "Status", "" );
+
+ while( ifp != (struct ifaddrs *)NULL)
+ {
+ if (ifp->ifa_addr->sa_family != AF_LINK)
+ {
+
+ html_table_row_begin(buf, "" );
+ {
+ html_table_data_begin( buf, "" );
+ sprintf( temp, "%s", ifp->ifa_name);
+ strcat(buf,temp);
+
+ html_table_data_begin( buf, "" );


+ html_table_begin( buf, "" );
+ {
+ /* Get the interface's flags and display
+ * the interesting ones.
+ */
+
+ html_table_row_begin(buf, "" );
+ sprintf( temp, "<td>Flags<td>\n" );
+ strcat(buf,temp);
+ for( i = 0; i < 16; i++ )
+ {
+
+ switch( ifp->ifa_flags & (1<<i) )
+ {
+ default: break;
+ case IFF_UP: strcat(buf, " UP" ); break;
+ case IFF_BROADCAST: strcat(buf, " BROADCAST"); break;
+ case IFF_DEBUG: strcat(buf, " DEBUG"); break;
+ case IFF_LOOPBACK: strcat(buf, " LOOPBACK"); break;
+ case IFF_PROMISC: strcat(buf, " PROMISCUOUS"); break;
+ case IFF_RUNNING: strcat(buf, " RUNNING"); break;
+ case IFF_SIMPLEX: strcat(buf, " SIMPLEX"); break;
+ case IFF_MULTICAST: strcat(buf, " MULTICAST"); break;
+ }
+ }
+ html_table_row_end( buf );
+
+ html_table_row_begin(buf, "" );
+ getnameinfo(ifp->ifa_addr, sizeof(*ifp->ifa_addr),
+ addr, sizeof(addr), NULL, 0, NI_NUMERICHOST);
+ sprintf( temp, "<td>Address<td>%s\n", addr);
+ strcat(buf,temp);
+ html_table_row_end( buf );
+
+ if (ifp->ifa_netmask)
+ {
+ html_table_row_begin(buf, "" );
+ getnameinfo(ifp->ifa_netmask, sizeof(*ifp->ifa_netmask),
+ addr, sizeof(addr), NULL, 0, NI_NUMERICHOST);
+ sprintf( temp, "<td>Mask<td>%s\n", addr);
+ strcat(buf,temp);
+ html_table_row_end( buf );
+ }
+
+ if (ifp->ifa_broadaddr)
+ {
+ html_table_row_begin(buf, "" );
+ getnameinfo(ifp->ifa_broadaddr, sizeof(*ifp->ifa_broadaddr),
+ addr, sizeof(addr), NULL, 0, NI_NUMERICHOST);
+ sprintf( temp, "<td>Broadcast<td>%s\n", addr);
+ strcat(buf,temp);
+ html_table_row_end( buf );
+ }
+ }
+ html_table_end( buf );
+ }
+ html_table_row_end( buf );
+
+ }
+ ifp = ifp->ifa_next;
+ }
+ }
+ html_table_end( buf );
+
+ strcpy(p->outbuffer, buf);
+ cyg_httpd_write_chunked(p->outbuffer, strlen(p->outbuffer));
+ sprintf(buf," ");
+
+ /* Now the protocols. For each of the main protocols: IP,
+ * ICMP, UDP, TCP print a table of useful information derived
+ * from the in-kernel data structures. Note that this only
+ * works for the BSD stacks.
+ */
+
+ html_para_begin( buf, "" );
+ html_heading(buf, 3, "Protocols" );
+
+ html_para_begin( buf, "" );
+ html_table_begin( buf, "border");
+ {
+ html_table_header( buf, "IPv4", "" );
+#ifdef CYGPKG_NET_INET6
+ html_table_header( buf, "IPv6", "" );
+#endif
+ html_table_header( buf, "ICMPv4", "" );
+#ifdef CYGPKG_NET_INET6
+ html_table_header( buf, "ICMPv6", "" );
+#endif
+ html_table_header( buf, "UDP", "" );
+ html_table_header( buf, "TCP", "" );
+
+ html_table_row_begin(buf, "" );
+ {
+ html_table_data_begin( buf, "valign=\"top\"" );


+ html_table_begin( buf, "" );
+ {
+
+ sprintf( temp, "<tr><td><b>%s:</b><td></tr>\n", "Received" );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Total",
+ ipstat.ips_total );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Bad",
+ ipstat.ips_badsum+
+ ipstat.ips_tooshort+
+ ipstat.ips_toosmall+
+ ipstat.ips_badhlen+
+ ipstat.ips_badlen+
+ ipstat.ips_noproto+
+ ipstat.ips_toolong
+ );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Reassembled",
+ ipstat.ips_reassembled );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Delivered",
+ ipstat.ips_delivered );
+ strcat(buf,temp);
+
+ sprintf( temp, "<tr><td><b>%s:</b><td></tr>\n", "Sent" );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Total",
+ ipstat.ips_localout );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Raw",
+ ipstat.ips_rawout );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Fragmented",
+ ipstat.ips_fragmented );
+ strcat(buf,temp);
+ }
+ html_table_end( buf );
+#ifdef CYGPKG_NET_INET6
+ html_table_data_begin( buf, "valign=\"top\"" );


+ html_table_begin( buf, "" );
+ {
+
+ sprintf( temp, "<tr><td><b>%s:</b><td></tr>\n", "Received" );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%lld</tr>\n", "Total",
+ ip6stat.ip6s_total );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%lld</tr>\n", "Bad",
+ ip6stat.ip6s_tooshort+
+ ip6stat.ip6s_toosmall
+ );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%lld</tr>\n", "Reassembled",
+ ip6stat.ip6s_reassembled );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%lld</tr>\n", "Delivered",
+ ip6stat.ip6s_delivered );
+ strcat(buf,temp);
+
+ sprintf( temp, "<tr><td><b>%s:</b><td></tr>\n", "Sent" );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%lld</tr>\n", "Total",
+ ip6stat.ip6s_localout );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%lld</tr>\n", "Raw",
+ ip6stat.ip6s_rawout );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%lld</tr>\n", "Fragmented",
+ ip6stat.ip6s_fragmented );
+ strcat(buf,temp);
+ }
+ html_table_end( buf );
+#endif
+ html_table_data_begin( buf, "valign=\"top\"" );


+ html_table_begin( buf, "" );
+ {
+
+ sprintf( temp, "<tr><td><b>%s:</b><td></tr>\n", "Received" );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "ECHO",
+ icmpstat.icps_inhist[ICMP_ECHO] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "ECHO REPLY",
+ icmpstat.icps_inhist[ICMP_ECHOREPLY] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "UNREACH",
+ icmpstat.icps_inhist[ICMP_UNREACH] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "REDIRECT",
+ icmpstat.icps_inhist[ICMP_REDIRECT] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Other",
+ icmpstat.icps_inhist[ICMP_SOURCEQUENCH]+
+ icmpstat.icps_inhist[ICMP_ROUTERADVERT]+
+ icmpstat.icps_inhist[ICMP_ROUTERSOLICIT]+
+ icmpstat.icps_inhist[ICMP_TIMXCEED]+
+ icmpstat.icps_inhist[ICMP_PARAMPROB]+
+ icmpstat.icps_inhist[ICMP_TSTAMP]+
+ icmpstat.icps_inhist[ICMP_TSTAMPREPLY]+
+ icmpstat.icps_inhist[ICMP_IREQ]+
+ icmpstat.icps_inhist[ICMP_IREQREPLY]+
+ icmpstat.icps_inhist[ICMP_MASKREQ]+
+ icmpstat.icps_inhist[ICMP_MASKREPLY]
+ );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Bad",
+ icmpstat.icps_badcode+
+ icmpstat.icps_tooshort+
+ icmpstat.icps_checksum+
+ icmpstat.icps_badlen+
+ icmpstat.icps_bmcastecho
+ );
+ strcat(buf,temp);
+
+ sprintf( temp, "<tr><td><b>%s:</b><td></tr>\n", "Sent" );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "ECHO",
+ icmpstat.icps_outhist[ICMP_ECHO] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "ECHO REPLY",
+ icmpstat.icps_outhist[ICMP_ECHOREPLY] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "UNREACH",
+ icmpstat.icps_outhist[ICMP_UNREACH] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "REDIRECT",
+ icmpstat.icps_outhist[ICMP_REDIRECT] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Other",
+ icmpstat.icps_inhist[ICMP_SOURCEQUENCH]+


+ icmpstat.icps_outhist[ICMP_ROUTERADVERT]+
+ icmpstat.icps_outhist[ICMP_ROUTERSOLICIT]+
+ icmpstat.icps_outhist[ICMP_TIMXCEED]+
+ icmpstat.icps_outhist[ICMP_PARAMPROB]+
+ icmpstat.icps_outhist[ICMP_TSTAMP]+
+ icmpstat.icps_outhist[ICMP_TSTAMPREPLY]+
+ icmpstat.icps_outhist[ICMP_IREQ]+
+ icmpstat.icps_outhist[ICMP_IREQREPLY]+
+ icmpstat.icps_outhist[ICMP_MASKREQ]+
+ icmpstat.icps_outhist[ICMP_MASKREPLY]
+ );
+ strcat(buf,temp);
+ }
+ html_table_end( buf );
+
+#ifdef CYGPKG_NET_INET6
+ html_table_data_begin( buf, "valign=\"top\"" );


+ html_table_begin( buf, "" );
+ {
+
+ sprintf( temp, "<tr><td><b>%s:</b><td></tr>\n", "Received" );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%lld</tr>\n", "ECHO",
+ icmp6stat.icp6s_inhist[ICMP_ECHO] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%lld</tr>\n", "ECHO REPLY",
+ icmp6stat.icp6s_inhist[ICMP_ECHOREPLY] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%lld</tr>\n", "UNREACH",
+ icmp6stat.icp6s_inhist[ICMP_UNREACH] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%lld</tr>\n", "REDIRECT",
+ icmp6stat.icp6s_inhist[ICMP_REDIRECT] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%lld</tr>\n", "Other",
+ icmp6stat.icp6s_inhist[ICMP_SOURCEQUENCH]+
+ icmp6stat.icp6s_inhist[ICMP_ROUTERADVERT]+
+ icmp6stat.icp6s_inhist[ICMP_ROUTERSOLICIT]+
+ icmp6stat.icp6s_inhist[ICMP_TIMXCEED]+
+ icmp6stat.icp6s_inhist[ICMP_PARAMPROB]+
+ icmp6stat.icp6s_inhist[ICMP_TSTAMP]+
+ icmp6stat.icp6s_inhist[ICMP_TSTAMPREPLY]+
+ icmp6stat.icp6s_inhist[ICMP_IREQ]+
+ icmp6stat.icp6s_inhist[ICMP_IREQREPLY]+
+ icmp6stat.icp6s_inhist[ICMP_MASKREQ]+
+ icmp6stat.icp6s_inhist[ICMP_MASKREPLY]
+ );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%lld</tr>\n", "Bad",
+ icmp6stat.icp6s_badcode+
+ icmp6stat.icp6s_tooshort+
+ icmp6stat.icp6s_checksum+
+ icmp6stat.icp6s_badlen
+ );
+ strcat(buf,temp);
+
+ sprintf( temp, "<tr><td><b>%s:</b><td></tr>\n", "Sent" );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%lld</tr>\n", "ECHO",
+ icmp6stat.icp6s_outhist[ICMP_ECHO] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%lld</tr>\n", "ECHO REPLY",
+ icmp6stat.icp6s_outhist[ICMP_ECHOREPLY] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%lld</tr>\n", "UNREACH",
+ icmp6stat.icp6s_outhist[ICMP_UNREACH] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%lld</tr>\n", "REDIRECT",
+ icmp6stat.icp6s_outhist[ICMP_REDIRECT] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%lld</tr>\n", "Other",
+ icmp6stat.icp6s_inhist[ICMP_SOURCEQUENCH]+


+ icmp6stat.icp6s_outhist[ICMP_ROUTERADVERT]+
+ icmp6stat.icp6s_outhist[ICMP_ROUTERSOLICIT]+
+ icmp6stat.icp6s_outhist[ICMP_TIMXCEED]+
+ icmp6stat.icp6s_outhist[ICMP_PARAMPROB]+
+ icmp6stat.icp6s_outhist[ICMP_TSTAMP]+
+ icmp6stat.icp6s_outhist[ICMP_TSTAMPREPLY]+
+ icmp6stat.icp6s_outhist[ICMP_IREQ]+
+ icmp6stat.icp6s_outhist[ICMP_IREQREPLY]+
+ icmp6stat.icp6s_outhist[ICMP_MASKREQ]+
+ icmp6stat.icp6s_outhist[ICMP_MASKREPLY]
+ );
+ strcat(buf,temp);
+ }
+ html_table_end( buf );
+
+ strcpy(p->outbuffer, buf);
+ cyg_httpd_write_chunked(p->outbuffer, strlen(p->outbuffer));
+ sprintf(buf," ");
+#endif
+ html_table_data_begin( buf, "valign=\"top\"" );


+ html_table_begin( buf, "" );
+ {
+
+ sprintf( temp, "<tr><td><b>%s:</b><td></tr>\n", "Received" );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Total",
+ udpstat.udps_ipackets );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Bad",
+ udpstat.udps_hdrops+
+ udpstat.udps_badsum+
+ udpstat.udps_badlen+
+ udpstat.udps_noport+
+ udpstat.udps_noportbcast+
+ udpstat.udps_fullsock
+ );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td><b>%s:</b><td></tr>\n", "Sent" );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Total",
+ udpstat.udps_opackets );
+ strcat(buf,temp);
+ }
+ html_table_end( buf );
+
+ html_table_data_begin( buf, "valign=\"top\"" );


+ html_table_begin( buf, "" );
+ {
+
+ sprintf( temp, "<tr><td><b>%s:</b><td></tr>\n", "Connections" );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Initiated",
+ tcpstat.tcps_connattempt );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Accepted",
+ tcpstat.tcps_accepts );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Established",
+ tcpstat.tcps_connects );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Closed",
+ tcpstat.tcps_closed );
+ strcat(buf,temp);
+
+ sprintf( temp, "<tr><td><b>%s:</b><td></tr>\n", "Received" );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Packets",
+ tcpstat.tcps_rcvtotal );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Data Packets",
+ tcpstat.tcps_rcvpack );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Bytes",
+ tcpstat.tcps_rcvbyte );
+ strcat(buf,temp);
+
+ sprintf( temp, "<tr><td><b>%s:</b><td></tr>\n", "Sent" );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Packets",
+ tcpstat.tcps_sndtotal );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Data Packets",
+ tcpstat.tcps_sndpack );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Bytes",
+ tcpstat.tcps_sndbyte );
+ strcat(buf,temp);
+
+
+ }
+ html_table_end( buf );
+
+
+ }
+ html_table_row_end( buf );
+
+ }
+ html_table_end( buf );
+
+ strcpy(p->outbuffer, buf);
+ cyg_httpd_write_chunked(p->outbuffer, strlen(p->outbuffer));
+ sprintf(buf," ");
+
+ html_para_begin( buf, "" );
+ html_heading(buf, 3, "Mbufs" );
+
+ html_table_begin( buf, "border" );
+ {
+ html_table_header( buf, "Summary", "" );
+ html_table_header( buf, "Types", "" );
+
+ html_table_row_begin( buf, "" );
+ {
+ html_table_data_begin( buf, "valign=\"top\"" );


+ html_table_begin( buf, "" );
+ {
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Mbufs",
+ mbstat.m_mbufs );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Clusters",
+ mbstat.m_clusters );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Free Clusters",
+ mbstat.m_clfree );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Drops",
+ mbstat.m_drops );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Waits",
+ mbstat.m_wait );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Drains",
+ mbstat.m_drain );
+ strcat(buf,temp);
+#if defined(CYGPKG_NET_FREEBSD_STACK)
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Copy Fails",
+ mbstat.m_mcfail );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "Pullup Fails",
+ mbstat.m_mpfail );
+ strcat(buf,temp);
+#endif
+
+ }
+ html_table_end( buf );
+
+ html_table_data_begin( buf, "valign=\"top\"" );


+ html_table_begin( buf, "" );
+ {
+ u_long *mtypes;
+#if defined(CYGPKG_NET_FREEBSD_STACK)
+ mtypes = mbtypes;
+#else
+ mtypes = mbstat.m_mtypes;
+#endif
+
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "FREE",
+ mtypes[MT_FREE] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "DATA",
+ mtypes[MT_DATA] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "HEADER",
+ mtypes[MT_HEADER] );
+ strcat(buf,temp);
+#if !defined(CYGPKG_NET_FREEBSD_STACK)
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "SOCKET",
+ mtypes[MT_SOCKET] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "PCB",
+ mtypes[MT_PCB] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "RTABLE",
+ mtypes[MT_RTABLE] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "HTABLE",
+ mtypes[MT_HTABLE] );
+ strcat(buf,temp);
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "ATABLE",
+ mtypes[MT_ATABLE] );
+ strcat(buf,temp);
+#endif
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "SONAME",
+ mtypes[MT_SONAME] );
+ strcat(buf,temp);
+#if !defined(CYGPKG_NET_FREEBSD_STACK)


+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "SOOPTS",
+ mtypes[MT_SOOPTS] );
+ strcat(buf,temp);
+#endif
+ sprintf( temp, "<tr><td>%s<td>%ld</tr>\n", "FTABLE",
+ mtypes[MT_FTABLE] );
+ strcat(buf,temp);
+
+ /* Ignore the rest for now... */
+
+ }
+ html_table_end( buf );
+
+ }
+ html_table_row_end( buf );
+
+ }
+ html_table_end( buf );
+
+
+ draw_navbar(buf);
+ }
+ html_body_end(buf);
+
+ html_end(buf);
+
+ freeifaddrs(iflist);
+
+ strcpy(p->outbuffer, buf);
+ cyg_httpd_write_chunked(p->outbuffer, strlen(p->outbuffer));
+ cyg_httpd_end_chunked();
+
+ return -1; // Do not further search the file system.
+}
+
+
+
+
+cyg_int32 monitor_interrupts(CYG_HTTPD_STATE* p)
+{
+
+
+ char temp[512];
+ char buf[2048];
+
+ sprintf(buf," ");
+
+ html_begin(buf);
+
+ html_head(buf,"eCos Interrupt Monitor", "");
+
+ html_body_begin(buf,"");
+ {
+ html_heading(buf, 2, "Interrupt Monitor" );
+
+ html_table_begin( buf, "border" );
+ {
+ int i;
+ int maxint = CYGNUM_HAL_ISR_MAX;
+#ifdef CYGPKG_HAL_I386
+ maxint = CYGNUM_HAL_ISR_MIN+16;
+#endif
+
+ html_table_header( buf, "ISR", "" );
+ html_table_header( buf, "State", "" );
+
+ for( i = CYGNUM_HAL_ISR_MIN; i <= maxint ; i++ )
+ {
+ cyg_bool_t inuse;
+ HAL_INTERRUPT_IN_USE( i, inuse );
+
+ html_table_row_begin(buf, "" );
+ {
+ html_table_data_begin( buf, "" );
+ sprintf( temp, "%d", i);
+ strcat(buf,temp);
+ html_table_data_begin( buf, "" );
+ if(inuse)
+ sprintf( temp, "In Use");
+ else
+ sprintf( temp, "Free");
+ strcat(buf,temp);
+ }
+ html_table_row_end( buf );
+ }
+
+ }
+ html_table_end( buf );
+
+ draw_navbar(buf);
+ }
+ html_body_end(buf);
+
+ html_end(buf);
+
+
+ cyg_httpd_start_chunked("html");
+ strcpy(p->outbuffer, buf);
+ cyg_httpd_write_chunked(p->outbuffer, strlen(p->outbuffer));
+ cyg_httpd_end_chunked();
+
+ return -1; // Do not further search the file system.
+}
+
+
+cyg_int32 monitor_threads(CYG_HTTPD_STATE* p)
+{
+
+
+ char temp[512];
+ char buf[2048];
+
+
+ sprintf(buf," ");
+ html_begin(buf);
+
+ html_head(buf,"eCos Thread Monitor", "");
+
+ html_body_begin(buf,"");
+ {
+ html_heading(buf, 2, "Thread Monitor" );
+
+ html_table_begin( buf, "border" );
+ {
+ cyg_handle_t thread = 0;
+ cyg_uint16 id = 0;
+
+ html_table_header( buf, "Id", "" );
+ html_table_header( buf, "State", "" );
+ html_table_header( buf, "Set<br>Priority", "" );
+ html_table_header( buf, "Current<br>Priority", "" );
+ html_table_header( buf, "Name", "" );
+ html_table_header( buf, "Stack Base", "" );
+ html_table_header( buf, "Stack Size", "" );
+#ifdef CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT
+ html_table_header( buf, "Stack Used", "" );
+#endif
+
+ while( cyg_thread_get_next( &thread, &id ) )
+ {
+ cyg_thread_info info;
+ char *state_string;
+
+ cyg_thread_get_info( thread, id, &info );
+
+ if( info.name == NULL )
+ info.name = NULL_THREAD_NAME;
+
+
+ if( info.state == 0 )
+ state_string = "RUN";
+ else if( info.state & 0x04 )
+ state_string = "SUSP";
+ else switch( info.state & 0x1b )
+ {
+ case 0x01: state_string = "SLEEP"; break;
+ case 0x02: state_string = "CNTSLEEP"; break;
+ case 0x08: state_string = "CREATE"; break;
+ case 0x10: state_string = "EXIT"; break;
+ default: state_string = "????"; break;
+ }
+
+
+ html_table_row_begin(buf, "" );
+ {
+ html_table_data_begin( buf, "" );
+ sprintf( temp, "<a href=\"/monitor/thread_edit.html?tid=%04x\">%04x</a>\n", id,id);
+ strcat(buf,temp);
+ html_table_data_begin( buf, "" );
+ sprintf( temp, "%s", state_string);
+ strcat(buf,temp);
+ html_table_data_begin( buf, "" );
+ sprintf( temp, "%d", info.set_pri);
+ strcat(buf,temp);
+ html_table_data_begin( buf, "" );
+ sprintf( temp, "%d", info.cur_pri);
+ strcat(buf,temp);
+ html_table_data_begin( buf, "" );
+ strcat( buf,info.name );
+ html_table_data_begin( buf, "" );
+ sprintf( temp, "%08x", info.stack_base );
+ strcat(buf,temp);
+ html_table_data_begin( buf, "" );
+ sprintf( temp, "%d", info.stack_size );
+ strcat(buf,temp);
+#ifdef CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT
+ html_table_data_begin( buf, "" );
+ sprintf( temp, "%d", info.stack_used );
+ strcat(buf,temp);
+#endif
+ }
+ html_table_row_end(buf);
+
+ }
+ }
+ html_table_end( buf );
+
+ draw_navbar(buf);
+ }
+ html_body_end(buf);
+
+ html_end(buf);
+
+
+ cyg_httpd_start_chunked("html");
+ strcpy(p->outbuffer, buf);
+ cyg_httpd_write_chunked(p->outbuffer, strlen(p->outbuffer));
+ cyg_httpd_end_chunked();
+
+ return -1; // Do not further search the file system.
+}
+
+cyg_int32 monitor_thread_edit(CYG_HTTPD_STATE* p)
+{
+
+
+ char temp[512];
+ char buf[2048];
+
+ sprintf(buf," ");
+
+ cyg_uint16 id;
+ cyg_handle_t thread = 0;
+
+ static char thread_edit_blurb[] =
+ "<p>This table contains an entry for each property of the thread "
+ "that you can edit. The properties are:\n"
+ "<p><b>State:</b> Change thread's state. The <em>Suspend</em> button "
+ "will suspend the thread. The <em>Run</em> button will undo any previous "
+ "suspends. The <em>Release</em> button will release the thread out of "
+ "any sleep it is currently in.\n"
+ "<p><b>Priority:</b> Change the thread's priority.\n"
+ "<p>Once the new state has been selected, press the <em>Submit</em> "
+ "button to make the change, or <em>Reset</em> to clear it.";
+
+ html_begin(buf);
+ sscanf( var_monitor_thread, "%04hx", &id );
+ thread = cyg_thread_find( id );
+ if(id)
+ {
+
+ if( strcmp( var_monitor_thread_update, "1" ) == 0 )
+ {
+ strcat(buf,"Thread state updated...");
+
+ // If there is a pri field, change the priority
+ // pri_string = cyg_formlist_find( formlist, "pri");
+
+ if( var_monitor_thread_pri != NULL )
+ {
+ cyg_priority_t pri;
+
+ sscanf( var_monitor_thread_pri, "%d", &pri );
+
+ cyg_thread_set_priority( thread, pri );
+ }
+
+ // If there is a state field, change the thread state
+ // state = cyg_formlist_find( formlist, "state");
+
+ if( var_monitor_thread_state != NULL )
+ {
+ if( strcmp( var_monitor_thread_state, "run" ) == 0 )
+ cyg_thread_resume( thread );
+ if( strcmp( var_monitor_thread_state, "suspend" ) == 0 )
+ cyg_thread_suspend( thread );
+ if( strcmp( var_monitor_thread_state, "release" ) == 0 )
+ cyg_thread_release( thread );
+
+ }
+ }
+
+ // Now generate a page showing the current thread state, and
+ // including form controls to change it.
+
+ html_begin(buf);
+
+ html_head(buf,"eCos Thread Editor", "");
+
+ html_body_begin(buf,"");
+ {
+
+ cyg_uint16 id;
+ cyg_thread_info info;
+ cyg_handle_t thread = 0;
+
+ sscanf( var_monitor_thread, "%04hx", &id );
+
+ thread = cyg_thread_find( id );
+ cyg_thread_get_info(thread, id, &info );
+
+ html_heading(buf, 2, "Thread State Editor" );
+
+ html_para_begin( buf, "" );
+
+ sprintf( temp, "Editing Thread %04x %s\n",id, info.name?info.name:NULL_THREAD_NAME);
+ strcat(buf,temp);
+ strcat(buf,thread_edit_blurb);
+
+
+ html_form_begin( buf, "/monitor/thread_edit.html", "" );
+ {
+ html_table_begin( buf, "border" );
+ {
+ html_table_header( buf, "Property", "" );
+ html_table_header( buf, "Value", "" );
+
+ html_table_row_begin(buf, "" );
+ {
+ html_table_data_begin( buf, "" );
+ strcat( buf, "State" );
+
+ html_table_data_begin( buf, "" );
+
+ html_form_input_radio( buf, "state", "run", (info.state&0x04)==0 );
+ strcat( buf, "Run" );
+ html_form_input_radio( buf, "state", "suspend", (info.state&0x04)!=0 );
+ strcat( buf, "Suspend");
+ html_form_input_radio( buf, "state", "release", 0 );
+ strcat( buf, "Release");
+ }
+ html_table_row_end( buf );
+
+ html_table_row_begin(buf, "" );
+ {
+ html_table_data_begin( buf, "" );
+ strcat( buf, "Priority" );
+ html_table_data_begin( buf, "" );
+ sprintf(temp,"<input type=\"text\" name=\"pri\" size=\"10\" value=\"%d\">\n",info.set_pri);
+ strcat(buf,temp);
+ }
+ html_table_row_end( buf );
+
+ }
+ html_table_end( buf );
+
+ // Add submit and reset buttons
+ html_form_input(buf, "submit", "submit", "Submit", "");


+ html_form_input(buf, "reset", "reset", "Reset", "");
+
+ // Pass the thread ID through to our next incarnation
+ sprintf( temp, "%04x", id );
+ html_form_input_hidden(buf, "tid", temp );
+ html_form_input_hidden(buf, "update", "1" );
+
+ }
+ html_form_end( buf );
+
+ draw_navbar(buf);
+ }
+ html_body_end(buf);
+
+ html_end(buf);
+ }
+ else
+ strcat(buf,"Error getting thread's id");
+
+ cyg_httpd_start_chunked("html");
+ strcpy(p->outbuffer, buf);
+ cyg_httpd_write_chunked(p->outbuffer, strlen(p->outbuffer));
+ cyg_httpd_end_chunked();
+
+return -1;
+}
+
+
+cyg_int32 monitor_memory(CYG_HTTPD_STATE* p)
+{
+
+
+ char temp[512];
+ char buf[2048];
+
+
+ cyg_uint32 base = 0;
+ unsigned int datasize = 1;
+ int size = 256;
+ sprintf (buf," ");
+
+ bool valid_base = true;
+
+ // If the page is requested without a 'base' parameter, do not attempt
+ // to access any memory locations to prevent illegal memory accesses
+ // on targets where '0' is not a valid address.
+ //
+ if(!(( strcmp( var_monitor_memory_base, "" ) == 0 )) )
+ sscanf( var_monitor_memory_base, "%x", &base );
+ else
+ valid_base = false;
+
+ if(!( strcmp( var_monitor_memory_datasize, "" ) == 0 ))
+ sscanf( var_monitor_memory_datasize, "%x", &datasize );
+
+ if( strcmp( var_monitor_memory_next, "Next Page" ) == 0 )
+ base += size;
+
+ if( strcmp( var_monitor_memory_prev, "Prev Page" ) == 0 )
+ base -= size;
+
+ html_begin(buf);
+
+ html_head(buf,"eCos Memory Monitor", "");
+
+ html_body_begin(buf,"");
+ {
+ html_heading(buf, 2, "Memory Monitor" );
+
+ html_form_begin( buf, "/monitor/memory.html", "" );
+ {
+
+ // Text input control for base address
+
+ html_para_begin( buf, "" );
+ sprintf(temp,
+ "Base Address: 0x<input type=\"text\" name=\"base\" size=\"10\" value=\"%x\">\n",
+ base);
+ strcat(buf,temp);
+
+ sprintf(temp,
+ "WARNING: entering an illegal base address can crash the system.\n");
+ strcat(buf,temp);
+ // A little menu for the element size
+
+ html_para_begin( buf, "" );
+
+ strcat( buf, "Element Size: " );
+ html_form_select_begin( buf, "datasize", "" );
+ html_form_option( buf, "1", "bytes", datasize==1 );
+ html_form_option( buf, "2", "words", datasize==2 );
+ html_form_option( buf, "4", "dwords", datasize==4 );
+ html_form_select_end( buf );
+
+ html_para_begin( buf, "" );
+
+ // Submit and reset buttons
+
+ html_form_input(buf, "submit", "submit", "Submit", "");


+ html_form_input(buf, "reset", "reset", "Reset", "");
+
+ html_para_begin( buf, "" );
+
+ // Previous page button
+ html_form_input(buf, "submit", "prev", "Prev Page", "");
+
+ // Switch to monospaced font
+ cyg_html_tag_begin( buf, "font", "face=\"monospace\"" );
+
+ html_table_begin( buf, "" );
+ cyg_httpd_start_chunked("html");
+
+ strcpy(p->outbuffer, buf);
+ cyg_httpd_write_chunked(p->outbuffer, strlen(p->outbuffer));
+ sprintf(buf," ");
+
+ if (valid_base == true) {
+ cyg_addrword_t loc;
+ cyg_addrword_t oloc;
+
+ for( oloc = loc = base; loc <= (base+size) ; loc++ )
+ {
+ if( ( loc % 16 ) == 0 )
+ {
+
+ if( loc != base )
+ {
+ html_table_data_begin( buf, "" );
+ for( ; oloc < loc; oloc++ )
+ {
+ int c =*(char *)oloc;
+ if(c) sprintf( temp, "%c",c );
+ else sprintf( temp, ".");
+ strcat(buf,temp);
+ }
+ html_table_row_end( buf );
+ }
+
+ if( loc == (base+size) )
+ break;
+ html_table_row_begin(buf, "" );
+ html_table_data_begin( buf, "" );
+ sprintf( temp, "%08x:",loc);
+ strcat(buf,temp);
+ }
+
+ html_table_data_begin( buf, "" );
+
+ if( (loc % datasize) == 0 )
+ {
+ switch( datasize )
+ {
+ case 1: {
+ sprintf( temp, "%02x", *(cyg_uint8 *)loc );
+ strcat(buf,temp);
+ break;
+ }
+ case 2: {
+ sprintf( temp, "%04x", *(cyg_uint16 *)loc );
+ strcat(buf,temp);
+ break;
+ }
+ case 4: {
+ sprintf( temp, "%08x", *(cyg_uint32 *)loc );
+ strcat(buf,temp);
+ break;
+ }
+ }
+ }
+
+ strcpy(p->outbuffer, buf);
+ cyg_httpd_write_chunked(p->outbuffer, strlen(p->outbuffer));
+ sprintf(buf," ");
+ }
+
+ }
+ html_table_end( buf );
+ cyg_html_tag_end( buf, "font" );
+
+ html_form_input(buf, "submit", "next", "Next Page", "");


+ }
+ html_form_end( buf );
+
+ draw_navbar(buf);
+ }
+ html_body_end(buf);
+
+ html_end(buf);
+
+ strcpy(p->outbuffer, buf);
+ cyg_httpd_write_chunked(p->outbuffer, strlen(p->outbuffer));
+ cyg_httpd_end_chunked();
+
+ return -1; // Do not further search the file system.
+}
+
+
+cyg_int32 monitor_index(CYG_HTTPD_STATE* p)
+{
+
+
+
+ char buf[2048];
+ sprintf( buf, " ");
+
+ static char monitor_index_blurb[] =
+ "<p>This is the eCos System Monitor. It presents a simple web monitor "
+ "and control interface for eCos systems.\n"
+ "<p>Use the navigation bar at the bottom of each page to explore."
+ ;
+
+ html_begin(buf);
+
+ html_head(buf,"eCos System Monitor", "");
+
+ html_body_begin(buf,"");
+ {
+ html_heading(buf, 2, "eCos System Monitor" );
+
+ strcat( buf, monitor_index_blurb );
+
+ draw_navbar(buf);
+ }
+ html_body_end(buf);
+
+ html_end(buf);
+
+ cyg_httpd_start_chunked("html");
+ strcpy(p->outbuffer, buf);
+ cyg_httpd_write_chunked(p->outbuffer, strlen(p->outbuffer));
+ cyg_httpd_end_chunked();
+
+ return -1; // Do not further search the file system.
+}
+
+cyg_int32 monitor_load(CYG_HTTPD_STATE* p)
+{
+
+ char buf[2048];
+ sprintf( buf, " ");
+
+ cyg_uint32 average_point1s;
+ cyg_uint32 average_1s;
+ cyg_uint32 average_10s;
+
+ html_begin(buf);
+
+ html_head(buf,"eCos CPU Load Monitor", "");
+ html_body_begin(buf,"");
+ {
+ html_heading(buf, 2, "CPU Load Monitor" );
+
+#ifdef CYGPKG_HAL_SYNTH
+ html_heading(buf, 3, "CPU load monitor is not available in Synth target" );
+#else
+ cyg_cpuload_get(handle,&average_point1s,&average_1s,&average_10s);
+ html_heading(buf, 3, "Current CPU Load" );
+ html_table_begin(buf,"border cellpadding=\"2\"");
+ html_table_row_begin(buf, "" );
+ html_table_data_begin( buf, "" );
+ strcat( buf, "<b>Last 10s:</b> " );
+ html_table_data_end( buf );
+ html_table_data_begin( buf, "average_10s" );
+ strcat( buf, );
+ html_table_data_end( buf );
+ html_table_row_end(buf );
+ html_table_row_begin(buf, "" );
+ html_table_data_begin( buf, "" );
+ strcat( buf, "<b>Last 1s: </b>" );
+ html_table_data_end( buf );
+ html_table_data_begin( buf, "" );
+ strcat( buf, average_1s );
+ html_table_data_end( buf );
+ html_table_row_end(buf);
+ html_table_row_begin(buf, "" );
+ html_table_data_begin( buf, "" );
+ strcat( buf, "<b>Last 100ms: </b>" );
+ html_table_data_end( buf );
+ html_table_data_begin( buf, "" );
+ strcat( buf, average_point1s );
+ html_table_data_end( buf );
+ html_table_row_end(buf);
+ html_table_end( buf);
+#endif
+
+
+
+ draw_navbar(buf);
+ }
+ html_body_end(buf);
+
+ html_end(buf);
+
+ cyg_httpd_start_chunked("html");
+ strcpy(p->outbuffer, buf);
+ cyg_httpd_write_chunked(p->outbuffer, strlen(p->outbuffer));
+ cyg_httpd_end_chunked();
+
+ return -1; // Do not further search the file system.
+}
+
+
+/* ================================================================= */
+/* eCos Logo
+ *
+ * Define the logo as a byte array, and then define the data structure
+ * and table entry to allow it to be fetched by the client.
+ */
+
+
+static cyg_uint8 ecos_logo_gif[] = {
+ 0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x6f, 0x00, 0x23, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xea, 0x19, 0x00, 0xcc, 0x00, 0x00, 0xfd, 0xfd, 0xfd, 0x83, 0x00, 0x00, 0xf6,
+ 0xf6, 0xf6, 0x2f, 0x2f, 0x2f, 0xef, 0xef, 0xef, 0x19, 0x00, 0x19, 0x45, 0x45, 0x45, 0xbb, 0xbb,
+ 0xbb, 0xe2, 0x3e, 0x3e, 0xe8, 0xbb, 0xd3, 0x3e, 0x3e, 0x3e, 0xfb, 0xfb, 0xfb, 0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00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00,
+ 0x00, 0x00, 0x6f, 0x00, 0x23, 0x00, 0x40, 0x08, 0xff, 0x00, 0x03, 0x08, 0x1c, 0x28, 0x10, 0x41,
+ 0x8a, 0x17, 0x0e, 0x1c, 0x00, 0x58, 0xc8, 0xb0, 0xa1, 0xc3, 0x87, 0x10, 0x21, 0x12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x35, 0x4e, 0x84, 0x80, 0x42, 0x0e, 0x5d,
+ 0x70, 0x83, 0x48, 0xac, 0xf5, 0xe8, 0xa3, 0x46, 0x2e, 0xac, 0x30, 0x9a, 0x48, 0x45, 0x66, 0xc4,
+ 0x80, 0x77, 0x01, 0x74, 0x69, 0x91, 0x75, 0x05, 0x0a, 0x80, 0xa4, 0x59, 0x5e, 0x92, 0x54, 0x92,
+ 0x94, 0x5f, 0x3d, 0xf9, 0x16, 0x09, 0x59, 0x6d, 0x44, 0x03, 0x98, 0x31, 0xfd, 0x48, 0x58, 0x56,
+ 0x20, 0x20, 0x45, 0x90, 0x71, 0xe2, 0xf5, 0x39, 0xde, 0x44, 0xe6, 0x05, 0xea, 0xdf, 0x4e, 0x1c,
+ 0x90, 0xe0, 0x40, 0x95, 0x7e, 0xf2, 0x45, 0x9e, 0xa0, 0xe6, 0x75, 0xc0, 0x80, 0x04, 0x00, 0x0a,
+ 0x85, 0x00, 0x82, 0x89, 0x86, 0xb7, 0x28, 0xa3, 0x82, 0x4e, 0x40, 0x27, 0x41, 0x94, 0x56, 0x2a,
+ 0xde, 0xa5, 0x98, 0x32, 0x5a, 0x58, 0x6a, 0x7d, 0xed, 0x90, 0x10, 0x93, 0x9e, 0x02, 0x00, 0x2a,
+ 0x47, 0x2e, 0x78, 0x14, 0x2a, 0x53, 0xb6, 0x75, 0xff, 0x0a, 0x91, 0x03, 0x53, 0xc6, 0x84, 0x00,
+ 0x09, 0x7c, 0x5d, 0x70, 0x82, 0x7b, 0x29, 0x21, 0x25, 0xc1, 0xa6, 0x03, 0x35, 0x90, 0x61, 0x46,
+ 0x2e, 0x48, 0x18, 0xec, 0xb0, 0x16, 0xb1, 0x45, 0x62, 0x44, 0x70, 0x92, 0xb5, 0x58, 0x49, 0x0a,
+ 0x0a, 0xb5, 0x91, 0xb1, 0x31, 0xa1, 0x79, 0x11, 0xb5, 0x03, 0x69, 0xc9, 0x51, 0x0c, 0x50, 0x3e,
+ 0x74, 0x01, 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d, 0x71, 0x96, 0xe4, 0x04, 0x53, 0x75, 0x00, 0x37,
+ 0x4a, 0x05, 0x42, 0xa5, 0x9f, 0xdb, 0x15, 0x8d, 0x61, 0x2a, 0xd0, 0xd1, 0x0c, 0x2c, 0x0b, 0x51,
+ 0xad, 0x6d, 0xf2, 0xec, 0xd0, 0x70, 0x35, 0x61, 0x69, 0x71, 0xcb, 0x7a, 0x0b, 0x65, 0x2d, 0x46,
+ 0x21, 0x11, 0x0c, 0x91, 0xce, 0x29, 0x41, 0x80, 0x68, 0x4b, 0x0e, 0xa0, 0xac, 0x35, 0x96, 0xd8,
+ 0x96, 0xd5, 0x51, 0xe7, 0x8f, 0x63, 0x44, 0x73, 0x00, 0x6e, 0xc5, 0xa5, 0x02, 0x09, 0xa8, 0x93,
+ 0xf0, 0xc2, 0xe5, 0x7e, 0xae, 0x1a, 0xd6, 0x08, 0x12, 0xc4, 0x2e, 0x01, 0x85, 0xaf, 0x66, 0x64,
+ 0x75, 0x41, 0x5f, 0xa7, 0xaa, 0xe8, 0xe6, 0xb5, 0x0b, 0x3a, 0x3a, 0x4a, 0x37, 0xe4, 0xae, 0xfb,
+ 0xbf, 0x1a, 0xf7, 0x3e, 0x18, 0x0d, 0x91, 0x0e, 0x14, 0x10, 0x00, 0x3b
+};
+
+CYG_HTTPD_HANDLER_TABLE_ENTRY(hal_monitor_entry1, "/monitor/", monitor_index);
+CYG_HTTPD_HANDLER_TABLE_ENTRY(hal_monitor_entry2, "/monitor", monitor_index);
+CYG_HTTPD_HANDLER_TABLE_ENTRY(hal_monitor_entry3, "/monitor/threads.html", monitor_threads);
+CYG_HTTPD_HANDLER_TABLE_ENTRY(hal_monitor_entry4, "/monitor/thread_edit.html", monitor_thread_edit);
+CYG_HTTPD_HANDLER_TABLE_ENTRY(hal_monitor_entry5, "/monitor/interrupts.html", monitor_interrupts);
+CYG_HTTPD_HANDLER_TABLE_ENTRY(hal_monitor_entry6, "/monitor/memory.html", monitor_memory);
+CYG_HTTPD_HANDLER_TABLE_ENTRY(hal_monitor_entry7, "/monitor/network.html", monitor_network);
+CYG_HTTPD_HANDLER_TABLE_ENTRY(hal_monitor_entry8, "/monitor/load.html", monitor_load);
+CYG_HTTPD_IRES_TABLE_ENTRY(hal_monitor_gif,"/monitor/ecos.gif",ecos_logo_gif,1660);
+




--
Greetings,

tezet
JID: tezet.pl@gmail.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]