bugfix fpm display precicion issues
authorSven-Ola Tuecke <sven-ola@gmx.de>
Fri, 29 Feb 2008 09:45:48 +0000 (10:45 +0100)
committerSven-Ola Tuecke <sven-ola@gmx.de>
Fri, 29 Feb 2008 09:45:48 +0000 (10:45 +0100)
15 files changed:
lib/dot_draw/src/olsrd_dot_draw.c
lib/httpinfo/src/olsrd_httpinfo.c
lib/nameservice/src/mapwrite.c
lib/nameservice/src/nameservice.c
lib/tas/src/plugin.c
lib/txtinfo/src/olsrd_txtinfo.c
src/fpm.c
src/fpm.h
src/hysteresis.c
src/link_set.c
src/lq_route.c
src/mantissa.c
src/routing_table.c
src/tc_set.c
src/two_hop_neighbor_table.c

index 739c0bc..26c9866 100644 (file)
@@ -176,7 +176,7 @@ ipc_print_neigh_link(const struct neighbor_entry *neighbor)
   ipc_send_fmt("\"%s\" -> \"%s\"[label=\"%s\", style=%s];\n",
                adr,
                olsr_ip_to_string(&strbuf, &neighbor->neighbor_main_addr),
-               olsr_etx_to_string(etx),
+               etxtoa(etx),
                style);
   
   if (neighbor->is_mpr) {
@@ -347,7 +347,7 @@ ipc_print_tc_link(const struct tc_entry *entry, const struct tc_edge_entry *dst_
   ipc_send_fmt("\"%s\" -> \"%s\"[label=\"%s\"];\n",
                olsr_ip_to_string(&strbuf1, &entry->addr),
                olsr_ip_to_string(&strbuf2, &dst_entry->T_dest_addr),
-               olsr_etx_to_string(olsr_calc_tc_etx(dst_entry)));
+               etxtoa(olsr_calc_tc_etx(dst_entry)));
 }
 
 
index ba9001a..d20c29f 100644 (file)
@@ -764,7 +764,7 @@ static int build_route(char *buf, olsr_u32_t bufsize, const struct rt_entry * rt
                    rt->rt_best->rtp_metric.hops);
   size += snprintf(&buf[size], bufsize-size,
                    "<td align=\"right\">%s</td>",
-                   olsr_etx_to_string(rt->rt_best->rtp_metric.etx));
+                   etxtoa(rt->rt_best->rtp_metric.etx));
   size += snprintf(&buf[size], bufsize-size,
                    "<td align=\"center\">%s</td></tr>\n",
                    if_ifwithindex_name(rt->rt_best->rtp_nexthop.iif_index));
@@ -984,7 +984,7 @@ static int build_neigh_body(char *buf, olsr_u32_t bufsize)
     size += snprintf(&buf[size], bufsize-size, "<tr>");
     size += build_ipaddr_with_link(&buf[size], bufsize, &link->local_iface_addr, -1);
     size += build_ipaddr_with_link(&buf[size], bufsize, &link->neighbor_iface_addr, -1);
-    size += snprintf(&buf[size], bufsize-size, "<td align=\"right\">%s</td>", olsr_etx_to_string(link->L_link_quality));
+    size += snprintf(&buf[size], bufsize-size, "<td align=\"right\">%s</td>", fpmtoa(link->L_link_quality));
     if (olsr_cnf->lq_level > 0) {
       size += snprintf(&buf[size], bufsize-size,
                        "<td align=\"right\">%s</td>"
@@ -992,11 +992,11 @@ static int build_neigh_body(char *buf, olsr_u32_t bufsize)
                        "<td>%d</td>"
                        "<td align=\"right\">%s</td>"
                        "<td align=\"right\">%s</td>\n",
-                       olsr_etx_to_string(link->loss_link_quality),
+                       fpmtoa(link->loss_link_quality),
                        link->lost_packets,
                        link->total_packets,
-                       olsr_etx_to_string(link->neigh_link_quality),
-                       olsr_etx_to_string(olsr_calc_link_etx(link)));
+                       fpmtoa(link->neigh_link_quality),
+                       etxtoa(olsr_calc_link_etx(link)));
     }
     size += snprintf(&buf[size], bufsize-size, "</tr>\n");
   }
@@ -1062,9 +1062,9 @@ static int build_topo_body(char *buf, olsr_u32_t bufsize)
                                "<td align=\"right\">%s</td>"
                                "<td align=\"right\">%s</td>"
                                "<td align=\"right\">%s</td>\n",
-                               olsr_etx_to_string(tc_edge->link_quality),
-                               olsr_etx_to_string(tc_edge->inverse_link_quality),
-                               olsr_etx_to_string(olsr_calc_tc_etx(tc_edge)));
+                               fpmtoa(tc_edge->link_quality),
+                               fpmtoa(tc_edge->inverse_link_quality),
+                               etxtoa(olsr_calc_tc_etx(tc_edge)));
           }
           size += snprintf(&buf[size], bufsize-size, "</tr>\n");
 
index 1545616..02e5920 100644 (file)
@@ -170,9 +170,9 @@ void mapwrite_work(FILE* fmap)
       if (0 > fprintf(fmap, "PLink('%s','%s',%s,%s,%s,%s,%s);\n", 
             olsr_ip_to_string(&strbuf1, &tc_edge->T_dest_addr),
             olsr_ip_to_string(&strbuf2, &tc->addr), 
-            olsr_etx_to_string(tc_edge->link_quality),
-            olsr_etx_to_string(tc_edge->inverse_link_quality),
-            olsr_etx_to_string(olsr_calc_tc_etx(tc_edge)),
+            fpmtoa(tc_edge->link_quality),
+            fpmtoa(tc_edge->inverse_link_quality),
+            etxtoa(olsr_calc_tc_etx(tc_edge)),
             lla, llb))
       {
         return;
@@ -186,9 +186,9 @@ void mapwrite_work(FILE* fmap)
       if (0 > fprintf(fmap, "Link('%s','%s',%s,%s,%s);\n", 
             olsr_ip_to_string(&strbuf1, &tc_edge->T_dest_addr),
             olsr_ip_to_string(&strbuf2, &tc->addr), 
-            olsr_etx_to_string(tc_edge->link_quality),
-            olsr_etx_to_string(tc_edge->inverse_link_quality),
-            olsr_etx_to_string(olsr_calc_tc_etx(tc_edge))))
+            fpmtoa(tc_edge->link_quality),
+            fpmtoa(tc_edge->inverse_link_quality),
+            etxtoa(olsr_calc_tc_etx(tc_edge))))
       {
         return;
       }
index 329067d..8c2b895 100644 (file)
@@ -1198,7 +1198,7 @@ select_best_nameserver(struct rt_entry **rt)
                         */
                        OLSR_PRINTF(6, "NAME PLUGIN: nameserver %s, etx %s\n",
                                                olsr_ip_to_string(&strbuf, &rt1->rt_dst.prefix),
-                                               olsr_etx_to_string(rt1->rt_best->rtp_metric.etx));
+                                               etxtoa(rt1->rt_best->rtp_metric.etx));
 
                        rt[nameserver_idx] = rt2;
                        rt[nameserver_idx+1] = rt1;
@@ -1250,7 +1250,7 @@ write_resolv_file(void)
                                *nameserver_routes = route;
                                OLSR_PRINTF(6, "NAME PLUGIN: found nameserver %s, etx %s",
                                                        olsr_ip_to_string(&strbuf, &name->ip),
-                                                       olsr_etx_to_string(route->rt_best->rtp_metric.etx));
+                                                       etxtoa(route->rt_best->rtp_metric.etx));
 
                                /* find the closet one */
                                select_best_nameserver(nameserver_routes);
index a679773..27fd6eb 100644 (file)
@@ -120,10 +120,10 @@ int iterLinkTabNext(char *buff, int len)
            rawIpAddrToString(&iterLinkTab->local_iface_addr, ipAddrLen),
            rawIpAddrToString(&iterLinkTab->neighbor_iface_addr, ipAddrLen),
            rawIpAddrToString(&iterLinkTab->neighbor->neighbor_main_addr, ipAddrLen),
-           olsr_etx_to_string(iterLinkTab->L_link_quality),
-           olsr_etx_to_string(iterLinkTab->loss_link_quality),
-           olsr_etx_to_string(iterLinkTab->neigh_link_quality),
-           olsr_etx_to_string(etx));
+           fpmtoa(iterLinkTab->L_link_quality),
+           fpmtoa(iterLinkTab->loss_link_quality),
+           fpmtoa(iterLinkTab->neigh_link_quality),
+           etxtoa(etx));
 
   iterLinkTab = iterLinkTab->next;
 
@@ -289,7 +289,7 @@ int iterTcTabNext(char *buff, int len)
 
     res = snprintf(buff, len, "[~%d~address~%s~etx~%s~]~", i,
                    rawIpAddrToString(&tc_edge->T_dest_addr, ipAddrLen),
-                   olsr_etx_to_string(olsr_calc_tc_etx(tc_edge)));
+                   etxtoa(olsr_calc_tc_etx(tc_edge)));
 
     if (res < len)
       buff += res;
index 602c7e5..75190c0 100644 (file)
@@ -311,12 +311,12 @@ static void ipc_print_neigh_link(void)
        ipc_sendf( "%s\t%s\t%s\t%s\t%d\t%d\t%s\t%s\t\n",
                    olsr_ip_to_string(&buf1, &link->local_iface_addr),
                    olsr_ip_to_string(&buf2, &link->neighbor_iface_addr),
-                   olsr_etx_to_string(link->L_link_quality), 
-                   olsr_etx_to_string(link->loss_link_quality),
+                   fpmtoa(link->L_link_quality), 
+                   fpmtoa(link->loss_link_quality),
                    link->lost_packets, 
                    link->total_packets,
-                   olsr_etx_to_string(link->neigh_link_quality), 
-                   olsr_etx_to_string(olsr_calc_link_etx(link)));
+                   fpmtoa(link->neigh_link_quality), 
+                   etxtoa(olsr_calc_link_etx(link)));
         link = link->next;
     }
     ipc_sendf("\nTable: Neighbors\nIP address\tSYM\tMPR\tMPRS\tWillingness\t2 Hop Neighbors\n");
@@ -367,7 +367,7 @@ static void ipc_print_routes(void)
                    rt->rt_dst.prefix_len,
                    olsr_ip_to_string(&buf2, &rt->rt_best->rtp_nexthop.gateway),
                    rt->rt_best->rtp_metric.hops,
-                   olsr_etx_to_string(rt->rt_best->rtp_metric.etx),
+                   etxtoa(rt->rt_best->rtp_metric.etx),
                    if_ifwithindex_name(rt->rt_best->rtp_nexthop.iif_index));
     }
     ipc_sendf("\n");
@@ -388,9 +388,9 @@ static void ipc_print_topology(void)
             ipc_sendf( "%s\t%s\t%s\t%s\t%s\n", 
                        olsr_ip_to_string(&dstbuf, &tc_edge->T_dest_addr),
                        olsr_ip_to_string(&addrbuf, &tc->addr), 
-                       olsr_etx_to_string(tc_edge->link_quality),
-                       olsr_etx_to_string(tc_edge->inverse_link_quality),
-                       olsr_etx_to_string(olsr_calc_tc_etx(tc_edge)));
+                       fpmtoa(tc_edge->link_quality),
+                       fpmtoa(tc_edge->inverse_link_quality),
+                       etxtoa(olsr_calc_tc_etx(tc_edge)));
 
         } OLSR_FOR_ALL_TC_EDGE_ENTRIES_END(tc, tc_edge);
     } OLSR_FOR_ALL_TC_ENTRIES_END(tc);
index 140fdf4..72fb64a 100644 (file)
--- a/src/fpm.c
+++ b/src/fpm.c
@@ -42,7 +42,9 @@
 #include <assert.h>
 #include "fpm.h"
 
-#if !defined(NDEBUG) && defined(USE_FPM)
+#ifdef USE_FPM
+
+#ifndef NDEBUG
 
 fpm itofpm(int i)
 {
@@ -148,32 +150,57 @@ fpm fpmldiv(fpm a, fpm b) {
 }
 #endif
 
-#endif /* !defined(NDEBUG) && defined(USE_FPM) */
+#endif /* !NDEBUG */
 
-const char *olsr_etx_to_string(
-#ifdef USE_FPM
-fpm etx
-#else
-float etx
-#endif
-)
+fpm atofpm(const char *s)
+{
+  float r = 0.0;
+  sscanf(s, "%f", &r);
+  return ftofpm(r);
+}
+
+const char *fpmtoa(fpm a)
 {
   static int idx = 0;
   static char ret[4][20];
 
-  if (etx >= INFINITE_ETX) {
-    return "INF";
-  }
   idx = (idx + 1) % (sizeof(ret) / sizeof(ret[0]));
-#ifdef USE_FPM
-  snprintf(ret[idx], sizeof(ret[0]), "%ld.%ld", (sfpm)etx >> FPM_BIT,
-           100 * (ufpm)((sfpm)(etx) & FPM_MSK) >> FPM_BIT);
-#else
-  snprintf(ret[idx], sizeof(ret[0]), "%.3f", etx);
-#endif
+  snprintf(ret[idx], sizeof(ret[0]), "%ld.%03ld", (sfpm)a >> FPM_BIT,
+    (1000 * ((sfpm)(a) & FPM_MSK) + (FPM_NUM / 2)) >> FPM_BIT);
   return ret[idx];
 }
 
+const char *etxtoa(fpm etx)
+{
+  return etx >= INFINITE_ETX ? "INF" : fpmtoa(etx);
+}
+
+#else /* USE_FPM */
+
+float atofpm(const char *s)
+{
+  float r = 0.0;
+  sscanf(s, "%f", &r);
+  return r;
+}
+
+const char *fpmtoa(float a)
+{
+  static int idx = 0;
+  static char ret[4][20];
+
+  idx = (idx + 1) % (sizeof(ret) / sizeof(ret[0]));
+  snprintf(ret[idx], sizeof(ret[0]), "%.3f", a);
+  return ret[idx];
+}
+
+const char *etxtoa(float etx)
+{
+  return etx >= INFINITE_ETX ? "INF" : fpmtoa(etx);
+}
+
+#endif /* USE_FPM */
+
 /*
  * Local Variables:
  * c-basic-offset: 2
index 9fdad8d..36ee30b 100644 (file)
--- a/src/fpm.h
+++ b/src/fpm.h
@@ -160,6 +160,10 @@ fpm fpmldiv(fpm a, fpm b);
 #define CEIL_LQDIFF ftofpm(1.1)
 #define FLOOR_LQDIFF ftofpm(0.9)
 
+fpm atofpm(const char *);
+const char *fpmtoa(fpm);
+const char *etxtoa(fpm);
+
 #else /* USE_FPM */
 
 #define INFINITE_ETX ((float)(1 << 30))
@@ -168,15 +172,11 @@ fpm fpmldiv(fpm a, fpm b);
 #define CEIL_LQDIFF 1.1
 #define FLOOR_LQDIFF 0.9
 
-#endif /* USE_FPM */
+float atofpm(const char *);
+const char *fpmtoa(float);
+const char *etxtoa(float);
 
-const char *olsr_etx_to_string(
-#ifdef USE_FPM
-fpm
-#else
-float
-#endif
-);
+#endif /* USE_FPM */
 
 #endif
 
index 698a149..1296947 100644 (file)
@@ -204,7 +204,7 @@ update_hysteresis_incoming(union olsr_ip_addr *remote, struct interface *local,
 #endif
       lnk->L_link_quality = olsr_hyst_calc_stability(lnk->L_link_quality);
 #ifdef DEBUG
-      OLSR_PRINTF(3, "HYST[%s]: %s\n", olsr_ip_to_string(&buf, remote), olsr_etx_to_string(lnk->L_link_quality));
+      OLSR_PRINTF(3, "HYST[%s]: %s\n", olsr_ip_to_string(&buf, remote), fpmtoa(lnk->L_link_quality));
 #endif
 
       /* 
@@ -221,7 +221,7 @@ update_hysteresis_incoming(union olsr_ip_addr *remote, struct interface *local,
              lnk->L_link_quality = olsr_hyst_calc_instability(lnk->L_link_quality);
 #ifdef DEBUG
              OLSR_PRINTF(5, "HYST[%s] PACKET LOSS! %s\n",
-                         olsr_ip_to_string(&buf, remote), olsr_etx_to_string(lnk->L_link_quality));
+                         olsr_ip_to_string(&buf, remote), fpmtoa(lnk->L_link_quality));
 #endif
 #ifdef USE_FPM
              if(lnk->L_link_quality < ftofpm(olsr_cnf->hysteresis_param.thr_low))
index befb577..d068a63 100644 (file)
@@ -975,7 +975,7 @@ olsr_time_out_hysteresis(void)
          tmp_link_set->L_link_quality = olsr_hyst_calc_instability(tmp_link_set->L_link_quality);
          OLSR_PRINTF(1, "HYST[%s] HELLO timeout %s\n",
                       olsr_ip_to_string(&buf, &tmp_link_set->neighbor_iface_addr),
-                      olsr_etx_to_string(tmp_link_set->L_link_quality));
+                      fpmtoa(tmp_link_set->L_link_quality));
          /* Update hello_timeout - NO SLACK THIS TIME */
          tmp_link_set->hello_timeout = GET_TIMESTAMP(tmp_link_set->last_htime*1000);
          /* Recalculate status */
@@ -1033,12 +1033,12 @@ void olsr_print_link_set(void)
 
     OLSR_PRINTF(1, "%-*s  %s  %s  %-3d    %-3d    %s  %s\n",
                 addrsize, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr),
-                olsr_etx_to_string(walker->L_link_quality),
-                olsr_etx_to_string(walker->loss_link_quality),
+                fpmtoa(walker->L_link_quality),
+                fpmtoa(walker->loss_link_quality),
                walker->lost_packets,
                 walker->total_packets,
-               olsr_etx_to_string(walker->neigh_link_quality),
-                olsr_etx_to_string(etx));
+               fpmtoa(walker->neigh_link_quality),
+                etxtoa(etx));
   }
 #endif
 }
index 155778a..8b51eb9 100644 (file)
@@ -106,7 +106,7 @@ olsr_spf_add_cand_tree (struct avl_tree *tree,
 #ifdef DEBUG
   OLSR_PRINTF(1, "SPF: insert candidate %s, cost %s\n",
               olsr_ip_to_string(&buf, &tc->addr),
-              olsr_etx_to_string(tc->path_etx));
+              etxtoa(tc->path_etx));
 #endif
 
   avl_insert(tree, &tc->cand_tree_node, AVL_DUP);
@@ -128,7 +128,7 @@ olsr_spf_del_cand_tree (struct avl_tree *tree,
 #endif
   OLSR_PRINTF(1, "SPF: delete candidate %s, cost %s\n",
               olsr_ip_to_string(&buf, &tc->addr),
-              olsr_etx_to_string(tc->path_etx));
+              etxtoa(tc->path_etx));
 #endif
 
   avl_delete(tree, &tc->cand_tree_node);
@@ -151,7 +151,7 @@ olsr_spf_add_path_list (struct list_node *head, int *path_count,
 #ifdef DEBUG
   OLSR_PRINTF(1, "SPF: append path %s, cost %s, via %s\n",
               olsr_ip_to_string(&pathbuf, &tc->addr),
-              olsr_etx_to_string(tc->path_etx),
+              etxtoa(tc->path_etx),
               tc->next_hop ? olsr_ip_to_string(
                 &nbuf, &tc->next_hop->neighbor_iface_addr) : "-");
 #endif
@@ -197,7 +197,7 @@ olsr_spf_relax (struct avl_tree *cand_tree, struct tc_entry *tc)
 #endif
   OLSR_PRINTF(1, "SPF: exploring node %s, cost %s\n",
               olsr_ip_to_string(&buf, &tc->addr),
-              olsr_etx_to_string(tc->path_etx));
+              etxtoa(tc->path_etx));
 #endif
 
   /*
@@ -241,7 +241,7 @@ olsr_spf_relax (struct avl_tree *cand_tree, struct tc_entry *tc)
 #ifdef DEBUG
       OLSR_PRINTF(1, "SPF:   exploring edge %s, cost %s\n",
                   olsr_ip_to_string(&buf, &tc_edge->T_dest_addr),
-                  olsr_etx_to_string(new_etx));
+                  etxtoa(new_etx));
 #endif
 
       /* 
@@ -270,8 +270,8 @@ olsr_spf_relax (struct avl_tree *cand_tree, struct tc_entry *tc)
 #ifdef DEBUG
       OLSR_PRINTF(1, "SPF:   better path to %s, cost %s -> %s, via %s, hops %u\n",
                   olsr_ip_to_string(&buf, &new_tc->addr),
-                  olsr_etx_to_string(new_tc->path_etx),
-                  olsr_etx_to_string(new_etx),
+                  etxtoa(new_tc->path_etx),
+                  etxtoa(new_etx),
                   tc->next_hop ? olsr_ip_to_string(
                     &nbuf, &tc->next_hop->neighbor_iface_addr) : "<none>",
                   new_tc->hops);
index 4df44dd..83654a6 100644 (file)
@@ -130,3 +130,40 @@ double me_to_double(const olsr_u8_t me)
     const olsr_u8_t b = me & 0x0F;
     return ((16 + a) << b) * VTIME_SCALE_FACTOR / 16.0;
 }
+
+#if 0
+/*
+ * Since the original VTIME_SCALE_FACTOR simply divides
+ * values by 16 (equals >> 4), we can shorten calculations.
+ * For details refer to RFC 3626 (search for "mantissa").
+ */
+olsr_u8_t fpm_to_me(const fpm interval)
+{
+  olsr_u8_t a = 0, b = 0; /* Underflow defaults */
+  const unsigned int unscaled_interval = (sfpm)interval >> (FPM_BIT - 4);
+
+  while (unscaled_interval >= (1U << b)) b++;
+
+  if (0 < b) {
+    b--;
+    if (15 < b) {
+      a = 15; /* Overflow defaults */
+      b = 15;
+    }
+    else
+    {
+      assert(FPM_BIT >= 8);
+      a = ((sfpm)interval >> (FPM_BIT + b - 8)) - 16;
+    }
+  }
+  return (a << 4) | (b & 0x0F);
+}
+
+fpm me_to_fpm(const olsr_u8_t me)
+{
+  const olsr_u8_t a = me >> 4;
+  const olsr_u8_t b = me & 0x0F;
+  assert(FPM_BIT >= 8);
+  return (fpm)(((sfpm)a + 16) << (b + FPM_BIT - 8));
+}
+#endif
index f897e42..eace72f 100644 (file)
@@ -659,7 +659,7 @@ olsr_rtp_to_string(const struct rt_path *rtp)
            rt->rt_dst.prefix_len,
            olsr_ip_to_string(&origstr, &rtp->rtp_originator),
            olsr_ip_to_string(&gwstr, &rtp->rtp_nexthop.gateway),
-           olsr_etx_to_string(rtp->rtp_metric.etx),
+           etxtoa(rtp->rtp_metric.etx),
            rtp->rtp_metric.hops,
            rtp->rtp_version);
 
@@ -700,7 +700,7 @@ olsr_print_routing_table(const struct avl_tree *tree)
       const struct rt_path * const rtp = rtp_tree_node->data;
       printf("\tfrom %s, etx %s, metric %u, via %s, %s, v %u\n",
              olsr_ip_to_string(&origstr, &rtp->rtp_originator),
-             olsr_etx_to_string(rtp->rtp_metric.etx),
+             etxtoa(rtp->rtp_metric.etx),
              rtp->rtp_metric.hops,
              olsr_ip_to_string(&gwstr, &rtp->rtp_nexthop.gateway),
              if_ifwithindex_name(rt->rt_nexthop.iif_index),
index ac53584..f83d4c3 100644 (file)
@@ -290,9 +290,9 @@ olsr_tc_edge_to_string(struct tc_edge_entry *tc_edge)
            "%s > %s, lq %s, inv-lq %s, etx %s",
            olsr_ip_to_string(&addrbuf, &tc->addr),
            olsr_ip_to_string(&dstbuf, &tc_edge->T_dest_addr),
-           olsr_etx_to_string(tc_edge->link_quality),
-           olsr_etx_to_string(tc_edge->inverse_link_quality),
-           olsr_etx_to_string(tc_edge->etx));
+           fpmtoa(tc_edge->link_quality),
+           fpmtoa(tc_edge->inverse_link_quality),
+           etxtoa(tc_edge->etx));
 
   return buf;
 }
@@ -764,9 +764,9 @@ olsr_print_tc_table(void)
       OLSR_PRINTF(1, "%-*s %-*s  %s  %s  %s\n",
                   ipwidth, olsr_ip_to_string(&addrbuf, &tc->addr),
                   ipwidth, olsr_ip_to_string(&dstaddrbuf, &tc_edge->T_dest_addr),
-                  olsr_etx_to_string(tc_edge->link_quality),
-                  olsr_etx_to_string(tc_edge->inverse_link_quality),
-                  olsr_etx_to_string(olsr_calc_tc_etx(tc_edge)));
+                  fpmtoa(tc_edge->link_quality),
+                  fpmtoa(tc_edge->inverse_link_quality),
+                  etxtoa(olsr_calc_tc_etx(tc_edge)),
     } OLSR_FOR_ALL_TC_EDGE_ENTRIES_END(tc, tc_edge);
   } OLSR_FOR_ALL_TC_ENTRIES_END(tc);
 #endif
index 0a11545..b47fea7 100644 (file)
@@ -264,7 +264,7 @@ olsr_print_two_hop_neighbor_table(void)
         }
         OLSR_PRINTF(1, "%-15s  %s\n",
                     olsr_ip_to_string(&buf, &entry->neighbor->neighbor_main_addr),
-                    olsr_etx_to_string(entry->path_link_quality));
+                    fpmtoa(entry->path_link_quality));
       }
     }
   }