New HTML layout now using multiple pages. CSS file now seperated from the HTML page...
authorAndreas Tonnesen <andreto@olsr.org>
Sun, 2 Jan 2005 13:54:40 +0000 (13:54 +0000)
committerAndreas Tonnesen <andreto@olsr.org>
Sun, 2 Jan 2005 13:54:40 +0000 (13:54 +0000)
lib/httpinfo/Makefile
lib/httpinfo/src/gfx.h
lib/httpinfo/src/olsrd_httpinfo.c
lib/httpinfo/src/olsrd_httpinfo.h

index ff79cbd..a1d132c 100644 (file)
@@ -14,7 +14,7 @@ ifeq ($(OS), linux)
 NAME ?= olsrd_httpinfo.so.0.1
 NAMEFLAGS ?= -Wl,-soname,$(NAME)
 CFLAGS ?= -g -O2 -fPIC -Dlinux -Wall -Wmissing-prototypes -Wstrict-prototypes
-LDFLAGS ?= -fPIC -shared
+LDFLAGS ?= -g -fPIC -shared
 LIBS ?= -lc -lm
 INSTALL_LIB =  install -D -m 755 $(NAME) $(LIBDIR)/$(NAME);\
                /sbin/ldconfig -n $(LIBDIR)
index 220ab25..61fd6f8 100644 (file)
@@ -37,7 +37,7 @@
  * to the project. For more information see the website or contact
  * the copyright holders.
  *
- * $Id: gfx.h,v 1.2 2004/12/21 08:55:46 kattemat Exp $
+ * $Id: gfx.h,v 1.3 2005/01/02 13:54:40 kattemat Exp $
  */
 
 /*
@@ -172,12 +172,12 @@ static unsigned char favicon_ico[] = {
 };
 
 
-static int favicon_ico_len = 1406;
+const unsigned int favicon_ico_len = 1406;
 
 
 
 
-unsigned char logo_gif[] = {
+static unsigned char logo_gif[] = {
   0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x50, 0x00, 0x50, 0x00, 0xf7, 0x00,
   0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x84, 0x10, 0x18, 0x7b, 0x10,
   0x18, 0x7b, 0x42, 0x4a, 0x84, 0x84, 0x94, 0x5a, 0x5a, 0x63, 0x7b, 0x7b,
@@ -414,8 +414,17 @@ unsigned char logo_gif[] = {
   0x39, 0x12, 0x10, 0x00, 0x3b
 };
 
-static unsigned int logo_gif_len = 2801;
+const unsigned int logo_gif_len = 2801;
 
 
+static unsigned char grayline_gif[] = {
+  0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x01, 0x00, 0x01, 0x00, 0x80, 0x00,
+  0x00, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x21, 0xf9, 0x04, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00,
+  0x00, 0x02, 0x02, 0x44, 0x01, 0x00, 0x3b
+};
+
+const unsigned int grayline_gif_len = 43;
+
 
 #endif
index 9702f96..f2e6f29 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.27 2004/12/31 08:58:33 kattemat Exp $
+ * $Id: olsrd_httpinfo.c,v 1.28 2005/01/02 13:54:40 kattemat Exp $
  */
 
 /*
 
 #define FRAMEWIDTH 800
 
+#define ACTIVE_TAB "class=\"active\""
+
+
+#define FILENREQ_MATCH(req, filename) \
+        !strcmp(req, filename) || \
+        (strlen(req) && !strcmp(&req[1], filename))
+
+struct tab_entry
+{
+  char *tab_label;
+  char *filename;
+  int(*build_body_cb)(char *, olsr_u32_t);
+};
+
+struct static_bin_file_entry
+{
+  char *filename;
+  unsigned char *data;
+  unsigned int data_size;
+};
+
+struct static_txt_file_entry
+{
+  char *filename;
+  const char **data;
+};
+
 static int
 get_http_socket(int);
 
+int
+build_tabs(char *, int);
+
 void
 parse_http_request(int);
 
@@ -96,6 +126,15 @@ build_hna_body(char *, olsr_u32_t);
 int
 build_mid_body(char *, olsr_u32_t);
 
+int
+build_nodes_body(char *, olsr_u32_t);
+
+int
+build_all_body(char *, olsr_u32_t);
+
+int
+build_about_body(char *, olsr_u32_t);
+
 char *
 sockaddr_to_string(struct sockaddr *);
 
@@ -108,6 +147,32 @@ static int client_sockets[MAX_CLIENTS];
 static int curr_clients;
 static int http_socket;
 
+
+
+struct tab_entry tab_entries[] =
+  {
+    {"Status", "status", build_status_body},
+    {"Routes", "routes", build_routes_body},
+    {"Links/Topology", "nodes", build_nodes_body},
+    {"All", "all", build_all_body},
+    {"About", "about", build_about_body},
+    {NULL, NULL, NULL}
+  };
+
+struct static_bin_file_entry static_bin_files[] =
+  {
+    {"favicon.ico", favicon_ico, 1406/*favicon_ico_len*/},
+    {"logo.gif", logo_gif, 2801/*logo_gif_len*/},
+    {"grayline.gif", grayline_gif, 43/*grayline_gif_len*/},
+    {NULL, NULL, 0}
+  };
+
+struct static_txt_file_entry static_txt_files[] =
+  {
+    {"httpinfo.css", httpinfo_css},
+    {NULL, NULL}
+  };
+
 /**
  *Do initialization here
  *
@@ -261,91 +326,100 @@ parse_http_request(int fd)
       stats.ill_hits++;
       c = build_http_header(HTTP_BAD_REQ, OLSR_TRUE, strlen(body), req, MAX_HTTPREQ_SIZE);
     }
-  else if(strlen(filename) > 1)
+  else
     {
-      if(!strcmp(filename, "/favicon.ico") || !strcmp(filename, "favicon.ico"))
+      int i = 0;
+      int y = 0;
+
+      while(static_bin_files[i].filename)
        {
-         stats.ok_hits++;
-         memcpy(body, favicon_ico, favicon_ico_len);
-         size = favicon_ico_len;
-         c = build_http_header(HTTP_OK, OLSR_FALSE, size, req, MAX_HTTPREQ_SIZE);  
+         if(FILENREQ_MATCH(filename, static_bin_files[i].filename))
+           break;
+         i++;
        }
-      else if(!strcmp(filename, "/logo.gif") || !strcmp(filename, "logo.gif"))
+      
+      if(static_bin_files[i].filename)
        {
          stats.ok_hits++;
-         memcpy(body, logo_gif, logo_gif_len);
-         size = logo_gif_len;
+         memcpy(body, static_bin_files[i].data, static_bin_files[i].data_size);
+         size = static_bin_files[i].data_size;
          c = build_http_header(HTTP_OK, OLSR_FALSE, size, req, MAX_HTTPREQ_SIZE);  
+         goto send_http_data;
        }
-      else
+
+      i = 0;
+
+      while(static_txt_files[i].filename)
        {
-         stats.ill_hits++;
-         strcpy(body, HTTP_404_MSG);
-         c = build_http_header(HTTP_BAD_FILE, OLSR_TRUE, strlen(body), req, MAX_HTTPREQ_SIZE);
+         if(FILENREQ_MATCH(filename, static_txt_files[i].filename))
+           break;
+         i++;
        }
-    }
-  else
-    {
-      int i = 0;
-
-      stats.ok_hits++;
-
-      while(http_ok_head[i])
-          {
-              size += sprintf(&body[size], http_ok_head[i]);
-              i++;
-          }
-      olsr_printf(1, "\n\n");
-      /* All is good */
-
-      size += build_frame("Status", 
-                         "status", 
-                         FRAMEWIDTH, 
-                         &body[size], 
-                         HTML_BUFSIZE - size, 
-                         &build_status_body);
-      size += build_frame("Current Routes", 
-                         "routes", 
-                         FRAMEWIDTH, 
-                         &body[size], 
-                         HTML_BUFSIZE - size, 
-                         &build_routes_body);
-      size += build_frame("Links and Neighbors", 
-                         "neighbors", 
-                         FRAMEWIDTH, 
-                         &body[size], 
-                         HTML_BUFSIZE - size, 
-                         &build_neigh_body);
-      size += build_frame("Topology", 
-                         "topology", 
-                         FRAMEWIDTH, 
-                         &body[size], 
-                         HTML_BUFSIZE - size, 
-                         &build_topo_body);
-      size += build_frame("HNA", 
-                         "hna", 
-                         FRAMEWIDTH, 
-                         &body[size], 
-                         HTML_BUFSIZE - size, 
-                         &build_hna_body);
-      size += build_frame("MID", 
-                         "mid", 
-                         FRAMEWIDTH, 
-                         &body[size], 
-                         HTML_BUFSIZE - size, 
-                         &build_mid_body);
+      
+      if(static_txt_files[i].filename)
+       {
+         stats.ok_hits++;
+         y = 0;
+         while(static_txt_files[i].data[y])
+           {
+             size += sprintf(&body[size], static_txt_files[i].data[y]);
+             y++;
+           }
 
+         c = build_http_header(HTTP_OK, OLSR_FALSE, size, req, MAX_HTTPREQ_SIZE);  
+         goto send_http_data;
+       }
 
       i = 0;
-      while(http_ok_tail[i])
-          {
-              size += sprintf(&body[size], http_ok_tail[i]);
-              i++;
-          }
 
+      if(strlen(filename) > 1)
+       {
+         while(tab_entries[i].filename)
+           {
+             if(FILENREQ_MATCH(filename, tab_entries[i].filename))
+               break;
+             i++;
+           }
+       }
 
-      c = build_http_header(HTTP_OK, OLSR_TRUE, size, req, MAX_HTTPREQ_SIZE);
+      if(tab_entries[i].filename)
+       {
+         y = 0;
+         while(http_ok_head[y])
+           {
+             size += sprintf(&body[size], http_ok_head[y]);
+             y++;
+           }
+         
+         size += build_tabs(&body[size], i);
+         size += build_frame("Current Routes", 
+                             "routes", 
+                             FRAMEWIDTH, 
+                             &body[size], 
+                             HTML_BUFSIZE - size, 
+                             tab_entries[i].build_body_cb);
+         
+         stats.ok_hits++;
+         
+         y = 0;
+         while(http_ok_tail[y])
+           {
+             size += sprintf(&body[size], http_ok_tail[y]);
+             y++;
+           }  
+         
+         c = build_http_header(HTTP_OK, OLSR_TRUE, size, req, MAX_HTTPREQ_SIZE);
+         
+         goto send_http_data;
+       }
+      
+      
+      stats.ill_hits++;
+      strcpy(body, HTTP_404_MSG);
+      c = build_http_header(HTTP_BAD_FILE, OLSR_TRUE, strlen(body), req, MAX_HTTPREQ_SIZE);
     }
+
+ send_http_data:
   
   r = send(client_sockets[curr_clients], req, c, 0);   
   if(r < 0)
@@ -440,6 +514,49 @@ build_http_header(http_header_type type,
 
 }
 
+
+
+int 
+build_tabs(char *buf, int active)
+{
+  int size = 0, i = 0, tabs = 0;
+
+  while(strcmp(html_tabs[i], "<!-- TAB ELEMENTS -->"))
+    {
+      size += sprintf(&buf[size], html_tabs[i]);
+      i++;
+    }
+
+  i++;
+
+  while(tab_entries[tabs].tab_label)
+    {
+      if(tabs == active)
+       size += sprintf(&buf[size], 
+                       html_tabs[i], 
+                       tab_entries[tabs].filename, 
+                       ACTIVE_TAB, 
+                       tab_entries[tabs].tab_label);
+      else
+       size += sprintf(&buf[size], 
+                       html_tabs[i], 
+                       tab_entries[tabs].filename, 
+                       " ", 
+                       tab_entries[tabs].tab_label);
+      tabs++;
+    }
+  
+  i++;      
+  while(html_tabs[i])
+    {
+      size += sprintf(&buf[size], html_tabs[i]);
+      i++;
+    }
+  
+  return size;
+}
+
+
 /*
  * destructor - called at unload
  */
@@ -477,9 +594,6 @@ build_frame(char *title,
 {
   int i = 0, size = 0;
 
-  size += sprintf(&buf[size], http_frame[i++], width);
-  size += sprintf(&buf[size], http_frame[i++], link, title);
-
   while(http_frame[i])
     {
       if(!strcmp(http_frame[i], "<!-- BODY -->"))
@@ -572,7 +686,7 @@ build_status_body(char *buf, olsr_u32_t bufsize)
 
       size += sprintf(&buf[size], "HTTP stats(ok/error/illegal): <i>%d/%d/%d</i>\n", stats.ok_hits, stats.err_hits, stats.ill_hits);
 
-    size += sprintf(&buf[size], "<hr><table width=790 border=0>\n<tr>");
+    size += sprintf(&buf[size], "<hr><table width=\"100%%\" border=0>\n<tr>");
 
     size += sprintf(&buf[size], "<td>Main address: <b>%s</b></td>\n", olsr_ip_to_string(main_addr));
     
@@ -614,7 +728,7 @@ build_status_body(char *buf, olsr_u32_t bufsize)
     size += sprintf(&buf[size], "Interfaces:<br>\n");
 
 
-    size += sprintf(&buf[size], "<table width=790 border=0>\n");
+    size += sprintf(&buf[size], "<table width=\"100%%\" border=0>\n");
 
 
     for(ifs = cfg->interfaces; ifs; ifs = ifs->next)
@@ -661,7 +775,7 @@ build_status_body(char *buf, olsr_u32_t bufsize)
 
     size += sprintf(&buf[size], "<hr>Plugins:<br>\n");
 
-    size += sprintf(&buf[size], "<table width=790 border=0><tr><th>Name</th><th>Parameters</th></tr>\n");
+    size += sprintf(&buf[size], "<table width=\"100%%\" border=0><tr><th>Name</th><th>Parameters</th></tr>\n");
 
     for(pentry = cfg->plugins; pentry; pentry = pentry->next)
       {
@@ -792,7 +906,7 @@ build_topo_body(char *buf, olsr_u32_t bufsize)
   struct topo_dst *dst_entry;
 
 
-  size += sprintf(&buf[size], "<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], "Topology entries:<hr>\n<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 */  
@@ -819,7 +933,7 @@ build_topo_body(char *buf, olsr_u32_t bufsize)
        }
     }
 
-  size += sprintf(&buf[size], "</table>\n");
+  size += sprintf(&buf[size], "</table><hr>\n");
 
   return size;
 }
@@ -836,7 +950,7 @@ build_hna_body(char *buf, olsr_u32_t bufsize)
 
   size = 0;
 
-  size += sprintf(&buf[size], "<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], "HNA entries:<hr>\n<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++)
@@ -861,7 +975,7 @@ build_hna_body(char *buf, olsr_u32_t bufsize)
        }
     }
 
-  size += sprintf(&buf[size], "</table>\n");
+  size += sprintf(&buf[size], "</table><hr>\n");
 
   return size;
 }
@@ -875,7 +989,7 @@ build_mid_body(char *buf, olsr_u32_t bufsize)
   struct mid_entry *entry;
   struct addresses *alias;
 
-  size += sprintf(&buf[size], "<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], "MID entries:<hr>\n<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++)
@@ -899,14 +1013,55 @@ build_mid_body(char *buf, olsr_u32_t bufsize)
        }
     }
 
-  size += sprintf(&buf[size], "</table>\n");
+  size += sprintf(&buf[size], "</table><hr>\n");
+
+
+
+  return size;
+}
+
+
+int
+build_nodes_body(char *buf, olsr_u32_t bufsize)
+{
+  int size = 0;
+
+  size += build_neigh_body(buf, bufsize);
+  size += build_topo_body(&buf[size], bufsize - size);
+  size += build_hna_body(&buf[size], bufsize - size);
+  size += build_mid_body(&buf[size], bufsize - size);
 
+  return size;
+}
 
+int
+build_all_body(char *buf, olsr_u32_t bufsize)
+{
+  int size = 0;
+
+  size += build_status_body(&buf[size], bufsize);
+  size += build_routes_body(&buf[size], bufsize - size);
+  size += build_neigh_body(&buf[size], bufsize);
+  size += build_topo_body(&buf[size], bufsize - size);
+  size += build_hna_body(&buf[size], bufsize - size);
+  size += build_mid_body(&buf[size], bufsize - size);
 
   return size;
 }
 
 
+int
+build_about_body(char *buf, olsr_u32_t bufsize)
+{
+  int size = 0, i = 0;
+
+  while(about_frame[i])
+    {
+      size += sprintf(&buf[size], about_frame[i]);
+      i++;
+    }
+  return size;
+}
 
 olsr_bool
 check_allowed_ip(union olsr_ip_addr *addr)
index 3a067de..1d65195 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.19 2004/12/28 20:40:03 kattemat Exp $
+ * $Id: olsrd_httpinfo.h,v 1.20 2005/01/02 13:54:40 kattemat Exp $
  */
 
 /*
 #define HTTP_404_MSG "<html><h1>404 - ERROR, no such file</h1><hr>This server does not support file requests!<br><br><i>" PLUGIN_NAME " version " PLUGIN_VERSION  "</i></html>"
 
 
+
+static const char *httpinfo_css[] =
+{
+  "A {text-decoration: none}\n",
+  "TH{text-align: left}\n",
+  "H1, H2, H3, TD, TH {font-family: Helvetica; font-size: 80%%}\n",
+  "hr\n{\nborder: none;\npadding: 1px;\nbackground: url(grayline.gif) repeat-x bottom;\n}\n",
+  "#maintable\n{\nmargin: 0px;\npadding: 5px;\nborder-left: 1px solid #ccc;\n",
+  "border-right: 1px solid #ccc;\nborder-bottom: 1px solid #ccc;\n}\n",
+  "#footer\n{\nfont-size: 10px;\nline-height: 14px;\ntext-decoration: none;\ncolor: #666;\n}\n",
+  "#container\n{\nwidth: 500px;\npadding: 30px;\nborder: 1px solid #ccc;\nbackground: #fff;\n}\n",
+  "#tabnav\n{\nheight: 20px;\nmargin: 0;\npadding-left: 10px;\n",
+  "background: url(grayline.gif) repeat-x bottom;\n}\n",
+  "#tabnav li\n{\nmargin: 0;\npadding: 0;\ndisplay: inline;\nlist-style-type: none;\n}\n",
+  "#tabnav a:link, #tabnav a:visited\n{\nfloat: left;\nbackground: #ececec;\n",
+  "font-size: 12px;\nline-height: 14px;\nfont-weight: bold;\npadding: 2px 10px 2px 10px;\n",
+  "margin-right: 4px;\nborder: 1px solid #ccc;\ntext-decoration: none;\ncolor: #666;\n}",
+  "#tabnav a:link.active, #tabnav a:visited.active\n{\nborder-bottom: 1px solid #fff;\n",
+  "background: #ffffff;\ncolor: #000;\n}\n",
+  "#tabnav a:hover\n{\nbackground: #777777;\ncolor: #ffffff;\n}\n",
+  NULL
+};
+
+
+
 static const char *http_ok_head[] =
 {
   "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n",
@@ -70,70 +95,61 @@ static const char *http_ok_head[] =
   "<TITLE>olsr.org httpinfo plugin</TITLE>\n",
   "<link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n",
   "<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n",
-  "<STYLE type=\"text/css\">\n",
-  "<!--\n",
-  "A {text-decoration: none}\n",
-  "TH{text-align: left}\n",
-  "H1, H2, H3, TD, TH {font-family: Helvetica; font-size: 80%%}\n",
-  "-->\n",
-  "</STYLE>\n\n",
+  "<link rel=\"stylesheet\" type=\"text/css\" href=\"httpinfo.css\">\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=\"80%%\" VALIGN=middle ALIGN=left>\n",
-  "<FONT COLOR=white SIZE=\"6\" FACE=\"timesroman\">&nbsp;&nbsp;&nbsp;olsr.org OLSR daemon</font></TD>\n",
-  "<TD HEIGHT=\"69\" WIDTH=\"20%%\" VALIGN=middle ALIGN=right>\n",
-  "<img src=\"/logo.gif\"></TD>\n",
-  "</TR>\n<TR BGCOLOR=\"#8888cc\">\n",
-  "<TD HEIGHT=\"25\" ALIGN=right VALIGN=middle colspan=2>\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",
-  "<A HREF=\"#neighbors\"><B>Neighbors</B></A>&nbsp;|&nbsp;\n",
-  "<A HREF=\"#topology\"><B>Topology</B></A>&nbsp;|&nbsp;\n",
-  "<A HREF=\"#hna\"><B>HNA</B></A>&nbsp;|&nbsp;\n",
-  "<A HREF=\"#mid\"><B>MID</B></A>&nbsp;|&nbsp;\n",
-  "<A HREF=\"/\"><B>Refresh</B></A>&nbsp;&nbsp;\n",
-  "</FONT>\n",
-  "</TD>\n",
-  "</TR>\n",
-  "</TABLE>\n",
+  "<body bgcolor=\"#ffffff\" text=\"#000000\">\n",
+  "<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"800\">"
+  "<tbody><tr bgcolor=\"#ffffff\">",
+  "<td align=\"left\" height=\"69\" valign=\"middle\" width=\"80%\">",
+  "<font color=\"black\" face=\"timesroman\" size=\"6\">&nbsp;&nbsp;&nbsp;olsr.org OLSR daemon</font></td>",
+  "<td align=\"right\" height=\"69\" valign=\"middle\" width=\"20%\">",
+  "<img src=\"/logo.gif\"></td>",
+  "</tr>",
+  "<p>",
+  "</table>",
   "<!-- END HEAD -->\n\n",
   NULL
 };
 
 
 
+static const char *html_tabs[] =
+{
+  "<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"800\">\n",
+  "<tr bgcolor=\"#ffffff\"><td>\n",
+  "<ul id=\"tabnav\">\n",
+  "<!-- TAB ELEMENTS -->",
+  "<li><a href=\"%s\" %s>%s</a></li>\n",
+  "</ul>\n",
+  "</td></tr>\n",
+  "<tr><td>\n",
+  NULL
+};
+
+
+
 
 
 static const char *http_ok_tail[] =
 {
     "\n<!-- START TAIL -->\n\n",
-    "<P>\n",
-    "<P>\n",
-    "<HR ALIGN=center WIDTH=800>\n",
-    "<P>\n",
-    "<P>\n",
-    "<TABLE WIDTH=800 BGCOLOR=\"#E0E0FF\" BORDER=0 CELLPADDING=2 ALIGN=center>\n",
-    "<TR>    \n",
-    "<TD ALIGN=center VALIGN=middle>\n",
-    "<TABLE BORDER=0 CELLSPACING=3 CELLPADDING=2>\n",
-    "<TR>\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=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",
-    "</TD>\n",
-    "</TR>\n",
-    "</TABLE>\n",
-    "</BODY></HTML>\n",
+    "<div id=\"footer\">\n\n",
+    "<p><center>\n",
+    "(C)2005 Andreas T&oslash;nnesen<br>\n",
+    "<a href=\"http://www.olsr.org/\">http://www.olsr.org</a>\n",
+    "</center>\n",
+    "</div>\n",
+    "</body></html>\n",
+    NULL
+};
+
+
+static const char *about_frame[] =
+{
+    "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 <br>\n",
+    "<a href=\"mailto:andreto-at-olsr.org\">andreto-at-olsr.org</a><br>\n"
+    "Official olsrd homepage:<br><a href=\"http://www.olsr.org/\">http://www.olsr.org</a><br>\n",
     NULL
 };
 
@@ -141,15 +157,9 @@ static const char *http_ok_tail[] =
 
 static const char *http_frame[] =
 {
-  "<P>\n<TABLE WIDTH=%d CELLSPACING=0 CELLPADDING=3 BORDER=1 ALIGN=center>\n",
-  "<TR BGCOLOR=\"#E0E0FF\">\n<TH ALIGN=left><a name=\"%s\">%s</a></TH>\n",
-  "</TR><TR BGCOLOR=\"#ECECEC\">\n",
-  "<TD>\n",
-  "<P>\n",
+  "<div id=\"maintable\">\n",
   "<!-- BODY -->",
-  "</TD>\n",
-  "</TR>\n",
-  "</TABLE>\n",
+  "</div>\n",
   NULL
 };