More HTML fixes. The infopage now validates in the W3C validator
authorAndreas Tonnesen <andreto@olsr.org>
Sun, 19 Dec 2004 15:48:47 +0000 (15:48 +0000)
committerAndreas Tonnesen <andreto@olsr.org>
Sun, 19 Dec 2004 15:48:47 +0000 (15:48 +0000)
lib/httpinfo/src/olsrd_httpinfo.c
lib/httpinfo/src/olsrd_httpinfo.h

index 84c96dd..2b692d0 100644 (file)
@@ -36,7 +36,7 @@
  * to the project. For more information see the website or contact
  * the copyright holders.
  *
- * $Id: olsrd_httpinfo.c,v 1.15 2004/12/19 15:04:30 kattemat Exp $
+ * $Id: olsrd_httpinfo.c,v 1.16 2004/12/19 15:48:47 kattemat Exp $
  */
 
 /*
@@ -417,7 +417,7 @@ build_routes_body(char *buf, olsr_u32_t bufsize)
   struct rt_entry *routes;
 
   size += sprintf(&buf[size], "OLSR host routes in kernel\n");
-  size += sprintf(&buf[size], "<hr><table width=100%% BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Destination</th><th>Gateway</th><th>Metric</th><th>Interface</th></tr>\n");
+  size += sprintf(&buf[size], "<hr><table width=\"100%%\" BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Destination</th><th>Gateway</th><th>Metric</th><th>Interface</th></tr>\n");
 
   /* Neighbors */
   for(index = 0;index < HASHSIZE;index++)
@@ -437,7 +437,7 @@ build_routes_body(char *buf, olsr_u32_t bufsize)
   size += sprintf(&buf[size], "</table><hr>\n");
 
   size += sprintf(&buf[size], "OLSR HNA routes in kernel\n");
-  size += sprintf(&buf[size], "<hr><table width=100%% BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Destination</th><th>Gateway</th><th>Metric</th><th>Interface</th></tr>\n");
+  size += sprintf(&buf[size], "<hr><table width=\"100%%\" BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Destination</th><th>Gateway</th><th>Metric</th><th>Interface</th></tr>\n");
 
   /* Neighbors */
   for(index = 0;index < HASHSIZE;index++)
@@ -540,10 +540,10 @@ build_status_body(char *buf, olsr_u32_t bufsize)
       {
        struct interface *rifs = ifs->interf;
 
-       size += sprintf(&buf[size], "<tr><th cellspan=3>%s</th>\n", ifs->name);
+       size += sprintf(&buf[size], "<tr><th colspan=3>%s</th>\n", ifs->name);
        if(!rifs)
          {
-           size += sprintf(&buf[size], "<tr><td cellspan=3>Status: DOWN</td></tr></table>\n");
+           size += sprintf(&buf[size], "<tr><td colspan=3>Status: DOWN</td></tr></table>\n");
            continue;
          }
        
@@ -615,7 +615,7 @@ build_neigh_body(char *buf, olsr_u32_t bufsize)
   int size = 0, index, thop_cnt;
 
   size += sprintf(&buf[size], "Links\n");
-  size += sprintf(&buf[size], "<hr><table width=100%% BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Local IP</th><th>remote IP</th><th>Hysteresis</th><th>LinkQuality</th><th>lost</th><th>total</th><th>NLQ</th><th>ETX</th></tr>\n");
+  size += sprintf(&buf[size], "<hr><table width=\"100%%\" BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Local IP</th><th>remote IP</th><th>Hysteresis</th><th>LinkQuality</th><th>lost</th><th>total</th><th>NLQ</th><th>ETX</th></tr>\n");
 
   /* Link set */
   if(olsr_plugin_io(GETD__LINK_SET, &link, sizeof(link)) && link)
@@ -642,7 +642,7 @@ build_neigh_body(char *buf, olsr_u32_t bufsize)
   size += sprintf(&buf[size], "</table><hr>\n");
 
   size += sprintf(&buf[size], "Neighbors\n");
-  size += sprintf(&buf[size], "<hr><table width=100%% BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>IP address</th><th>SYM</th><th>MPR</th><th>MPRS</th><th>Willingness</th><th>2 Hop Neighbors</th></tr>\n");
+  size += sprintf(&buf[size], "<hr><table width=\"100%%\" BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>IP address</th><th>SYM</th><th>MPR</th><th>MPRS</th><th>Willingness</th><th>2 Hop Neighbors</th></tr>\n");
   /* Neighbors */
   for(index=0;index<HASHSIZE;index++)
     {
@@ -671,7 +671,7 @@ build_neigh_body(char *buf, olsr_u32_t bufsize)
            {
              size += sprintf(&buf[size], "<option>%s</option>\n", olsr_ip_to_string(&list_2->neighbor_2->neighbor_2_addr));
              thop_cnt ++;
-                }
+           }
          size += sprintf(&buf[size], "</select> (%d)</td></tr>\n", thop_cnt);
 
        }
@@ -693,7 +693,7 @@ build_topo_body(char *buf, olsr_u32_t bufsize)
   struct topo_dst *dst_entry;
 
 
-  size += sprintf(&buf[size], "<hr><table width=100%% BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Source IP addr</th><th>Dest IP addr</th><th>LQ</th><th>ILQ</th><th>ETX</th></tr>\n");
+  size += sprintf(&buf[size], "<hr><table width=\"100%%\" BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Source IP addr</th><th>Dest IP addr</th><th>LQ</th><th>ILQ</th><th>ETX</th></tr>\n");
 
 
   /* Topology */  
@@ -739,7 +739,7 @@ build_hna_body(char *buf, olsr_u32_t bufsize)
   size = 0;
 
   size += sprintf(&buf[size], "Remote HNA entries\n");
-  size += sprintf(&buf[size], "<hr><table width=100%% BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Network</th><th>Netmask</th><th>Gateway</th></tr>\n");
+  size += sprintf(&buf[size], "<hr><table width=\"100%%\" BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Network</th><th>Netmask</th><th>Gateway</th></tr>\n");
 
   /* HNA entries */
   for(index=0;index<HASHSIZE;index++)
@@ -766,7 +766,7 @@ build_hna_body(char *buf, olsr_u32_t bufsize)
 
   size += sprintf(&buf[size], "</table><hr>\n");
   size += sprintf(&buf[size], "Local(announced) HNA entries\n");
-  size += sprintf(&buf[size], "<hr><table width=100%% BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Network</th><th>Netmask</th></tr>\n");
+  size += sprintf(&buf[size], "<hr><table width=\"100%%\" BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Network</th><th>Netmask</th></tr>\n");
 
   for(hna4 = cfg->hna4_entries; hna4; hna4 = hna4->next)
     {
@@ -790,7 +790,7 @@ build_mid_body(char *buf, olsr_u32_t bufsize)
   struct mid_entry *entry;
   struct addresses *alias;
 
-  size += sprintf(&buf[size], "<hr><table width=100%% BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Main Address</th><th>Aliases</th></tr>\n");
+  size += sprintf(&buf[size], "<hr><table width=\"100%%\" BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Main Address</th><th>Aliases</th></tr>\n");
   
   /* MID */  
   for(index=0;index<HASHSIZE;index++)
@@ -807,6 +807,7 @@ build_mid_body(char *buf, olsr_u32_t bufsize)
              size += sprintf(&buf[size], "<option>%s</option>\n", olsr_ip_to_string(&alias->address));
              alias = alias->next;
            }
+         size += sprintf(&buf[size], "</select>\n");
 
          size += sprintf(&buf[size], "</tr>\n");
          entry = entry->next;
index 9c266c7..be58e1e 100644 (file)
@@ -37,7 +37,7 @@
  * to the project. For more information see the website or contact
  * the copyright holders.
  *
- * $Id: olsrd_httpinfo.h,v 1.12 2004/12/19 15:04:30 kattemat Exp $
+ * $Id: olsrd_httpinfo.h,v 1.13 2004/12/19 15:48:47 kattemat Exp $
  */
 
 /*
@@ -68,22 +68,21 @@ static const char *http_ok_head[] =
   "<HEAD>\n",
   "<META http-equiv=\"Content-type\" content=\"text/html; charset=ISO-8859-1\">\n",
   "<TITLE>olsr.org httpinfo plugin</TITLE>\n",
-  "</HEAD>\n",
-  "<STYLE>\n",
+  "<STYLE type=\"text/css\">\n",
   "<!--\n",
   "A {text-decoration: none}\n",
   "TH{text-align: left}\n",
   "H1, H2, H3, TD, TH, B {font-family: Helvetica; font-size: 80%}\n",
   "-->\n",
   "</STYLE>\n\n",
+  "</HEAD>\n",
   "<BODY BGCOLOR=\"#FFFFFF\" TEXT=\"#0000000\">\n",
   "<TABLE WIDTH=800 BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center>\n",
   "<TR BGCOLOR=\"#000044\">\n",
-  "<TD HEIGHT=\"69\" WIDTH=\"100%\" VALIGN=center ALIGN=left>\n",
-  "<FONT COLOR=white SIZE=\"6\" FACE=\"timesroman\">&nbsp;&nbsp;&nbsp;olsr.org OLSR daemon</TD>\n",
-  "</FONT></TD>\n",
+  "<TD HEIGHT=\"69\" WIDTH=\"100%\" VALIGN=middle ALIGN=left>\n",
+  "<FONT COLOR=white SIZE=\"6\" FACE=\"timesroman\">&nbsp;&nbsp;&nbsp;olsr.org OLSR daemon</font></TD>\n",
   "</TR>\n<TR BGCOLOR=\"#8888cc\">\n",
-  "<TD HEIGHT=\"25\" ALIGN=right VALIGN=center>\n",
+  "<TD HEIGHT=\"25\" ALIGN=right VALIGN=middle>\n",
   "<FONT COLOR=\"#FFFFFF\">\n",
   "<A HREF=\"#status\"><B>Status</B></A>&nbsp;|&nbsp;\n",
   "<A HREF=\"#routes\"><B>Routes</B></A>&nbsp;|&nbsp;\n",
@@ -111,20 +110,19 @@ static const char *http_ok_tail[] =
     "<P>\n",
     "<HR ALIGN=center WIDTH=800>\n",
     "<P>\n",
-    "<P>     \n",
+    "<P>\n",
     "<TABLE WIDTH=800 BGCOLOR=\"#E0E0FF\" BORDER=0 CELLPADDING=2 ALIGN=center>\n",
     "<TR>    \n",
-    "<TD ALIGN=center VALIGN=center>\n",
+    "<TD ALIGN=center VALIGN=middle>\n",
     "<TABLE BORDER=0 CELLSPACING=3 CELLPADDING=2>\n",
     "<TR>\n",
-    "<TD WIDTH=\"50\%\" ALIGN=\"center\" VALIGN=\"center\">\n",
-    "</CENTER>\n",
+    "<TD WIDTH=\"50\%\" ALIGN=\"center\" VALIGN=middle>\n",
     "<CENTER>Plugin by Andreas T&oslash;nnesen.<br> Send questions or comments to<br>\n",
     "<A HREF=\"mailto:olsr-users@olsr.org\">olsr-users@olsr.org</A> or \n",
     "<A HREF=\"mailto:andreto-at-olsr.org\">andreto-at-olsr.org</A></CENTER></TD>\n",
-    "<TD WIDTH=\"50\%\" ALIGN=\"center\" VALIGN=\"center\">\n",
-    "<CENTER><FONT-=2>Official olsrd homepage:</FONT><br><A HREF=\"http://www.olsr.org/\">http://www.olsr.org</A>\n",
-    "</FONT></CENTER>\n",
+    "<TD WIDTH=\"50\%\" ALIGN=\"center\" VALIGN=middle>\n",
+    "<CENTER>Official olsrd homepage:<br><A HREF=\"http://www.olsr.org/\">http://www.olsr.org</A>\n",
+    "</CENTER>\n",
     "</TD>\n",
     "</TR>\n",
     "</TABLE>\n",