summaryrefslogtreecommitdiff
path: root/ripd
diff options
context:
space:
mode:
Diffstat (limited to 'ripd')
-rw-r--r--ripd/ChangeLog9
-rw-r--r--ripd/rip_zebra.c12
-rw-r--r--ripd/ripd.c26
3 files changed, 17 insertions, 30 deletions
diff --git a/ripd/ChangeLog b/ripd/ChangeLog
index 6aecebd4..0e19ef3c 100644
--- a/ripd/ChangeLog
+++ b/ripd/ChangeLog
@@ -1,3 +1,12 @@
+2005-10-01 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
+ * rip_zebra.c: (config_write_rip_redistribute): Remove local hard-coded
+ table str[]. Replace str[] with calls to new library function
+ zebra_route_string().
+ * ripd.c: Remove local hard-coded table route_info[].
+ (show_ip_rip) Replace uses of str[] with calls to new library
+ functions zebra_route_char and zebra_route_string.
+
2005-09-29 Alain Ritoux <alain.ritoux@6wind.com>
* rip_snmp.c: rip2IfConfReceive() sends values in conformance
diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c
index 570b5281..d810a6b9 100644
--- a/ripd/rip_zebra.c
+++ b/ripd/rip_zebra.c
@@ -653,8 +653,6 @@ int
config_write_rip_redistribute (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])
@@ -665,27 +663,27 @@ config_write_rip_redistribute (struct vty *vty, int config_mode)
{
if (rip->route_map[i].name)
vty_out (vty, " redistribute %s metric %d route-map %s%s",
- str[i], rip->route_map[i].metric,
+ zebra_route_string(i), rip->route_map[i].metric,
rip->route_map[i].name,
VTY_NEWLINE);
else
vty_out (vty, " redistribute %s metric %d%s",
- str[i], rip->route_map[i].metric,
+ zebra_route_string(i), rip->route_map[i].metric,
VTY_NEWLINE);
}
else
{
if (rip->route_map[i].name)
vty_out (vty, " redistribute %s route-map %s%s",
- str[i], rip->route_map[i].name,
+ zebra_route_string(i), rip->route_map[i].name,
VTY_NEWLINE);
else
- vty_out (vty, " redistribute %s%s", str[i],
+ 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));
}
return 0;
}
diff --git a/ripd/ripd.c b/ripd/ripd.c
index 13cf9b9b..fd1f2da6 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -85,26 +85,6 @@ struct message rip_msg[] =
{RIP_POLL_ENTRY, "POLL ENTRY"},
{0, NULL}
};
-
-/* Each route type's strings and default preference. */
-struct
-{
- int key;
- const char *str;
- const char *str_long;
-} route_info[] =
-{
- { ZEBRA_ROUTE_SYSTEM, "X", "system"},
- { ZEBRA_ROUTE_KERNEL, "K", "kernel"},
- { ZEBRA_ROUTE_CONNECT, "C", "connected"},
- { ZEBRA_ROUTE_STATIC, "S", "static"},
- { ZEBRA_ROUTE_RIP, "R", "rip"},
- { ZEBRA_ROUTE_RIPNG, "R", "ripng"},
- { ZEBRA_ROUTE_OSPF, "O", "ospf"},
- { ZEBRA_ROUTE_OSPF6, "O", "ospf6"},
- { ZEBRA_ROUTE_ISIS, "I", "isis"},
- { ZEBRA_ROUTE_BGP, "B", "bgp"}
-};
/* Utility function to set boradcast option to the socket. */
int
@@ -3478,9 +3458,9 @@ DEFUN (show_ip_rip,
{
int len;
- len = vty_out (vty, "%s(%s) %s/%d",
+ len = vty_out (vty, "%c(%s) %s/%d",
/* np->lock, For debugging. */
- route_info[rinfo->type].str,
+ zebra_route_char(rinfo->type),
rip_route_type_print (rinfo->sub_type),
inet_ntoa (np->p.u.prefix4), np->p.prefixlen);
@@ -3514,7 +3494,7 @@ DEFUN (show_ip_rip,
if (rinfo->external_metric)
{
len = vty_out (vty, "self (%s:%d)",
- route_info[rinfo->type].str_long,
+ zebra_route_string(rinfo->type),
rinfo->external_metric);
len = 16 - len;
if (len > 0)