summaryrefslogtreecommitdiff
path: root/ripngd
diff options
context:
space:
mode:
Diffstat (limited to 'ripngd')
-rw-r--r--ripngd/ChangeLog9
-rw-r--r--ripngd/ripng_zebra.c15
-rw-r--r--ripngd/ripngd.c28
3 files changed, 21 insertions, 31 deletions
diff --git a/ripngd/ChangeLog b/ripngd/ChangeLog
index 84c3ea0a..46d4f9f7 100644
--- a/ripngd/ChangeLog
+++ b/ripngd/ChangeLog
@@ -1,3 +1,12 @@
+2005-10-01 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
+ * ripng_zebra.c: (ripng_redistribute_write) Remove local hard-coded
+ table str[]. Replace str[i] with new library function
+ zebra_route_string(i).
+ * ripngd.c: Remove local hard-coded table route_info[].
+ (show_ipv6_ripng) Use new library function zebra_route_char() instead
+ of table route_info[].
+
2005-08-27 Hasso Tepper <hasso at quagga.net>
* ripng_zebra.c, ripngd.[ch]: Pass metric info to the zebra daemon.
diff --git a/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c
index 7744fd55..1f9bee0c 100644
--- a/ripngd/ripng_zebra.c
+++ b/ripngd/ripng_zebra.c
@@ -486,8 +486,6 @@ void
ripng_redistribute_write (struct vty *vty, int config_mode)
{
int i;
- const char *str[] = { "system", "kernel", "connected", "static", "rip",
- "ripng", "ospf", "ospf6", "isis", "bgp"};
for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
if (i != zclient->redist_default && zclient->redist[i])
@@ -498,23 +496,26 @@ ripng_redistribute_write (struct vty *vty, int config_mode)
{
if (ripng->route_map[i].name)
vty_out (vty, " redistribute %s metric %d route-map %s%s",
- str[i], ripng->route_map[i].metric,
+ zebra_route_string(i), ripng->route_map[i].metric,
ripng->route_map[i].name, VTY_NEWLINE);
else
vty_out (vty, " redistribute %s metric %d%s",
- str[i], ripng->route_map[i].metric, VTY_NEWLINE);
+ zebra_route_string(i), ripng->route_map[i].metric,
+ VTY_NEWLINE);
}
else
{
if (ripng->route_map[i].name)
vty_out (vty, " redistribute %s route-map %s%s",
- str[i], ripng->route_map[i].name, VTY_NEWLINE);
+ zebra_route_string(i), ripng->route_map[i].name,
+ VTY_NEWLINE);
else
- vty_out (vty, " redistribute %s%s", str[i], VTY_NEWLINE);
+ vty_out (vty, " redistribute %s%s", zebra_route_string(i),
+ VTY_NEWLINE);
}
}
else
- vty_out (vty, " %s", str[i]);
+ vty_out (vty, " %s", zebra_route_string(i));
}
}
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index cf0d5784..a5bc28dd 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -1922,26 +1922,6 @@ ripng_event (enum ripng_event event, int sock)
}
}
-/* Each route type's strings and default preference.
- * FIXME: ISIS? What are these distance values? */
-struct
-{
- int key;
- const char *str;
- const char *str_long;
- int distance;
-} route_info[] =
-{
- { ZEBRA_ROUTE_SYSTEM, "X", "system", 10},
- { ZEBRA_ROUTE_KERNEL, "K", "kernel", 20},
- { ZEBRA_ROUTE_CONNECT, "C", "connected", 30},
- { ZEBRA_ROUTE_STATIC, "S", "static", 40},
- { ZEBRA_ROUTE_RIP, "R", "rip", 50},
- { ZEBRA_ROUTE_RIPNG, "R", "ripng", 50},
- { ZEBRA_ROUTE_OSPF, "O", "ospf", 60},
- { ZEBRA_ROUTE_OSPF6, "O", "ospf6", 60},
- { ZEBRA_ROUTE_BGP, "B", "bgp", 70},
-};
/* Print out routes update time. */
static void
@@ -2059,14 +2039,14 @@ DEFUN (show_ipv6_ripng,
p = (struct prefix_ipv6 *) &rp->p;
#ifdef DEBUG
- len = vty_out (vty, "%s(%s) 0/%d %s/%d ",
- route_info[rinfo->type].str,
+ len = vty_out (vty, "%c(%s) 0/%d %s/%d ",
+ zebra_route_char(rinfo->type),
ripng_route_subtype_print(rinfo),
rinfo->suppress,
inet6_ntoa (p->prefix), p->prefixlen);
#else
- len = vty_out (vty, "%s(%s) %s/%d ",
- route_info[rinfo->type].str,
+ len = vty_out (vty, "%c(%s) %s/%d ",
+ zebra_route_char(rinfo->type),
ripng_route_subtype_print(rinfo),
inet6_ntoa (p->prefix), p->prefixlen);
#endif /* DEBUG */