txtinfo and httpinfo should consider OLSR_TC_EDGE_DOWN flag
authorHenning Rogge <rogge@fgan.de>
Sun, 27 Apr 2008 20:07:05 +0000 (22:07 +0200)
committerHenning Rogge <rogge@fgan.de>
Sun, 27 Apr 2008 20:07:05 +0000 (22:07 +0200)
lib/httpinfo/src/olsrd_httpinfo.c
lib/txtinfo/src/olsrd_txtinfo.c

index a765ce9..0fcf419 100644 (file)
@@ -1053,6 +1053,8 @@ static int build_topo_body(char *buf, olsr_u32_t bufsize)
   OLSR_FOR_ALL_TC_ENTRIES(tc) {
       struct tc_edge_entry *tc_edge;
       OLSR_FOR_ALL_TC_EDGE_ENTRIES(tc, tc_edge) {
+       if (tc_edge->edge_inv &&
+        ((tc_edge->flags | tc_edge->edge_inv->flags) & OLSR_TC_EDGE_DOWN)==0)  {
           size += snprintf(&buf[size], bufsize-size, "<tr>");
           size += build_ipaddr_with_link(&buf[size], bufsize, &tc_edge->T_dest_addr, -1);
           size += build_ipaddr_with_link(&buf[size], bufsize, &tc->addr, -1);
@@ -1064,7 +1066,7 @@ static int build_topo_body(char *buf, olsr_u32_t bufsize)
                                get_linkcost_text(tc_edge->cost, OLSR_FALSE, &lqbuffer2));
           }
           size += snprintf(&buf[size], bufsize-size, "</tr>\n");
-
+       }
       } OLSR_FOR_ALL_TC_EDGE_ENTRIES_END(tc, tc_edge);
   } OLSR_FOR_ALL_TC_ENTRIES_END(tc);
 
index 3ae0ca3..762f59c 100644 (file)
@@ -400,6 +400,8 @@ static void ipc_print_topology(void)
     OLSR_FOR_ALL_TC_ENTRIES(tc) {
         struct tc_edge_entry *tc_edge;
         OLSR_FOR_ALL_TC_EDGE_ENTRIES(tc, tc_edge) {
+               if (tc_edge->edge_inv &&
+                ((tc_edge->flags | tc_edge->edge_inv->flags) & OLSR_TC_EDGE_DOWN)==0)  {
             struct ipaddr_str dstbuf, addrbuf;
             struct lqtextbuffer lqbuffer1, lqbuffer2;
             ipc_sendf( "%s\t%s\t%s\t%s\n", 
@@ -407,7 +409,7 @@ static void ipc_print_topology(void)
                        olsr_ip_to_string(&addrbuf, &tc->addr), 
                        get_tc_edge_entry_text(tc_edge, &lqbuffer1),
                        get_linkcost_text(tc_edge->cost, OLSR_FALSE, &lqbuffer2));
-
+               }
         } OLSR_FOR_ALL_TC_EDGE_ENTRIES_END(tc, tc_edge);
     } OLSR_FOR_ALL_TC_ENTRIES_END(tc);