[Olsr-cvs] olsrd-current/lib/httpinfo/src olsrd_httpinfo.c, 1.89, 1.90 admin_interface.c, 1.15, 1.16

Bernd Petrovitsch (spam-protected)
Wed Dec 12 23:06:26 CET 2007


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

Modified Files:
	olsrd_httpinfo.c admin_interface.c 
Log Message:
* do not generate netmasks but the prefixlen

Index: olsrd_httpinfo.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_httpinfo.c,v
retrieving revision 1.89
retrieving revision 1.90
diff -C2 -d -r1.89 -r1.90
*** olsrd_httpinfo.c	2 Dec 2007 19:00:29 -0000	1.89
--- olsrd_httpinfo.c	12 Dec 2007 22:06:24 -0000	1.90
***************
*** 951,974 ****
      if (olsr_cnf->hna_entries) {
        struct ip_prefix_list *hna;
!       if (olsr_cnf->ip_version == AF_INET) {
! 	size += snprintf(&buf[size], bufsize-size, "<tr><th>Network</th><th>Netmask</th></tr>\n");
! 	for (hna = olsr_cnf->hna_entries; hna; hna = hna->next) {
!           union olsr_ip_addr netmask;
!           struct ipaddr_str netbuf, maskbuf;
!           olsr_prefix_to_netmask(&netmask, hna->net.prefix_len);
!           size += snprintf(&buf[size], bufsize-size,
!                            "<tr><td>%s</td><td>%s</td></tr>\n", 
!                            olsr_ip_to_string(&netbuf, &hna->net.prefix),
!                            olsr_ip_to_string(&maskbuf, &netmask));
!         }
!       } else {
! 	size += snprintf(&buf[size], bufsize-size, "<tr><th>Network</th><th>Prefix length</th></tr>\n");
! 	for (hna = olsr_cnf->hna_entries; hna; hna = hna->next) {
!           struct ipaddr_str netbuf;
!           size += snprintf(&buf[size], bufsize-size,
!                            "<tr><td>%s</td><td>%d</td></tr>\n", 
!                            olsr_ip_to_string(&netbuf, &hna->net.prefix),
!                            hna->net.prefix_len);
!         }
        }
      } else {
--- 951,961 ----
      if (olsr_cnf->hna_entries) {
        struct ip_prefix_list *hna;
!       size += snprintf(&buf[size], bufsize-size, "<tr><th>Network</th></tr>\n");
!       for (hna = olsr_cnf->hna_entries; hna; hna = hna->next) {
!         struct ipaddr_str netbuf;
!         size += snprintf(&buf[size], bufsize-size,
!                          "<tr><td>%s/%d</td></tr>\n", 
!                          olsr_ip_to_string(&netbuf, &hna->net.prefix),
!                          hna->net.prefix_len);
        }
      } else {

Index: admin_interface.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/admin_interface.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** admin_interface.c	2 Dec 2007 19:00:29 -0000	1.15
--- admin_interface.c	12 Dec 2007 22:06:24 -0000	1.16
***************
*** 153,176 ****
  
    if(olsr_cnf->hna_entries) {
!     if(olsr_cnf->ip_version == AF_INET) {
!       struct ip_prefix_list *hna;
!       struct ipaddr_str netbuf, maskbuf;
!       for(hna = olsr_cnf->hna_entries; hna; hna = hna->next) {
!         union olsr_ip_addr netmask;
!         olsr_prefix_to_netmask(&netmask, hna->net.prefix_len);
!         size += snprintf(&buf[size], bufsize-size,
!                          "<tr><td halign=\"middle\"><input type=\"checkbox\" name=\"del_hna%1$s*%2$s\" class=\"input_checkbox\"></td><td>%1$s</td><td>%2$s</td></tr>\n",
!                          olsr_ip_to_string(&netbuf, &hna->net.prefix),
!                          olsr_ip_to_string(&maskbuf, &netmask));
!       }
!     } else {
!       struct ip_prefix_list *hna;
!       for(hna = olsr_cnf->hna_entries; hna; hna = hna->next) {
!         struct ipaddr_str netbuf;
!         size += snprintf(&buf[size], bufsize-size,
!                          "<tr><td halign=\"middle\"><input type=\"checkbox\" name=\"del_hna%1$s*%2$d\" class=\"input_checkbox\"></td><td>%1$s</td><td>%2$d</td></tr>\n",
!                          olsr_ip_to_string(&netbuf, &hna->net.prefix),
!                          hna->net.prefix_len);
!       }
      }
    }
--- 153,163 ----
  
    if(olsr_cnf->hna_entries) {
!     struct ip_prefix_list *hna;
!     for(hna = olsr_cnf->hna_entries; hna; hna = hna->next) {
!       struct ipaddr_str netbuf;
!       size += snprintf(&buf[size], bufsize-size,
!                        "<tr><td halign=\"middle\"><input type=\"checkbox\" name=\"del_hna%1$s*%2$d\" class=\"input_checkbox\"></td><td>%1$s</td><td>%2$d</td></tr>\n",
!                        olsr_ip_to_string(&netbuf, &hna->net.prefix),
!                        hna->net.prefix_len);
      }
    }





More information about the Olsr-cvs mailing list