summaryrefslogtreecommitdiff
path: root/zebra/zebra_vty.c
diff options
context:
space:
mode:
authorpaul <paul>2003-07-15 12:52:22 +0000
committerpaul <paul>2003-07-15 12:52:22 +0000
commit7021c425a9f5bd9f62b934124becbaadd961cac0 (patch)
treecf386f6923eac9f1c665400d0557448c4f5a89e0 /zebra/zebra_vty.c
parent8fc0f64b143ed2155567f5c9f0faad756252146a (diff)
2003-07-15 Paul Jakma <paul@dishone.st>
* lib/version.h: add ZEBRA_URL (unused for now) * lib/vty.c: CMD_ERR_NOTHING_TODO when reading conf file should not be fatal. slight reformating. * ospfd/ospf_zebra.c: ignore reject/blackhole routes if zebra sends these type of routes. probably should be a new type of route to allow daemons to more easily choose whether to redistribute them - rathen than just a flag (eg for reject/blackhole). reorder the is_prefix_default test for ZEBRA_IPV4_ROUTE_DELETE to avoid the inverted test - slightly more readable. * redhat/zebra.spec.in: Add ospfapi port to services file, if with_ospfapi. * zebra/rib.h: Change nexthop types to an enum. * zebra/rt_netlink.c: run it through indent -nut. Add nexthop_types_desc[] descriptive array for nexthop types. (netlink_route_multipath) debug statements indicate which branch they are in and print out nexthop type. * zebra/zebra_rib.c: slight reformatting. * zebra/zebra_vty.c: Pass ZEBRA_FLAG_BLACKHOLE flag to static_add_ipv4() if Null0 route is configured. print out Null0 if STATIC_IPV4_BLACKHOLE route, and ignore flags (shouldnt be possible to set flags from vty) for config and show route.
Diffstat (limited to 'zebra/zebra_vty.c')
-rw-r--r--zebra/zebra_vty.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 19ec3ae8..ebb36941 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -136,7 +136,7 @@ zebra_static_ipv4 (struct vty *vty, int add_cmd,
return CMD_WARNING;
}
if (add_cmd)
- static_add_ipv4 (&p, NULL, NULL, 0, distance, 0);
+ static_add_ipv4 (&p, NULL, NULL, ZEBRA_FLAG_BLACKHOLE, distance, 0);
else
static_delete_ipv4 (&p, NULL, NULL, distance, 0);
return CMD_SUCCESS;
@@ -603,11 +603,9 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn)
vty_out (vty, " directly connected, %s", nexthop->ifname);
break;
case NEXTHOP_TYPE_BLACKHOLE:
- vty_out (vty, " directly connected");
- if (!rib->flags)
- vty_out (vty, ", Null0");
+ vty_out (vty, " directly connected, Null0");
break;
- default:
+ default:
break;
}
if (! CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
@@ -688,11 +686,9 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib)
vty_out (vty, " is directly connected, %s", nexthop->ifname);
break;
case NEXTHOP_TYPE_BLACKHOLE:
- vty_out (vty, " is directly connected");
- if (!rib->flags)
- vty_out (vty, ", Null0");
+ vty_out (vty, " is directly connected, Null0");
break;
- default:
+ default:
break;
}
if (! CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
@@ -1070,34 +1066,38 @@ static_config_ipv4 (struct vty *vty)
for (rn = route_top (stable); rn; rn = route_next (rn))
for (si = rn->info; si; si = si->next)
{
- vty_out (vty, "ip route %s/%d", inet_ntoa (rn->p.u.prefix4),
- rn->p.prefixlen);
-
- switch (si->type)
- {
- case STATIC_IPV4_GATEWAY:
- vty_out (vty, " %s", inet_ntoa (si->gate.ipv4));
- break;
- case STATIC_IPV4_IFNAME:
- vty_out (vty, " %s", si->gate.ifname);
- break;
- case STATIC_IPV4_BLACKHOLE:
- if (!si->flags)
- vty_out (vty, " Null0");
- break;
- }
-
- if (CHECK_FLAG(si->flags, ZEBRA_FLAG_REJECT))
- vty_out (vty, " %s", "reject");
-
- if (CHECK_FLAG(si->flags, ZEBRA_FLAG_BLACKHOLE))
- vty_out (vty, " %s", "blackhole");
-
- if (si->distance != ZEBRA_STATIC_DISTANCE_DEFAULT)
- vty_out (vty, " %d", si->distance);
- vty_out (vty, "%s", VTY_NEWLINE);
-
- write = 1;
+ vty_out (vty, "ip route %s/%d", inet_ntoa (rn->p.u.prefix4),
+ rn->p.prefixlen);
+
+ switch (si->type)
+ {
+ case STATIC_IPV4_GATEWAY:
+ vty_out (vty, " %s", inet_ntoa (si->gate.ipv4));
+ break;
+ case STATIC_IPV4_IFNAME:
+ vty_out (vty, " %s", si->gate.ifname);
+ break;
+ case STATIC_IPV4_BLACKHOLE:
+ vty_out (vty, " Null0");
+ break;
+ }
+
+ /* flags are incompatible with STATIC_IPV4_BLACKHOLE */
+ if (si->type != STATIC_IPV4_BLACKHOLE)
+ {
+ if (CHECK_FLAG(si->flags, ZEBRA_FLAG_REJECT))
+ vty_out (vty, " %s", "reject");
+
+ if (CHECK_FLAG(si->flags, ZEBRA_FLAG_BLACKHOLE))
+ vty_out (vty, " %s", "blackhole");
+ }
+
+ if (si->distance != ZEBRA_STATIC_DISTANCE_DEFAULT)
+ vty_out (vty, " %d", si->distance);
+
+ vty_out (vty, "%s", VTY_NEWLINE);
+
+ write = 1;
}
return write;
}