[Olsr-cvs] olsrd-current/lib/httpinfo/src olsrd_httpinfo.c, 1.90, 1.91

Bernd Petrovitsch (spam-protected)
Wed Dec 12 23:39:38 CET 2007


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

Modified Files:
	olsrd_httpinfo.c 
Log Message:
added configuration file support for "flat fib metrics".


Index: olsrd_httpinfo.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_httpinfo.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -C2 -d -r1.90 -r1.91
*** olsrd_httpinfo.c	12 Dec 2007 22:06:24 -0000	1.90
--- olsrd_httpinfo.c	12 Dec 2007 22:39:36 -0000	1.91
***************
*** 4,32 ****
   * All rights reserved.
   *
!  * Redistribution and use in source and binary forms, with or without 
!  * modification, are permitted provided that the following conditions 
   * are met:
   *
!  * * Redistributions of source code must retain the above copyright 
   *   notice, this list of conditions and the following disclaimer.
!  * * Redistributions in binary form must reproduce the above copyright 
!  *   notice, this list of conditions and the following disclaimer in 
!  *   the documentation and/or other materials provided with the 
   *   distribution.
!  * * Neither the name of olsr.org, olsrd nor the names of its 
!  *   contributors may be used to endorse or promote products derived 
   *   from this software without specific prior written permission.
   *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
!  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
!  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
!  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
!  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
!  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
!  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
!  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
   * POSSIBILITY OF SUCH DAMAGE.
   *
--- 4,32 ----
   * All rights reserved.
   *
!  * Redistribution and use in source and binary forms, with or without
!  * modification, are permitted provided that the following conditions
   * are met:
   *
!  * * Redistributions of source code must retain the above copyright
   *   notice, this list of conditions and the following disclaimer.
!  * * Redistributions in binary form must reproduce the above copyright
!  *   notice, this list of conditions and the following disclaimer in
!  *   the documentation and/or other materials provided with the
   *   distribution.
!  * * Neither the name of olsr.org, olsrd nor the names of its
!  *   contributors may be used to endorse or promote products derived
   *   from this software without specific prior written permission.
   *
!  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
!  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
!  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
!  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
!  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
!  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
!  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
!  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
!  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   * POSSIBILITY OF SUCH DAMAGE.
   *
***************
*** 131,135 ****
    "text-align: left;\n\nwidth: 100px;\npadding: 0px;\ncolor: #000000;\n"
    "text-decoration: none;\nfont-family: verdana;\nfont-size: 12px;\n"
!   "border: 1px solid #ccc;\n}\n" 
    ".input_button\n{\nbackground: #B5D1EE;\nmargin-left: 5px;\nmargin-top: 0px;\n"
    "text-align: center;\nwidth: 120px;\npadding: 0px;\ncolor: #000000;\n"
--- 131,135 ----
    "text-align: left;\n\nwidth: 100px;\npadding: 0px;\ncolor: #000000;\n"
    "text-decoration: none;\nfont-family: verdana;\nfont-size: 12px;\n"
!   "border: 1px solid #ccc;\n}\n"
    ".input_button\n{\nbackground: #B5D1EE;\nmargin-left: 5px;\nmargin-top: 0px;\n"
    "text-align: center;\nwidth: 120px;\npadding: 0px;\ncolor: #000000;\n"
***************
*** 275,279 ****
  
    /* Bind the socket */
!   
    /* complete the socket structure */
    memset(&sin, 0, sizeof(sin));
--- 275,279 ----
  
    /* Bind the socket */
! 
    /* complete the socket structure */
    memset(&sin, 0, sizeof(sin));
***************
*** 281,285 ****
    sin.sin_addr.s_addr = INADDR_ANY;
    sin.sin_port = htons(port);
!   
    /* bind the socket to the port number */
    if (bind(s, (struct sockaddr *) &sin, sizeof(sin)) == -1) {
--- 281,285 ----
    sin.sin_addr.s_addr = INADDR_ANY;
    sin.sin_port = htons(port);
! 
    /* bind the socket to the port number */
    if (bind(s, (struct sockaddr *) &sin, sizeof(sin)) == -1) {
***************
*** 288,292 ****
      return -1;
    }
!       
    /* show that we are willing to listen */
    if (listen(s, 1) == -1) {
--- 288,292 ----
      return -1;
    }
! 
    /* show that we are willing to listen */
    if (listen(s, 1) == -1) {
***************
*** 332,336 ****
    struct sockaddr_in pin;
    socklen_t addrlen;
!   char *addr;  
    char req[MAX_HTTPREQ_SIZE];
    static char body[HTML_BUFSIZE];
--- 332,336 ----
    struct sockaddr_in pin;
    socklen_t addrlen;
!   char *addr;
    char req[MAX_HTTPREQ_SIZE];
    static char body[HTML_BUFSIZE];
***************
*** 355,359 ****
    if (!check_allowed_ip(allowed_nets, (union olsr_ip_addr *)&pin.sin_addr.s_addr)) {
      struct ipaddr_str strbuf;
!     olsr_printf(0, "HTTP request from non-allowed host %s!\n", 
                  olsr_ip_to_string(&strbuf, (union olsr_ip_addr *)&pin.sin_addr.s_addr));
      close(client_sockets[curr_clients]);
--- 355,359 ----
    if (!check_allowed_ip(allowed_nets, (union olsr_ip_addr *)&pin.sin_addr.s_addr)) {
      struct ipaddr_str strbuf;
!     olsr_printf(0, "HTTP request from non-allowed host %s!\n",
                  olsr_ip_to_string(&strbuf, (union olsr_ip_addr *)&pin.sin_addr.s_addr));
      close(client_sockets[curr_clients]);
***************
*** 372,376 ****
            break;
    }
!   
    if (r < 0) {
      olsr_printf(1, "(HTTPINFO) Failed to recieve data from client!\n");
--- 372,376 ----
            break;
    }
! 
    if (r < 0) {
      olsr_printf(1, "(HTTPINFO) Failed to recieve data from client!\n");
***************
*** 378,382 ****
      goto close_connection;
    }
!   
    /* Get the request */
    if (sscanf(req, "%10s %250s %10s\n", req_type, filename, http_version) != 3) {
--- 378,382 ----
      goto close_connection;
    }
! 
    /* Get the request */
    if (sscanf(req, "%10s %250s %10s\n", req_type, filename, http_version) != 3) {
***************
*** 405,412 ****
              req[param_size] = '\0';
              printf("Dynamic read %d bytes\n", param_size);
! 	      
              //memcpy(body, dynamic_files[i].data, static_bin_files[i].data_size);
              size += dynamic_files[i].process_data_cb(req, param_size, &body[size], sizeof(body)-size);
!             c = build_http_header(HTTP_OK, OLSR_TRUE, size, req, sizeof(req));  
              goto send_http_data;
          }
--- 405,412 ----
              req[param_size] = '\0';
              printf("Dynamic read %d bytes\n", param_size);
! 	
              //memcpy(body, dynamic_files[i].data, static_bin_files[i].data_size);
              size += dynamic_files[i].process_data_cb(req, param_size, &body[size], sizeof(body)-size);
!             c = build_http_header(HTTP_OK, OLSR_TRUE, size, req, sizeof(req));
              goto send_http_data;
          }
***************
*** 426,435 ****
          }
      }
!       
      if (static_bin_files[i].filename) {
        stats.ok_hits++;
        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, sizeof(req));  
        goto send_http_data;
      }
--- 426,435 ----
          }
      }
! 
      if (static_bin_files[i].filename) {
        stats.ok_hits++;
        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, sizeof(req));
        goto send_http_data;
      }
***************
*** 442,450 ****
        i++;
      }
!       
      if (static_txt_files[i].filename) {
        stats.ok_hits++;
        size += snprintf(&body[size], sizeof(body)-size, "%s", static_txt_files[i].data);
!       c = build_http_header(HTTP_OK, OLSR_FALSE, size, req, sizeof(req));  
        goto send_http_data;
      }
--- 442,450 ----
        i++;
      }
! 
      if (static_txt_files[i].filename) {
        stats.ok_hits++;
        size += snprintf(&body[size], sizeof(body)-size, "%s", static_txt_files[i].data);
!       c = build_http_header(HTTP_OK, OLSR_FALSE, size, req, sizeof(req));
        goto send_http_data;
      }
***************
*** 463,467 ****
  #ifdef NETDIRECT
        c = build_http_header(HTTP_OK, OLSR_TRUE, size, req, sizeof(req));
!       r = send(client_sockets[curr_clients], req, c, 0);   
        if (r < 0) {
          olsr_printf(1, "(HTTPINFO) Failed sending data to client!\n");
--- 463,467 ----
  #ifdef NETDIRECT
        c = build_http_header(HTTP_OK, OLSR_TRUE, size, req, sizeof(req));
!       r = send(client_sockets[curr_clients], req, c, 0);
        if (r < 0) {
          olsr_printf(1, "(HTTPINFO) Failed sending data to client!\n");
***************
*** 491,503 ****
                         "</table>\n",
                         FRAMEWIDTH);
! 	  
        size += build_tabs(&body[size], sizeof(body)-size, i);
!       size += build_frame(&body[size], 
!                           sizeof(body)-size, 
!                           "Current Routes", 
!                           "routes", 
!                           FRAMEWIDTH, 
                            tab_entries[i].build_body_cb);
! 	  
        stats.ok_hits++;
  
--- 491,503 ----
                         "</table>\n",
                         FRAMEWIDTH);
! 	
        size += build_tabs(&body[size], sizeof(body)-size, i);
!       size += build_frame(&body[size],
!                           sizeof(body)-size,
!                           "Current Routes",
!                           "routes",
!                           FRAMEWIDTH,
                            tab_entries[i].build_body_cb);
! 	
        stats.ok_hits++;
  
***************
*** 512,516 ****
                         "</body>\n"
                         "</html>\n");
! 	  
  #ifdef NETDIRECT
        netsprintf_direct = 1;
--- 512,516 ----
                         "</body>\n"
                         "</html>\n");
! 	
  #ifdef NETDIRECT
        netsprintf_direct = 1;
***************
*** 521,526 ****
  #endif
      }
!       
!       
      stats.ill_hits++;
      strcpy(body, HTTP_404_MSG);
--- 521,526 ----
  #endif
      }
! 
! 
      stats.ill_hits++;
      strcpy(body, HTTP_404_MSG);
***************
*** 534,539 ****
  
   send_http_data:
!   
!   r = writen(client_sockets[curr_clients], req, c);   
    if (r < 0) {
        olsr_printf(1, "(HTTPINFO) Failed sending data to client!\n");
--- 534,539 ----
  
   send_http_data:
! 
!   r = writen(client_sockets[curr_clients], req, c);
    if (r < 0) {
        olsr_printf(1, "(HTTPINFO) Failed sending data to client!\n");
***************
*** 555,562 ****
  
  int
! build_http_header(http_header_type type, 
! 		  olsr_bool is_html, 
! 		  olsr_u32_t msgsize, 
! 		  char *buf, 
  		  olsr_u32_t bufsize)
  {
--- 555,562 ----
  
  int
! build_http_header(http_header_type type,
! 		  olsr_bool is_html,
! 		  olsr_u32_t msgsize,
! 		  char *buf,
  		  olsr_u32_t bufsize)
  {
***************
*** 582,586 ****
    time(&currtime);
    size += strftime(&buf[size], bufsize-size, "Date: %a, %d %b %Y %H:%M:%S GMT\r\n", localtime(&currtime));
!   
    /* Server version */
    size += snprintf(&buf[size], bufsize-size, "Server: %s %s %s\r\n", PLUGIN_NAME, PLUGIN_VERSION, HTTP_VERSION);
--- 582,586 ----
    time(&currtime);
    size += strftime(&buf[size], bufsize-size, "Date: %a, %d %b %Y %H:%M:%S GMT\r\n", localtime(&currtime));
! 
    /* Server version */
    size += snprintf(&buf[size], bufsize-size, "Server: %s %s %s\r\n", PLUGIN_NAME, PLUGIN_VERSION, HTTP_VERSION);
***************
*** 597,601 ****
    }
  
!   /* Cache-control 
     * No caching dynamic pages
     */
--- 597,601 ----
    }
  
!   /* Cache-control
     * No caching dynamic pages
     */
***************
*** 607,611 ****
    /* End header */
    size += snprintf(&buf[size], bufsize-size, "\r\n");
!   
    olsr_printf(1, "HEADER:\n%s", buf);
  
--- 607,611 ----
    /* End header */
    size += snprintf(&buf[size], bufsize-size, "\r\n");
! 
    olsr_printf(1, "HEADER:\n%s", buf);
  
***************
*** 628,634 ****
        continue;
      }
!     size += snprintf(&buf[size], bufsize-size, 
                       "<li><a href=\"%s\"%s>%s</a></li>\n",
!                      tab_entries[tabs].filename, 
                       tabs == active ? " class=\"active\"" : "",
                       tab_entries[tabs].tab_label);
--- 628,634 ----
        continue;
      }
!     size += snprintf(&buf[size], bufsize-size,
                       "<li><a href=\"%s\"%s>%s</a></li>\n",
!                      tab_entries[tabs].filename,
                       tabs == active ? " class=\"active\"" : "",
                       tab_entries[tabs].tab_label);
***************
*** 663,668 ****
  static int build_frame(char *buf,
                         olsr_u32_t bufsize,
!                        const char *title __attribute__((unused)), 
!                        const char *link __attribute__((unused)), 
                         int width __attribute__((unused)),
                         build_body_callback frame_body_cb)
--- 663,668 ----
  static int build_frame(char *buf,
                         olsr_u32_t bufsize,
!                        const char *title __attribute__((unused)),
!                        const char *link __attribute__((unused)),
                         int width __attribute__((unused)),
                         build_body_callback frame_body_cb)
***************
*** 670,674 ****
    int size = 0;
    size += snprintf(&buf[size], bufsize-size, "<div id=\"maintable\">\n");
!   size += frame_body_cb(&buf[size], bufsize-size);  
    size += snprintf(&buf[size], bufsize-size, "</div>\n");
    return size;
--- 670,674 ----
    int size = 0;
    size += snprintf(&buf[size], bufsize-size, "<div id=\"maintable\">\n");
!   size += frame_body_cb(&buf[size], bufsize-size);
    size += snprintf(&buf[size], bufsize-size, "</div>\n");
    return size;
***************
*** 699,703 ****
        size += snprintf(&buf[size], bufsize-size, "/%d", prefix_len);
    }
!   
    if (print_link) { /* Print the link only if there is no prefix_len */
      size += snprintf(&buf[size], bufsize-size, "</a>");
--- 699,703 ----
        size += snprintf(&buf[size], bufsize-size, "/%d", prefix_len);
    }
! 
    if (print_link) { /* Print the link only if there is no prefix_len */
      size += snprintf(&buf[size], bufsize-size, "</a>");
***************
*** 802,806 ****
      size += snprintf(&buf[size], bufsize-size, "OS: %s\n<br>", OS);
  
!     { 
        const time_t currtime = time(NULL);
        const int rc = strftime(&buf[size], bufsize-size, "System time: <em>%a, %d %b %Y %H:%M:%S</em><br>", localtime(&currtime));
--- 802,806 ----
      size += snprintf(&buf[size], bufsize-size, "OS: %s\n<br>", OS);
  
!     {
        const time_t currtime = time(NULL);
        const int rc = strftime(&buf[size], bufsize-size, "System time: <em>%a, %d %b %Y %H:%M:%S</em><br>", localtime(&currtime));
***************
*** 839,846 ****
  
      size += snprintf(&buf[size], bufsize-size, "<td>Main address: <strong>%s</strong></td>\n", olsr_ip_to_string(&mainaddrbuf, &olsr_cnf->main_addr));
-     
      size += snprintf(&buf[size], bufsize-size, "<td>IP version: %d</td>\n", olsr_cnf->ip_version == AF_INET ? 4 : 6);
- 
      size += snprintf(&buf[size], bufsize-size, "<td>Debug level: %d</td>\n", olsr_cnf->debug_level);
  
      size += snprintf(&buf[size], bufsize-size, "</tr>\n<tr>\n");
--- 839,845 ----
  
      size += snprintf(&buf[size], bufsize-size, "<td>Main address: <strong>%s</strong></td>\n", olsr_ip_to_string(&mainaddrbuf, &olsr_cnf->main_addr));
      size += snprintf(&buf[size], bufsize-size, "<td>IP version: %d</td>\n", olsr_cnf->ip_version == AF_INET ? 4 : 6);
      size += snprintf(&buf[size], bufsize-size, "<td>Debug level: %d</td>\n", olsr_cnf->debug_level);
+     size += snprintf(&buf[size], bufsize-size, "<td>FIB Metrics: %s</td>\n", olsr_cnf->flat_fib_metric ? CFG_FIBM_FLAT : CFG_FIBM_CORRECT);
  
      size += snprintf(&buf[size], bufsize-size, "</tr>\n<tr>\n");
***************
*** 850,864 ****
      size += snprintf(&buf[size], bufsize-size, "<td>MPR coverage: %d</td>\n", olsr_cnf->mpr_coverage);
  
- 
      size += snprintf(&buf[size], bufsize-size, "</tr>\n<tr>\n");
  
      size += snprintf(&buf[size], bufsize-size, "<td>Fisheye: %s</td>\n", olsr_cnf->lq_fish ? "Enabled" : "Disabled");
- 
      size += snprintf(&buf[size], bufsize-size, "<td>TOS: 0x%04x</td>\n", olsr_cnf->tos);
- 
      size += snprintf(&buf[size], bufsize-size, "<td>RtTable: 0x%04x/%d</td>\n", olsr_cnf->rttable, olsr_cnf->rttable);
- 
      size += snprintf(&buf[size], bufsize-size, "<td>Willingness: %d %s</td>\n", olsr_cnf->willingness, olsr_cnf->willingness_auto ? "(auto)" : "");
-     
  
      if (olsr_cnf->lq_level == 0) {
--- 849,858 ----
***************
*** 913,917 ****
                             ip6_to_string(&addrbuf, &rifs->int6_addr.sin6_addr),
                             ip6_to_string(&maskbuf, &rifs->int6_multaddr.sin6_addr));
!         }	    
          size += snprintf(&buf[size], bufsize-size,
                           "<tr>\n"
--- 907,911 ----
                             ip6_to_string(&addrbuf, &rifs->int6_addr.sin6_addr),
                             ip6_to_string(&maskbuf, &rifs->int6_multaddr.sin6_addr));
!         }	
          size += snprintf(&buf[size], bufsize-size,
                           "<tr>\n"
***************
*** 955,959 ****
          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);
--- 949,953 ----
          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);
***************
*** 985,989 ****
    size += snprintf(&buf[size], bufsize-size, "</tr>\n");
  
!   /* Link set */  
    for (link = link_set; link != NULL; link = link->next) {
      size += snprintf(&buf[size], bufsize-size, "<tr>");
--- 979,983 ----
    size += snprintf(&buf[size], bufsize-size, "</tr>\n");
  
!   /* Link set */
    for (link = link_set; link != NULL; link = link->next) {
      size += snprintf(&buf[size], bufsize-size, "<tr>");
***************
*** 999,1005 ****
                         "<td align=\"right\">%0.2f</td>\n",
                         link->loss_link_quality,
!                        link->lost_packets, 
                         link->total_packets,
!                        link->neigh_link_quality, 
                         olsr_calc_link_etx(link));
      }
--- 993,999 ----
                         "<td align=\"right\">%0.2f</td>\n",
                         link->loss_link_quality,
!                        link->lost_packets,
                         link->total_packets,
!                        link->neigh_link_quality,
                         olsr_calc_link_etx(link));
      }
***************
*** 1010,1014 ****
  
    size += section_title(&buf[size], bufsize-size, "Neighbors");
!   size += snprintf(&buf[size], bufsize-size, 
                     "<tr><th align=\"center\"%s>IP Address</th><th align=\"center\">SYM</th><th align=\"center\">MPR</th><th align=\"center\">MPRS</th><th align=\"center\">Willingness</th><th>2 Hop Neighbors</th></tr>\n", colspan);
    /* Neighbors */
--- 1004,1008 ----
  
    size += section_title(&buf[size], bufsize-size, "Neighbors");
!   size += snprintf(&buf[size], bufsize-size,
                     "<tr><th align=\"center\"%s>IP Address</th><th align=\"center\">SYM</th><th align=\"center\">MPR</th><th align=\"center\">MPRS</th><th align=\"center\">Willingness</th><th>2 Hop Neighbors</th></tr>\n", colspan);
    /* Neighbors */
***************
*** 1019,1027 ****
        size += snprintf(&buf[size], bufsize-size, "<tr>");
        size += build_ipaddr_with_link(&buf[size], bufsize, &neigh->neighbor_main_addr, -1);
!       size += snprintf(&buf[size], bufsize-size, 
                         "<td align=\"center\">%s</td>"
                         "<td align=\"center\">%s</td>"
                         "<td align=\"center\">%s</td>"
!                        "<td align=\"center\">%d</td>", 
                         (neigh->status == SYM) ? "YES" : "NO",
                         neigh->is_mpr ? "YES" : "NO",
--- 1013,1021 ----
        size += snprintf(&buf[size], bufsize-size, "<tr>");
        size += build_ipaddr_with_link(&buf[size], bufsize, &neigh->neighbor_main_addr, -1);
!       size += snprintf(&buf[size], bufsize-size,
                         "<td align=\"center\">%s</td>"
                         "<td align=\"center\">%s</td>"
                         "<td align=\"center\">%s</td>"
!                        "<td align=\"center\">%d</td>",
                         (neigh->status == SYM) ? "YES" : "NO",
                         neigh->is_mpr ? "YES" : "NO",
***************
*** 1032,1036 ****
                         "<option>IP ADDRESS</option>\n");
  
!       
        for (list_2 = neigh->neighbor_2_list.next, thop_cnt = 0; list_2 != &neigh->neighbor_2_list; list_2 = list_2->next, thop_cnt++) {
          struct ipaddr_str strbuf;
--- 1026,1030 ----
                         "<option>IP ADDRESS</option>\n");
  
! 
        for (list_2 = neigh->neighbor_2_list.next, thop_cnt = 0; list_2 != &neigh->neighbor_2_list; list_2 = list_2->next, thop_cnt++) {
          struct ipaddr_str strbuf;
***************
*** 1091,1096 ****
    size += snprintf(&buf[size], bufsize-size,
                     "<tr><th align=\"center\"%s>Main Address</th><th>Aliases</th></tr>\n", colspan);
!   
!   /* MID */  
    for (idx = 0; idx < HASHSIZE; idx++) {
      struct mid_entry *entry;
--- 1085,1090 ----
    size += snprintf(&buf[size], bufsize-size,
                     "<tr><th align=\"center\"%s>Main Address</th><th>Aliases</th></tr>\n", colspan);
! 
!   /* MID */
    for (idx = 0; idx < HASHSIZE; idx++) {
      struct mid_entry *entry;
***************
*** 1101,1105 ****
        size += build_ipaddr_with_link(&buf[size], bufsize, &entry->main_addr, -1);
        size += snprintf(&buf[size], bufsize-size, "<td><select>\n<option>IP ADDRESS</option>\n");
!       
        for (mid_cnt = 0, alias = entry->aliases; alias != NULL; alias = alias->next_alias, mid_cnt++) {
          struct ipaddr_str strbuf;
--- 1095,1099 ----
        size += build_ipaddr_with_link(&buf[size], bufsize, &entry->main_addr, -1);
        size += snprintf(&buf[size], bufsize-size, "<td><select>\n<option>IP ADDRESS</option>\n");
! 
        for (mid_cnt = 0, alias = entry->aliases; alias != NULL; alias = alias->next_alias, mid_cnt++) {
          struct ipaddr_str strbuf;
***************
*** 1208,1212 ****
    size += olsrd_write_cnf_buf(olsr_cnf, &buf[size], bufsize-size);
  #endif
!   
    if (size < 0) {
      size = snprintf(buf, size, "ERROR GENERATING CONFIGFILE!\n");
--- 1202,1206 ----
    size += olsrd_write_cnf_buf(olsr_cnf, &buf[size], bufsize-size);
  #endif
! 
    if (size < 0) {
      size = snprintf(buf, size, "ERROR GENERATING CONFIGFILE!\n");
***************
*** 1241,1245 ****
   * scalable solution here.
   */
!  
  int netsprintf(char *str, const char* format, ...)
  {
--- 1235,1239 ----
   * scalable solution here.
   */
! 
  int netsprintf(char *str, const char* format, ...)
  {





More information about the Olsr-cvs mailing list