summaryrefslogtreecommitdiff
path: root/ospf6d
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d')
-rw-r--r--ospf6d/ChangeLog17
-rw-r--r--ospf6d/ospf6_asbr.c18
-rw-r--r--ospf6d/ospf6_zebra.c13
3 files changed, 22 insertions, 26 deletions
diff --git a/ospf6d/ChangeLog b/ospf6d/ChangeLog
index e925d807..c6bc39f6 100644
--- a/ospf6d/ChangeLog
+++ b/ospf6d/ChangeLog
@@ -1,3 +1,20 @@
+2005-10-01 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
+ * ospf6_asbr.c: Remove local hard-coded tables zroute_name and
+ zroute_abname. Change the ZROUTE_NAME macro to use new library
+ function zebra_route_string(). Remove the ZROUTE_ABNAME macro.
+ (ospf6_asbr_external_route_show): Replace ZROUTE_ABNAME() with
+ a call to zebra_route_char(), and be sure to fix the format string,
+ since we now have a char instead of a char *.
+ * ospf6_zebra.c: Remove local hard-coded tables zebra_route_name and
+ zebra_route_abname. Note that the zebra_route_name[] table
+ contained mixed-case strings, whereas the zebra_route_string()
+ function returns lower-case strings.
+ (ospf6_zebra_read_ipv6): Change debug message to use new library
+ function zebra_route_string() instead of zebra_route_name[].
+ (show_zebra): Use new library function zebra_route_string() instead
+ of zebra_route_name[].
+
2005-08-09 Paul Jakma <paul.jakma@sun.com>
* ospf6_asbr.c: (ospf6_asbr_redistribute_add) Fix sense of testing
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index 379b629a..286b5c1b 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -50,19 +50,7 @@
unsigned char conf_debug_ospf6_asbr = 0;
-const char *zroute_name[] =
-{ "system", "kernel", "connected", "static",
- "rip", "ripng", "ospf", "ospf6", "isis", "bgp", "hsls", "unknown" };
-
-const char *zroute_abname[] =
-{ "X", "K", "C", "S", "R", "R", "O", "O", "I", "B", "H", "?" };
-
-#define ZROUTE_NAME(x) \
- (0 < (x) && (x) < ZEBRA_ROUTE_MAX ? zroute_name[(x)] : \
- zroute_name[ZEBRA_ROUTE_MAX])
-#define ZROUTE_ABNAME(x) \
- (0 < (x) && (x) < ZEBRA_ROUTE_MAX ? zroute_abname[(x)] : \
- zroute_abname[ZEBRA_ROUTE_MAX])
+#define ZROUTE_NAME(x) zebra_route_string(x)
/* AS External LSA origination */
void
@@ -1198,8 +1186,8 @@ ospf6_asbr_external_route_show (struct vty *vty, struct ospf6_route *route)
snprintf (forwarding, sizeof (forwarding), ":: (ifindex %d)",
route->nexthop[0].ifindex);
- vty_out (vty, "%s %-32s %-15s type-%d %5lu %s%s",
- ZROUTE_ABNAME (info->type),
+ vty_out (vty, "%c %-32s %-15s type-%d %5lu %s%s",
+ zebra_route_char(info->type),
prefix, id, route->path.metric_type,
(u_long) (route->path.metric_type == 2 ?
route->path.cost_e2 : route->path.cost),
diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c
index bb324592..c974005f 100644
--- a/ospf6d/ospf6_zebra.c
+++ b/ospf6d/ospf6_zebra.c
@@ -187,15 +187,6 @@ ospf6_zebra_if_address_update_delete (int command, struct zclient *zclient,
return 0;
}
-
-
-const char *zebra_route_name[ZEBRA_ROUTE_MAX] =
- { "System", "Kernel", "Connect", "Static", "RIP", "RIPng", "OSPF",
- "OSPF6", "ISIS", "BGP" };
-
-const char *zebra_route_abname[ZEBRA_ROUTE_MAX] =
- { "X", "K", "C", "S", "r", "R", "o", "O", "I", "B" };
-
int
ospf6_zebra_read_ipv6 (int command, struct zclient *zclient,
zebra_size_t length)
@@ -255,7 +246,7 @@ ospf6_zebra_read_ipv6 (int command, struct zclient *zclient,
zlog_debug ("Zebra Receive route %s: %s %s nexthop %s ifindex %ld",
(command == ZEBRA_IPV6_ROUTE_ADD ? "add" : "delete"),
- zebra_route_name[api.type], prefixstr, nexthopstr, ifindex);
+ zebra_route_string(api.type), prefixstr, nexthopstr, ifindex);
}
if (command == ZEBRA_IPV6_ROUTE_ADD)
@@ -295,7 +286,7 @@ DEFUN (show_zebra,
for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
{
if (zclient->redist[i])
- vty_out (vty, " %s", zebra_route_name[i]);
+ vty_out (vty, " %s", zebra_route_string(i));
}
vty_out (vty, "%s", VNL);
return CMD_SUCCESS;