[Olsr-cvs] olsrd-current/lib/httpinfo/src html.h, 1.6, 1.7 olsrd_httpinfo.c, 1.60, 1.61 olsrd_plugin.c, 1.12, 1.13 olsrd_plugin.h, 1.20, 1.21

Bernd Petrovitsch (spam-protected)
Sun Feb 4 23:37:38 CET 2007


Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10220/lib/httpinfo/src

Modified Files:
	html.h olsrd_httpinfo.c olsrd_plugin.c olsrd_plugin.h 
Log Message:
* applied hunks from Erik Tromps patch at http://home.tiscali.nl/levab001/olsrd-0.4.10.diff

Index: olsrd_httpinfo.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_httpinfo.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -d -r1.60 -r1.61
*** olsrd_httpinfo.c	5 Nov 2006 23:03:56 -0000	1.60
--- olsrd_httpinfo.c	4 Feb 2007 22:37:36 -0000	1.61
***************
*** 716,720 ****
    size += sprintf(&buf[size], "<h2>OLSR routes in kernel</h2>\n");
  
!   size += sprintf(&buf[size], "<table width=\"100%%\" BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Destination</th><th>Gateway</th><th>Metric</th><th>ETX</th><th>Interface</th><th>Type</th></tr>\n");
  
    /* Neighbors */
--- 716,723 ----
    size += sprintf(&buf[size], "<h2>OLSR routes in kernel</h2>\n");
  
!   size += sprintf(&buf[size], "<table width=\"100%%\" BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Destination</th><th>Gateway</th><th>Metric</th>");
!   if (olsr_cnf->lq_level > 0)
!     size += sprintf(&buf[size], "<th>ETX</th>");
!   size += sprintf(&buf[size], "<th>Interface</th><th>Type</th></tr>\n");
  
    /* Neighbors */
***************
*** 725,734 ****
  	  routes = routes->next)
  	{
! 	  size += sprintf(&buf[size], "<tr><td>%s</td><td>%s</td><td>%d</td><td>%.2f</td><td>%s</td><td>HOST</td></tr>\n",
! 			  olsr_ip_to_string(&routes->rt_dst),
! 			  olsr_ip_to_string(&routes->rt_router),
! 			  routes->rt_metric,
! 			  routes->rt_etx,
! 			  routes->rt_if->int_name);
  	}
      }
--- 728,748 ----
  	  routes = routes->next)
  	{
! 	  size += sprintf(&buf[size],
!                          "<tr><td><a href=\"http://%s:%d/all\">%s</a></td>"
!                          "<td><a href=\"http://%s:%d/all\">%s</a></td>"
!                          "<td>%d</td>",
!                          olsr_ip_to_string(&routes->rt_dst),
!                          http_port,
!                          olsr_ip_to_string(&routes->rt_dst),
!                          olsr_ip_to_string(&routes->rt_router),
!                          http_port,
!                          olsr_ip_to_string(&routes->rt_router),
!                          routes->rt_metric);
!           if (olsr_cnf->lq_level > 0)
! 	    size += sprintf(&buf[size], "<td>%.2f</td>", routes->rt_etx);
! 	  size += sprintf(&buf[size],
!                          "<td>%s</td>"
!                          "<td>HOST</td></tr>\n",
!                          routes->rt_if->int_name);
  	}
      }
***************
*** 741,749 ****
  	  routes = routes->next)
  	{
! 	  size += sprintf(&buf[size], "<tr><td>%s</td><td>%s</td><td>%d</td><td>%s</td><td>HNA</td></tr>\n",
! 			  olsr_ip_to_string(&routes->rt_dst),
! 			  olsr_ip_to_string(&routes->rt_router),
! 			  routes->rt_metric,
! 			  routes->rt_if->int_name);
  	}
      }
--- 755,773 ----
  	  routes = routes->next)
  	{
! 	  size += sprintf(&buf[size],
!                          "<tr><td>%s</td>"
!                          "<td><a href=\"http://%s:%d/all\">%s</a></td>"
!                          "<td>%d</td>",
!                          olsr_ip_to_string(&routes->rt_dst),
!                          olsr_ip_to_string(&routes->rt_router),
!                          http_port,
!                          olsr_ip_to_string(&routes->rt_router),
!                          routes->rt_metric);
!           if (olsr_cnf->lq_level > 0)
! 	    size += sprintf(&buf[size], "<td>%.2f</td>", routes->rt_etx);
! 	  size += sprintf(&buf[size],
!                          "<td>%s</td>"
!                          "<td>HNA</td></tr>\n",
!                          routes->rt_if->int_name);
  	}
      }
***************
*** 819,833 ****
      size += sprintf(&buf[size], "</tr>\n<tr>\n");
  
!     size += sprintf(&buf[size], "<td>Hysteresis: %s</td>\n", olsr_cnf->use_hysteresis ? "Enabled" : "Disabled");
! 	
!     size += sprintf(&buf[size], "<td>Hyst scaling: %0.2f</td>\n", olsr_cnf->hysteresis_param.scaling);
!     size += sprintf(&buf[size], "<td>Hyst lower/upper: %0.2f/%0.2f</td>\n", olsr_cnf->hysteresis_param.thr_low, olsr_cnf->hysteresis_param.thr_high);
  
      size += sprintf(&buf[size], "</tr>\n<tr>\n");
  
!     size += sprintf(&buf[size], "<td>LQ extention: %s</td>\n", olsr_cnf->lq_level ? "Enabled" : "Disabled");
!     size += sprintf(&buf[size], "<td>LQ level: %d</td>\n", olsr_cnf->lq_level);
!     size += sprintf(&buf[size], "<td>LQ winsize: %d</td>\n", olsr_cnf->lq_wsize);
!     size += sprintf(&buf[size], "<td></td>\n");
  
      size += sprintf(&buf[size], "</tr></table>\n");
--- 843,864 ----
      size += sprintf(&buf[size], "</tr>\n<tr>\n");
  
!     if (olsr_cnf->lq_level == 0)
!       {
!         size += sprintf(&buf[size], "<td>Hysteresis: %s</td>\n", olsr_cnf->use_hysteresis ? "Enabled" : "Disabled");
! 	if (olsr_cnf->use_hysteresis)
!           {
!             size += sprintf(&buf[size], "<td>Hyst scaling: %0.2f</td>\n", olsr_cnf->hysteresis_param.scaling);
!             size += sprintf(&buf[size], "<td>Hyst lower/upper: %0.2f/%0.2f</td>\n", olsr_cnf->hysteresis_param.thr_low, olsr_cnf->hysteresis_param.thr_high);
!           }
!       }
  
      size += sprintf(&buf[size], "</tr>\n<tr>\n");
  
!     size += sprintf(&buf[size], "<td>LQ extension: %s</td>\n", olsr_cnf->lq_level ? "Enabled" : "Disabled");
!     if (olsr_cnf->lq_level)
!       {
!         size += sprintf(&buf[size], "<td>LQ level: %d</td>\n", olsr_cnf->lq_level);
!         size += sprintf(&buf[size], "<td>LQ winsize: %d</td>\n", olsr_cnf->lq_wsize);
!       }
  
      size += sprintf(&buf[size], "</tr></table>\n");
***************
*** 871,875 ****
  	    size += sprintf(&buf[size], "<td>STATUS: UP</td></tr>\n");
  	  }	    
- 
        }
  
--- 902,905 ----
***************
*** 953,957 ****
  
    size += sprintf(&buf[size], "<h2>Links</h2>\n");
!   size += sprintf(&buf[size], "<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 */
--- 983,990 ----
  
    size += sprintf(&buf[size], "<h2>Links</h2>\n");
!   size += sprintf(&buf[size], "<table width=\"100%%\" BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Local IP</th><th>remote IP</th><th>Hysteresis</th>\n");
!   if (olsr_cnf->lq_level > 0)
!     size += sprintf(&buf[size], "<th>LinkQuality</th><th>lost</th><th>total</th><th>NLQ</th><th>ETX</th>\n");
!   size += sprintf(&buf[size], "</tr>\n");
  
    /* Link set */
***************
*** 959,971 ****
      while(link)
        {
! 	size += sprintf(&buf[size], "<tr><td>%s</td><td>%s</td><td>%0.2f</td><td>%0.2f</td><td>%d</td><td>%d</td><td>%0.2f</td><td>%0.2f</td></tr>\n",
! 			olsr_ip_to_string(&link->local_iface_addr),
! 			olsr_ip_to_string(&link->neighbor_iface_addr),
! 			link->L_link_quality, 
! 			link->loss_link_quality,
! 			link->lost_packets, 
! 			link->total_packets,
! 			link->neigh_link_quality, 
! 			(link->loss_link_quality * link->neigh_link_quality) ? 1.0 / (link->loss_link_quality * link->neigh_link_quality) : 0.0);
  
  	link = link->next;
--- 992,1019 ----
      while(link)
        {
! 	size += sprintf(&buf[size],
!                        "<tr><td>%s</td>"
!                        "<td><a href=\"http://%s:%d/all\">%s</a></td>"
!                        "<td>%0.2f</td>",
!                        olsr_ip_to_string(&link->local_iface_addr),
!                        olsr_ip_to_string(&link->neighbor_iface_addr),
!                        http_port,
!                        olsr_ip_to_string(&link->neighbor_iface_addr),
!                        link->L_link_quality);
!         if (olsr_cnf->lq_level > 0)
!           {
! 	    size += sprintf(&buf[size],
!                            "<td>%0.2f</td>"
!                            "<td>%d</td>"
!                            "<td>%d</td>"
!                            "<td>%0.2f</td>"
!                            "<td>%0.2f</td></tr>\n",
!                            link->loss_link_quality,
!                            link->lost_packets, 
!                            link->total_packets,
!                            link->neigh_link_quality, 
!                            (link->loss_link_quality * link->neigh_link_quality) ? 1.0 / (link->loss_link_quality * link->neigh_link_quality) : 0.0);
!           }
! 	size += sprintf(&buf[size], "</tr>\n");
  
  	link = link->next;
***************
*** 984,988 ****
  	{
  	  size += sprintf(&buf[size], 
! 			  "<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%d</td>", 
  			  olsr_ip_to_string(&neigh->neighbor_main_addr),
  			  (neigh->status == SYM) ? "YES" : "NO",
--- 1032,1042 ----
  	{
  	  size += sprintf(&buf[size], 
! 			  "<tr><td><a href=\"http://%s:%d/all\">%s</a></td>"
! 			  "<td>%s</td>"
! 			  "<td>%s</td>"
! 			  "<td>%s</td>"
! 			  "<td>%d</td>", 
! 			  olsr_ip_to_string(&neigh->neighbor_main_addr),
!                           http_port,
  			  olsr_ip_to_string(&neigh->neighbor_main_addr),
  			  (neigh->status == SYM) ? "YES" : "NO",
***************
*** 1024,1028 ****
  
  
!   size += sprintf(&buf[size], "<h2>Topology entries</h2>\n<table width=\"100%%\" BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Destination IP</th><th>Last hop IP</th><th>LQ</th><th>ILQ</th><th>ETX</th></tr>\n");
  
  
--- 1078,1085 ----
  
  
!   size += sprintf(&buf[size], "<h2>Topology entries</h2>\n<table width=\"100%%\" BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=center><tr><th>Destination IP</th><th>Last hop IP</th>");
!   if (olsr_cnf->lq_level > 0)
!     size += sprintf(&buf[size], "<th>LQ</th><th>ILQ</th><th>ETX</th>");
!   size += sprintf(&buf[size], "</tr>\n");
  
  
***************
*** 1038,1047 ****
  	  while(dst_entry != &entry->destinations)
  	    {
! 	      size += sprintf(&buf[size], "<tr><td>%s</td><td>%s</td><td>%0.2f</td><td>%0.2f</td><td>%0.2f</td></tr>\n", 
! 			      olsr_ip_to_string(&dst_entry->T_dest_addr),
! 			      olsr_ip_to_string(&entry->T_last_addr), 
! 			      dst_entry->link_quality,
! 			      dst_entry->inverse_link_quality,
! 			      (dst_entry->link_quality * dst_entry->inverse_link_quality) ? 1.0 / (dst_entry->link_quality * dst_entry->inverse_link_quality) : 0.0);
  
  	      dst_entry = dst_entry->next;
--- 1095,1118 ----
  	  while(dst_entry != &entry->destinations)
  	    {
! 	      size += sprintf(&buf[size],
!                              "<tr><td><a href=\"http://%s:%d/all\">%s</a></td>"
!                              "<td><a href=\"http://%s:%d/all\">%s</a></td>",
!                              olsr_ip_to_string(&dst_entry->T_dest_addr),
!                              http_port,
!                              olsr_ip_to_string(&dst_entry->T_dest_addr),
!                              olsr_ip_to_string(&entry->T_last_addr), 
!                              http_port,
!                              olsr_ip_to_string(&entry->T_last_addr));
!               if (olsr_cnf->lq_level > 0)
!                 {
! 	          size += sprintf(&buf[size],
!                                  "<td>%0.2f</td>"
!                                  "<td>%0.2f</td>"
!                                  "<td>%0.2f</td>\n",
!                                  dst_entry->link_quality,
!                                  dst_entry->inverse_link_quality,
!                                  (dst_entry->link_quality * dst_entry->inverse_link_quality) ? 1.0 / (dst_entry->link_quality * dst_entry->inverse_link_quality) : 0.0);
!                 }
! 	      size += sprintf(&buf[size], "</tr>\n");
  
  	      dst_entry = dst_entry->next;
***************
*** 1086,1090 ****
  	      size += sprintf(&buf[size], "<td>%s</td>",
  			      olsr_netmask_to_string(&tmp_net->A_netmask));
! 	      size += sprintf(&buf[size], "<td>%s</td></tr>\n",
                                olsr_ip_to_string(&tmp_hna->A_gateway_addr));
  	      tmp_net = tmp_net->next;
--- 1157,1163 ----
  	      size += sprintf(&buf[size], "<td>%s</td>",
  			      olsr_netmask_to_string(&tmp_net->A_netmask));
! 	      size += sprintf(&buf[size], "<td><a href=\"http://%s:%d/all\">%s</a></td></tr>\n",
!                               olsr_ip_to_string(&tmp_hna->A_gateway_addr),
!                               http_port,
                                olsr_ip_to_string(&tmp_hna->A_gateway_addr));
  	      tmp_net = tmp_net->next;
***************
*** 1104,1108 ****
  build_mid_body(char *buf, olsr_u32_t bufsize)
  {
!   int size = 0;
    olsr_u8_t index;
    struct mid_entry *entry;
--- 1177,1181 ----
  build_mid_body(char *buf, olsr_u32_t bufsize)
  {
!   int size = 0, mid_cnt;
    olsr_u8_t index;
    struct mid_entry *entry;
***************
*** 1117,1132 ****
        while(entry != &mid_set[index])
  	{
! 	  size += sprintf(&buf[size], "<tr><td>%s</td>\n", olsr_ip_to_string(&entry->main_addr));
  	  size += sprintf(&buf[size], "<td><select>\n<option>IP ADDRESS</option>\n");
  
  	  alias = entry->aliases;
  	  while(alias)
  	    {
  	      size += sprintf(&buf[size], "<option>%s</option>\n", olsr_ip_to_string(&alias->alias));
  	      alias = alias->next_alias;
  	    }
! 	  size += sprintf(&buf[size], "</select>\n");
! 
! 	  size += sprintf(&buf[size], "</tr>\n");
  	  entry = entry->next;
  	}
--- 1190,1208 ----
        while(entry != &mid_set[index])
  	{
! 	  size += sprintf(&buf[size], "<tr><td><a href=\"http://%s:%d/all\">%s</a></td>\n",
! 	                  olsr_ip_to_string(&entry->main_addr),
!                           http_port,
! 	                  olsr_ip_to_string(&entry->main_addr));
  	  size += sprintf(&buf[size], "<td><select>\n<option>IP ADDRESS</option>\n");
  
  	  alias = entry->aliases;
+ 	  mid_cnt = 0;
  	  while(alias)
  	    {
  	      size += sprintf(&buf[size], "<option>%s</option>\n", olsr_ip_to_string(&alias->alias));
+ 	      mid_cnt ++;
  	      alias = alias->next_alias;
  	    }
! 	  size += sprintf(&buf[size], "</select> (%d)</td></tr>\n", mid_cnt);
  	  entry = entry->next;
  	}

Index: html.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/html.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** html.h	14 Mar 2005 21:28:15 -0000	1.6
--- html.h	4 Feb 2007 22:37:36 -0000	1.7
***************
*** 49,53 ****
  static const char *httpinfo_css[] =
  {
!   "A {text-decoration: none}\n",
    "TH{text-align: left}\n",
    "H1, H3, TD, TH {font-family: Helvetica; font-size: 80%%}\n",
--- 49,53 ----
  static const char *httpinfo_css[] =
  {
!   "#A {text-decoration: none}\n",
    "TH{text-align: left}\n",
    "H1, H3, TD, TH {font-family: Helvetica; font-size: 80%%}\n",

Index: olsrd_plugin.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_plugin.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** olsrd_plugin.h	29 May 2005 12:47:41 -0000	1.20
--- olsrd_plugin.h	4 Feb 2007 22:37:36 -0000	1.21
***************
*** 72,76 ****
  #define PLUGIN_INTERFACE_VERSION 4
  
! int http_port;
  
  /* Allowed hosts stuff */
--- 72,76 ----
  #define PLUGIN_INTERFACE_VERSION 4
  
! extern int http_port;
  
  /* Allowed hosts stuff */

Index: olsrd_plugin.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_plugin.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** olsrd_plugin.c	29 May 2005 12:47:41 -0000	1.12
--- olsrd_plugin.c	4 Feb 2007 22:37:36 -0000	1.13
***************
*** 52,55 ****
--- 52,57 ----
  #include "olsrd_httpinfo.h"
  
+ int http_port = 0;
+ 
  static void __attribute__ ((constructor)) 
  my_init(void);





More information about the Olsr-cvs mailing list